You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by an...@apache.org on 2014/10/03 16:27:17 UTC
[01/50] [abbrv] git commit: Updated api-version and removed upper
bounds wildcards for extension APIs
Repository: jclouds
Updated Branches:
refs/heads/fix-jclouds-538 0e15ec16b -> 6ed38b780 (forced update)
Updated api-version and removed upper bounds wildcards for extension APIs
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/398e8e30
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/398e8e30
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/398e8e30
Branch: refs/heads/fix-jclouds-538
Commit: 398e8e30a4f4ffb0f03352c08a26a7c0e7589f1f
Parents: 808bef3
Author: Jeremy Daggett <je...@rackspace.com>
Authored: Wed Sep 3 11:05:52 2014 -0700
Committer: Jeremy Daggett <jd...@apache.org>
Committed: Thu Sep 4 09:33:58 2014 -0700
----------------------------------------------------------------------
apis/openstack-nova/pom.xml | 4 +--
.../jclouds/openstack/nova/v2_0/NovaApi.java | 32 ++++++++++----------
2 files changed, 18 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/398e8e30/apis/openstack-nova/pom.xml
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/pom.xml b/apis/openstack-nova/pom.xml
index 96bd580..75a8095 100644
--- a/apis/openstack-nova/pom.xml
+++ b/apis/openstack-nova/pom.xml
@@ -35,7 +35,7 @@
<!-- keystone endpoint -->
<test.openstack-nova.endpoint>http://localhost:5000/v2.0/</test.openstack-nova.endpoint>
<!-- keystone version -->
- <test.openstack-nova.api-version>1.1</test.openstack-nova.api-version>
+ <test.openstack-nova.api-version>2</test.openstack-nova.api-version>
<test.openstack-nova.build-version />
<test.openstack-nova.identity>FIXME_IDENTITY</test.openstack-nova.identity>
<test.openstack-nova.credential>FIXME_CREDENTIALS</test.openstack-nova.credential>
@@ -114,7 +114,7 @@
</exclusions>
</dependency>
</dependencies>
-
+
<profiles>
<profile>
<id>live</id>
http://git-wip-us.apache.org/repos/asf/jclouds/blob/398e8e30/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApi.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApi.java
index ecedb32..7839612 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApi.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/NovaApi.java
@@ -93,7 +93,7 @@ public interface NovaApi extends Closeable {
* to determine if it is present.
*/
@Delegate
- Optional<? extends AvailabilityZoneApi> getAvailabilityZoneApi(
+ Optional<AvailabilityZoneApi> getAvailabilityZoneApi(
@EndpointParam(parser = RegionToEndpoint.class) String region);
/**
@@ -104,7 +104,7 @@ public interface NovaApi extends Closeable {
* to determine if it is present.
*/
@Delegate
- Optional<? extends FloatingIPApi> getFloatingIPApi(
+ Optional<FloatingIPApi> getFloatingIPApi(
@EndpointParam(parser = RegionToEndpoint.class) String region);
/**
@@ -115,7 +115,7 @@ public interface NovaApi extends Closeable {
* to determine if it is present.
*/
@Delegate
- Optional<? extends SecurityGroupApi> getSecurityGroupApi(
+ Optional<SecurityGroupApi> getSecurityGroupApi(
@EndpointParam(parser = RegionToEndpoint.class) String region);
/**
@@ -126,7 +126,7 @@ public interface NovaApi extends Closeable {
* to determine if it is present.
*/
@Delegate
- Optional<? extends KeyPairApi> getKeyPairApi(
+ Optional<KeyPairApi> getKeyPairApi(
@EndpointParam(parser = RegionToEndpoint.class) String region);
/**
@@ -137,7 +137,7 @@ public interface NovaApi extends Closeable {
* to determine if it is present.
*/
@Delegate
- Optional<? extends HostAdministrationApi> getHostAdministrationApi(
+ Optional<HostAdministrationApi> getHostAdministrationApi(
@EndpointParam(parser = RegionToEndpoint.class) String region);
/**
@@ -148,7 +148,7 @@ public interface NovaApi extends Closeable {
* to determine if it is present.
*/
@Delegate
- Optional<? extends SimpleTenantUsageApi> getSimpleTenantUsageApi(
+ Optional<SimpleTenantUsageApi> getSimpleTenantUsageApi(
@EndpointParam(parser = RegionToEndpoint.class) String region);
/**
@@ -159,7 +159,7 @@ public interface NovaApi extends Closeable {
* to determine if it is present.
*/
@Delegate
- Optional<? extends VirtualInterfaceApi> getVirtualInterfaceApi(
+ Optional<VirtualInterfaceApi> getVirtualInterfaceApi(
@EndpointParam(parser = RegionToEndpoint.class) String region);
/**
@@ -170,7 +170,7 @@ public interface NovaApi extends Closeable {
* to determine if it is present.
*/
@Delegate
- Optional<? extends ServerWithSecurityGroupsApi> getServerWithSecurityGroupsApi(
+ Optional<ServerWithSecurityGroupsApi> getServerWithSecurityGroupsApi(
@EndpointParam(parser = RegionToEndpoint.class) String region);
/**
@@ -181,7 +181,7 @@ public interface NovaApi extends Closeable {
* to determine if it is present.
*/
@Delegate
- Optional<? extends ServerAdminApi> getServerAdminApi(
+ Optional<ServerAdminApi> getServerAdminApi(
@EndpointParam(parser = RegionToEndpoint.class) String region);
/**
@@ -192,7 +192,7 @@ public interface NovaApi extends Closeable {
* to determine if it is present.
*/
@Delegate
- Optional<? extends HostAggregateApi> getHostAggregateApi(
+ Optional<HostAggregateApi> getHostAggregateApi(
@EndpointParam(parser = RegionToEndpoint.class) String region);
/**
@@ -203,7 +203,7 @@ public interface NovaApi extends Closeable {
* to determine if it is present.
*/
@Delegate
- Optional<? extends FlavorExtraSpecsApi> getFlavorExtraSpecsApi(
+ Optional<FlavorExtraSpecsApi> getFlavorExtraSpecsApi(
@EndpointParam(parser = RegionToEndpoint.class) String region);
/**
@@ -214,7 +214,7 @@ public interface NovaApi extends Closeable {
* to determine if it is present.
*/
@Delegate
- Optional<? extends QuotaApi> getQuotaApi(
+ Optional<QuotaApi> getQuotaApi(
@EndpointParam(parser = RegionToEndpoint.class) String region);
/**
@@ -225,7 +225,7 @@ public interface NovaApi extends Closeable {
* to determine if it is present.
*/
@Delegate
- Optional<? extends VolumeApi> getVolumeApi(
+ Optional<VolumeApi> getVolumeApi(
@EndpointParam(parser = RegionToEndpoint.class) String region);
/**
@@ -236,7 +236,7 @@ public interface NovaApi extends Closeable {
* to determine if it is present.
*/
@Delegate
- Optional<? extends VolumeAttachmentApi> getVolumeAttachmentApi(
+ Optional<VolumeAttachmentApi> getVolumeAttachmentApi(
@EndpointParam(parser = RegionToEndpoint.class) String region);
/**
@@ -247,7 +247,7 @@ public interface NovaApi extends Closeable {
* to determine if it is present.
*/
@Delegate
- Optional<? extends VolumeTypeApi> getVolumeTypeApi(
+ Optional<VolumeTypeApi> getVolumeTypeApi(
@EndpointParam(parser = RegionToEndpoint.class) String region);
/**
@@ -258,7 +258,7 @@ public interface NovaApi extends Closeable {
* to determine if it is present.
*/
@Delegate
- Optional<? extends ConsolesApi> getConsolesApi(
+ Optional<ConsolesApi> getConsolesApi(
@EndpointParam(parser = RegionToEndpoint.class) String region);
/**
[48/50] [abbrv] git commit: Aligning indents in checkstyle config file
Posted by an...@apache.org.
Aligning indents in checkstyle config file
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/1eb9cd24
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/1eb9cd24
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/1eb9cd24
Branch: refs/heads/fix-jclouds-538
Commit: 1eb9cd245d6fb4e505dc59996473b08af947e887
Parents: a32292f
Author: Andrew Phillips <an...@apache.org>
Authored: Fri Oct 3 02:20:39 2014 -0500
Committer: Andrew Phillips <an...@apache.org>
Committed: Fri Oct 3 08:38:09 2014 -0500
----------------------------------------------------------------------
resources/checkstyle.xml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/1eb9cd24/resources/checkstyle.xml
----------------------------------------------------------------------
diff --git a/resources/checkstyle.xml b/resources/checkstyle.xml
index da62202..2c734ee 100644
--- a/resources/checkstyle.xml
+++ b/resources/checkstyle.xml
@@ -60,9 +60,9 @@
<property name="tokens" value="COMMA, SEMI"/>
</module>
<module name="WhitespaceAround">
- <property name="ignoreEnhancedForColon" value="false" />
- <!-- TODO: enable LCURLY, RCURLY, SLIST -->
- <property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LE, LITERAL_ASSERT, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, SL, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, TYPE_EXTENSION_AND" />
+ <property name="ignoreEnhancedForColon" value="false" />
+ <!-- TODO: enable LCURLY, RCURLY, SLIST -->
+ <property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LE, LITERAL_ASSERT, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, SL, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, TYPE_EXTENSION_AND" />
</module>
</module>
<module name="Header">
[49/50] [abbrv] git commit: Excluding checkstyle.xml from Checkstyle
checking
Posted by an...@apache.org.
Excluding checkstyle.xml from Checkstyle checking
Since 5bac61d9 (update to Checkstyle 2.13), fails on itself
as it includes '@author' in a module definition.
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/641bc6fd
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/641bc6fd
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/641bc6fd
Branch: refs/heads/fix-jclouds-538
Commit: 641bc6fda0527fd828697081b565a0b2a5e3fdec
Parents: 1eb9cd2
Author: Andrew Phillips <an...@apache.org>
Authored: Fri Oct 3 02:20:51 2014 -0500
Committer: Andrew Phillips <an...@apache.org>
Committed: Fri Oct 3 08:38:13 2014 -0500
----------------------------------------------------------------------
project/pom.xml | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/641bc6fd/project/pom.xml
----------------------------------------------------------------------
diff --git a/project/pom.xml b/project/pom.xml
index 6caa1ba..5290894 100644
--- a/project/pom.xml
+++ b/project/pom.xml
@@ -1106,6 +1106,8 @@
<configLocation>resources/checkstyle.xml</configLocation>
<failOnViolation>true</failOnViolation>
<failsOnError>true</failsOnError>
+ <!-- fails on itself as it uses the author tag in a module definition -->
+ <resourceExcludes>checkstyle.xml</resourceExcludes>
<violationSeverity>warning</violationSeverity>
</configuration>
<executions>
[12/50] [abbrv] git commit: Add
PayloadEnclosing.setPayload(ByteSource)
Posted by an...@apache.org.
Add PayloadEnclosing.setPayload(ByteSource)
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/a4bc36da
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/a4bc36da
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/a4bc36da
Branch: refs/heads/fix-jclouds-538
Commit: a4bc36dafaf75805904a082c43ea4e89b47329a3
Parents: 7869d92
Author: Andrew Gaul <ga...@apache.org>
Authored: Sat Sep 6 22:27:22 2014 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Sat Sep 6 22:27:22 2014 -0700
----------------------------------------------------------------------
.../org/jclouds/http/internal/PayloadEnclosingImpl.java | 10 ++++++++++
core/src/main/java/org/jclouds/io/PayloadEnclosing.java | 8 ++++++--
2 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a4bc36da/core/src/main/java/org/jclouds/http/internal/PayloadEnclosingImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/jclouds/http/internal/PayloadEnclosingImpl.java b/core/src/main/java/org/jclouds/http/internal/PayloadEnclosingImpl.java
index 62380d4..a8b5196 100644
--- a/core/src/main/java/org/jclouds/http/internal/PayloadEnclosingImpl.java
+++ b/core/src/main/java/org/jclouds/http/internal/PayloadEnclosingImpl.java
@@ -26,6 +26,8 @@ import org.jclouds.io.Payload;
import org.jclouds.io.PayloadEnclosing;
import org.jclouds.javax.annotation.Nullable;
+import com.google.common.io.ByteSource;
+
public class PayloadEnclosingImpl implements PayloadEnclosing {
protected Payload payload;
@@ -87,6 +89,14 @@ public class PayloadEnclosingImpl implements PayloadEnclosing {
setPayload(newPayload(checkNotNull(data, "data")));
}
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setPayload(ByteSource data) {
+ setPayload(newPayload(checkNotNull(data, "data")));
+ }
+
@Override
public int hashCode() {
final int prime = 31;
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a4bc36da/core/src/main/java/org/jclouds/io/PayloadEnclosing.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/jclouds/io/PayloadEnclosing.java b/core/src/main/java/org/jclouds/io/PayloadEnclosing.java
index 55f6858..3ed2983 100644
--- a/core/src/main/java/org/jclouds/io/PayloadEnclosing.java
+++ b/core/src/main/java/org/jclouds/io/PayloadEnclosing.java
@@ -21,6 +21,8 @@ import java.io.InputStream;
import org.jclouds.javax.annotation.Nullable;
+import com.google.common.io.ByteSource;
+
public interface PayloadEnclosing {
/**
@@ -28,8 +30,8 @@ public interface PayloadEnclosing {
* attempt to discover it.
*
* @param data
- * typically InputStream for downloads, or File, byte [], String, or InputStream for
- * uploads.
+ * typically InputStream for downloads, or File, byte[], String, InputStream,
+ * of ByteSource for uploads.
*/
void setPayload(Payload data);
@@ -41,6 +43,8 @@ public interface PayloadEnclosing {
void setPayload(String data);
+ void setPayload(ByteSource data);
+
@Nullable
Payload getPayload();
[03/50] [abbrv] git commit: Remove ByteStreams2.asByteSource
Posted by an...@apache.org.
Remove ByteStreams2.asByteSource
This method is dangerous since all ByteSource should provide a new
InputStream on every call to openStream while the method returns the
same InputStream for non-repeatable Payloads.
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/86139678
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/86139678
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/86139678
Branch: refs/heads/fix-jclouds-538
Commit: 8613967820b3918a8b930f41179205675925f5d6
Parents: 1b39589
Author: Andrew Gaul <ga...@apache.org>
Authored: Wed Sep 3 21:54:03 2014 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Thu Sep 4 16:55:55 2014 -0700
----------------------------------------------------------------------
core/src/main/java/org/jclouds/io/ByteStreams2.java | 11 -----------
.../java/org/jclouds/io/internal/BasePayloadSlicer.java | 3 +--
2 files changed, 1 insertion(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/86139678/core/src/main/java/org/jclouds/io/ByteStreams2.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/jclouds/io/ByteStreams2.java b/core/src/main/java/org/jclouds/io/ByteStreams2.java
index 3012c91..73c7bb1 100644
--- a/core/src/main/java/org/jclouds/io/ByteStreams2.java
+++ b/core/src/main/java/org/jclouds/io/ByteStreams2.java
@@ -51,15 +51,4 @@ public class ByteStreams2 {
Closeables.closeQuietly(input);
}
}
-
- @Deprecated
- public static ByteSource asByteSource(final Payload payload) {
- checkNotNull(payload, "payload");
- return new ByteSource() {
- @Override
- public InputStream openStream() throws IOException {
- return payload.openStream();
- }
- };
- }
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/86139678/core/src/main/java/org/jclouds/io/internal/BasePayloadSlicer.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/jclouds/io/internal/BasePayloadSlicer.java b/core/src/main/java/org/jclouds/io/internal/BasePayloadSlicer.java
index 198a252..d3a41f3 100644
--- a/core/src/main/java/org/jclouds/io/internal/BasePayloadSlicer.java
+++ b/core/src/main/java/org/jclouds/io/internal/BasePayloadSlicer.java
@@ -31,7 +31,6 @@ import java.util.NoSuchElementException;
import javax.inject.Singleton;
-import org.jclouds.io.ByteStreams2;
import org.jclouds.io.ContentMetadata;
import org.jclouds.io.Payload;
import org.jclouds.io.PayloadSlicer;
@@ -156,7 +155,7 @@ public class BasePayloadSlicer implements PayloadSlicer {
}
protected Payload doSlice(Payload content, long offset, long length) {
- return doSlice(ByteStreams2.asByteSource(content), offset, length);
+ return doSlice(content.getInput(), offset, length);
}
protected Payload doSlice(String content, long offset, long length) {
[31/50] [abbrv] git commit: Convert fake interfaces to utility classes
Posted by an...@apache.org.
Convert fake interfaces to utility classes
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/20048130
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/20048130
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/20048130
Branch: refs/heads/fix-jclouds-538
Commit: 200481300d369de9f076d8c30c8ad7ad26f514d0
Parents: dc30114
Author: Andrew Gaul <ga...@apache.org>
Authored: Sat Sep 6 11:21:15 2014 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Sat Sep 20 18:48:40 2014 -0700
----------------------------------------------------------------------
.../org/jclouds/openstack/v2_0/ServiceType.java | 24 ++++++++++++--------
.../cloudidentity/v2_0/ServiceType.java | 24 ++++++++++++--------
.../blobstore/strategy/MultipartUpload.java | 16 ++++++++-----
.../internal/MultipartUploadStrategy.java | 3 +--
.../strategy/AsyncMultipartUploadStrategy.java | 2 +-
.../s3/blobstore/strategy/MultipartUpload.java | 16 ++++++++-----
.../strategy/MultipartUploadStrategy.java | 2 +-
7 files changed, 51 insertions(+), 36 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/20048130/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/ServiceType.java
----------------------------------------------------------------------
diff --git a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/ServiceType.java b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/ServiceType.java
index a7d9ae4..3b5280d 100644
--- a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/ServiceType.java
+++ b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/ServiceType.java
@@ -21,49 +21,53 @@ package org.jclouds.openstack.v2_0;
* A service provides one or more endpoints through which users can access resources and perform
* (presumably useful) operations.
*/
-public interface ServiceType {
+public final class ServiceType {
/**
* Object Storage (Swift)
*/
- String OBJECT_STORE = "object-store";
+ public static final String OBJECT_STORE = "object-store";
/**
* Compute (Nova)
*/
- String COMPUTE = "compute";
+ public static final String COMPUTE = "compute";
/**
* Image Service (Glance)
*/
- String IMAGE = "image";
+ public static final String IMAGE = "image";
/**
* Identity Service (Keystone)
*/
- String IDENTITY = "identity";
+ public static final String IDENTITY = "identity";
/**
* Network Service (Neutron)
*/
- String NETWORK = "network";
+ public static final String NETWORK = "network";
/**
* Block Storage (Cinder)
*/
- String BLOCK_STORAGE = "volume";
+ public static final String BLOCK_STORAGE = "volume";
/**
* Database Service (Trove)
*/
- String DATABASE = "database";
+ public static final String DATABASE = "database";
/**
* Queues Service (Marconi)
*/
- String QUEUES = "queuing";
+ public static final String QUEUES = "queuing";
/**
* Orchestration Service (Heat)
*/
- String ORCHESTRATION = "orchestration";
+ public static final String ORCHESTRATION = "orchestration";
+
+ private ServiceType() {
+ throw new AssertionError("intentionally unimplemented");
+ }
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/20048130/apis/rackspace-cloudidentity/src/main/java/org/jclouds/rackspace/cloudidentity/v2_0/ServiceType.java
----------------------------------------------------------------------
diff --git a/apis/rackspace-cloudidentity/src/main/java/org/jclouds/rackspace/cloudidentity/v2_0/ServiceType.java b/apis/rackspace-cloudidentity/src/main/java/org/jclouds/rackspace/cloudidentity/v2_0/ServiceType.java
index d6d33a3..9fd8993 100644
--- a/apis/rackspace-cloudidentity/src/main/java/org/jclouds/rackspace/cloudidentity/v2_0/ServiceType.java
+++ b/apis/rackspace-cloudidentity/src/main/java/org/jclouds/rackspace/cloudidentity/v2_0/ServiceType.java
@@ -20,49 +20,53 @@ package org.jclouds.rackspace.cloudidentity.v2_0;
* An Rackspace service, such as Cloud Load Balancers, DNS, etc.
* A service provides one or more endpoints through which users can access resources and perform operations.
*/
-public interface ServiceType {
+public final class ServiceType {
/**
* Cloud Load Balancers
*/
- String LOAD_BALANCERS = "rax:load-balancer";
+ public static final String LOAD_BALANCERS = "rax:load-balancer";
/**
* Cloud DNS
*/
- String DNS = "rax:dns";
+ public static final String DNS = "rax:dns";
/**
* Cloud Queues
*/
- String QUEUES = "rax:queues";
+ public static final String QUEUES = "rax:queues";
/**
* Cloud Files CDN
*/
- String OBJECT_CDN = "rax:object-cdn";
+ public static final String OBJECT_CDN = "rax:object-cdn";
/**
* Auto Scale
*/
- String AUTO_SCALE = "rax:autoscale";
+ public static final String AUTO_SCALE = "rax:autoscale";
/**
* Cloud Backup
*/
- String BACKUP = "rax:backup";
+ public static final String BACKUP = "rax:backup";
/**
* Cloud Databases
*/
- String DATABASES = "rax:database";
+ public static final String DATABASES = "rax:database";
/**
* Cloud Monitoring
*/
- String MONITORING = "rax:monitor";
+ public static final String MONITORING = "rax:monitor";
/**
* Cloud Big Data
*/
- String BIG_DATA = "rax:bigdata";
+ public static final String BIG_DATA = "rax:bigdata";
+
+ private ServiceType() {
+ throw new AssertionError("intentionally unimplemented");
+ }
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/20048130/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/strategy/MultipartUpload.java
----------------------------------------------------------------------
diff --git a/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/strategy/MultipartUpload.java b/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/strategy/MultipartUpload.java
index c73a536..3b74ff8 100644
--- a/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/strategy/MultipartUpload.java
+++ b/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/strategy/MultipartUpload.java
@@ -16,18 +16,22 @@
*/
package org.jclouds.openstack.swift.blobstore.strategy;
-public interface MultipartUpload {
+public final class MultipartUpload {
/* Maximum number of parts per upload */
- int MAX_NUMBER_OF_PARTS = 10000;
+ public static final int MAX_NUMBER_OF_PARTS = 10000;
/* Maximum number of parts returned for a list parts request */
- int MAX_LIST_PARTS_RETURNED = 1000;
+ public static final int MAX_LIST_PARTS_RETURNED = 1000;
/* Maximum number of multipart uploads returned in a list multipart uploads request */
- int MAX_LIST_MPU_RETURNED = 1000;
+ public static final int MAX_LIST_MPU_RETURNED = 1000;
/*
* part size 5 MB to 5 GB, last part can be < 5 MB
*/
- long MIN_PART_SIZE = 5242880L;
- long MAX_PART_SIZE = 5368709120L;
+ public static final long MIN_PART_SIZE = 5242880L;
+ public static final long MAX_PART_SIZE = 5368709120L;
+
+ private MultipartUpload() {
+ throw new AssertionError("intentionally unimplemented");
+ }
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/20048130/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/strategy/internal/MultipartUploadStrategy.java
----------------------------------------------------------------------
diff --git a/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/strategy/internal/MultipartUploadStrategy.java b/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/strategy/internal/MultipartUploadStrategy.java
index ba8c342..435b750 100644
--- a/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/strategy/internal/MultipartUploadStrategy.java
+++ b/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/strategy/internal/MultipartUploadStrategy.java
@@ -17,12 +17,11 @@
package org.jclouds.openstack.swift.blobstore.strategy.internal;
import org.jclouds.blobstore.domain.Blob;
-import org.jclouds.openstack.swift.blobstore.strategy.MultipartUpload;
import com.google.inject.ImplementedBy;
@ImplementedBy(SequentialMultipartUploadStrategy.class)
-public interface MultipartUploadStrategy extends MultipartUpload {
+public interface MultipartUploadStrategy {
String execute(String container, Blob blob);
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/20048130/providers/aws-s3/src/main/java/org/jclouds/aws/s3/blobstore/strategy/AsyncMultipartUploadStrategy.java
----------------------------------------------------------------------
diff --git a/providers/aws-s3/src/main/java/org/jclouds/aws/s3/blobstore/strategy/AsyncMultipartUploadStrategy.java b/providers/aws-s3/src/main/java/org/jclouds/aws/s3/blobstore/strategy/AsyncMultipartUploadStrategy.java
index ed50c55..1431b6d 100644
--- a/providers/aws-s3/src/main/java/org/jclouds/aws/s3/blobstore/strategy/AsyncMultipartUploadStrategy.java
+++ b/providers/aws-s3/src/main/java/org/jclouds/aws/s3/blobstore/strategy/AsyncMultipartUploadStrategy.java
@@ -27,7 +27,7 @@ import com.google.inject.ImplementedBy;
* @see <a href="http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?qfacts.html">AWS Documentation</a>
*/
@ImplementedBy(ParallelMultipartUploadStrategy.class)
-public interface AsyncMultipartUploadStrategy extends MultipartUpload {
+public interface AsyncMultipartUploadStrategy {
ListenableFuture<String> execute(String container, Blob blob, PutOptions options);
http://git-wip-us.apache.org/repos/asf/jclouds/blob/20048130/providers/aws-s3/src/main/java/org/jclouds/aws/s3/blobstore/strategy/MultipartUpload.java
----------------------------------------------------------------------
diff --git a/providers/aws-s3/src/main/java/org/jclouds/aws/s3/blobstore/strategy/MultipartUpload.java b/providers/aws-s3/src/main/java/org/jclouds/aws/s3/blobstore/strategy/MultipartUpload.java
index 34aa077..622c60e 100644
--- a/providers/aws-s3/src/main/java/org/jclouds/aws/s3/blobstore/strategy/MultipartUpload.java
+++ b/providers/aws-s3/src/main/java/org/jclouds/aws/s3/blobstore/strategy/MultipartUpload.java
@@ -19,18 +19,22 @@ package org.jclouds.aws.s3.blobstore.strategy;
/**
* @see <a href="http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?qfacts.html">AWS Documentation</a>
*/
-public interface MultipartUpload {
+public final class MultipartUpload {
/* Maximum number of parts per upload */
- int MAX_NUMBER_OF_PARTS = 10000;
+ public static final int MAX_NUMBER_OF_PARTS = 10000;
/* Maximum number of parts returned for a list parts request */
- int MAX_LIST_PARTS_RETURNED = 1000;
+ public static final int MAX_LIST_PARTS_RETURNED = 1000;
/* Maximum number of multipart uploads returned in a list multipart uploads request */
- int MAX_LIST_MPU_RETURNED = 1000;
+ public static final int MAX_LIST_MPU_RETURNED = 1000;
/*
* part size 5 MB to 5 GB, last part can be < 5 MB
*/
- long MIN_PART_SIZE = 5242880L;
- long MAX_PART_SIZE = 5368709120L;
+ public static final long MIN_PART_SIZE = 5242880L;
+ public static final long MAX_PART_SIZE = 5368709120L;
+
+ private MultipartUpload() {
+ throw new AssertionError("intentionally unimplemented");
+ }
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/20048130/providers/aws-s3/src/main/java/org/jclouds/aws/s3/blobstore/strategy/MultipartUploadStrategy.java
----------------------------------------------------------------------
diff --git a/providers/aws-s3/src/main/java/org/jclouds/aws/s3/blobstore/strategy/MultipartUploadStrategy.java b/providers/aws-s3/src/main/java/org/jclouds/aws/s3/blobstore/strategy/MultipartUploadStrategy.java
index b06aed8..e00580d 100644
--- a/providers/aws-s3/src/main/java/org/jclouds/aws/s3/blobstore/strategy/MultipartUploadStrategy.java
+++ b/providers/aws-s3/src/main/java/org/jclouds/aws/s3/blobstore/strategy/MultipartUploadStrategy.java
@@ -25,7 +25,7 @@ import com.google.inject.ImplementedBy;
* @see <a href="http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?qfacts.html">AWS Documentation</a>
*/
@ImplementedBy(SequentialMultipartUploadStrategy.class)
-public interface MultipartUploadStrategy extends MultipartUpload {
+public interface MultipartUploadStrategy {
String execute(String container, Blob blob);
}
[24/50] [abbrv] git commit: Remove unnecessary blobstore references
Posted by an...@apache.org.
Remove unnecessary blobstore references
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/d2f181bc
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/d2f181bc
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/d2f181bc
Branch: refs/heads/fix-jclouds-538
Commit: d2f181bc558ee34f43f1efacc5c94216af27bf89
Parents: 18046cd
Author: Jeremy Daggett <je...@rackspace.com>
Authored: Tue Sep 16 09:22:56 2014 -0700
Committer: Jeremy Daggett <jd...@apache.org>
Committed: Tue Sep 16 12:50:25 2014 -0700
----------------------------------------------------------------------
apis/cloudservers/src/test/resources/log4j.xml | 17 -----------------
apis/cloudwatch/src/test/resources/log4j.xml | 17 -----------------
apis/ec2/src/test/resources/log4j.xml | 18 ------------------
apis/openstack-cinder/pom.xml | 4 +---
.../src/test/resources/logback-test.xml | 13 -------------
.../src/test/resources/logback.xml | 13 -------------
apis/sqs/src/test/resources/log4j.xml | 17 -----------------
apis/sts/src/test/resources/log4j.xml | 17 -----------------
.../src/test/resources/logback.xml | 13 -------------
.../src/test/resources/logback.xml | 13 -------------
.../src/test/resources/log4j.xml | 17 -----------------
11 files changed, 1 insertion(+), 158 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/d2f181bc/apis/cloudservers/src/test/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/apis/cloudservers/src/test/resources/log4j.xml b/apis/cloudservers/src/test/resources/log4j.xml
index 7527432..eff16d0 100644
--- a/apis/cloudservers/src/test/resources/log4j.xml
+++ b/apis/cloudservers/src/test/resources/log4j.xml
@@ -51,16 +51,6 @@
-->
</layout>
</appender>
- <!-- A time/date based rolling appender -->
- <appender name="BLOBSTOREFILE" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="File" value="target/test-data/jclouds-blobstore.log" />
- <param name="Append" value="true" />
- <param name="DatePattern" value="'.'yyyy-MM-dd" />
- <param name="Threshold" value="TRACE" />
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n" />
- </layout>
- </appender>
<!-- A time/date based rolling appender -->
<appender name="COMPUTEFILE" class="org.apache.log4j.DailyRollingFileAppender">
@@ -122,9 +112,6 @@
<appender-ref ref="WIREFILE" />
</appender>
- <appender name="ASYNCBLOBSTORE" class="org.apache.log4j.AsyncAppender">
- <appender-ref ref="BLOBSTOREFILE" />
- </appender>
<!-- ================ -->
<!-- Limit categories -->
<!-- ================ -->
@@ -147,10 +134,6 @@
<priority value="DEBUG" />
<appender-ref ref="ASYNCWIRE" />
</category>
- <category name="jclouds.blobstore">
- <priority value="DEBUG" />
- <appender-ref ref="ASYNCBLOBSTORE" />
- </category>
<category name="jclouds.compute">
<priority value="TRACE" />
<appender-ref ref="ASYNCCOMPUTE" />
http://git-wip-us.apache.org/repos/asf/jclouds/blob/d2f181bc/apis/cloudwatch/src/test/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/apis/cloudwatch/src/test/resources/log4j.xml b/apis/cloudwatch/src/test/resources/log4j.xml
index 7527432..eff16d0 100644
--- a/apis/cloudwatch/src/test/resources/log4j.xml
+++ b/apis/cloudwatch/src/test/resources/log4j.xml
@@ -51,16 +51,6 @@
-->
</layout>
</appender>
- <!-- A time/date based rolling appender -->
- <appender name="BLOBSTOREFILE" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="File" value="target/test-data/jclouds-blobstore.log" />
- <param name="Append" value="true" />
- <param name="DatePattern" value="'.'yyyy-MM-dd" />
- <param name="Threshold" value="TRACE" />
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n" />
- </layout>
- </appender>
<!-- A time/date based rolling appender -->
<appender name="COMPUTEFILE" class="org.apache.log4j.DailyRollingFileAppender">
@@ -122,9 +112,6 @@
<appender-ref ref="WIREFILE" />
</appender>
- <appender name="ASYNCBLOBSTORE" class="org.apache.log4j.AsyncAppender">
- <appender-ref ref="BLOBSTOREFILE" />
- </appender>
<!-- ================ -->
<!-- Limit categories -->
<!-- ================ -->
@@ -147,10 +134,6 @@
<priority value="DEBUG" />
<appender-ref ref="ASYNCWIRE" />
</category>
- <category name="jclouds.blobstore">
- <priority value="DEBUG" />
- <appender-ref ref="ASYNCBLOBSTORE" />
- </category>
<category name="jclouds.compute">
<priority value="TRACE" />
<appender-ref ref="ASYNCCOMPUTE" />
http://git-wip-us.apache.org/repos/asf/jclouds/blob/d2f181bc/apis/ec2/src/test/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/apis/ec2/src/test/resources/log4j.xml b/apis/ec2/src/test/resources/log4j.xml
index 7527432..986833c 100644
--- a/apis/ec2/src/test/resources/log4j.xml
+++ b/apis/ec2/src/test/resources/log4j.xml
@@ -52,17 +52,6 @@
</layout>
</appender>
<!-- A time/date based rolling appender -->
- <appender name="BLOBSTOREFILE" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="File" value="target/test-data/jclouds-blobstore.log" />
- <param name="Append" value="true" />
- <param name="DatePattern" value="'.'yyyy-MM-dd" />
- <param name="Threshold" value="TRACE" />
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n" />
- </layout>
- </appender>
-
- <!-- A time/date based rolling appender -->
<appender name="COMPUTEFILE" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="target/test-data/jclouds-compute.log" />
<param name="Append" value="true" />
@@ -122,9 +111,6 @@
<appender-ref ref="WIREFILE" />
</appender>
- <appender name="ASYNCBLOBSTORE" class="org.apache.log4j.AsyncAppender">
- <appender-ref ref="BLOBSTOREFILE" />
- </appender>
<!-- ================ -->
<!-- Limit categories -->
<!-- ================ -->
@@ -147,10 +133,6 @@
<priority value="DEBUG" />
<appender-ref ref="ASYNCWIRE" />
</category>
- <category name="jclouds.blobstore">
- <priority value="DEBUG" />
- <appender-ref ref="ASYNCBLOBSTORE" />
- </category>
<category name="jclouds.compute">
<priority value="TRACE" />
<appender-ref ref="ASYNCCOMPUTE" />
http://git-wip-us.apache.org/repos/asf/jclouds/blob/d2f181bc/apis/openstack-cinder/pom.xml
----------------------------------------------------------------------
diff --git a/apis/openstack-cinder/pom.xml b/apis/openstack-cinder/pom.xml
index c134f1c..019bd1d 100644
--- a/apis/openstack-cinder/pom.xml
+++ b/apis/openstack-cinder/pom.xml
@@ -86,7 +86,7 @@
<scope>test</scope>
</dependency>
</dependencies>
-
+
<profiles>
<profile>
<id>live</id>
@@ -110,8 +110,6 @@
<test.openstack-cinder.identity>${test.openstack-cinder.identity}</test.openstack-cinder.identity>
<test.openstack-cinder.credential>${test.openstack-cinder.credential}</test.openstack-cinder.credential>
<test.jclouds.keystone.credential-type>${test.jclouds.keystone.credential-type}</test.jclouds.keystone.credential-type>
- <jclouds.blobstore.httpstream.url>${jclouds.blobstore.httpstream.url}</jclouds.blobstore.httpstream.url>
- <jclouds.blobstore.httpstream.md5>${jclouds.blobstore.httpstream.md5}</jclouds.blobstore.httpstream.md5>
</systemPropertyVariables>
</configuration>
</execution>
http://git-wip-us.apache.org/repos/asf/jclouds/blob/d2f181bc/apis/openstack-trove/src/test/resources/logback-test.xml
----------------------------------------------------------------------
diff --git a/apis/openstack-trove/src/test/resources/logback-test.xml b/apis/openstack-trove/src/test/resources/logback-test.xml
index 6559c23..d7c463a 100644
--- a/apis/openstack-trove/src/test/resources/logback-test.xml
+++ b/apis/openstack-trove/src/test/resources/logback-test.xml
@@ -34,14 +34,6 @@
</encoder>
</appender>
- <appender name="BLOBSTOREFILE" class="ch.qos.logback.core.FileAppender">
- <file>target/test-data/jclouds-blobstore.log</file>
-
- <encoder>
- <Pattern>%d %-5p [%c] [%thread] %m%n</Pattern>
- </encoder>
- </appender>
-
<root>
<level value="warn" />
</root>
@@ -61,9 +53,4 @@
<appender-ref ref="WIREFILE" />
</logger>
- <logger name="jclouds.blobstore">
- <level value="DEBUG" />
- <appender-ref ref="BLOBSTOREFILE" />
- </logger>
-
</configuration>
http://git-wip-us.apache.org/repos/asf/jclouds/blob/d2f181bc/apis/openstack-trove/src/test/resources/logback.xml
----------------------------------------------------------------------
diff --git a/apis/openstack-trove/src/test/resources/logback.xml b/apis/openstack-trove/src/test/resources/logback.xml
index 6559c23..d7c463a 100644
--- a/apis/openstack-trove/src/test/resources/logback.xml
+++ b/apis/openstack-trove/src/test/resources/logback.xml
@@ -34,14 +34,6 @@
</encoder>
</appender>
- <appender name="BLOBSTOREFILE" class="ch.qos.logback.core.FileAppender">
- <file>target/test-data/jclouds-blobstore.log</file>
-
- <encoder>
- <Pattern>%d %-5p [%c] [%thread] %m%n</Pattern>
- </encoder>
- </appender>
-
<root>
<level value="warn" />
</root>
@@ -61,9 +53,4 @@
<appender-ref ref="WIREFILE" />
</logger>
- <logger name="jclouds.blobstore">
- <level value="DEBUG" />
- <appender-ref ref="BLOBSTOREFILE" />
- </logger>
-
</configuration>
http://git-wip-us.apache.org/repos/asf/jclouds/blob/d2f181bc/apis/sqs/src/test/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/apis/sqs/src/test/resources/log4j.xml b/apis/sqs/src/test/resources/log4j.xml
index 7527432..9fd717b 100644
--- a/apis/sqs/src/test/resources/log4j.xml
+++ b/apis/sqs/src/test/resources/log4j.xml
@@ -52,15 +52,6 @@
</layout>
</appender>
<!-- A time/date based rolling appender -->
- <appender name="BLOBSTOREFILE" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="File" value="target/test-data/jclouds-blobstore.log" />
- <param name="Append" value="true" />
- <param name="DatePattern" value="'.'yyyy-MM-dd" />
- <param name="Threshold" value="TRACE" />
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n" />
- </layout>
- </appender>
<!-- A time/date based rolling appender -->
<appender name="COMPUTEFILE" class="org.apache.log4j.DailyRollingFileAppender">
@@ -121,10 +112,6 @@
<appender name="ASYNCWIRE" class="org.apache.log4j.AsyncAppender">
<appender-ref ref="WIREFILE" />
</appender>
-
- <appender name="ASYNCBLOBSTORE" class="org.apache.log4j.AsyncAppender">
- <appender-ref ref="BLOBSTOREFILE" />
- </appender>
<!-- ================ -->
<!-- Limit categories -->
<!-- ================ -->
@@ -147,10 +134,6 @@
<priority value="DEBUG" />
<appender-ref ref="ASYNCWIRE" />
</category>
- <category name="jclouds.blobstore">
- <priority value="DEBUG" />
- <appender-ref ref="ASYNCBLOBSTORE" />
- </category>
<category name="jclouds.compute">
<priority value="TRACE" />
<appender-ref ref="ASYNCCOMPUTE" />
http://git-wip-us.apache.org/repos/asf/jclouds/blob/d2f181bc/apis/sts/src/test/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/apis/sts/src/test/resources/log4j.xml b/apis/sts/src/test/resources/log4j.xml
index 7527432..9fd717b 100644
--- a/apis/sts/src/test/resources/log4j.xml
+++ b/apis/sts/src/test/resources/log4j.xml
@@ -52,15 +52,6 @@
</layout>
</appender>
<!-- A time/date based rolling appender -->
- <appender name="BLOBSTOREFILE" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="File" value="target/test-data/jclouds-blobstore.log" />
- <param name="Append" value="true" />
- <param name="DatePattern" value="'.'yyyy-MM-dd" />
- <param name="Threshold" value="TRACE" />
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n" />
- </layout>
- </appender>
<!-- A time/date based rolling appender -->
<appender name="COMPUTEFILE" class="org.apache.log4j.DailyRollingFileAppender">
@@ -121,10 +112,6 @@
<appender name="ASYNCWIRE" class="org.apache.log4j.AsyncAppender">
<appender-ref ref="WIREFILE" />
</appender>
-
- <appender name="ASYNCBLOBSTORE" class="org.apache.log4j.AsyncAppender">
- <appender-ref ref="BLOBSTOREFILE" />
- </appender>
<!-- ================ -->
<!-- Limit categories -->
<!-- ================ -->
@@ -147,10 +134,6 @@
<priority value="DEBUG" />
<appender-ref ref="ASYNCWIRE" />
</category>
- <category name="jclouds.blobstore">
- <priority value="DEBUG" />
- <appender-ref ref="ASYNCBLOBSTORE" />
- </category>
<category name="jclouds.compute">
<priority value="TRACE" />
<appender-ref ref="ASYNCCOMPUTE" />
http://git-wip-us.apache.org/repos/asf/jclouds/blob/d2f181bc/providers/rackspace-clouddatabases-uk/src/test/resources/logback.xml
----------------------------------------------------------------------
diff --git a/providers/rackspace-clouddatabases-uk/src/test/resources/logback.xml b/providers/rackspace-clouddatabases-uk/src/test/resources/logback.xml
index 6559c23..d7c463a 100644
--- a/providers/rackspace-clouddatabases-uk/src/test/resources/logback.xml
+++ b/providers/rackspace-clouddatabases-uk/src/test/resources/logback.xml
@@ -34,14 +34,6 @@
</encoder>
</appender>
- <appender name="BLOBSTOREFILE" class="ch.qos.logback.core.FileAppender">
- <file>target/test-data/jclouds-blobstore.log</file>
-
- <encoder>
- <Pattern>%d %-5p [%c] [%thread] %m%n</Pattern>
- </encoder>
- </appender>
-
<root>
<level value="warn" />
</root>
@@ -61,9 +53,4 @@
<appender-ref ref="WIREFILE" />
</logger>
- <logger name="jclouds.blobstore">
- <level value="DEBUG" />
- <appender-ref ref="BLOBSTOREFILE" />
- </logger>
-
</configuration>
http://git-wip-us.apache.org/repos/asf/jclouds/blob/d2f181bc/providers/rackspace-clouddatabases-us/src/test/resources/logback.xml
----------------------------------------------------------------------
diff --git a/providers/rackspace-clouddatabases-us/src/test/resources/logback.xml b/providers/rackspace-clouddatabases-us/src/test/resources/logback.xml
index 6559c23..d7c463a 100644
--- a/providers/rackspace-clouddatabases-us/src/test/resources/logback.xml
+++ b/providers/rackspace-clouddatabases-us/src/test/resources/logback.xml
@@ -34,14 +34,6 @@
</encoder>
</appender>
- <appender name="BLOBSTOREFILE" class="ch.qos.logback.core.FileAppender">
- <file>target/test-data/jclouds-blobstore.log</file>
-
- <encoder>
- <Pattern>%d %-5p [%c] [%thread] %m%n</Pattern>
- </encoder>
- </appender>
-
<root>
<level value="warn" />
</root>
@@ -61,9 +53,4 @@
<appender-ref ref="WIREFILE" />
</logger>
- <logger name="jclouds.blobstore">
- <level value="DEBUG" />
- <appender-ref ref="BLOBSTOREFILE" />
- </logger>
-
</configuration>
http://git-wip-us.apache.org/repos/asf/jclouds/blob/d2f181bc/skeletons/standalone-compute/src/test/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/skeletons/standalone-compute/src/test/resources/log4j.xml b/skeletons/standalone-compute/src/test/resources/log4j.xml
index b14cdd7..9d88c65 100644
--- a/skeletons/standalone-compute/src/test/resources/log4j.xml
+++ b/skeletons/standalone-compute/src/test/resources/log4j.xml
@@ -75,15 +75,6 @@
</layout>
</appender>
<!-- A time/date based rolling appender -->
- <appender name="BLOBSTOREFILE" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="File" value="target/test-data/jclouds-blobstore.log"/>
- <param name="Append" value="true"/>
- <param name="DatePattern" value="'.'yyyy-MM-dd"/>
- <param name="Threshold" value="TRACE"/>
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n"/>
- </layout>
- </appender>
<!-- A time/date based rolling appender -->
<appender name="COMPUTEFILE" class="org.apache.log4j.DailyRollingFileAppender">
@@ -144,10 +135,6 @@
<appender name="ASYNCWIRE" class="org.apache.log4j.AsyncAppender">
<appender-ref ref="WIREFILE"/>
</appender>
-
- <appender name="ASYNCBLOBSTORE" class="org.apache.log4j.AsyncAppender">
- <appender-ref ref="BLOBSTOREFILE"/>
- </appender>
<!-- ================ -->
<!-- Limit categories -->
<!-- ================ -->
@@ -170,10 +157,6 @@
<priority value="DEBUG"/>
<appender-ref ref="ASYNCWIRE"/>
</category>
- <category name="jclouds.blobstore">
- <priority value="DEBUG"/>
- <appender-ref ref="ASYNCBLOBSTORE"/>
- </category>
<category name="jclouds.compute">
<priority value="TRACE"/>
<appender-ref ref="ASYNCCOMPUTE"/>
[23/50] [abbrv] git commit: Whitespace fix.
Posted by an...@apache.org.
Whitespace fix.
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/18046cd3
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/18046cd3
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/18046cd3
Branch: refs/heads/fix-jclouds-538
Commit: 18046cd3c7cc85aac7b5ed79572f202cf1632952
Parents: 816e70e
Author: Zack Shoylev <za...@rackspace.com>
Authored: Mon Sep 15 17:11:40 2014 -0500
Committer: Zack Shoylev <za...@rackspace.com>
Committed: Mon Sep 15 17:11:40 2014 -0500
----------------------------------------------------------------------
resources/checkstyle.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/18046cd3/resources/checkstyle.xml
----------------------------------------------------------------------
diff --git a/resources/checkstyle.xml b/resources/checkstyle.xml
index efc4a67..d08ce5b 100644
--- a/resources/checkstyle.xml
+++ b/resources/checkstyle.xml
@@ -21,10 +21,10 @@
<module name="Checker">
<property name="severity" value="warning"/>
- <module name="NewlineAtEndOfFile">
- <property name="lineSeparator" value="lf"/>
- </module>
- <module name="TreeWalker">
+ <module name="NewlineAtEndOfFile">
+ <property name="lineSeparator" value="lf"/>
+ </module>
+ <module name="TreeWalker">
<module name="AvoidStarImport"/>
<module name="EmptyStatement"/>
<module name="IllegalInstantiation">
[37/50] [abbrv] git commit: Revert "Revert "Unhook modernizer from
verify phase""
Posted by an...@apache.org.
Revert "Revert "Unhook modernizer from verify phase""
This reverts commit bc4b89feb153fa3cff3bb89259c5ae1629970ba2.
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/2c790c89
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/2c790c89
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/2c790c89
Branch: refs/heads/fix-jclouds-538
Commit: 2c790c897e91404704a3b29f37517ba60e776e66
Parents: bc4b89f
Author: Andrew Gaul <ga...@apache.org>
Authored: Tue Sep 23 13:08:24 2014 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Tue Sep 23 13:10:58 2014 -0700
----------------------------------------------------------------------
project/pom.xml | 9 ---------
1 file changed, 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/2c790c89/project/pom.xml
----------------------------------------------------------------------
diff --git a/project/pom.xml b/project/pom.xml
index 524605e..f765537 100644
--- a/project/pom.xml
+++ b/project/pom.xml
@@ -719,15 +719,6 @@
<groupId>org.gaul</groupId>
<artifactId>modernizer-maven-plugin</artifactId>
<version>1.1.0</version>
- <executions>
- <execution>
- <id>modernizer</id>
- <phase>verify</phase>
- <goals>
- <goal>modernizer</goal>
- </goals>
- </execution>
- </executions>
<configuration>
<javaVersion>1.7</javaVersion>
<exclusionsFile>resources/modernizer_exclusions.txt</exclusionsFile>
[02/50] [abbrv] git commit: Ensure that deprecated methods are fully
annotated
Posted by an...@apache.org.
Ensure that deprecated methods are fully annotated
Found with Google error-prone.
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/1b395890
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/1b395890
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/1b395890
Branch: refs/heads/fix-jclouds-538
Commit: 1b39589092ff7795b2ff2f24ffa4632b866ebc60
Parents: 398e8e3
Author: Andrew Gaul <ga...@apache.org>
Authored: Tue May 27 00:49:14 2014 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Thu Sep 4 16:54:52 2014 -0700
----------------------------------------------------------------------
.../openstack/swift/CommonSwiftClient.java | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/1b395890/apis/swift/src/main/java/org/jclouds/openstack/swift/CommonSwiftClient.java
----------------------------------------------------------------------
diff --git a/apis/swift/src/main/java/org/jclouds/openstack/swift/CommonSwiftClient.java b/apis/swift/src/main/java/org/jclouds/openstack/swift/CommonSwiftClient.java
index c5e4f5d..c995e65 100644
--- a/apis/swift/src/main/java/org/jclouds/openstack/swift/CommonSwiftClient.java
+++ b/apis/swift/src/main/java/org/jclouds/openstack/swift/CommonSwiftClient.java
@@ -47,6 +47,7 @@ public interface CommonSwiftClient extends Closeable {
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.domain.SwiftObject#builder()}
*/
+ @Deprecated
@Provides
SwiftObject newSwiftObject();
@@ -63,6 +64,7 @@ public interface CommonSwiftClient extends Closeable {
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.AccountApi#get()}
*/
+ @Deprecated
AccountMetadata getAccountStatistics();
/**
@@ -97,6 +99,7 @@ public interface CommonSwiftClient extends Closeable {
* {@link com.jclouds.openstack.swift.v1.features.ContainerApi#list()} and
* {@link com.jclouds.openstack.swift.v1.features.ContainerApi#list(ListContainerOptions)}
*/
+ @Deprecated
Set<ContainerMetadata> listContainers(ListContainerOptions... options);
/**
@@ -108,6 +111,7 @@ public interface CommonSwiftClient extends Closeable {
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ContainerApi#get()}
*/
+ @Deprecated
ContainerMetadata getContainerMetadata(String container);
/**
@@ -122,6 +126,7 @@ public interface CommonSwiftClient extends Closeable {
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ContainerApi#updateMetadata()}
*/
+ @Deprecated
boolean setContainerMetadata(String container, Map<String, String> containerMetadata);
/**
@@ -136,6 +141,7 @@ public interface CommonSwiftClient extends Closeable {
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ContainerApi#deleteMetadata()}
*/
+ @Deprecated
boolean deleteContainerMetadata(String container, Iterable<String> metadataKeys);
/**
@@ -148,24 +154,28 @@ public interface CommonSwiftClient extends Closeable {
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ContainerApi#createIfAbsent()}
*/
+ @Deprecated
boolean createContainer(String container);
/**
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ContainerApi#createIfAbsent()}
*/
+ @Deprecated
boolean createContainer(String container, CreateContainerOptions... options);
/**
* @deprecated This method will be replaced by
* (@link com.jclouds.openstack.swift.v1.features.ContainerApi#deleteIfEmpty()}
*/
+ @Deprecated
boolean deleteContainerIfEmpty(String container);
/**
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ContainerApi#head()}
*/
+ @Deprecated
boolean containerExists(String container);
/**
@@ -173,30 +183,35 @@ public interface CommonSwiftClient extends Closeable {
* {@link com.jclouds.openstack.swift.v1.features.ObjectApi#list()} and
* {@link com.jclouds.openstack.swift.v1.features.ObjectApi#list(ListContainerOptions)}
*/
+ @Deprecated
PageSet<ObjectInfo> listObjects(String container, ListContainerOptions... options);
/**
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ObjectApi#get()}
*/
+ @Deprecated
SwiftObject getObject(String container, String name, GetOptions... options);
/**
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ObjectApi@updateMetadata()}
*/
+ @Deprecated
boolean setObjectInfo(String container, String name, Map<String, String> userMetadata);
/**
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ObjectApi#head()}
*/
+ @Deprecated
MutableObjectInfoWithMetadata getObjectInfo(String container, String name);
/**
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ObjectApi#replace()}
*/
+ @Deprecated
String putObject(String container, SwiftObject object);
/**
@@ -205,12 +220,14 @@ public interface CommonSwiftClient extends Closeable {
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ObjectApi#copy()}
*/
+ @Deprecated
boolean copyObject(String sourceContainer, String sourceObject, String destinationContainer, String destinationObject);
/**
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ObjectApi#delete()}
*/
+ @Deprecated
void removeObject(String container, String name);
/**
@@ -219,11 +236,13 @@ public interface CommonSwiftClient extends Closeable {
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ObjectApi#head()}
*/
+ @Deprecated
boolean objectExists(String container, String name);
/**
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ObjectApi#replaceManifest()}
*/
+ @Deprecated
String putObjectManifest(String container, String name);
}
[04/50] [abbrv] git commit: Ensure that Content-MD5 has 128 bits
Posted by an...@apache.org.
Ensure that Content-MD5 has 128 bits
Update many tests Content-MD5 headers and ETag responses.
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/0b89b1fd
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/0b89b1fd
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/0b89b1fd
Branch: refs/heads/fix-jclouds-538
Commit: 0b89b1fd1095c3f05cae0e6e825acc1dc0025ccf
Parents: 8613967
Author: Andrew Gaul <ga...@apache.org>
Authored: Tue Sep 2 15:19:07 2014 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Thu Sep 4 16:57:48 2014 -0700
----------------------------------------------------------------------
.../atmos/blobstore/AtmosBlobRequestSignerTest.java | 10 ++++++----
.../blobstore/CloudFilesBlobSignerExpectTest.java | 2 +-
.../s3/blobstore/S3BlobSignerExpectTest.java | 4 ++--
.../ParseObjectMetadataFromHeadersTest.java | 11 +++++++----
.../swift/blobstore/SwiftBlobSignerExpectTest.java | 2 +-
.../SwiftKeystoneBlobSignerExpectTest.java | 2 +-
.../blobstore/TransientBlobRequestSignerTest.java | 13 +++++++++----
.../internal/BaseBlobSignerExpectTest.java | 4 +++-
.../java/org/jclouds/io/ContentMetadataBuilder.java | 2 ++
.../org/jclouds/gae/ConvertToGaeRequestTest.java | 7 +++++--
.../org/jclouds/aws/s3/AWSS3AsyncClientTest.java | 16 +++++++++++-----
.../aws/s3/blobstore/AWSS3BlobSignerExpectTest.java | 2 +-
.../blobstore/AzureBlobRequestSignerTest.java | 12 +++++++++---
.../HPCloudObjectStorageBlobSignerExpectTest.java | 2 +-
14 files changed, 59 insertions(+), 30 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/0b89b1fd/apis/atmos/src/test/java/org/jclouds/atmos/blobstore/AtmosBlobRequestSignerTest.java
----------------------------------------------------------------------
diff --git a/apis/atmos/src/test/java/org/jclouds/atmos/blobstore/AtmosBlobRequestSignerTest.java b/apis/atmos/src/test/java/org/jclouds/atmos/blobstore/AtmosBlobRequestSignerTest.java
index d6620b5..97f8862 100644
--- a/apis/atmos/src/test/java/org/jclouds/atmos/blobstore/AtmosBlobRequestSignerTest.java
+++ b/apis/atmos/src/test/java/org/jclouds/atmos/blobstore/AtmosBlobRequestSignerTest.java
@@ -37,6 +37,7 @@ import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import com.google.common.base.Supplier;
+import com.google.common.hash.HashCode;
import com.google.inject.Module;
/**
@@ -83,11 +84,12 @@ public class AtmosBlobRequestSignerTest extends BaseAsyncClientTest<AtmosAsyncCl
public void testSignPutBlob() throws ArrayIndexOutOfBoundsException, SecurityException, IllegalArgumentException,
NoSuchMethodException, IOException {
+ HashCode hashCode = HashCode.fromBytes(new byte[16]);
Blob blob = blobFactory.create(null);
blob.getMetadata().setName("name");
blob.setPayload("");
blob.getPayload().getContentMetadata().setContentLength(2l);
- blob.getPayload().getContentMetadata().setContentMD5(new byte[] { 0, 2, 4, 8 });
+ blob.getPayload().getContentMetadata().setContentMD5(hashCode.asBytes());
blob.getPayload().getContentMetadata().setContentType("text/plain");
blob.getPayload().getContentMetadata().setExpires(new Date(1000));
@@ -100,11 +102,11 @@ public class AtmosBlobRequestSignerTest extends BaseAsyncClientTest<AtmosAsyncCl
"Accept: */*\n" +
"Date: Thu, 05 Jun 2008 16:38:19 GMT\n" +
"Expect: 100-continue\n" +
- "x-emc-signature: DTzbKA9a0TAawWFEbC4D76wTq3A=\n" +
+ "x-emc-signature: OlAHsoIDCsO5YmqjRxOIM5sp3r0=\n" +
"x-emc-uid: identity\n" +
- "x-emc-wschecksum: MD5/0/00020408\n");
+ "x-emc-wschecksum: MD5/0/00000000000000000000000000000000\n");
- assertContentHeadersEqual(request, "text/plain", null, null, null, 2L, new byte[] { 0, 2, 4, 8 }, new Date(1000));
+ assertContentHeadersEqual(request, "text/plain", null, null, null, 2L, hashCode.asBytes(), new Date(1000));
assertEquals(request.getFilters().size(), 0);
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/0b89b1fd/apis/cloudfiles/src/test/java/org/jclouds/cloudfiles/blobstore/CloudFilesBlobSignerExpectTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudfiles/src/test/java/org/jclouds/cloudfiles/blobstore/CloudFilesBlobSignerExpectTest.java b/apis/cloudfiles/src/test/java/org/jclouds/cloudfiles/blobstore/CloudFilesBlobSignerExpectTest.java
index 4ab268f..11ef7ba 100644
--- a/apis/cloudfiles/src/test/java/org/jclouds/cloudfiles/blobstore/CloudFilesBlobSignerExpectTest.java
+++ b/apis/cloudfiles/src/test/java/org/jclouds/cloudfiles/blobstore/CloudFilesBlobSignerExpectTest.java
@@ -76,7 +76,7 @@ public class CloudFilesBlobSignerExpectTest extends BaseBlobSignerExpectTest {
protected HttpRequest putBlob() {
return HttpRequest.builder().method("PUT")
.endpoint("https://storage101.lon3.clouddrive.com/v1/MossoCloudFS_83a9d536-2e25-4166-bd3b-a503a934f953/container/name")
- .addHeader("ETag", "00020408")
+ .addHeader("ETag", "00000000000000000000000000000000")
.addHeader("Expect", "100-continue")
.addHeader("X-Auth-Token", authToken)
.addHeader("X-Delete-At", "1")
http://git-wip-us.apache.org/repos/asf/jclouds/blob/0b89b1fd/apis/s3/src/test/java/org/jclouds/s3/blobstore/S3BlobSignerExpectTest.java
----------------------------------------------------------------------
diff --git a/apis/s3/src/test/java/org/jclouds/s3/blobstore/S3BlobSignerExpectTest.java b/apis/s3/src/test/java/org/jclouds/s3/blobstore/S3BlobSignerExpectTest.java
index 093e1a6..1c138ae 100644
--- a/apis/s3/src/test/java/org/jclouds/s3/blobstore/S3BlobSignerExpectTest.java
+++ b/apis/s3/src/test/java/org/jclouds/s3/blobstore/S3BlobSignerExpectTest.java
@@ -77,7 +77,7 @@ public class S3BlobSignerExpectTest extends BaseBlobSignerExpectTest {
.endpoint("https://s3.amazonaws.com/container/name")
.addHeader("Expect", "100-continue")
.addHeader("Date", "Thu, 05 Jun 2008 16:38:19 GMT")
- .addHeader("Authorization", "AWS identity:j9Dy/lmmvlCKjA4lkqZenLxMkR4=").build();
+ .addHeader("Authorization", "AWS identity:zM2oT+71KcoOSxv1SU5L12UXnT8=").build();
}
@Override
@@ -93,7 +93,7 @@ public class S3BlobSignerExpectTest extends BaseBlobSignerExpectTest {
.endpoint("https://s3.amazonaws.com/container/name")
.addHeader("Expect", "100-continue")
.addHeader("Date", "Thu, 05 Jun 2008 16:38:19 GMT")
- .addHeader("Authorization", "AWS identity:0uvBv1wEskuhFHYJF/L6kEV9A7o=").build();
+ .addHeader("Authorization", "AWS identity:zM2oT+71KcoOSxv1SU5L12UXnT8=").build();
}
@Override
http://git-wip-us.apache.org/repos/asf/jclouds/blob/0b89b1fd/apis/s3/src/test/java/org/jclouds/s3/functions/ParseObjectMetadataFromHeadersTest.java
----------------------------------------------------------------------
diff --git a/apis/s3/src/test/java/org/jclouds/s3/functions/ParseObjectMetadataFromHeadersTest.java b/apis/s3/src/test/java/org/jclouds/s3/functions/ParseObjectMetadataFromHeadersTest.java
index e36028d..8f916c1 100644
--- a/apis/s3/src/test/java/org/jclouds/s3/functions/ParseObjectMetadataFromHeadersTest.java
+++ b/apis/s3/src/test/java/org/jclouds/s3/functions/ParseObjectMetadataFromHeadersTest.java
@@ -38,6 +38,7 @@ import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import com.google.common.collect.ImmutableMap;
+import com.google.common.hash.HashCode;
import com.google.common.net.HttpHeaders;
import com.google.inject.AbstractModule;
import com.google.inject.Guice;
@@ -51,7 +52,7 @@ public class ParseObjectMetadataFromHeadersTest {
HttpResponse http = HttpResponse.builder().statusCode(400).message("boa").payload("")
.addHeader(S3Headers.USER_METADATA_PREFIX + "foo", "bar")
.addHeader(HttpHeaders.LAST_MODIFIED, lastModified)
- .addHeader(HttpHeaders.ETAG, "\"abcd\"")
+ .addHeader(HttpHeaders.ETAG, "\"00000000000000000000000000000000\"")
.addHeader(HttpHeaders.CACHE_CONTROL, "cacheControl").build();
http.getPayload().getContentMetadata().setContentLength(1025l);
http.getPayload().getContentMetadata().setContentDisposition("contentDisposition");
@@ -60,13 +61,14 @@ public class ParseObjectMetadataFromHeadersTest {
MutableObjectMetadata response = parser.apply(http);
+ HashCode hashCode = HashCode.fromBytes(new byte[16]);
MutableObjectMetadataImpl expects = new MutableObjectMetadataImpl();
expects.setCacheControl("cacheControl");
expects.getContentMetadata().setContentDisposition("contentDisposition");
expects.getContentMetadata().setContentEncoding("encoding");
expects.getContentMetadata().setContentType(MediaType.APPLICATION_OCTET_STREAM);
expects.getContentMetadata().setContentLength(1025l);
- expects.getContentMetadata().setContentMD5(base16().lowerCase().decode("abcd"));
+ expects.getContentMetadata().setContentMD5(hashCode);
expects.setETag("\"abcd\"");
expects.setKey("key");
expects.setLastModified(now);
@@ -110,7 +112,7 @@ public class ParseObjectMetadataFromHeadersTest {
HttpResponse http = HttpResponse.builder().statusCode(400).message("boa").payload("")
.addHeader(S3Headers.USER_METADATA_PREFIX + "foo", "bar")
.addHeader(HttpHeaders.LAST_MODIFIED, lastModified)
- .addHeader(S3Headers.AMZ_ETAG, "\"abcd\"")
+ .addHeader(S3Headers.AMZ_ETAG, "\"00000000000000000000000000000000\"")
.addHeader(HttpHeaders.CACHE_CONTROL, "cacheControl").build();
http.getPayload().getContentMetadata().setContentLength(1025l);
@@ -120,11 +122,12 @@ public class ParseObjectMetadataFromHeadersTest {
MutableObjectMetadata response = parser.apply(http);
+ HashCode hashCode = HashCode.fromBytes(new byte[16]);
MutableObjectMetadataImpl expects = new MutableObjectMetadataImpl();
expects.setCacheControl("cacheControl");
expects.getContentMetadata().setContentDisposition("contentDisposition");
expects.getContentMetadata().setContentEncoding("encoding");
- expects.getContentMetadata().setContentMD5(base16().lowerCase().decode("abcd"));
+ expects.getContentMetadata().setContentMD5(hashCode);
expects.getContentMetadata().setContentType(MediaType.APPLICATION_OCTET_STREAM);
expects.getContentMetadata().setContentLength(1025l);
expects.setETag("\"abcd\"");
http://git-wip-us.apache.org/repos/asf/jclouds/blob/0b89b1fd/apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/SwiftBlobSignerExpectTest.java
----------------------------------------------------------------------
diff --git a/apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/SwiftBlobSignerExpectTest.java b/apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/SwiftBlobSignerExpectTest.java
index b5a8f79..32d66a5 100644
--- a/apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/SwiftBlobSignerExpectTest.java
+++ b/apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/SwiftBlobSignerExpectTest.java
@@ -74,7 +74,7 @@ public class SwiftBlobSignerExpectTest extends BaseBlobSignerExpectTest {
protected HttpRequest putBlob() {
return HttpRequest.builder().method("PUT")
.endpoint("http://storage/container/name")
- .addHeader("ETag", "00020408")
+ .addHeader("ETag", "00000000000000000000000000000000")
.addHeader("Expect", "100-continue")
.addHeader("X-Auth-Token", "testtoken")
.addHeader("X-Delete-At", "1")
http://git-wip-us.apache.org/repos/asf/jclouds/blob/0b89b1fd/apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/SwiftKeystoneBlobSignerExpectTest.java
----------------------------------------------------------------------
diff --git a/apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/SwiftKeystoneBlobSignerExpectTest.java b/apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/SwiftKeystoneBlobSignerExpectTest.java
index 0f9cedd..af087b4 100644
--- a/apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/SwiftKeystoneBlobSignerExpectTest.java
+++ b/apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/SwiftKeystoneBlobSignerExpectTest.java
@@ -69,7 +69,7 @@ public class SwiftKeystoneBlobSignerExpectTest extends BaseBlobSignerExpectTest
protected HttpRequest putBlob() {
return HttpRequest.builder().method("PUT")
.endpoint("https://objects.jclouds.org/v1.0/40806637803162/container/name")
- .addHeader("ETag", "00020408")
+ .addHeader("ETag", "00000000000000000000000000000000")
.addHeader("Expect", "100-continue")
.addHeader("X-Auth-Token", "Auth_4f173437e4b013bee56d1007")
.addHeader("X-Delete-At", "1")
http://git-wip-us.apache.org/repos/asf/jclouds/blob/0b89b1fd/blobstore/src/test/java/org/jclouds/blobstore/TransientBlobRequestSignerTest.java
----------------------------------------------------------------------
diff --git a/blobstore/src/test/java/org/jclouds/blobstore/TransientBlobRequestSignerTest.java b/blobstore/src/test/java/org/jclouds/blobstore/TransientBlobRequestSignerTest.java
index 80b528c..ff833ab 100644
--- a/blobstore/src/test/java/org/jclouds/blobstore/TransientBlobRequestSignerTest.java
+++ b/blobstore/src/test/java/org/jclouds/blobstore/TransientBlobRequestSignerTest.java
@@ -31,6 +31,7 @@ import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import com.google.common.base.Charsets;
+import com.google.common.hash.HashCode;
import com.google.common.hash.Hashing;
import com.google.common.io.ByteSource;
@@ -72,18 +73,22 @@ public class TransientBlobRequestSignerTest extends BaseAsyncClientTest<LocalAsy
public void testSignPutBlob() throws ArrayIndexOutOfBoundsException, SecurityException, IllegalArgumentException,
NoSuchMethodException, IOException {
- Blob blob = blobFactory.get().name(blobName).forSigning().contentLength(2l).contentMD5(new byte[] { 0, 2, 4, 8 })
+ HashCode hashCode = HashCode.fromBytes(new byte[16]);
+ Blob blob = blobFactory.get().name(blobName).forSigning().contentLength(2l).contentMD5(hashCode)
.contentType("text/plain").build();
- assertEquals(blob.getPayload().getContentMetadata().getContentMD5(), new byte[] { 0, 2, 4, 8 });
+ assertEquals(blob.getPayload().getContentMetadata().getContentMD5AsHashCode(), hashCode);
HttpRequest request = signer.signPutBlob(containerName, blob);
assertRequestLineEquals(request, "PUT " + fullUrl + " HTTP/1.1");
assertNonPayloadHeadersEqual(
request,
- "Authorization: Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==\nContent-Length: 2\nContent-MD5: AAIECA==\nContent-Type: text/plain\n");
- assertContentHeadersEqual(request, "text/plain", null, null, null, 2L, new byte[] { 0, 2, 4, 8 }, null);
+ "Authorization: Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==\n" +
+ "Content-Length: 2\n" +
+ "Content-MD5: AAAAAAAAAAAAAAAAAAAAAA==\n" +
+ "Content-Type: text/plain\n");
+ assertContentHeadersEqual(request, "text/plain", null, null, null, 2L, hashCode.asBytes(), null);
assertEquals(request.getFilters().size(), 0);
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/0b89b1fd/blobstore/src/test/java/org/jclouds/blobstore/internal/BaseBlobSignerExpectTest.java
----------------------------------------------------------------------
diff --git a/blobstore/src/test/java/org/jclouds/blobstore/internal/BaseBlobSignerExpectTest.java b/blobstore/src/test/java/org/jclouds/blobstore/internal/BaseBlobSignerExpectTest.java
index 337b484..02de7f1 100644
--- a/blobstore/src/test/java/org/jclouds/blobstore/internal/BaseBlobSignerExpectTest.java
+++ b/blobstore/src/test/java/org/jclouds/blobstore/internal/BaseBlobSignerExpectTest.java
@@ -33,6 +33,7 @@ import org.testng.annotations.Test;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableMap;
+import com.google.common.hash.HashCode;
import com.google.inject.Module;
public abstract class BaseBlobSignerExpectTest extends BaseRestClientExpectTest<BlobStore> {
@@ -85,8 +86,9 @@ public abstract class BaseBlobSignerExpectTest extends BaseRestClientExpectTest<
@Test
public void testSignPutBlob() throws Exception {
+ HashCode hashCode = HashCode.fromBytes(new byte[16]);
BlobStore signPutBlob = requestsSendResponses(init());
- Blob blob = signPutBlob.blobBuilder("name").forSigning().contentLength(2l).contentMD5(new byte[] { 0, 2, 4, 8 })
+ Blob blob = signPutBlob.blobBuilder("name").forSigning().contentLength(2l).contentMD5(hashCode)
.contentType("text/plain").expires(new Date(1000)).build();
HttpRequest compare = putBlob();
compare.setPayload(blob.getPayload());
http://git-wip-us.apache.org/repos/asf/jclouds/blob/0b89b1fd/core/src/main/java/org/jclouds/io/ContentMetadataBuilder.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/jclouds/io/ContentMetadataBuilder.java b/core/src/main/java/org/jclouds/io/ContentMetadataBuilder.java
index 3e17f1c..84cca64 100644
--- a/core/src/main/java/org/jclouds/io/ContentMetadataBuilder.java
+++ b/core/src/main/java/org/jclouds/io/ContentMetadataBuilder.java
@@ -22,6 +22,7 @@ import org.jclouds.io.payloads.BaseImmutableContentMetadata;
import org.jclouds.javax.annotation.Nullable;
import com.google.common.base.Objects;
+import com.google.common.base.Preconditions;
import com.google.common.hash.HashCode;
public class ContentMetadataBuilder {
@@ -51,6 +52,7 @@ public class ContentMetadataBuilder {
public ContentMetadataBuilder contentMD5(@Nullable HashCode contentMD5) {
if (contentMD5 != null) {
+ Preconditions.checkArgument(contentMD5.bits() == 128, "MD5 hash must have 128 bits, was: %s", contentMD5.bits());
this.contentMD5 = contentMD5;
}
return this;
http://git-wip-us.apache.org/repos/asf/jclouds/blob/0b89b1fd/drivers/gae/src/test/java/org/jclouds/gae/ConvertToGaeRequestTest.java
----------------------------------------------------------------------
diff --git a/drivers/gae/src/test/java/org/jclouds/gae/ConvertToGaeRequestTest.java b/drivers/gae/src/test/java/org/jclouds/gae/ConvertToGaeRequestTest.java
index 21d0f3f..1f744d8 100644
--- a/drivers/gae/src/test/java/org/jclouds/gae/ConvertToGaeRequestTest.java
+++ b/drivers/gae/src/test/java/org/jclouds/gae/ConvertToGaeRequestTest.java
@@ -157,7 +157,7 @@ public class ConvertToGaeRequestTest {
private void testHoot(HttpRequest request) throws IOException {
request.getPayload().getContentMetadata().setContentType("text/plain");
- request.getPayload().getContentMetadata().setContentMD5(new byte[] { 1, 2, 3, 4 });
+ request.getPayload().getContentMetadata().setContentMD5(new byte[16]);
HTTPRequest gaeRequest = req.apply(request);
StringBuilder builder = new StringBuilder();
@@ -166,7 +166,10 @@ public class ConvertToGaeRequestTest {
}
assertEquals(builder.toString(),
// note content-length is prohibited in gae
- "User-Agent: jclouds/1.0 urlfetch/1.4.3\nExpect: 100-continue\nContent-Type: text/plain\nContent-MD5: AQIDBA==\n");
+ "User-Agent: jclouds/1.0 urlfetch/1.4.3\n" +
+ "Expect: 100-continue\n" +
+ "Content-Type: text/plain\n" +
+ "Content-MD5: AAAAAAAAAAAAAAAAAAAAAA==\n");
assertEquals(new String(gaeRequest.getPayload()), "hoot!");
}
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/0b89b1fd/providers/aws-s3/src/test/java/org/jclouds/aws/s3/AWSS3AsyncClientTest.java
----------------------------------------------------------------------
diff --git a/providers/aws-s3/src/test/java/org/jclouds/aws/s3/AWSS3AsyncClientTest.java b/providers/aws-s3/src/test/java/org/jclouds/aws/s3/AWSS3AsyncClientTest.java
index 71694bb..8b436d3 100644
--- a/providers/aws-s3/src/test/java/org/jclouds/aws/s3/AWSS3AsyncClientTest.java
+++ b/providers/aws-s3/src/test/java/org/jclouds/aws/s3/AWSS3AsyncClientTest.java
@@ -63,6 +63,7 @@ import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.google.common.reflect.Invokable;
import com.google.inject.Module;
+
// NOTE:without testName, this will not call @Before* and fail w/NPE during
// surefire
@Test(groups = "unit", testName = "AWSS3AsyncClientTest")
@@ -166,11 +167,13 @@ public class AWSS3AsyncClientTest extends S3AsyncClientTest<AWSS3AsyncClient> {
Invokable<?, ?> method = method(AWSS3AsyncClient.class, "initiateMultipartUpload", String.class, ObjectMetadata.class,
PutObjectOptions[].class);
GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.<Object> of("bucket", ObjectMetadataBuilder.create().key("foo")
- .contentMD5(new byte[] { 1, 2, 3, 4 }).build()));
+ .contentMD5(new byte[16]).build()));
assertRequestLineEquals(request, "POST https://bucket." + url + "/foo?uploads HTTP/1.1");
- assertNonPayloadHeadersEqual(request, "Content-MD5: AQIDBA==\nContent-Type: binary/octet-stream\nHost: bucket."
- + url + "\n");
+ assertNonPayloadHeadersEqual(request,
+ "Content-MD5: AAAAAAAAAAAAAAAAAAAAAA==\n" +
+ "Content-Type: binary/octet-stream\n" +
+ "Host: bucket." + url + "\n");
assertPayloadEquals(request, null, null, false);
// as this is a payload-related command, but with no payload, be careful
@@ -180,8 +183,11 @@ public class AWSS3AsyncClientTest extends S3AsyncClientTest<AWSS3AsyncClient> {
assertRequestLineEquals(request, "POST https://bucket." + url + "/foo?uploads HTTP/1.1");
assertNonPayloadHeadersEqual(request,
- "Authorization: AWS identity:Sp1FX4svL9P2u2bFJwroaYpSANo=\nContent-MD5: AQIDBA==\n"
- + "Content-Type: binary/octet-stream\nDate: 2009-11-08T15:54:08.897Z\nHost: bucket." + url + "\n");
+ "Authorization: AWS identity:972m/Bqn2L5FIaB+wWDeY83mGvU=\n" +
+ "Content-MD5: AAAAAAAAAAAAAAAAAAAAAA==\n" +
+ "Content-Type: binary/octet-stream\n" +
+ "Date: 2009-11-08T15:54:08.897Z\n" +
+ "Host: bucket." + url + "\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, UploadIdFromHttpResponseViaRegex.class);
http://git-wip-us.apache.org/repos/asf/jclouds/blob/0b89b1fd/providers/aws-s3/src/test/java/org/jclouds/aws/s3/blobstore/AWSS3BlobSignerExpectTest.java
----------------------------------------------------------------------
diff --git a/providers/aws-s3/src/test/java/org/jclouds/aws/s3/blobstore/AWSS3BlobSignerExpectTest.java b/providers/aws-s3/src/test/java/org/jclouds/aws/s3/blobstore/AWSS3BlobSignerExpectTest.java
index eb9f306..60649a2 100644
--- a/providers/aws-s3/src/test/java/org/jclouds/aws/s3/blobstore/AWSS3BlobSignerExpectTest.java
+++ b/providers/aws-s3/src/test/java/org/jclouds/aws/s3/blobstore/AWSS3BlobSignerExpectTest.java
@@ -82,7 +82,7 @@ public class AWSS3BlobSignerExpectTest extends S3BlobSignerExpectTest {
.addHeader("Host", HOST)
.addHeader("Expect", "100-continue")
.addHeader("Date", "Thu, 05 Jun 2008 16:38:19 GMT")
- .addHeader("Authorization", "AWS identity:j9Dy/lmmvlCKjA4lkqZenLxMkR4=").build();
+ .addHeader("Authorization", "AWS identity:zM2oT+71KcoOSxv1SU5L12UXnT8=").build();
}
@Override
http://git-wip-us.apache.org/repos/asf/jclouds/blob/0b89b1fd/providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/AzureBlobRequestSignerTest.java
----------------------------------------------------------------------
diff --git a/providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/AzureBlobRequestSignerTest.java b/providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/AzureBlobRequestSignerTest.java
index 240a028..96ae9da 100644
--- a/providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/AzureBlobRequestSignerTest.java
+++ b/providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/AzureBlobRequestSignerTest.java
@@ -35,6 +35,7 @@ import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import com.google.common.base.Supplier;
+import com.google.common.hash.HashCode;
import com.google.inject.Module;
/**
@@ -80,11 +81,12 @@ public class AzureBlobRequestSignerTest extends BaseAsyncClientTest<AzureBlobAsy
public void testSignPutBlob() throws ArrayIndexOutOfBoundsException, SecurityException, IllegalArgumentException,
NoSuchMethodException, IOException {
+ HashCode hashCode = HashCode.fromBytes(new byte[16]);
Blob blob = blobFactory.create(null);
blob.getMetadata().setName("name");
blob.setPayload("");
blob.getPayload().getContentMetadata().setContentLength(2l);
- blob.getPayload().getContentMetadata().setContentMD5(new byte[] { 0, 2, 4, 8 });
+ blob.getPayload().getContentMetadata().setContentMD5(hashCode);
blob.getPayload().getContentMetadata().setContentType("text/plain");
blob.getPayload().getContentMetadata().setExpires(new Date(1000));
@@ -93,8 +95,12 @@ public class AzureBlobRequestSignerTest extends BaseAsyncClientTest<AzureBlobAsy
assertRequestLineEquals(request, "PUT https://identity.blob.core.windows.net/container/name HTTP/1.1");
assertNonPayloadHeadersEqual(
request,
- "Authorization: SharedKeyLite identity:ssvK6ZB8GMqRcp1lBpY9vIzbLKL9Goxh7wZ2YhfHNzQ=\nDate: Thu, 05 Jun 2008 16:38:19 GMT\nExpect: 100-continue\nx-ms-blob-type: BlockBlob\nx-ms-version: 2009-09-19\n");
- assertContentHeadersEqual(request, "text/plain", null, null, null, 2L, new byte[] { 0, 2, 4, 8 }, new Date(1000));
+ "Authorization: SharedKeyLite identity:8kilG1mKxSWaKMLIQPI/aBlTFvaRRbmGOBqKaE+/R5A=\n" +
+ "Date: Thu, 05 Jun 2008 16:38:19 GMT\n" +
+ "Expect: 100-continue\n" +
+ "x-ms-blob-type: BlockBlob\n" +
+ "x-ms-version: 2009-09-19\n");
+ assertContentHeadersEqual(request, "text/plain", null, null, null, 2L, hashCode.asBytes(), new Date(1000));
assertEquals(request.getFilters().size(), 0);
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/0b89b1fd/providers/hpcloud-objectstorage/src/test/java/org/jclouds/hpcloud/objectstorage/blobstore/HPCloudObjectStorageBlobSignerExpectTest.java
----------------------------------------------------------------------
diff --git a/providers/hpcloud-objectstorage/src/test/java/org/jclouds/hpcloud/objectstorage/blobstore/HPCloudObjectStorageBlobSignerExpectTest.java b/providers/hpcloud-objectstorage/src/test/java/org/jclouds/hpcloud/objectstorage/blobstore/HPCloudObjectStorageBlobSignerExpectTest.java
index 5aa225e..874fcf8 100644
--- a/providers/hpcloud-objectstorage/src/test/java/org/jclouds/hpcloud/objectstorage/blobstore/HPCloudObjectStorageBlobSignerExpectTest.java
+++ b/providers/hpcloud-objectstorage/src/test/java/org/jclouds/hpcloud/objectstorage/blobstore/HPCloudObjectStorageBlobSignerExpectTest.java
@@ -72,7 +72,7 @@ public class HPCloudObjectStorageBlobSignerExpectTest extends BaseBlobSignerExpe
protected HttpRequest putBlob() {
return HttpRequest.builder().method("PUT")
.endpoint("https://region-a.geo-1.objects.hpcloudsvc.com/v1/myTenantId/container/name")
- .addHeader("ETag", "00020408")
+ .addHeader("ETag", "00000000000000000000000000000000")
.addHeader("Expect", "100-continue")
.addHeader("X-Auth-Token", "myToken")
.addHeader("X-Delete-At", "1")
[20/50] [abbrv] git commit: Fail build on checkstyle warnings
Posted by an...@apache.org.
Fail build on checkstyle warnings
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/9384575d
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/9384575d
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/9384575d
Branch: refs/heads/fix-jclouds-538
Commit: 9384575d1ee4c2e68ff503b237dfedf8ab6b14bb
Parents: d6eb54e
Author: Jeremy Daggett <je...@rackspace.com>
Authored: Wed Aug 6 11:09:57 2014 -0700
Committer: Jeremy Daggett <jd...@apache.org>
Committed: Wed Sep 10 11:41:30 2014 -0700
----------------------------------------------------------------------
project/pom.xml | 49 +++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 43 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/9384575d/project/pom.xml
----------------------------------------------------------------------
diff --git a/project/pom.xml b/project/pom.xml
index a2fd019..286bfe3 100644
--- a/project/pom.xml
+++ b/project/pom.xml
@@ -84,7 +84,7 @@
<url>https://git-wip-us.apache.org/repos/asf?p=jclouds.git</url>
<tag>HEAD</tag>
</scm>
-
+
<repositories>
<repository>
<id>apache-snapshots</id>
@@ -340,7 +340,7 @@
<arguments>-Pdoc -Papache-release ${arguments}</arguments>
</configuration>
</plugin>
-
+
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
@@ -361,7 +361,7 @@
<exclude>**/src/test/resources/**/*.txt</exclude>
<exclude>**/src/test/resources/**/*.gz</exclude>
<exclude>**/src/test/resources/**/*.xml</exclude>
-
+
<!-- META-INF/services files -->
<exclude>**/services/*LoggingModule</exclude>
<exclude>**/services/*ApiMetadata</exclude>
@@ -671,10 +671,25 @@
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.12.1</version>
+ <executions>
+ <execution>
+ <id>checkstyle</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ <configuration>
+ <failOnViolation>true</failOnViolation>
+ </configuration>
+ </execution>
+ </executions>
<configuration>
<!-- configLocation configured via profiles -->
<violationSeverity>warning</violationSeverity>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
+ <failOnViolation>true</failOnViolation>
+ <failsOnError>true</failsOnError>
+ <violationSeverity>warning</violationSeverity>
</configuration>
</plugin>
</plugins>
@@ -947,7 +962,7 @@
<configuration>
<descriptors>
<descriptor>src-descriptor.xml</descriptor>
- <descriptor>provided-dependencies-descriptor.xml</descriptor>
+ <descriptor>provided-dependencies-descriptor.xml</descriptor>
<descriptor>jar-with-dependencies-no-core-no-apis-descriptor.xml</descriptor>
</descriptors>
</configuration>
@@ -963,7 +978,7 @@
</plugin>
</plugins>
</build>
- </profile>
+ </profile>
<profile>
<id>site</id>
<build>
@@ -1019,7 +1034,18 @@
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<configLocation>../resources/checkstyle.xml</configLocation>
+ <failOnViolation>true</failOnViolation>
+ <failsOnError>true</failsOnError>
+ <violationSeverity>warning</violationSeverity>
</configuration>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
</plugin>
</plugins>
</build>
@@ -1046,9 +1072,20 @@
<configuration>
<!-- jclouds-resources has the checkstyle config in the classpath -->
<configLocation>resources/checkstyle.xml</configLocation>
+ <failOnViolation>true</failOnViolation>
+ <failsOnError>true</failsOnError>
+ <violationSeverity>warning</violationSeverity>
</configuration>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
</plugin>
- </plugins>
+ </plugins>
</build>
</profile>
<profile>
[46/50] [abbrv] git commit: JCLOUDS-692 Remove the CloudSigma v1
provider.
Posted by an...@apache.org.
JCLOUDS-692 Remove the CloudSigma v1 provider.
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/f7aea987
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/f7aea987
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/f7aea987
Branch: refs/heads/fix-jclouds-538
Commit: f7aea98742c2885eb85f07754b47abf7e71ec851
Parents: 5bac61d
Author: Adrian Cole <ad...@gmail.com>
Authored: Tue Sep 30 16:04:20 2014 -0700
Committer: Jeremy Daggett <jd...@apache.org>
Committed: Thu Oct 2 09:28:53 2014 -0700
----------------------------------------------------------------------
allcompute/pom.xml | 15 -
apis/cloudsigma/README.txt | 6 -
apis/cloudsigma/pom.xml | 116 ----
.../org/jclouds/cloudsigma/CloudSigmaApi.java | 447 -------------
.../cloudsigma/CloudSigmaApiMetadata.java | 88 ---
.../BindCloneDriveOptionsToPlainTextString.java | 87 ---
.../binders/BindDriveDataToPlainTextString.java | 55 --
.../binders/BindDriveToPlainTextString.java | 55 --
.../binders/BindServerToPlainTextString.java | 55 --
.../CloudSigmaComputeServiceAdapter.java | 251 --------
.../compute/CloudSigmaTemplateBuilderImpl.java | 44 --
.../CloudSigmaComputeServiceContextModule.java | 120 ----
.../ParseOsFamilyVersion64BitFromImageName.java | 82 ---
.../functions/PreinstalledDiskToImage.java | 62 --
.../functions/ServerInfoToNodeMetadata.java | 174 -----
.../options/CloudSigmaTemplateOptions.java | 323 ----------
.../config/CloudSigmaRestClientModule.java | 88 ---
.../jclouds/cloudsigma/domain/AffinityType.java | 47 --
.../jclouds/cloudsigma/domain/BlockDevice.java | 79 ---
.../jclouds/cloudsigma/domain/ClaimType.java | 52 --
.../cloudsigma/domain/CreateDriveRequest.java | 164 -----
.../org/jclouds/cloudsigma/domain/Device.java | 101 ---
.../org/jclouds/cloudsigma/domain/Drive.java | 209 ------
.../jclouds/cloudsigma/domain/DriveData.java | 81 ---
.../jclouds/cloudsigma/domain/DriveInfo.java | 466 --------------
.../jclouds/cloudsigma/domain/DriveMetrics.java | 132 ----
.../jclouds/cloudsigma/domain/DriveStatus.java | 41 --
.../jclouds/cloudsigma/domain/DriveType.java | 41 --
.../jclouds/cloudsigma/domain/IDEDevice.java | 91 ---
.../org/jclouds/cloudsigma/domain/Item.java | 163 -----
.../jclouds/cloudsigma/domain/MediaType.java | 45 --
.../org/jclouds/cloudsigma/domain/Model.java | 40 --
.../java/org/jclouds/cloudsigma/domain/NIC.java | 170 -----
.../jclouds/cloudsigma/domain/ProfileInfo.java | 191 ------
.../jclouds/cloudsigma/domain/ProfileType.java | 40 --
.../jclouds/cloudsigma/domain/SCSIDevice.java | 85 ---
.../org/jclouds/cloudsigma/domain/Server.java | 286 --------
.../jclouds/cloudsigma/domain/ServerInfo.java | 251 --------
.../cloudsigma/domain/ServerMetrics.java | 149 -----
.../jclouds/cloudsigma/domain/ServerStatus.java | 40 --
.../jclouds/cloudsigma/domain/StaticIPInfo.java | 224 -------
.../org/jclouds/cloudsigma/domain/VLANInfo.java | 159 -----
.../java/org/jclouds/cloudsigma/domain/VNC.java | 98 ---
.../cloudsigma/functions/BaseDriveToMap.java | 50 --
.../cloudsigma/functions/DriveDataToMap.java | 77 ---
...yValuesDelimitedByBlankLinesToDriveInfo.java | 46 --
...aluesDelimitedByBlankLinesToProfileInfo.java | 46 --
...ValuesDelimitedByBlankLinesToServerInfo.java | 46 --
...luesDelimitedByBlankLinesToStaticIPInfo.java | 46 --
...eyValuesDelimitedByBlankLinesToVLANInfo.java | 46 --
...luesDelimitedByBlankLinesToDriveInfoSet.java | 53 --
...ValuesDelimitedByBlankLinesToListOfMaps.java | 54 --
...esDelimitedByBlankLinesToProfileInfoSet.java | 53 --
...uesDelimitedByBlankLinesToServerInfoSet.java | 54 --
...sDelimitedByBlankLinesToStaticIPInfoSet.java | 53 --
...aluesDelimitedByBlankLinesToVLANInfoSet.java | 53 --
...sToListOfKeyValuesDelimitedByBlankLines.java | 51 --
.../cloudsigma/functions/MapToDevices.java | 95 ---
.../cloudsigma/functions/MapToDriveInfo.java | 110 ----
.../cloudsigma/functions/MapToDriveMetrics.java | 80 ---
.../jclouds/cloudsigma/functions/MapToNICs.java | 52 --
.../cloudsigma/functions/MapToProfileInfo.java | 54 --
.../cloudsigma/functions/MapToServerInfo.java | 87 ---
.../functions/MapToServerMetrics.java | 53 --
.../cloudsigma/functions/MapToStaticIPInfo.java | 54 --
.../cloudsigma/functions/MapToVLANInfo.java | 50 --
.../cloudsigma/functions/ReturnPayload.java | 32 -
.../cloudsigma/functions/ServerToMap.java | 74 ---
.../cloudsigma/functions/SplitNewlines.java | 45 --
.../SplitNewlinesAndReturnSecondField.java | 60 --
.../handlers/CloudSigmaErrorHandler.java | 102 ---
.../cloudsigma/options/CloneDriveOptions.java | 136 ----
.../cloudsigma/predicates/DriveClaimed.java | 56 --
.../reference/CloudSigmaConstants.java | 29 -
.../org/jclouds/cloudsigma/util/Servers.java | 79 ---
.../services/org.jclouds.apis.ApiMetadata | 1 -
.../cloudsigma/CloudSigmaApiMetadataTest.java | 28 -
.../jclouds/cloudsigma/CloudSigmaApiTest.java | 644 -------------------
.../cloudsigma/CloudSigmaClientLiveTest.java | 441 -------------
...dCloneDriveOptionsToPlainTextStringTest.java | 67 --
.../BindDriveDataToPlainTextStringTest.java | 80 ---
.../binders/BindDriveToPlainTextStringTest.java | 83 ---
.../BindServerToPlainTextStringTest.java | 85 ---
.../CloudSigmaComputeServiceLiveTest.java | 64 --
.../functions/BaseDriveToMapTest.java | 60 --
.../functions/DriveDataToMapTest.java | 74 ---
...uesDelimitedByBlankLinesToDriveInfoTest.java | 42 --
...sDelimitedByBlankLinesToProfileInfoTest.java | 42 --
...esDelimitedByBlankLinesToServerInfoTest.java | 73 ---
...luesDelimitedByBlankLinesToVLANInfoTest.java | 42 --
...DelimitedByBlankLinesToDriveInfoSetTest.java | 44 --
...esDelimitedByBlankLinesToListOfMapsTest.java | 59 --
...elimitedByBlankLinesToServerInfoSetTest.java | 73 ---
...sDelimitedByBlankLinesToVLANInfoSetTest.java | 44 --
...istOfKeyValuesDelimitedByBlankLinesTest.java | 53 --
.../functions/MapToDriveInfoTest.java | 90 ---
.../functions/MapToProfileInfoTest.java | 51 --
.../functions/MapToServerInfoTest.java | 155 -----
.../cloudsigma/functions/MapToVLANInfoTest.java | 49 --
...seOsFamilyVersion64BitFromImageNameTest.java | 74 ---
.../cloudsigma/functions/ServerToMapTest.java | 59 --
.../cloudsigma/functions/SplitNewlinesTest.java | 48 --
.../handlers/CloudSigmaErrorHandlerTest.java | 131 ----
.../options/CloneDriveOptionsTest.java | 127 ----
.../src/test/resources/create_drive.txt | 5 -
.../src/test/resources/create_server.txt | 11 -
apis/cloudsigma/src/test/resources/drive.txt | 27 -
.../src/test/resources/drive_data.txt | 6 -
apis/cloudsigma/src/test/resources/log4j.xml | 151 -----
.../src/test/resources/new_server.txt | 24 -
.../src/test/resources/osmatches.json | 174 -----
apis/cloudsigma/src/test/resources/profile.txt | 28 -
apis/cloudsigma/src/test/resources/servers.txt | 40 --
apis/cloudsigma/src/test/resources/uuids.txt | 3 -
apis/cloudsigma/src/test/resources/vlan.txt | 4 -
apis/pom.xml | 1 -
providers/cloudsigma-lvs/pom.xml | 125 ----
.../CloudSigmaLasVegasProviderMetadata.java | 81 ---
.../org.jclouds.providers.ProviderMetadata | 1 -
.../CloudSigmaLasVegasLondonClientLiveTest.java | 26 -
.../CloudSigmaLasVegasProviderTest.java | 28 -
...loudSigmaLasVegasComputeServiceLiveTest.java | 28 -
...oudSigmaLasVegasTemplateBuilderLiveTest.java | 85 ---
providers/cloudsigma-zrh/pom.xml | 126 ----
.../CloudSigmaZurichProviderMetadata.java | 81 ---
.../org.jclouds.providers.ProviderMetadata | 1 -
.../CloudSigmaZurichClientLiveTest.java | 26 -
.../CloudSigmaZurichProviderTest.java | 28 -
.../CloudSigmaZurichComputeServiceLiveTest.java | 75 ---
...CloudSigmaZurichTemplateBuilderLiveTest.java | 82 ---
providers/pom.xml | 2 -
131 files changed, 11641 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/allcompute/pom.xml
----------------------------------------------------------------------
diff --git a/allcompute/pom.xml b/allcompute/pom.xml
index c29e553..488a108 100644
--- a/allcompute/pom.xml
+++ b/allcompute/pom.xml
@@ -79,11 +79,6 @@
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>cloudsigma</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
<groupId>org.apache.jclouds.provider</groupId>
<artifactId>bluelock-vcloud-zone01</artifactId>
<version>${project.version}</version>
@@ -130,16 +125,6 @@
</dependency>
<dependency>
<groupId>org.apache.jclouds.provider</groupId>
- <artifactId>cloudsigma-zrh</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.provider</groupId>
- <artifactId>cloudsigma-lvs</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.provider</groupId>
<artifactId>go2cloud-jhb1</artifactId>
<version>${project.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/README.txt
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/README.txt b/apis/cloudsigma/README.txt
deleted file mode 100644
index bddfd04..0000000
--- a/apis/cloudsigma/README.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-#
-# The jclouds provider for CloudSigma (http://www.cloudsigma.com/).
-#
-# TODO: Implementation status.
-# TODO: Supported features.
-# TODO: Usage example.
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/pom.xml
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/pom.xml b/apis/cloudsigma/pom.xml
deleted file mode 100644
index 859f62d..0000000
--- a/apis/cloudsigma/pom.xml
+++ /dev/null
@@ -1,116 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-project</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- <relativePath>../../project/pom.xml</relativePath>
- </parent>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>cloudsigma</artifactId>
- <name>jclouds CloudSigma API</name>
- <description>ComputeService binding to the CloudSigma API</description>
- <packaging>bundle</packaging>
-
- <properties>
- <test.cloudsigma.endpoint>https://api.cloudsigma.com</test.cloudsigma.endpoint>
- <test.cloudsigma.api-version>1.0</test.cloudsigma.api-version>
- <test.cloudsigma.build-version />
- <test.cloudsigma.identity>FIXME_IDENTITY</test.cloudsigma.identity>
- <test.cloudsigma.credential>FIXME_CREDENTIAL</test.cloudsigma.credential>
- <test.cloudsigma.template>imageId=f3c7c665-cd54-4a78-8fd2-7ec2f028cf29</test.cloudsigma.template>
- <jclouds.osgi.export>org.jclouds.cloudsigma*;version="${project.version}"</jclouds.osgi.export>
- <jclouds.osgi.import>
- org.jclouds.compute.internal;version="${project.version}",
- org.jclouds.rest.internal;version="${project.version}",
- org.jclouds*;version="${project.version}",
- *
- </jclouds.osgi.import>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-compute</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.driver</groupId>
- <artifactId>jclouds-sshj</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-compute</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.driver</groupId>
- <artifactId>jclouds-log4j</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- <profiles>
- <profile>
- <id>live</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <executions>
- <execution>
- <id>integration</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <systemPropertyVariables>
- <test.cloudsigma.endpoint>${test.cloudsigma.endpoint}</test.cloudsigma.endpoint>
- <test.cloudsigma.api-version>${test.cloudsigma.api-version}</test.cloudsigma.api-version>
- <test.cloudsigma.build-version>${test.cloudsigma.build-version}</test.cloudsigma.build-version>
- <test.cloudsigma.identity>${test.cloudsigma.identity}</test.cloudsigma.identity>
- <test.cloudsigma.credential>${test.cloudsigma.credential}</test.cloudsigma.credential>
- <test.cloudsigma.template>${test.cloudsigma.template}</test.cloudsigma.template>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/CloudSigmaApi.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/CloudSigmaApi.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/CloudSigmaApi.java
deleted file mode 100644
index da0156d..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/CloudSigmaApi.java
+++ /dev/null
@@ -1,447 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma;
-
-import java.io.Closeable;
-import java.util.Set;
-
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.Fallbacks.VoidOnNotFoundOr404;
-import org.jclouds.cloudsigma.binders.BindCloneDriveOptionsToPlainTextString;
-import org.jclouds.cloudsigma.binders.BindDriveDataToPlainTextString;
-import org.jclouds.cloudsigma.binders.BindDriveToPlainTextString;
-import org.jclouds.cloudsigma.binders.BindServerToPlainTextString;
-import org.jclouds.cloudsigma.domain.Drive;
-import org.jclouds.cloudsigma.domain.DriveData;
-import org.jclouds.cloudsigma.domain.DriveInfo;
-import org.jclouds.cloudsigma.domain.ProfileInfo;
-import org.jclouds.cloudsigma.domain.Server;
-import org.jclouds.cloudsigma.domain.ServerInfo;
-import org.jclouds.cloudsigma.domain.StaticIPInfo;
-import org.jclouds.cloudsigma.domain.VLANInfo;
-import org.jclouds.cloudsigma.functions.KeyValuesDelimitedByBlankLinesToDriveInfo;
-import org.jclouds.cloudsigma.functions.KeyValuesDelimitedByBlankLinesToProfileInfo;
-import org.jclouds.cloudsigma.functions.KeyValuesDelimitedByBlankLinesToServerInfo;
-import org.jclouds.cloudsigma.functions.KeyValuesDelimitedByBlankLinesToStaticIPInfo;
-import org.jclouds.cloudsigma.functions.KeyValuesDelimitedByBlankLinesToVLANInfo;
-import org.jclouds.cloudsigma.functions.ListOfKeyValuesDelimitedByBlankLinesToDriveInfoSet;
-import org.jclouds.cloudsigma.functions.ListOfKeyValuesDelimitedByBlankLinesToServerInfoSet;
-import org.jclouds.cloudsigma.functions.ListOfKeyValuesDelimitedByBlankLinesToStaticIPInfoSet;
-import org.jclouds.cloudsigma.functions.ListOfKeyValuesDelimitedByBlankLinesToVLANInfoSet;
-import org.jclouds.cloudsigma.functions.SplitNewlines;
-import org.jclouds.cloudsigma.functions.SplitNewlinesAndReturnSecondField;
-import org.jclouds.cloudsigma.options.CloneDriveOptions;
-import org.jclouds.http.filters.BasicAuthentication;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.MapBinder;
-import org.jclouds.rest.annotations.Payload;
-import org.jclouds.rest.annotations.PayloadParam;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.ResponseParser;
-
-/**
- * Provides synchronous access to CloudSigma via their REST API.
- * <p/>
- *
- * @see <a href="http://cloudsigma.com/en/platform-details/the-api" />
- */
-@RequestFilters(BasicAuthentication.class)
-@Consumes(MediaType.TEXT_PLAIN)
-public interface CloudSigmaApi extends Closeable {
-
- /**
- * list of drive uuids that are in the library
- *
- * @return or empty set if no drives are found
- */
- @GET
- @Path("/drives/standard/list")
- @ResponseParser(SplitNewlines.class)
- Set<String> listStandardDrives();
-
- /**
- * list of cd uuids that are in the library
- *
- * @return or empty set if no cds are found
- */
- @GET
- @Path("/drives/standard/cd/list")
- @ResponseParser(SplitNewlines.class)
- Set<String> listStandardCds();
-
- /**
- * list of image uuids that are in the library
- *
- * @return or empty set if no images are found
- */
- @GET
- @Path("/drives/standard/img/list")
- @ResponseParser(SplitNewlines.class)
- Set<String> listStandardImages();
-
- /**
- * Clone an existing drive. By default, the size is the same as the source
- *
- * @param sourceUuid
- * source to clone
- * @param newName
- * name of the resulting drive
- * @param options
- * options to control size
- * @return new drive
- */
- @POST
- @ResponseParser(KeyValuesDelimitedByBlankLinesToDriveInfo.class)
- @Path("/drives/{uuid}/clone")
- @MapBinder(BindCloneDriveOptionsToPlainTextString.class)
- DriveInfo cloneDrive(@PathParam("uuid") String sourceUuid, @PayloadParam("name") String newName,
- CloneDriveOptions... options);
-
- /**
- * Get profile info
- *
- * @return info or null, if not found
- */
- @GET
- @Path("/profile/info")
- @Fallback(NullOnNotFoundOr404.class)
- @ResponseParser(KeyValuesDelimitedByBlankLinesToProfileInfo.class)
- ProfileInfo getProfileInfo();
-
- /**
- * Get all drives info
- *
- * @return or empty set if no drives are found
- */
- @GET
- @Path("/drives/info")
- @ResponseParser(ListOfKeyValuesDelimitedByBlankLinesToDriveInfoSet.class)
- Set<DriveInfo> listDriveInfo();
-
- /**
- * @param uuid
- * what to get
- * @return null, if not found
- */
- @GET
- @Fallback(NullOnNotFoundOr404.class)
- @ResponseParser(KeyValuesDelimitedByBlankLinesToDriveInfo.class)
- @Path("/drives/{uuid}/info")
- DriveInfo getDriveInfo(@PathParam("uuid") String uuid);
-
- /**
- * create a new drive
- *
- * @param createDrive
- * required parameters: name, size
- * @return newly created drive
- */
- @POST
- @Fallback(NullOnNotFoundOr404.class)
- @ResponseParser(KeyValuesDelimitedByBlankLinesToDriveInfo.class)
- @Path("/drives/create")
- DriveInfo createDrive(@BinderParam(BindDriveToPlainTextString.class) Drive createDrive);
-
- /**
- * set extra drive data
- *
- * @param uuid
- * what drive to change
- * @param createDrive
- * what values to change
- * @return new data
- */
- @POST
- @ResponseParser(KeyValuesDelimitedByBlankLinesToDriveInfo.class)
- @Path("/drives/{uuid}/set")
- DriveInfo setDriveData(@PathParam("uuid") String uuid,
- @BinderParam(BindDriveDataToPlainTextString.class) DriveData createDrive);
-
- /**
- * create a new server
- *
- * @param createServer
- * @return newly created server
- */
- @POST
- @Fallback(NullOnNotFoundOr404.class)
- @ResponseParser(KeyValuesDelimitedByBlankLinesToServerInfo.class)
- @Path("/servers/create")
- ServerInfo createServer(@BinderParam(BindServerToPlainTextString.class) Server createServer);
-
- /**
- * Get all servers info
- *
- * @return or empty set if no servers are found
- */
- @GET
- @Path("/servers/info")
- @ResponseParser(ListOfKeyValuesDelimitedByBlankLinesToServerInfoSet.class)
- Set<ServerInfo> listServerInfo();
-
- /**
- * @param uuid
- * what to get
- * @return null, if not found
- */
- @GET
- @Fallback(NullOnNotFoundOr404.class)
- @ResponseParser(KeyValuesDelimitedByBlankLinesToServerInfo.class)
- @Path("/servers/{uuid}/info")
- ServerInfo getServerInfo(@PathParam("uuid") String uuid);
-
- /**
- * set server configuration
- *
- * @param uuid
- * what server to change
- * @param setServer
- * what values to change
- * @return new data
- */
- @POST
- @Fallback(NullOnNotFoundOr404.class)
- @ResponseParser(KeyValuesDelimitedByBlankLinesToServerInfo.class)
- @Path("/servers/{uuid}/set")
- ServerInfo setServerConfiguration(@PathParam("uuid") String uuid,
- @BinderParam(BindServerToPlainTextString.class) Server setServer);
-
- /**
- * list of server uuids in your account
- *
- * @return or empty set if no servers are found
- */
- @GET
- @Path("/servers/list")
- @ResponseParser(SplitNewlines.class)
- Set<String> listServers();
-
- /**
- * Destroy a server
- *
- * @param uuid
- * what to destroy
- */
- @GET
- @Path("/servers/{uuid}/destroy")
- @Fallback(VoidOnNotFoundOr404.class)
- void destroyServer(@PathParam("uuid") String uuid);
-
- /**
- * Start a server
- *
- * @param uuid
- * what to start
- */
- @POST
- @Path("/servers/{uuid}/start")
- void startServer(@PathParam("uuid") String uuid);
-
- /**
- * Stop a server
- * <p/>
- * Kills the server immediately, equivalent to a power failure. Server reverts to a stopped
- * status if it is persistent and is automatically destroyed otherwise.
- *
- * @param uuid
- * what to stop
- */
- @POST
- @Path("/servers/{uuid}/stop")
- void stopServer(@PathParam("uuid") String uuid);
-
- /**
- * Shutdown a server
- * <p/>
- * Sends the server an ACPI power-down event. Server reverts to a stopped status if it is
- * persistent and is automatically destroyed otherwise.
- * <h4>note</h4> behaviour on shutdown depends on how your server OS is set up to respond to an
- * ACPI power button signal.
- *
- * @param uuid
- * what to shutdown
- */
- @POST
- @Path("/servers/{uuid}/shutdown")
- void shutdownServer(@PathParam("uuid") String uuid);
-
- /**
- * Reset a server
- *
- * @param uuid
- * what to reset
- */
- @POST
- @Path("/servers/{uuid}/reset")
- void resetServer(@PathParam("uuid") String uuid);
-
- /**
- * list of drive uuids in your account
- *
- * @return or empty set if no drives are found
- */
- @GET
- @Path("/drives/list")
- @ResponseParser(SplitNewlines.class)
- Set<String> listDrives();
-
- /**
- * Destroy a drive
- *
- * @param uuid
- * what to delete
- */
- @GET
- @Path("/drives/{uuid}/destroy")
- @Fallback(VoidOnNotFoundOr404.class)
- void destroyDrive(@PathParam("uuid") String uuid);
-
- /**
- * create a new vlan
- *
- * @param name
- * @return newly created vlan
- */
- @POST
- @Fallback(NullOnNotFoundOr404.class)
- @ResponseParser(KeyValuesDelimitedByBlankLinesToVLANInfo.class)
- @Path("/resources/vlan/create")
- @Payload("name {name}\n")
- @Produces(MediaType.TEXT_PLAIN)
- VLANInfo createVLAN(@PayloadParam("name") String name);
-
- /**
- * Get all vlans info
- *
- * @return or empty set if no vlans are found
- */
- @GET
- @Path("/resources/vlan/info")
- @ResponseParser(ListOfKeyValuesDelimitedByBlankLinesToVLANInfoSet.class)
- Set<VLANInfo> listVLANInfo();
-
- /**
- * @param uuid
- * what to get
- * @return null, if not found
- */
- @GET
- @Fallback(NullOnNotFoundOr404.class)
- @ResponseParser(KeyValuesDelimitedByBlankLinesToVLANInfo.class)
- @Path("/resources/vlan/{uuid}/info")
- VLANInfo getVLANInfo(@PathParam("uuid") String uuid);
-
- /**
- * set vlan configuration
- *
- * @param uuid
- * what vlan to change
- * @param name
- * what the new name is
- * @return new data
- */
- @POST
- @ResponseParser(KeyValuesDelimitedByBlankLinesToVLANInfo.class)
- @Path("/resources/vlan/{uuid}/set")
- @Payload("name {name}\n")
- @Produces(MediaType.TEXT_PLAIN)
- VLANInfo renameVLAN(@PathParam("uuid") String uuid, @PayloadParam("name") String name);
-
- /**
- * list of vlan uuids in your account
- *
- * @return or empty set if no vlans are found
- */
- @GET
- @Path("/resources/vlan/list")
- @ResponseParser(SplitNewlinesAndReturnSecondField.class)
- Set<String> listVLANs();
-
- /**
- * Destroy a vlan
- *
- * @param uuid
- * what to destroy
- */
- @GET
- @Path("/resources/vlan/{uuid}/destroy")
- @Fallback(VoidOnNotFoundOr404.class)
- void destroyVLAN(@PathParam("uuid") String uuid);
-
- /**
- * create a new ip
- *
- * @return newly created ip
- */
- @POST
- @Fallback(NullOnNotFoundOr404.class)
- @ResponseParser(KeyValuesDelimitedByBlankLinesToStaticIPInfo.class)
- @Path("/resources/ip/create")
- StaticIPInfo createStaticIP();
-
- /**
- * Get all ips info
- *
- * @return or empty set if no ips are found
- */
- @GET
- @Path("/resources/ip/info")
- @ResponseParser(ListOfKeyValuesDelimitedByBlankLinesToStaticIPInfoSet.class)
- Set<StaticIPInfo> listStaticIPInfo();
-
- /**
- * @param uuid
- * what to get
- * @return null, if not found
- */
- @GET
- @Fallback(NullOnNotFoundOr404.class)
- @ResponseParser(KeyValuesDelimitedByBlankLinesToStaticIPInfo.class)
- @Path("/resources/ip/{uuid}/info")
- StaticIPInfo getStaticIPInfo(@PathParam("uuid") String uuid);
-
- /**
- * list of ip uuids in your account
- *
- * @return or empty set if no ips are found
- */
- @GET
- @Path("/resources/ip/list")
- @ResponseParser(SplitNewlinesAndReturnSecondField.class)
- Set<String> listStaticIPs();
-
- /**
- * Destroy a ip
- *
- * @param uuid
- * what to destroy
- */
- @GET
- @Path("/resources/ip/{uuid}/destroy")
- @Fallback(VoidOnNotFoundOr404.class)
- void destroyStaticIP(@PathParam("uuid") String uuid);
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/CloudSigmaApiMetadata.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/CloudSigmaApiMetadata.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/CloudSigmaApiMetadata.java
deleted file mode 100644
index 6a0192e..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/CloudSigmaApiMetadata.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma;
-import static org.jclouds.cloudsigma.reference.CloudSigmaConstants.PROPERTY_VNC_PASSWORD;
-import static org.jclouds.compute.config.ComputeServiceProperties.TEMPLATE;
-import static org.jclouds.reflect.Reflection2.typeToken;
-
-import java.net.URI;
-import java.util.Properties;
-
-import org.jclouds.cloudsigma.compute.config.CloudSigmaComputeServiceContextModule;
-import org.jclouds.cloudsigma.config.CloudSigmaRestClientModule;
-import org.jclouds.compute.ComputeServiceContext;
-import org.jclouds.rest.internal.BaseHttpApiMetadata;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.inject.Module;
-
-/**
- * Implementation of {@link ApiMetadata} for the Cloud Sigma API
- */
-public class CloudSigmaApiMetadata extends BaseHttpApiMetadata<CloudSigmaApi> {
-
-
- @Override
- public Builder toBuilder() {
- return new Builder().fromApiMetadata(this);
- }
-
- public CloudSigmaApiMetadata() {
- this(new Builder());
- }
-
- protected CloudSigmaApiMetadata(Builder builder) {
- super(builder);
- }
-
- public static Properties defaultProperties() {
- Properties properties = BaseHttpApiMetadata.defaultProperties();
- properties.setProperty(PROPERTY_VNC_PASSWORD, "IL9vs34d");
- // passwords are set post-boot, so auth failures are possible
- // from a race condition applying the password set script
- properties.setProperty("jclouds.ssh.max-retries", "7");
- properties.setProperty("jclouds.ssh.retry-auth", "true");
- properties.setProperty(TEMPLATE, "osFamily=UBUNTU,imageNameMatches=.*[Aa]utomated SSH Access.*,os64Bit=true");
- return properties;
- }
-
- public static class Builder extends BaseHttpApiMetadata.Builder<CloudSigmaApi, Builder> {
-
- protected Builder() {
- id("cloudsigma")
- .name("CloudSigma API")
- .identityName("Email")
- .credentialName("Password")
- .documentation(URI.create("http://cloudsigma.com/en/platform-details/the-api"))
- .version("1.0")
- .defaultEndpoint("https://api.cloudsigma.com")
- .defaultProperties(CloudSigmaApiMetadata.defaultProperties())
- .view(typeToken(ComputeServiceContext.class))
- .defaultModules(ImmutableSet.<Class<? extends Module>>of(CloudSigmaRestClientModule.class, CloudSigmaComputeServiceContextModule.class));
- }
-
- @Override
- public CloudSigmaApiMetadata build() {
- return new CloudSigmaApiMetadata(this);
- }
-
- @Override
- protected Builder self() {
- return this;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/binders/BindCloneDriveOptionsToPlainTextString.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/binders/BindCloneDriveOptionsToPlainTextString.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/binders/BindCloneDriveOptionsToPlainTextString.java
deleted file mode 100644
index 9736efa..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/binders/BindCloneDriveOptionsToPlainTextString.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.binders;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Map;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.cloudsigma.functions.ListOfMapsToListOfKeyValuesDelimitedByBlankLines;
-import org.jclouds.cloudsigma.options.CloneDriveOptions;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.rest.MapBinder;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Maps;
-
-@Singleton
-public class BindCloneDriveOptionsToPlainTextString implements MapBinder {
- private final ListOfMapsToListOfKeyValuesDelimitedByBlankLines listOfMapsToListOfKeyValuesDelimitedByBlankLines;
-
- @Inject
- public BindCloneDriveOptionsToPlainTextString(
- ListOfMapsToListOfKeyValuesDelimitedByBlankLines listOfMapsToListOfKeyValuesDelimitedByBlankLines) {
- this.listOfMapsToListOfKeyValuesDelimitedByBlankLines = listOfMapsToListOfKeyValuesDelimitedByBlankLines;
- }
-
- @Override
- public <R extends HttpRequest> R bindToRequest(R request, Map<String, Object> postParams) {
- checkArgument(checkNotNull(request, "request") instanceof GeneratedHttpRequest,
- "this binder is only valid for GeneratedHttpRequests!");
- GeneratedHttpRequest gRequest = GeneratedHttpRequest.class.cast(request);
-
- CloneDriveOptions options = findOptionsInArgsOrNull(gRequest);
- if (options != null) {
- postParams = ImmutableMap.<String, Object> builder().putAll(postParams).putAll(options.getOptions()).build();
- }
-
- request.setPayload(listOfMapsToListOfKeyValuesDelimitedByBlankLines.apply(ImmutableSet.of(Maps.transformValues(postParams, new Function<Object, String>() {
- @Override
- public String apply(Object input) {
- return input == null ? null : input.toString();
- }
- }))));
- request.getPayload().getContentMetadata().setContentType(MediaType.TEXT_PLAIN);
- return request;
- }
-
- static CloneDriveOptions findOptionsInArgsOrNull(GeneratedHttpRequest gRequest) {
- for (Object arg : gRequest.getInvocation().getArgs()) {
- if (arg instanceof CloneDriveOptions) {
- return (CloneDriveOptions) arg;
- } else if (arg instanceof CloneDriveOptions[]) {
- CloneDriveOptions[] options = (CloneDriveOptions[]) arg;
- return (options.length > 0) ? options[0] : null;
- }
- }
- return null;
- }
-
- @Override
- public <R extends HttpRequest> R bindToRequest(R request, Object input) {
- throw new UnsupportedOperationException();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/binders/BindDriveDataToPlainTextString.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/binders/BindDriveDataToPlainTextString.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/binders/BindDriveDataToPlainTextString.java
deleted file mode 100644
index a3c8922..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/binders/BindDriveDataToPlainTextString.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.binders;
-
-import static com.google.common.base.Preconditions.checkArgument;
-
-import java.util.Map;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.cloudsigma.domain.DriveData;
-import org.jclouds.cloudsigma.functions.ListOfMapsToListOfKeyValuesDelimitedByBlankLines;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.rest.Binder;
-
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableSet;
-
-@Singleton
-public class BindDriveDataToPlainTextString implements Binder {
- private final Function<DriveData, Map<String, String>> createDriveRequestToMap;
- private final ListOfMapsToListOfKeyValuesDelimitedByBlankLines listOfMapsToListOfKeyValuesDelimitedByBlankLines;
-
- @Inject
- public BindDriveDataToPlainTextString(Function<DriveData, Map<String, String>> createDriveRequestToMap,
- ListOfMapsToListOfKeyValuesDelimitedByBlankLines listOfMapsToListOfKeyValuesDelimitedByBlankLines) {
- this.createDriveRequestToMap = createDriveRequestToMap;
- this.listOfMapsToListOfKeyValuesDelimitedByBlankLines = listOfMapsToListOfKeyValuesDelimitedByBlankLines;
- }
- @Override
- public <R extends HttpRequest> R bindToRequest(R request, Object payload) {
- checkArgument(payload instanceof DriveData, "this binder is only valid for DriveData!");
- DriveData create = DriveData.class.cast(payload);
- Map<String, String> map = createDriveRequestToMap.apply(create);
- request.setPayload(listOfMapsToListOfKeyValuesDelimitedByBlankLines.apply(ImmutableSet.of(map)));
- request.getPayload().getContentMetadata().setContentType(MediaType.TEXT_PLAIN);
- return request;
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/binders/BindDriveToPlainTextString.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/binders/BindDriveToPlainTextString.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/binders/BindDriveToPlainTextString.java
deleted file mode 100644
index 21b203f..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/binders/BindDriveToPlainTextString.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.binders;
-
-import static com.google.common.base.Preconditions.checkArgument;
-
-import java.util.Map;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.cloudsigma.domain.Drive;
-import org.jclouds.cloudsigma.functions.ListOfMapsToListOfKeyValuesDelimitedByBlankLines;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.rest.Binder;
-
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableSet;
-
-@Singleton
-public class BindDriveToPlainTextString implements Binder {
- private final Function<Drive, Map<String, String>> createDriveRequestToMap;
- private final ListOfMapsToListOfKeyValuesDelimitedByBlankLines listOfMapsToListOfKeyValuesDelimitedByBlankLines;
-
- @Inject
- public BindDriveToPlainTextString(Function<Drive, Map<String, String>> createDriveRequestToMap,
- ListOfMapsToListOfKeyValuesDelimitedByBlankLines listOfMapsToListOfKeyValuesDelimitedByBlankLines) {
- this.createDriveRequestToMap = createDriveRequestToMap;
- this.listOfMapsToListOfKeyValuesDelimitedByBlankLines = listOfMapsToListOfKeyValuesDelimitedByBlankLines;
- }
- @Override
- public <R extends HttpRequest> R bindToRequest(R request, Object payload) {
- checkArgument(payload instanceof Drive, "this binder is only valid for Drive!");
- Drive create = Drive.class.cast(payload);
- Map<String, String> map = createDriveRequestToMap.apply(create);
- request.setPayload(listOfMapsToListOfKeyValuesDelimitedByBlankLines.apply(ImmutableSet.of(map)));
- request.getPayload().getContentMetadata().setContentType(MediaType.TEXT_PLAIN);
- return request;
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/binders/BindServerToPlainTextString.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/binders/BindServerToPlainTextString.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/binders/BindServerToPlainTextString.java
deleted file mode 100644
index 351de4e..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/binders/BindServerToPlainTextString.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.binders;
-
-import static com.google.common.base.Preconditions.checkArgument;
-
-import java.util.Map;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.cloudsigma.domain.Server;
-import org.jclouds.cloudsigma.functions.ListOfMapsToListOfKeyValuesDelimitedByBlankLines;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.rest.Binder;
-
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableSet;
-
-@Singleton
-public class BindServerToPlainTextString implements Binder {
- private final Function<Server, Map<String, String>> createServerRequestToMap;
- private final ListOfMapsToListOfKeyValuesDelimitedByBlankLines listOfMapsToListOfKeyValuesDelimitedByBlankLines;
-
- @Inject
- public BindServerToPlainTextString(Function<Server, Map<String, String>> createServerRequestToMap,
- ListOfMapsToListOfKeyValuesDelimitedByBlankLines listOfMapsToListOfKeyValuesDelimitedByBlankLines) {
- this.createServerRequestToMap = createServerRequestToMap;
- this.listOfMapsToListOfKeyValuesDelimitedByBlankLines = listOfMapsToListOfKeyValuesDelimitedByBlankLines;
- }
- @Override
- public <R extends HttpRequest> R bindToRequest(R request, Object payload) {
- checkArgument(payload instanceof Server, "this binder is only valid for Server!");
- Server create = Server.class.cast(payload);
- Map<String, String> map = createServerRequestToMap.apply(create);
- request.setPayload(listOfMapsToListOfKeyValuesDelimitedByBlankLines.apply(ImmutableSet.of(map)));
- request.getPayload().getContentMetadata().setContentType(MediaType.TEXT_PLAIN);
- return request;
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/CloudSigmaComputeServiceAdapter.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/CloudSigmaComputeServiceAdapter.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/CloudSigmaComputeServiceAdapter.java
deleted file mode 100644
index c3159da..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/CloudSigmaComputeServiceAdapter.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.compute;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.collect.Iterables.contains;
-import static com.google.common.collect.Iterables.filter;
-import static org.jclouds.concurrent.FutureIterables.transformParallel;
-
-import javax.annotation.Resource;
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
-
-import org.jclouds.Constants;
-import org.jclouds.cloudsigma.CloudSigmaApi;
-import org.jclouds.cloudsigma.compute.options.CloudSigmaTemplateOptions;
-import org.jclouds.cloudsigma.domain.AffinityType;
-import org.jclouds.cloudsigma.domain.Device;
-import org.jclouds.cloudsigma.domain.DriveInfo;
-import org.jclouds.cloudsigma.domain.DriveType;
-import org.jclouds.cloudsigma.domain.Server;
-import org.jclouds.cloudsigma.domain.ServerInfo;
-import org.jclouds.cloudsigma.options.CloneDriveOptions;
-import org.jclouds.cloudsigma.reference.CloudSigmaConstants;
-import org.jclouds.cloudsigma.util.Servers;
-import org.jclouds.compute.ComputeServiceAdapter;
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.HardwareBuilder;
-import org.jclouds.compute.domain.Image;
-import org.jclouds.compute.domain.Processor;
-import org.jclouds.compute.domain.Template;
-import org.jclouds.compute.domain.Volume;
-import org.jclouds.compute.domain.internal.VolumeImpl;
-import org.jclouds.compute.reference.ComputeServiceConstants;
-import org.jclouds.domain.Location;
-import org.jclouds.domain.LoginCredentials;
-import org.jclouds.logging.Logger;
-
-import com.google.common.base.Function;
-import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
-import com.google.common.collect.FluentIterable;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.ImmutableSet.Builder;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
-import com.google.common.util.concurrent.ListeningExecutorService;
-import com.google.common.util.concurrent.UncheckedExecutionException;
-
-/**
- * defines the connection between the {@link org.jclouds.cloudsigma.CloudSigmaApi} implementation
- * and the jclouds {@link ComputeService}
- */
-@Singleton
-public class CloudSigmaComputeServiceAdapter implements
- ComputeServiceAdapter<ServerInfo, Hardware, DriveInfo, Location> {
- private static final Predicate<DriveInfo> PREINSTALLED_DISK = Predicates.and(Predicates.notNull(),
- new Predicate<DriveInfo>() {
-
- @Override
- public boolean apply(DriveInfo drive) {
- return drive.getType().equals(DriveType.DISK) && drive.getDriveType().contains("preinstalled");
- }
-
- });
- private final CloudSigmaApi client;
- private final Predicate<DriveInfo> driveNotClaimed;
- private final String defaultVncPassword;
- private final LoadingCache<String, DriveInfo> cache;
- private final ListeningExecutorService userExecutor;
-
- @Resource
- @Named(ComputeServiceConstants.COMPUTE_LOGGER)
- protected Logger logger = Logger.NULL;
-
- @Inject
- public CloudSigmaComputeServiceAdapter(CloudSigmaApi client, Predicate<DriveInfo> driveNotClaimed,
- @Named(CloudSigmaConstants.PROPERTY_VNC_PASSWORD) String defaultVncPassword,
- LoadingCache<String, DriveInfo> cache, @Named(Constants.PROPERTY_USER_THREADS) ListeningExecutorService userExecutor) {
- this.client = checkNotNull(client, "client");
- this.driveNotClaimed = checkNotNull(driveNotClaimed, "driveNotClaimed");
- this.defaultVncPassword = checkNotNull(defaultVncPassword, "defaultVncPassword");
- checkArgument(defaultVncPassword.length() <= 8, "vnc passwords should be less that 8 characters!");
- this.cache = checkNotNull(cache, "cache");
- this.userExecutor = checkNotNull(userExecutor, "userExecutor");
- }
-
- @Override
- public NodeAndInitialCredentials<ServerInfo> createNodeWithGroupEncodedIntoName(String tag, String name, Template template) {
- long bootSize = (long) (template.getHardware().getVolumes().get(0).getSize() * 1024 * 1024 * 1024l);
- AffinityType affinityType = AffinityType.HDD;
- if (template.getOptions() instanceof CloudSigmaTemplateOptions) {
- CloudSigmaTemplateOptions options = CloudSigmaTemplateOptions.class.cast(template.getOptions());
- affinityType = options.getDiskDriveAffinity();
- }
- logger.debug(">> imaging boot drive source(%s) bytes(%d) affinityType(%s)",
- template.getImage().getId(), bootSize, affinityType);
- DriveInfo drive = client.cloneDrive(template.getImage().getId(), template.getImage().getId(),
- new CloneDriveOptions().size(bootSize).affinity(affinityType));
- boolean success = driveNotClaimed.apply(drive);
- logger.debug("<< image(%s) complete(%s)", drive.getUuid(), success);
- if (!success) {
- client.destroyDrive(drive.getUuid());
- throw new IllegalStateException("could not image drive in time!");
- }
-
- Server toCreate = Servers.small(name, drive.getUuid(), defaultVncPassword).mem(template.getHardware().getRam())
- .cpu((int) (template.getHardware().getProcessors().get(0).getSpeed())).build();
-
- logger.debug(">> creating server");
- ServerInfo from = client.createServer(toCreate);
- logger.debug("<< created server(%s)", from.getUuid());
- logger.debug(">> starting server(%s)", from.getUuid());
- client.startServer(from.getUuid());
- return new NodeAndInitialCredentials<ServerInfo>(from, from.getUuid(), LoginCredentials.builder()
- .password(defaultVncPassword).authenticateSudo(true).build());
- }
-
- @Override
- public Iterable<Hardware> listHardwareProfiles() {
- Builder<Hardware> hardware = ImmutableSet.builder();
- for (double cpu : new double[] { 1000, 5000, 10000, 20000 })
- for (int ram : new int[] { 512, 1024, 4 * 1024, 16 * 1024, 32 * 1024 }) {
- final float size = (float) cpu / 100;
- String id = String.format("cpu=%f,ram=%s,disk=%f", cpu, ram, size);
- hardware.add(new HardwareBuilder().supportsImage(new Predicate<Image>() {
-
- @Override
- public boolean apply(Image input) {
- String toParse = input.getUserMetadata().get("size");
- return toParse != null && new Float(toParse) <= size;
- }
-
- @Override
- public String toString() {
- return "sizeLessThanOrEqual(" + size + ")";
- }
-
- }).ids(id).ram(ram).processors(ImmutableList.of(new Processor(1, cpu))).hypervisor("kvm")
- .volumes(ImmutableList.<Volume>of(new VolumeImpl(size, true, true))).build());
- }
- return hardware.build();
- }
-
- /**
- * look up the current standard images and do not error out, if they are not
- * found.
- */
- @Override
- public Iterable<DriveInfo> listImages() {
- return FluentIterable.from(transformParallel(client.listStandardDrives(),
- new Function<String, ListenableFuture<? extends DriveInfo>>() {
-
- @Override
- public ListenableFuture<DriveInfo> apply(String input) {
- try {
- return Futures.immediateFuture(cache.getUnchecked(input));
- } catch (CacheLoader.InvalidCacheLoadException e) {
- logger.debug("drive %s not found", input);
- } catch (UncheckedExecutionException e) {
- logger.warn(e, "error finding drive %s: %s", input, e.getMessage());
- }
- return Futures.immediateFuture(null);
- }
-
- @Override
- public String toString() {
- return "seedDriveCache()";
- }
- }, userExecutor, null, logger, "drives")).filter(PREINSTALLED_DISK);
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Iterable<ServerInfo> listNodes() {
- return (Iterable<ServerInfo>) client.listServerInfo();
- }
-
- @Override
- public Iterable<ServerInfo> listNodesByIds(final Iterable<String> ids) {
- return filter(listNodes(), new Predicate<ServerInfo>() {
-
- @Override
- public boolean apply(ServerInfo server) {
- return contains(ids, server.getUuid());
- }
- });
- }
-
- @Override
- public Iterable<Location> listLocations() {
- // Not using the adapter to determine locations
- return ImmutableSet.<Location>of();
- }
-
- @Override
- public ServerInfo getNode(String id) {
- return client.getServerInfo(id);
- }
-
- @Override
- public DriveInfo getImage(String id) {
- return client.getDriveInfo(id);
- }
-
- @Override
- public void destroyNode(String id) {
- ServerInfo server = getNode(id);
- if (server != null) {
- client.stopServer(id);
- client.destroyServer(id);
- for (Device dev : server.getDevices().values())
- client.destroyDrive(dev.getDriveUuid());
- }
- }
-
- @Override
- public void rebootNode(String id) {
- client.resetServer(id);
- }
-
- @Override
- public void resumeNode(String id) {
- client.startServer(id);
-
- }
-
- @Override
- public void suspendNode(String id) {
- client.stopServer(id);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/CloudSigmaTemplateBuilderImpl.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/CloudSigmaTemplateBuilderImpl.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/CloudSigmaTemplateBuilderImpl.java
deleted file mode 100644
index c609806..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/CloudSigmaTemplateBuilderImpl.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.compute;
-
-import java.util.Set;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Provider;
-
-import org.jclouds.collect.Memoized;
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.TemplateBuilder;
-import org.jclouds.compute.domain.internal.TemplateBuilderImpl;
-import org.jclouds.compute.options.TemplateOptions;
-import org.jclouds.compute.strategy.GetImageStrategy;
-import org.jclouds.compute.suppliers.ImageCacheSupplier;
-import org.jclouds.domain.Location;
-
-import com.google.common.base.Supplier;
-
-public class CloudSigmaTemplateBuilderImpl extends TemplateBuilderImpl {
- @Inject
- public CloudSigmaTemplateBuilderImpl(@Memoized Supplier<Set<? extends Location>> locations,
- ImageCacheSupplier images, @Memoized Supplier<Set<? extends Hardware>> hardwares,
- Supplier<Location> defaultLocation2, @Named("DEFAULT") Provider<TemplateOptions> optionsProvider,
- @Named("DEFAULT") Provider<TemplateBuilder> defaultTemplateProvider, GetImageStrategy getImageStrategy) {
- super(locations, images, hardwares, defaultLocation2, optionsProvider, defaultTemplateProvider, getImageStrategy);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/config/CloudSigmaComputeServiceContextModule.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/config/CloudSigmaComputeServiceContextModule.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/config/CloudSigmaComputeServiceContextModule.java
deleted file mode 100644
index 9daff85..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/config/CloudSigmaComputeServiceContextModule.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.compute.config;
-
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import static org.jclouds.util.Predicates2.retry;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.cloudsigma.CloudSigmaApi;
-import org.jclouds.cloudsigma.compute.CloudSigmaComputeServiceAdapter;
-import org.jclouds.cloudsigma.compute.CloudSigmaTemplateBuilderImpl;
-import org.jclouds.cloudsigma.compute.functions.ParseOsFamilyVersion64BitFromImageName;
-import org.jclouds.cloudsigma.compute.functions.PreinstalledDiskToImage;
-import org.jclouds.cloudsigma.compute.functions.ServerInfoToNodeMetadata;
-import org.jclouds.cloudsigma.compute.functions.ServerInfoToNodeMetadata.DeviceToVolume;
-import org.jclouds.cloudsigma.compute.functions.ServerInfoToNodeMetadata.GetImageIdFromServer;
-import org.jclouds.cloudsigma.compute.options.CloudSigmaTemplateOptions;
-import org.jclouds.cloudsigma.domain.Device;
-import org.jclouds.cloudsigma.domain.DriveInfo;
-import org.jclouds.cloudsigma.domain.Server;
-import org.jclouds.cloudsigma.domain.ServerInfo;
-import org.jclouds.cloudsigma.predicates.DriveClaimed;
-import org.jclouds.compute.ComputeServiceAdapter;
-import org.jclouds.compute.config.ComputeServiceAdapterContextModule;
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.Image;
-import org.jclouds.compute.domain.NodeMetadata;
-import org.jclouds.compute.domain.OsFamilyVersion64Bit;
-import org.jclouds.compute.domain.TemplateBuilder;
-import org.jclouds.compute.domain.Volume;
-import org.jclouds.compute.options.TemplateOptions;
-import org.jclouds.compute.reference.ComputeServiceConstants.Timeouts;
-import org.jclouds.domain.Location;
-import org.jclouds.functions.IdentityFunction;
-
-import com.google.common.base.Function;
-import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
-import com.google.inject.Provides;
-import com.google.inject.TypeLiteral;
-
-public class CloudSigmaComputeServiceContextModule extends
- ComputeServiceAdapterContextModule<ServerInfo, Hardware, DriveInfo, Location> {
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Override
- protected void configure() {
- super.configure();
- bind(new TypeLiteral<ComputeServiceAdapter<ServerInfo, Hardware, DriveInfo, Location>>() {
- }).to(CloudSigmaComputeServiceAdapter.class);
- bind(new TypeLiteral<Function<ServerInfo, NodeMetadata>>() {
- }).to(ServerInfoToNodeMetadata.class);
- bind(new TypeLiteral<Function<Hardware, Hardware>>() {
- }).to(Class.class.cast(IdentityFunction.class));
- bind(new TypeLiteral<Function<DriveInfo, Image>>() {
- }).to(PreinstalledDiskToImage.class);
- bind(new TypeLiteral<Function<Location, Location>>() {
- }).to(Class.class.cast(IdentityFunction.class));
- bind(new TypeLiteral<Function<Device, Volume>>() {
- }).to(DeviceToVolume.class);
- bind(new TypeLiteral<Function<Server, String>>() {
- }).to(GetImageIdFromServer.class);
- bind(new TypeLiteral<Function<String, OsFamilyVersion64Bit>>() {
- }).to(ParseOsFamilyVersion64BitFromImageName.class);
- bind(TemplateBuilder.class)
- .to(CloudSigmaTemplateBuilderImpl.class);
- }
-
- @Provides
- @Singleton
- protected LoadingCache<String, DriveInfo> cache(GetDrive getDrive) {
- return CacheBuilder.newBuilder().build(getDrive);
- }
-
- @Singleton
- public static class GetDrive extends CacheLoader<String, DriveInfo> {
- private final CloudSigmaApi client;
-
- @Inject
- public GetDrive(CloudSigmaApi client) {
- this.client = client;
- }
-
- @Override
- public DriveInfo load(String input) {
- return client.getDriveInfo(input);
- }
- }
-
- @Provides
- @Singleton
- protected Predicate<DriveInfo> supplyDriveUnclaimed(DriveClaimed driveClaimed, Timeouts timeouts) {
- return retry(Predicates.not(driveClaimed), timeouts.nodeRunning, 1000, MILLISECONDS);
- }
-
- @Provides
- @Singleton
- protected TemplateOptions templateOptions() {
- return new CloudSigmaTemplateOptions();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/functions/ParseOsFamilyVersion64BitFromImageName.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/functions/ParseOsFamilyVersion64BitFromImageName.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/functions/ParseOsFamilyVersion64BitFromImageName.java
deleted file mode 100644
index bbea27d..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/functions/ParseOsFamilyVersion64BitFromImageName.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.compute.functions;
-
-import static com.google.common.base.Predicates.and;
-import static com.google.common.base.Predicates.containsPattern;
-import static com.google.common.base.Predicates.not;
-import static com.google.common.base.Predicates.or;
-
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.compute.domain.OsFamily;
-import org.jclouds.compute.domain.OsFamilyVersion64Bit;
-import org.jclouds.compute.util.ComputeServiceUtils;
-
-import com.google.common.base.Function;
-
-/**
- * Defaults to version null and 64bit, if the operating system is unrecognized and the pattern
- * "32bit" isn't in the string.
- */
-@Singleton
-public class ParseOsFamilyVersion64BitFromImageName implements Function<String, OsFamilyVersion64Bit> {
- private final Map<OsFamily, Map<String, String>> osVersionMap;
-
- @Inject
- public ParseOsFamilyVersion64BitFromImageName(Map<OsFamily, Map<String, String>> osVersionMap) {
- this.osVersionMap = osVersionMap;
- }
-
- // ex CentOS 5.5 Linux 64bit Preinstalled System with AppFirst Monitoring
- // ex. Centos-5.6-20110917 pub
- public static final Pattern PATTERN = Pattern.compile("([^ -]+)[^0-9]([0-9.]+)[ -].*");
-
- @Override
- public OsFamilyVersion64Bit apply(String input) {
- boolean is64Bit = and(not(containsPattern("32bit")),
- or(containsPattern("64bit"), not(containsPattern("Windows")))).apply(input);
- if (input.contains("Windows")) {
- String version = null;
- Matcher matcher = Pattern.compile(".*(20[01][0-9] R[1-9]).*").matcher(input);
- if (matcher.find()) {
- version = matcher.group(1);
- } else {
- matcher = Pattern.compile(".*(20[01][0-9]).*").matcher(input);
- if (matcher.find())
- version = matcher.group(1);
- }
- return new OsFamilyVersion64Bit(OsFamily.WINDOWS, osVersionMap.get(OsFamily.WINDOWS).get(version), is64Bit);
- } else {
- Matcher matcher = PATTERN.matcher(input);
- if (matcher.find()) {
- OsFamily fam = OsFamily.fromValue(matcher.group(1).toLowerCase());
- if (fam == OsFamily.UNRECOGNIZED)
- return new OsFamilyVersion64Bit(OsFamily.UNRECOGNIZED, null, is64Bit);
- return new OsFamilyVersion64Bit(fam, ComputeServiceUtils.parseVersionOrReturnEmptyString(fam, matcher
- .group(2), osVersionMap), is64Bit);
- } else {
- return new OsFamilyVersion64Bit(OsFamily.UNRECOGNIZED, null, is64Bit);
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/functions/PreinstalledDiskToImage.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/functions/PreinstalledDiskToImage.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/functions/PreinstalledDiskToImage.java
deleted file mode 100644
index c415556..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/functions/PreinstalledDiskToImage.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.compute.functions;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.cloudsigma.domain.DriveInfo;
-import org.jclouds.compute.domain.Image;
-import org.jclouds.compute.domain.Image.Status;
-import org.jclouds.compute.domain.ImageBuilder;
-import org.jclouds.compute.domain.OperatingSystem;
-import org.jclouds.compute.domain.OperatingSystem.Builder;
-import org.jclouds.compute.domain.OsFamilyVersion64Bit;
-import org.jclouds.domain.Location;
-
-import com.google.common.base.Function;
-import com.google.common.base.Supplier;
-import com.google.common.collect.ImmutableMap;
-
-@Singleton
-public class PreinstalledDiskToImage implements Function<DriveInfo, Image> {
- private final Supplier<Location> locationSupplier;
- private final Function<String, OsFamilyVersion64Bit> imageParser;
-
- @Inject
- public PreinstalledDiskToImage(Supplier<Location> locationSupplier,
- Function<String, OsFamilyVersion64Bit> imageParser) {
- this.locationSupplier = locationSupplier;
- this.imageParser = imageParser;
- }
-
- @Override
- public Image apply(DriveInfo drive) {
- if (drive.getName() == null)
- return null;
- String description = drive.getDescription() != null ? drive.getDescription() : drive.getName();
- Builder builder = OperatingSystem.builder();
- OsFamilyVersion64Bit parsed = imageParser.apply(drive.getName());
- builder.name(drive.getName()).description(description)
- .is64Bit(drive.getBits() != null ? drive.getBits() == 64 : parsed.is64Bit).version(parsed.version)
- .family(parsed.family);
- return new ImageBuilder().ids(drive.getUuid())
- .userMetadata(ImmutableMap.<String, String> of("size", drive.getSize() / 1024 / 1024 / 1024 + ""))
- .location(locationSupplier.get()).name(drive.getName()).description(description)
- .operatingSystem(builder.build()).status(Status.AVAILABLE).version("").build();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/functions/ServerInfoToNodeMetadata.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/functions/ServerInfoToNodeMetadata.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/functions/ServerInfoToNodeMetadata.java
deleted file mode 100644
index 38ef7f4..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/functions/ServerInfoToNodeMetadata.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.compute.functions;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static org.jclouds.compute.predicates.ImagePredicates.idEquals;
-
-import java.util.Map;
-import java.util.Set;
-
-import javax.annotation.Resource;
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.cloudsigma.domain.Device;
-import org.jclouds.cloudsigma.domain.DriveInfo;
-import org.jclouds.cloudsigma.domain.Server;
-import org.jclouds.cloudsigma.domain.ServerInfo;
-import org.jclouds.cloudsigma.domain.ServerStatus;
-import org.jclouds.collect.Memoized;
-import org.jclouds.compute.domain.HardwareBuilder;
-import org.jclouds.compute.domain.Image;
-import org.jclouds.compute.domain.NodeMetadata;
-import org.jclouds.compute.domain.NodeMetadata.Status;
-import org.jclouds.compute.domain.NodeMetadataBuilder;
-import org.jclouds.compute.domain.Processor;
-import org.jclouds.compute.domain.Volume;
-import org.jclouds.compute.domain.VolumeBuilder;
-import org.jclouds.compute.functions.GroupNamingConvention;
-import org.jclouds.domain.Location;
-import org.jclouds.logging.Logger;
-
-import com.google.common.base.Function;
-import com.google.common.base.Optional;
-import com.google.common.base.Supplier;
-import com.google.common.cache.LoadingCache;
-import com.google.common.collect.FluentIterable;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Iterables;
-import com.google.common.util.concurrent.UncheckedExecutionException;
-
-@Singleton
-public class ServerInfoToNodeMetadata implements Function<ServerInfo, NodeMetadata> {
- public static final Map<ServerStatus, Status> serverStatusToNodeStatus = ImmutableMap
- .<ServerStatus, Status> builder().put(ServerStatus.ACTIVE, Status.RUNNING)//
- .put(ServerStatus.STOPPED, Status.SUSPENDED)//
- .put(ServerStatus.PAUSED, Status.SUSPENDED)//
- .put(ServerStatus.DUMPED, Status.PENDING)//
- .put(ServerStatus.DEAD, Status.TERMINATED)//
- .put(ServerStatus.UNRECOGNIZED, Status.UNRECOGNIZED)//
- .build();
-
- private final Function<Server, String> getImageIdFromServer;
- private final Supplier<Set<? extends Image>> images;
- private final Supplier<Location> locationSupplier;
- private final Function<Device, Volume> deviceToVolume;
- private final GroupNamingConvention nodeNamingConvention;
-
- @Inject
- ServerInfoToNodeMetadata(Function<Server, String> getImageIdFromServer, @Memoized Supplier<Set<? extends Image>> images,
- Function<Device, Volume> deviceToVolume, Supplier<Location> locationSupplier,
- GroupNamingConvention.Factory namingConvention) {
- this.nodeNamingConvention = checkNotNull(namingConvention, "namingConvention").createWithoutPrefix();
- this.locationSupplier = checkNotNull(locationSupplier, "locationSupplier");
- this.deviceToVolume = checkNotNull(deviceToVolume, "deviceToVolume");
- this.images = checkNotNull(images, "images");
- this.getImageIdFromServer = checkNotNull(getImageIdFromServer, "getImageIdFromServer");
- }
-
- @Override
- public NodeMetadata apply(ServerInfo from) {
- NodeMetadataBuilder builder = new NodeMetadataBuilder();
- builder.ids(from.getUuid());
- builder.name(from.getName());
- builder.location(locationSupplier.get());
- builder.group(nodeNamingConvention.groupInUniqueNameOrNull(from.getName()));
-
- String imageId = getImageIdFromServer.apply(from);
- if (imageId != null) {
- Optional<? extends Image> image = FluentIterable.from(images.get()).firstMatch(idEquals(imageId));
- if (image.isPresent()) {
- builder.operatingSystem(image.get().getOperatingSystem());
- }
- }
- builder.hardware(new HardwareBuilder().ids(from.getUuid()).hypervisor("kvm")
- .processors(ImmutableList.of(new Processor(1, from.getCpu()))).ram(from.getMem())
- .volumes(Iterables.transform(from.getDevices().values(), deviceToVolume)).build());
- builder.status(serverStatusToNodeStatus.get(from.getStatus()));
- builder.publicAddresses(ImmutableSet.<String> of(from.getVnc().getIp()));
- builder.privateAddresses(ImmutableSet.<String> of());
- return builder.build();
- }
-
- @Singleton
- public static final class DeviceToVolume implements Function<Device, Volume> {
- @Resource
- protected Logger logger = Logger.NULL;
-
- private final LoadingCache<String, DriveInfo> cache;
-
- @Inject
- public DeviceToVolume(LoadingCache<String, DriveInfo> cache) {
- this.cache = checkNotNull(cache, "cache");
- }
-
- @Override
- public Volume apply(Device input) {
- VolumeBuilder builder = new VolumeBuilder();
- builder.id(input.getId());
- try {
- DriveInfo drive = cache.getUnchecked(input.getDriveUuid());
- builder.size((float) drive.getSize());
- } catch (NullPointerException e) {
- logger.debug("drive %s not found", input.getDriveUuid());
- } catch (UncheckedExecutionException e) {
- logger.warn(e, "error finding drive %s: %s", input.getDriveUuid(), e.getMessage());
- }
- return builder.durable(true).type(Volume.Type.NAS).build();
- }
- }
-
- /**
- * When we create the boot drive of the server, by convention we set the name
- * to the image it came from.
- *
- *
- */
- @Singleton
- public static class GetImageIdFromServer implements Function<Server, String> {
- @Resource
- protected Logger logger = Logger.NULL;
-
- private final LoadingCache<String, DriveInfo> cache;
-
- @Inject
- public GetImageIdFromServer(LoadingCache<String, DriveInfo> cache) {
- this.cache = cache;
- }
-
- @Override
- public String apply(Server from) {
- String imageId = null;
- String bootDeviceId = Iterables.get(from.getBootDeviceIds(), 0);
- Device bootDevice = from.getDevices().get(bootDeviceId);
- if (bootDevice != null) {
- try {
- DriveInfo drive = cache.getUnchecked(bootDevice.getDriveUuid());
- imageId = drive.getName();
- } catch (NullPointerException e) {
- logger.debug("drive %s not found", bootDevice.getDriveUuid());
- } catch (UncheckedExecutionException e) {
- logger.warn(e, "error finding drive %s: %s", bootDevice.getDriveUuid(), e.getMessage());
- }
- }
- return imageId;
- }
- }
-}
[10/50] [abbrv] git commit: Improve XML compatibility with
trace-level logging
Posted by an...@apache.org.
Improve XML compatibility with trace-level logging
Some providers, notably Azure, include a byte-order mark in their XML
responses. ParseSax.apply buffers these responses in a String when
users enable trace-level logging to include the response in any thrown
exceptions. InputSource(InputStream) skips these byte-order marks
while InputSource(Reader) does not, yielding a SAXParseException.
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/e1a5c521
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/e1a5c521
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/e1a5c521
Branch: refs/heads/fix-jclouds-538
Commit: e1a5c521c58a611272a18e488e870215469d82a6
Parents: 3c050e0
Author: Andrew Gaul <ga...@apache.org>
Authored: Fri Sep 5 16:16:07 2014 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Fri Sep 5 17:53:50 2014 -0700
----------------------------------------------------------------------
core/src/main/java/org/jclouds/http/functions/ParseSax.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/e1a5c521/core/src/main/java/org/jclouds/http/functions/ParseSax.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/jclouds/http/functions/ParseSax.java b/core/src/main/java/org/jclouds/http/functions/ParseSax.java
index 31fb7d6..3650344 100644
--- a/core/src/main/java/org/jclouds/http/functions/ParseSax.java
+++ b/core/src/main/java/org/jclouds/http/functions/ParseSax.java
@@ -21,6 +21,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
import static org.jclouds.http.HttpUtils.closeClientButKeepContentStream;
import static org.jclouds.util.Closeables2.closeQuietly;
+import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
@@ -91,9 +92,11 @@ public class ParseSax<T> implements Function<HttpResponse, T>, InvocationContext
private T convertStreamToStringAndParse(HttpResponse response) {
String from = null;
try {
- from = new String(closeClientButKeepContentStream(response));
+ byte[] fromBytes = closeClientButKeepContentStream(response);
+ from = new String(fromBytes);
validateXml(from);
- return doParse(new InputSource(new StringReader(from)));
+ // Use InputStream to skip over byte order mark.
+ return doParse(new InputSource(new ByteArrayInputStream(fromBytes)));
} catch (Exception e) {
return addDetailsAndPropagate(response, e, from);
}
[09/50] [abbrv] git commit: Address Checkstyle violations
Posted by an...@apache.org.
Address Checkstyle violations
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/3c050e0e
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/3c050e0e
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/3c050e0e
Branch: refs/heads/fix-jclouds-538
Commit: 3c050e0e9737fc5c3ccb8edc220e04f5a61abd5b
Parents: 975c132
Author: Andrew Gaul <ga...@apache.org>
Authored: Fri Sep 5 16:38:20 2014 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Fri Sep 5 16:38:20 2014 -0700
----------------------------------------------------------------------
.../openstack/nova/v2_0/domain/regionscoped/FlavorInRegion.java | 1 -
.../openstack/nova/v2_0/domain/regionscoped/ImageInRegion.java | 1 -
2 files changed, 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/3c050e0e/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/FlavorInRegion.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/FlavorInRegion.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/FlavorInRegion.java
index ec69213..5754bba 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/FlavorInRegion.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/FlavorInRegion.java
@@ -20,7 +20,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
import org.jclouds.openstack.nova.v2_0.domain.Flavor;
-import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
public class FlavorInRegion extends RegionAndId {
http://git-wip-us.apache.org/repos/asf/jclouds/blob/3c050e0e/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/ImageInRegion.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/ImageInRegion.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/ImageInRegion.java
index bc58130..9fd9829 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/ImageInRegion.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/ImageInRegion.java
@@ -20,7 +20,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
import org.jclouds.openstack.nova.v2_0.domain.Image;
-import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
public class ImageInRegion extends RegionAndId {
[19/50] [abbrv] git commit: JCLOUDS-296: Deprecate Rackspace
First-Gen CloudServers
Posted by an...@apache.org.
JCLOUDS-296: Deprecate Rackspace First-Gen CloudServers
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/d6eb54e2
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/d6eb54e2
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/d6eb54e2
Branch: refs/heads/fix-jclouds-538
Commit: d6eb54e2b4f0f6af2319a70bfde56602b9bd5028
Parents: 0e3d147
Author: Jeremy Daggett <je...@rackspace.com>
Authored: Fri Aug 29 14:04:59 2014 -0700
Committer: Jeremy Daggett <jd...@apache.org>
Committed: Tue Sep 9 17:05:42 2014 -0700
----------------------------------------------------------------------
.../java/org/jclouds/cloudservers/CloudServersAsyncClient.java | 6 +++---
.../main/java/org/jclouds/cloudservers/CloudServersClient.java | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/d6eb54e2/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersAsyncClient.java
----------------------------------------------------------------------
diff --git a/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersAsyncClient.java b/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersAsyncClient.java
index 2070f7a..75aebdb 100644
--- a/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersAsyncClient.java
+++ b/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersAsyncClient.java
@@ -70,9 +70,9 @@ import com.google.common.util.concurrent.ListenableFuture;
*
* @see CloudServersClient
*
- * @deprecated The Rackspace First-Gen Cloud Servers product has been retired and this API should not be used. Please
- * use the {@code rackspace-cloudservers-uk} and {@code rackspace-cloudservers-us} providers as this
- * API will be removed in jclouds 2.0.
+ * @deprecated The Rackspace First-Gen Cloud Servers product has been deprecated. Please refer to the
+ * <a href="http://jclouds.apache.org/guides/rackspace">Rackspace Getting Started Guide</a>
+ * for accessing the Rackspace Cloud. This API will be removed in 2.0.
*/
@Deprecated
@RequestFilters({ AuthenticateRequest.class, AddTimestampQuery.class })
http://git-wip-us.apache.org/repos/asf/jclouds/blob/d6eb54e2/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersClient.java
----------------------------------------------------------------------
diff --git a/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersClient.java b/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersClient.java
index 1ad88e0..4fe9761 100644
--- a/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersClient.java
+++ b/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersClient.java
@@ -41,9 +41,9 @@ import org.jclouds.cloudservers.options.RebuildServerOptions;
*
* @see CloudServersAsyncClient
*
- * @deprecated The Rackspace First-Gen Cloud Servers product has been retired and this API should not be used. Please
- * use the {@code rackspace-cloudservers-uk} and {@code rackspace-cloudservers-us} providers as this
- * API will be removed in jclouds 2.0.
+ * @deprecated The Rackspace First-Gen Cloud Servers product has been deprecated. Please refer to the
+ * <a href="http://jclouds.apache.org/guides/rackspace">Rackspace Getting Started Guide</a>
+ * for accessing the Rackspace Cloud. This API will be removed in 2.0.
*/
@Deprecated
public interface CloudServersClient extends Closeable {
[35/50] [abbrv] git commit: Unhook modernizer from verify phase
Posted by an...@apache.org.
Unhook modernizer from verify phase
modernizer erroneously requires Maven 3.0.5 but BuildHive is confused
about this version since jclouds does not specify it.
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/0d67da75
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/0d67da75
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/0d67da75
Branch: refs/heads/fix-jclouds-538
Commit: 0d67da75e9295742d44e041489206c9f79472e9d
Parents: 1f9c4cc
Author: Andrew Gaul <ga...@apache.org>
Authored: Mon Sep 22 22:20:36 2014 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Mon Sep 22 22:29:44 2014 -0700
----------------------------------------------------------------------
project/pom.xml | 9 ---------
1 file changed, 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/0d67da75/project/pom.xml
----------------------------------------------------------------------
diff --git a/project/pom.xml b/project/pom.xml
index 524605e..f765537 100644
--- a/project/pom.xml
+++ b/project/pom.xml
@@ -719,15 +719,6 @@
<groupId>org.gaul</groupId>
<artifactId>modernizer-maven-plugin</artifactId>
<version>1.1.0</version>
- <executions>
- <execution>
- <id>modernizer</id>
- <phase>verify</phase>
- <goals>
- <goal>modernizer</goal>
- </goals>
- </execution>
- </executions>
<configuration>
<javaVersion>1.7</javaVersion>
<exclusionsFile>resources/modernizer_exclusions.txt</exclusionsFile>
[06/50] [abbrv] git commit: Address Checkstyle violations
Posted by an...@apache.org.
Address Checkstyle violations
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/58438d7d
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/58438d7d
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/58438d7d
Branch: refs/heads/fix-jclouds-538
Commit: 58438d7d1e6aa5b765e0d8989c5d46a41335942c
Parents: a104944
Author: Andrew Gaul <ga...@apache.org>
Authored: Thu Sep 4 17:24:27 2014 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Thu Sep 4 17:24:27 2014 -0700
----------------------------------------------------------------------
.../jclouds/s3/functions/ParseObjectMetadataFromHeadersTest.java | 1 -
core/src/main/java/org/jclouds/io/ByteStreams2.java | 1 -
2 files changed, 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/58438d7d/apis/s3/src/test/java/org/jclouds/s3/functions/ParseObjectMetadataFromHeadersTest.java
----------------------------------------------------------------------
diff --git a/apis/s3/src/test/java/org/jclouds/s3/functions/ParseObjectMetadataFromHeadersTest.java b/apis/s3/src/test/java/org/jclouds/s3/functions/ParseObjectMetadataFromHeadersTest.java
index 8f916c1..b10311f 100644
--- a/apis/s3/src/test/java/org/jclouds/s3/functions/ParseObjectMetadataFromHeadersTest.java
+++ b/apis/s3/src/test/java/org/jclouds/s3/functions/ParseObjectMetadataFromHeadersTest.java
@@ -16,7 +16,6 @@
*/
package org.jclouds.s3.functions;
-import static com.google.common.io.BaseEncoding.base16;
import static org.easymock.EasyMock.createMock;
import static org.jclouds.aws.reference.AWSConstants.PROPERTY_HEADER_TAG;
import static org.jclouds.blobstore.reference.BlobStoreConstants.PROPERTY_USER_METADATA_PREFIX;
http://git-wip-us.apache.org/repos/asf/jclouds/blob/58438d7d/core/src/main/java/org/jclouds/io/ByteStreams2.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/jclouds/io/ByteStreams2.java b/core/src/main/java/org/jclouds/io/ByteStreams2.java
index 73c7bb1..91d5d4e 100644
--- a/core/src/main/java/org/jclouds/io/ByteStreams2.java
+++ b/core/src/main/java/org/jclouds/io/ByteStreams2.java
@@ -25,7 +25,6 @@ import com.google.common.annotations.Beta;
import com.google.common.hash.HashCode;
import com.google.common.hash.HashFunction;
import com.google.common.hash.HashingInputStream;
-import com.google.common.io.ByteSource;
import com.google.common.io.ByteStreams;
import com.google.common.io.Closeables;
[17/50] [abbrv] git commit: JCLOUDS-296: Deprecate Rackspace
First-Gen CloudServers
Posted by an...@apache.org.
JCLOUDS-296: Deprecate Rackspace First-Gen CloudServers
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/a73340ab
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/a73340ab
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/a73340ab
Branch: refs/heads/fix-jclouds-538
Commit: a73340abb99df54f7ece482f05a25f7b3b183250
Parents: 000a505
Author: Jeremy Daggett <je...@rackspace.com>
Authored: Fri Aug 29 14:04:59 2014 -0700
Committer: Jeremy Daggett <jd...@apache.org>
Committed: Tue Sep 9 14:41:54 2014 -0700
----------------------------------------------------------------------
.../cloudservers/CloudServersAsyncClient.java | 9 +-
.../cloudservers/CloudServersClient.java | 90 ++++++++++----------
2 files changed, 52 insertions(+), 47 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a73340ab/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersAsyncClient.java
----------------------------------------------------------------------
diff --git a/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersAsyncClient.java b/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersAsyncClient.java
index 2cd1101..2070f7a 100644
--- a/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersAsyncClient.java
+++ b/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersAsyncClient.java
@@ -67,11 +67,12 @@ import com.google.common.util.concurrent.ListenableFuture;
* All commands return a ListenableFuture of the result from Cloud Servers. Any exceptions incurred
* during processing will be backend in an {@link ExecutionException} as documented in
* {@link ListenableFuture#get()}.
- *
+ *
* @see CloudServersClient
- * @see <a href="http://docs.rackspacecloud.com/servers/api/cs-devguide-latest.pdf" />
- * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(CloudServersClient.class)} as
- * {@link CloudServersAsyncClient} interface will be removed in jclouds 1.7.
+ *
+ * @deprecated The Rackspace First-Gen Cloud Servers product has been retired and this API should not be used. Please
+ * use the {@code rackspace-cloudservers-uk} and {@code rackspace-cloudservers-us} providers as this
+ * API will be removed in jclouds 2.0.
*/
@Deprecated
@RequestFilters({ AuthenticateRequest.class, AddTimestampQuery.class })
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a73340ab/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersClient.java
----------------------------------------------------------------------
diff --git a/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersClient.java b/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersClient.java
index 418eb03..1ad88e0 100644
--- a/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersClient.java
+++ b/apis/cloudservers/src/main/java/org/jclouds/cloudservers/CloudServersClient.java
@@ -38,25 +38,29 @@ import org.jclouds.cloudservers.options.RebuildServerOptions;
* <p/>
* All commands return a Future of the result from Cloud Servers. Any exceptions incurred during
* processing will be backend in an {@link ExecutionException} as documented in {@link Future#get()}.
- *
+ *
* @see CloudServersAsyncClient
- * @see <a href="http://docs.rackspacecloud.com/servers/api/cs-devguide-latest.pdf" />
+ *
+ * @deprecated The Rackspace First-Gen Cloud Servers product has been retired and this API should not be used. Please
+ * use the {@code rackspace-cloudservers-uk} and {@code rackspace-cloudservers-us} providers as this
+ * API will be removed in jclouds 2.0.
*/
+@Deprecated
public interface CloudServersClient extends Closeable {
/**
* All accounts, by default, have a preconfigured set of thresholds (or limits) to manage
* capacity and prevent abuse of the system. The system recognizes two kinds of limits: rate
* limits and absolute limits. Rate limits are thresholds that are reset after a certain amount
* of time passes. Absolute limits are fixed.
- *
+ *
* @return limits on the account
*/
Limits getLimits();
/**
- *
+ *
* List all servers (IDs and names only)
- *
+ *
* This operation provides a list of servers associated with your identity. Servers that have
* been deleted are not included in this list.
* <p/>
@@ -66,20 +70,20 @@ public interface CloudServersClient extends Closeable {
Set<Server> listServers(ListOptions... options);
/**
- *
+ *
* This operation returns details of the specified server.
- *
+ *
* @return null, if the server is not found
* @see Server
*/
Server getServer(@PathParam("id") int id);
/**
- *
+ *
* This operation deletes a cloud server instance from the system.
* <p/>
* Note: When a server is deleted, all images created from that server are also removed.
- *
+ *
* @return false if the server is not found
* @see Server
*/
@@ -93,7 +97,7 @@ public interface CloudServersClient extends Closeable {
* ACTIVE - REBOOT - ACTIVE (soft reboot)
* <p/>
* ACTIVE - HARD_REBOOT - ACTIVE (hard reboot)
- *
+ *
* @param rebootType
* With a soft reboot, the operating system is signaled to restart, which allows for a
* graceful shutdown of all processes. A hard reboot is the equivalent of power cycling
@@ -149,7 +153,7 @@ public interface CloudServersClient extends Closeable {
* which will return a progress attribute (0-100% completion). A password will be randomly
* generated for you and returned in the response object. For security reasons, it will not be
* returned in subsequent GET calls against a given server ID.
- *
+ *
* @param options
* - used to specify extra files, metadata, or ip parameters during server creation.
*/
@@ -165,7 +169,7 @@ public interface CloudServersClient extends Closeable {
* <p/>
* ACTIVE - REBUILD - ERROR (on error)
* <p/>
- *
+ *
* @param options
* - imageId is an optional argument. If it is not specified, the server is rebuilt
* with the original imageId.
@@ -178,11 +182,11 @@ public interface CloudServersClient extends Closeable {
* This operation shares an IP from an existing server in the specified shared IP group to
* another specified server in the same group. The operation modifies cloud network restrictions
* to allow IP traffic for the given IP to/from the server specified.
- *
+ *
* <p/>
* Status Transition: ACTIVE - SHARE_IP - ACTIVE (if configureServer is true) ACTIVE -
* SHARE_IP_NO_CONFIG - ACTIVE
- *
+ *
* @param configureServer
* <p/>
* if set to true, the server is configured with the new address, though the address is
@@ -198,7 +202,7 @@ public interface CloudServersClient extends Closeable {
* This operation removes a shared IP address from the specified server.
* <p/>
* Status Transition: ACTIVE - DELETE_IP - ACTIVE
- *
+ *
* @param addressToShare
* @param serverToTosignBindressTo
* @return
@@ -209,7 +213,7 @@ public interface CloudServersClient extends Closeable {
* This operation allows you to change the administrative password.
* <p/>
* Status Transition: ACTIVE - PASSWORD - ACTIVE
- *
+ *
*/
void changeAdminPass(int id, String adminPass);
@@ -218,66 +222,66 @@ public interface CloudServersClient extends Closeable {
* the server in the Cloud Servers system and does not change the server host name itself.
* <p/>
* Status Transition: ACTIVE - PASSWORD - ACTIVE
- *
+ *
*/
void renameServer(int id, String newName);
/**
- *
+ *
* List available flavors (IDs and names only)
- *
+ *
* in order to retrieve all details, pass the option {@link ListOptions#withDetails()
* withDetails()}
*/
Set<Flavor> listFlavors(ListOptions... options);
/**
- *
+ *
* This operation returns details of the specified flavor.
- *
+ *
* @return null, if the flavor is not found
* @see Flavor
*/
Flavor getFlavor(int id);
/**
- *
+ *
* List available images (IDs and names only)
- *
+ *
* in order to retrieve all details, pass the option {@link ListOptions#withDetails()
* withDetails()}
*/
Set<Image> listImages(ListOptions... options);
/**
- *
+ *
* This operation returns details of the specified image.
- *
+ *
* @return null, if the image is not found
- *
+ *
* @see Image
*/
Image getImage(int id);
/**
- *
+ *
* This operation deletes an image from the system.
* <p/>
* Note: Images are immediately removed. Currently, there are no state transitions to track the
* delete operation.
- *
+ *
* @return false if the image is not found
* @see Image
*/
boolean deleteImage(int id);
/**
- *
+ *
* This operation creates a new image for the given server ID. Once complete, a new image will be
* available that can be used to rebuild or create servers. Specifying the same image name as an
* existing custom image replaces the image. The image creation status can be queried by
* performing a GET on /images/id and examining the status and progress attributes.
- *
+ *
* Status Transition:
* <p/>
* QUEUED - PREPARING - SAVING - ACTIVE
@@ -286,7 +290,7 @@ public interface CloudServersClient extends Closeable {
* <p/>
* Note: At present, image creation is an asynchronous operation, so coordinating the creation
* with data quiescence, etc. is currently not possible.
- *
+ *
* @throws ResourceNotFoundException
* if the server is not found
* @see Image
@@ -294,20 +298,20 @@ public interface CloudServersClient extends Closeable {
Image createImageFromServer(String imageName, int serverId);
/**
- *
+ *
* List shared IP groups (IDs and names only)
- *
+ *
* in order to retrieve all details, pass the option {@link ListOptions#withDetails()
* withDetails()}
*/
Set<SharedIpGroup> listSharedIpGroups(ListOptions... options);
/**
- *
+ *
* This operation returns details of the specified shared IP group.
- *
+ *
* @return null, if the shared ip group is not found
- *
+ *
* @see SharedIpGroup
*/
SharedIpGroup getSharedIpGroup(int id);
@@ -324,7 +328,7 @@ public interface CloudServersClient extends Closeable {
* This operation deletes the specified shared IP group. This operation will ONLY succeed if 1)
* there are no active servers in the group (i.e. they have all been terminated) or 2) no servers
* in the group are actively sharing IPs.
- *
+ *
* @return false if the shared ip group is not found
* @see SharedIpGroup
*/
@@ -332,7 +336,7 @@ public interface CloudServersClient extends Closeable {
/**
* List the backup schedule for the specified server
- *
+ *
* @throws ResourceNotFoundException
* , if the server doesn't exist
*/
@@ -342,34 +346,34 @@ public interface CloudServersClient extends Closeable {
* Delete backup schedule for the specified server.
* <p/>
* Web Hosting #119571 currently disables the schedule, not deletes it.
- *
+ *
* @return false if the schedule is not found
*/
boolean deleteBackupSchedule(int serverId);
/**
* Enable/update the backup schedule for the specified server
- *
+ *
*/
void replaceBackupSchedule(int id, BackupSchedule backupSchedule);
/**
* List all server addresses
- *
+ *
* returns empty set if the server doesn't exist
*/
Addresses getAddresses(int serverId);
/**
* List all public server addresses
- *
+ *
* returns empty set if the server doesn't exist
*/
Set<String> listPublicAddresses(int serverId);
/**
* List all private server addresses
- *
+ *
* returns empty set if the server doesn't exist
*/
Set<String> listPrivateAddresses(int serverId);
[15/50] [abbrv] git commit: Ignore non-existent container in
deleteContainer
Posted by an...@apache.org.
Ignore non-existent container in deleteContainer
All other blobstore providers allow this operation. Further this
matches the behavior of TransientStorageStrategy.deleteContainer.
This commit prevents a spurious error message from
deleteContainerOrWarnIfUnable after test suite completion.
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/fc4b072a
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/fc4b072a
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/fc4b072a
Branch: refs/heads/fix-jclouds-538
Commit: fc4b072a26772566c07526907821fbea51aed408
Parents: ac22383
Author: Andrew Gaul <ga...@apache.org>
Authored: Mon Sep 8 18:27:08 2014 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Mon Sep 8 18:37:19 2014 -0700
----------------------------------------------------------------------
.../strategy/internal/FilesystemStorageStrategyImpl.java | 3 +++
.../org/jclouds/filesystem/FilesystemAsyncBlobStoreTest.java | 6 +-----
.../strategy/internal/FilesystemStorageStrategyImplTest.java | 8 ++------
3 files changed, 6 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/fc4b072a/apis/filesystem/src/main/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImpl.java
----------------------------------------------------------------------
diff --git a/apis/filesystem/src/main/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImpl.java b/apis/filesystem/src/main/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImpl.java
index 04b3172..65919d3 100644
--- a/apis/filesystem/src/main/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImpl.java
+++ b/apis/filesystem/src/main/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImpl.java
@@ -131,6 +131,9 @@ public class FilesystemStorageStrategyImpl implements LocalStorageStrategy {
@Override
public void deleteContainer(String container) {
filesystemContainerNameValidator.validate(container);
+ if (!containerExists(container)) {
+ return;
+ }
deleteDirectory(container, null);
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/fc4b072a/apis/filesystem/src/test/java/org/jclouds/filesystem/FilesystemAsyncBlobStoreTest.java
----------------------------------------------------------------------
diff --git a/apis/filesystem/src/test/java/org/jclouds/filesystem/FilesystemAsyncBlobStoreTest.java b/apis/filesystem/src/test/java/org/jclouds/filesystem/FilesystemAsyncBlobStoreTest.java
index 0c52a49..3129241 100644
--- a/apis/filesystem/src/test/java/org/jclouds/filesystem/FilesystemAsyncBlobStoreTest.java
+++ b/apis/filesystem/src/test/java/org/jclouds/filesystem/FilesystemAsyncBlobStoreTest.java
@@ -620,11 +620,7 @@ public class FilesystemAsyncBlobStoreTest {
}
public void testDeleteContainer_NotExistingContainer() {
- try {
- blobStore.deleteContainer(CONTAINER_NAME);
- fail("No error when container doesn't exist");
- } catch (Exception e) {
- }
+ blobStore.deleteContainer(CONTAINER_NAME);
}
public void testDeleteContainer_EmptyContanier() {
http://git-wip-us.apache.org/repos/asf/jclouds/blob/fc4b072a/apis/filesystem/src/test/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImplTest.java
----------------------------------------------------------------------
diff --git a/apis/filesystem/src/test/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImplTest.java b/apis/filesystem/src/test/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImplTest.java
index 10bc59e..466d1a2 100644
--- a/apis/filesystem/src/test/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImplTest.java
+++ b/apis/filesystem/src/test/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImplTest.java
@@ -282,12 +282,8 @@ public class FilesystemStorageStrategyImplTest {
TestUtils.directoryExists(CONTAINER_NAME, false);
}
- public void testDeleteContainer_ErrorWhenNotExists() {
- try {
- storageStrategy.deleteContainer(CONTAINER_NAME);
- fail("Exception not throwed");
- } catch (Exception e) {
- }
+ public void testDeleteContainerNoErrorWhenNotExists() {
+ storageStrategy.deleteContainer(CONTAINER_NAME);
}
public void testGetAllContainerNames() {
[39/50] [abbrv] git commit: Upgrade to Maven Checkstyle Plugin 2.13
Posted by an...@apache.org.
Upgrade to Maven Checkstyle Plugin 2.13
This release fixes an issue we encountered with parallel builds:
https://jira.codehaus.org/browse/MCHECKSTYLE-230
https://jira.codehaus.org/browse/MCHECKSTYLE-244
Release notes:
http://www.mail-archive.com/announce@maven.apache.org/msg00611.html
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/5bac61d9
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/5bac61d9
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/5bac61d9
Branch: refs/heads/fix-jclouds-538
Commit: 5bac61d94b93ee4bea332579831cffc67156d8d5
Parents: cf95033
Author: Andrew Gaul <ga...@apache.org>
Authored: Wed Oct 1 13:01:13 2014 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Wed Oct 1 13:09:01 2014 -0700
----------------------------------------------------------------------
project/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/5bac61d9/project/pom.xml
----------------------------------------------------------------------
diff --git a/project/pom.xml b/project/pom.xml
index f765537..6caa1ba 100644
--- a/project/pom.xml
+++ b/project/pom.xml
@@ -693,7 +693,7 @@
</plugin>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
- <version>2.12.1</version>
+ <version>2.13</version>
<executions>
<execution>
<id>checkstyle</id>
[05/50] [abbrv] git commit: Reset xattr on overwrite in filesystem
provider
Posted by an...@apache.org.
Reset xattr on overwrite in filesystem provider
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/a1049449
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/a1049449
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/a1049449
Branch: refs/heads/fix-jclouds-538
Commit: a1049449f421c29e6dbe68499fdc7bead7cdf65a
Parents: 0b89b1f
Author: Andrew Gaul <ga...@apache.org>
Authored: Sun Aug 31 13:04:32 2014 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Thu Sep 4 17:22:26 2014 -0700
----------------------------------------------------------------------
.../internal/FilesystemStorageStrategyImpl.java | 1 +
.../FilesystemStorageStrategyImplTest.java | 33 ++++++++++++++++++++
2 files changed, 34 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a1049449/apis/filesystem/src/main/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImpl.java
----------------------------------------------------------------------
diff --git a/apis/filesystem/src/main/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImpl.java b/apis/filesystem/src/main/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImpl.java
index ea975e8..04b3172 100644
--- a/apis/filesystem/src/main/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImpl.java
+++ b/apis/filesystem/src/main/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImpl.java
@@ -276,6 +276,7 @@ public class FilesystemStorageStrategyImpl implements LocalStorageStrategy {
try {
Files.createParentDirs(outputFile);
his = new HashingInputStream(Hashing.md5(), payload.openStream());
+ outputFile.delete();
Files.asByteSink(outputFile).writeFrom(his);
HashCode actualHashCode = his.hash();
HashCode expectedHashCode = payload.getContentMetadata().getContentMD5AsHashCode();
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a1049449/apis/filesystem/src/test/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImplTest.java
----------------------------------------------------------------------
diff --git a/apis/filesystem/src/test/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImplTest.java b/apis/filesystem/src/test/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImplTest.java
index aaa4b78..c24458e 100644
--- a/apis/filesystem/src/test/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImplTest.java
+++ b/apis/filesystem/src/test/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImplTest.java
@@ -16,6 +16,8 @@
*/
package org.jclouds.filesystem.strategy.internal;
+import static org.jclouds.utils.TestUtils.isMacOSX;
+import static org.jclouds.utils.TestUtils.randomByteSource;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertNotNull;
@@ -43,8 +45,10 @@ import org.jclouds.io.payloads.InputStreamPayload;
import org.jclouds.util.Throwables2;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
+import org.testng.SkipException;
import org.testng.annotations.Test;
+import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.google.common.io.ByteSource;
@@ -526,6 +530,35 @@ public class FilesystemStorageStrategyImplTest {
}
}
+ public void testOverwriteBlobMetadata() throws Exception {
+ if (isMacOSX()) {
+ throw new SkipException("blob metadata not supported on Mac OS X");
+ }
+ String blobKey = TestUtils.createRandomBlobKey("writePayload-", ".img");
+
+ // write blob
+ Blob blob = new BlobBuilderImpl()
+ .name(blobKey)
+ .payload(randomByteSource().slice(0, 1024))
+ .userMetadata(ImmutableMap.of("key1", "value1"))
+ .build();
+ storageStrategy.putBlob(CONTAINER_NAME, blob);
+
+ blob = storageStrategy.getBlob(CONTAINER_NAME, blobKey);
+ assertEquals(blob.getMetadata().getUserMetadata().get("key1"), "value1");
+
+ // overwrite blob
+ blob = new BlobBuilderImpl()
+ .name(blobKey)
+ .payload(randomByteSource().slice(0, 1024))
+ // no metadata
+ .build();
+ storageStrategy.putBlob(CONTAINER_NAME, blob);
+
+ blob = storageStrategy.getBlob(CONTAINER_NAME, blobKey);
+ assertFalse(blob.getMetadata().getUserMetadata().containsKey("key1"));
+ }
+
// ---------------------------------------------------------- Private methods
/**
[50/50] [abbrv] git commit: First attempt at fixing 538 by adding
dummy override methods for TestNG
Posted by an...@apache.org.
First attempt at fixing 538 by adding dummy override methods for TestNG
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/6ed38b78
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/6ed38b78
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/6ed38b78
Branch: refs/heads/fix-jclouds-538
Commit: 6ed38b780caff0efa0d2e57b05d0005913554400
Parents: 641bc6f
Author: Andrew Phillips <an...@apache.org>
Authored: Fri Apr 18 19:30:13 2014 -0400
Committer: Andrew Phillips <an...@apache.org>
Committed: Fri Oct 3 09:21:26 2014 -0500
----------------------------------------------------------------------
.../blobstore/integration/SwiftContainerLiveTest.java | 11 +++++++++++
1 file changed, 11 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/6ed38b78/apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/integration/SwiftContainerLiveTest.java
----------------------------------------------------------------------
diff --git a/apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/integration/SwiftContainerLiveTest.java b/apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/integration/SwiftContainerLiveTest.java
index a12e8c1..d83d35b 100644
--- a/apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/integration/SwiftContainerLiveTest.java
+++ b/apis/swift/src/test/java/org/jclouds/openstack/swift/blobstore/integration/SwiftContainerLiveTest.java
@@ -41,4 +41,15 @@ public class SwiftContainerLiveTest extends BaseContainerLiveTest {
public void testPublicAccess() throws MalformedURLException, InterruptedException, IOException {
super.testPublicAccess();
}
+
+ @Test(dependsOnMethods = "testPublicAccess")
+ public void testPublicAccessInNonDefaultLocation() throws InterruptedException, MalformedURLException, IOException {
+ super.testPublicAccessInNonDefaultLocation();
+ }
+
+ @Test(dependsOnMethods = "testPublicAccess")
+ public void testPublicAccessInNonDefaultLocationWithBigBlob() throws InterruptedException, MalformedURLException,
+ IOException {
+ super.testPublicAccessInNonDefaultLocationWithBigBlob();
+ }
}
[21/50] [abbrv] git commit: JCLOUDS-686: Remove changesSince() query
from base PaginationOptions
Posted by an...@apache.org.
JCLOUDS-686: Remove changesSince() query from base PaginationOptions
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/d309e457
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/d309e457
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/d309e457
Branch: refs/heads/fix-jclouds-538
Commit: d309e457256e794f35542f136af5fbadaa66325a
Parents: 9384575
Author: Jeremy Daggett <je...@rackspace.com>
Authored: Tue Aug 26 13:17:07 2014 -0700
Committer: Jeremy Daggett <jd...@apache.org>
Committed: Thu Sep 11 09:27:55 2014 -0700
----------------------------------------------------------------------
.../v2_0/domain/PaginatedCollection.java | 3 --
.../v2_0/options/PaginationOptions.java | 42 ++++++++++-------
.../v2_0/options/PaginationOptionsTest.java | 17 -------
.../nova/v2_0/options/ListOptions.java | 43 ++++++++++-------
.../nova/v2_0/options/ListOptionsTest.java | 49 ++++++++++++++++++++
5 files changed, 98 insertions(+), 56 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/d309e457/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/domain/PaginatedCollection.java
----------------------------------------------------------------------
diff --git a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/domain/PaginatedCollection.java b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/domain/PaginatedCollection.java
index 13e34c7..cca9ede 100644
--- a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/domain/PaginatedCollection.java
+++ b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/domain/PaginatedCollection.java
@@ -30,9 +30,6 @@ import static org.jclouds.http.utils.Queries.queryParser;
/**
* Base class for a paginated collection in OpenStack.
*
- * @see <a
- * href="http://docs.openstack.org/api/openstack-identity-service/2.0/content/Paginated_Collections-d1e325.html">
- * docs</a>
*/
public class PaginatedCollection<T> extends IterableWithMarker<T> {
private final Iterable<T> resources;
http://git-wip-us.apache.org/repos/asf/jclouds/blob/d309e457/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/options/PaginationOptions.java
----------------------------------------------------------------------
diff --git a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/options/PaginationOptions.java b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/options/PaginationOptions.java
index 5d1f30d..80ac010 100644
--- a/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/options/PaginationOptions.java
+++ b/apis/openstack-keystone/src/main/java/org/jclouds/openstack/v2_0/options/PaginationOptions.java
@@ -21,15 +21,13 @@ import static com.google.common.base.Preconditions.checkState;
import java.util.Date;
-import com.google.common.collect.Multimap;
import org.jclouds.http.options.BaseHttpRequestOptions;
+import com.google.common.collect.Multimap;
+
/**
* Options used to control paginated results (aka list commands).
- *
- * @see <a href=
- * "http://docs.openstack.org/api/openstack-compute/2/content/Paginated_Collections-d1e664.html"
- * />
+ *
*/
public class PaginationOptions extends BaseHttpRequestOptions {
/**
@@ -43,10 +41,15 @@ public class PaginationOptions extends BaseHttpRequestOptions {
}
/**
- * Only return objects changed since this time.
+ * Only return objects changed since a specified time.
+ *
+ * @deprecated The {@code changes-since} query does not apply to all OpenStack APIs. Please refer to the OpenStack
+ * Nova {@code ListOptions.changesSince(Date)} and Glance {@code ListImageOptions.changesSince(Date)}.
+ * This option will be removed in 2.1.
*/
- public PaginationOptions changesSince(Date ifModifiedSince) {
- this.queryParameters.put("changes-since", checkNotNull(ifModifiedSince, "ifModifiedSince").getTime() / 1000 + "");
+ @Deprecated
+ public PaginationOptions changesSince(Date changesSince) {
+ this.queryParameters.put("changes-since", checkNotNull(changesSince, "changesSince").getTime() / 1000 + "");
return this;
}
@@ -84,28 +87,31 @@ public class PaginationOptions extends BaseHttpRequestOptions {
}
/**
- * @see PaginationOptions#marker(String)
+ * @see PaginationOptions#changesSince(Date)
+ * @deprecated The {@code changes-since} query does not apply to all OpenStack APIs. Please refer to the OpenStack
+ * Nova {@code ListOptions.changesSince(Date)} and Glance {@code ListImageOptions.changesSince(Date)}.
+ * This option will be removed in 2.1.
*/
- public static PaginationOptions marker(String marker) {
+ @Deprecated
+ public static PaginationOptions changesSince(Date changesSince) {
PaginationOptions options = new PaginationOptions();
- return options.marker(marker);
+ return options.changesSince(changesSince);
}
/**
- * @see PaginationOptions#limit
+ * @see PaginationOptions#marker(String)
*/
- public static PaginationOptions limit(int limit) {
+ public static PaginationOptions marker(String marker) {
PaginationOptions options = new PaginationOptions();
- return options.limit(limit);
+ return options.marker(marker);
}
/**
- * @see PaginationOptions#changesSince(Date)
+ * @see PaginationOptions#limit(int)
*/
- public static PaginationOptions changesSince(Date since) {
+ public static PaginationOptions limit(int limit) {
PaginationOptions options = new PaginationOptions();
- return options.changesSince(since);
+ return options.limit(limit);
}
-
}
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/d309e457/apis/openstack-keystone/src/test/java/org/jclouds/openstack/v2_0/options/PaginationOptionsTest.java
----------------------------------------------------------------------
diff --git a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/v2_0/options/PaginationOptionsTest.java b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/v2_0/options/PaginationOptionsTest.java
index 9171448..9a6588b 100644
--- a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/v2_0/options/PaginationOptionsTest.java
+++ b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/v2_0/options/PaginationOptionsTest.java
@@ -16,13 +16,10 @@
*/
package org.jclouds.openstack.v2_0.options;
-import static org.jclouds.openstack.v2_0.options.PaginationOptions.Builder.changesSince;
import static org.jclouds.openstack.v2_0.options.PaginationOptions.Builder.limit;
import static org.jclouds.openstack.v2_0.options.PaginationOptions.Builder.marker;
import static org.testng.Assert.assertEquals;
-import java.util.Date;
-
import org.testng.annotations.Test;
import com.google.common.collect.ImmutableList;
@@ -33,13 +30,6 @@ import com.google.common.collect.ImmutableList;
@Test(groups = "unit", testName = "PaginationOptionsTest")
public class PaginationOptionsTest {
- public void testChangesSince() {
- Date ifModifiedSince = new Date();
- PaginationOptions options = new PaginationOptions().changesSince(ifModifiedSince);
- assertEquals(ImmutableList.of(ifModifiedSince.getTime() / 1000 + ""),
- options.buildQueryParameters().get("changes-since"));
- }
-
public void testMarker() {
String marker = "52415800-8b69-11e0-9b19-734f6f006e54";
PaginationOptions options = new PaginationOptions().marker(marker);
@@ -52,13 +42,6 @@ public class PaginationOptionsTest {
assertEquals(ImmutableList.of("1"), options.buildQueryParameters().get("limit"));
}
- public void testChangesSinceStatic() {
- Date ifModifiedSince = new Date();
- PaginationOptions options = changesSince(ifModifiedSince);
- assertEquals(ImmutableList.of(ifModifiedSince.getTime() / 1000 + ""),
- options.buildQueryParameters().get("changes-since"));
- }
-
public void testMarkerStatic() {
String marker = "52415800-8b69-11e0-9b19-734f6f006e54";
PaginationOptions options = marker(marker);
http://git-wip-us.apache.org/repos/asf/jclouds/blob/d309e457/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/options/ListOptions.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/options/ListOptions.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/options/ListOptions.java
index 848f3c3..6b1e648 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/options/ListOptions.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/options/ListOptions.java
@@ -16,24 +16,23 @@
*/
package org.jclouds.openstack.nova.v2_0.options;
+import static com.google.common.base.Preconditions.checkNotNull;
+
import java.util.Date;
import org.jclouds.openstack.v2_0.options.PaginationOptions;
/**
* Options used to control the amount of detail in the request.
- *
+ *
* @see PaginationOptions
- * @see <a href="http://wiki.openstack.org/OpenStackAPI_1-1" />
*/
public class ListOptions extends PaginationOptions {
public static final ListOptions NONE = new ListOptions();
/**
- * unless used, only the name and id will be returned per row.
- *
- * @return
+ * Provides detailed results for list operations.
*/
public ListOptions withDetails() {
this.pathSuffix = "/detail";
@@ -44,8 +43,8 @@ public class ListOptions extends PaginationOptions {
* {@inheritDoc}
*/
@Override
- public ListOptions changesSince(Date ifModifiedSince) {
- super.changesSince(ifModifiedSince);
+ public ListOptions limit(int limit) {
+ super.limit(limit);
return this;
}
@@ -53,18 +52,16 @@ public class ListOptions extends PaginationOptions {
* {@inheritDoc}
*/
@Override
- public ListOptions limit(int limit) {
- super.limit(limit);
+ public ListOptions marker(String marker) {
+ super.marker(marker);
return this;
-
}
/**
- * {@inheritDoc}
+ * Checks for any changes since the given date.
*/
- @Override
- public ListOptions marker(String marker) {
- super.marker(marker);
+ public ListOptions changesSince(Date changesSince) {
+ this.queryParameters.put("changes-since", checkNotNull(changesSince, "changesSince").getTime() / 1000 + "");
return this;
}
@@ -87,15 +84,25 @@ public class ListOptions extends PaginationOptions {
}
/**
- * @see PaginationOptions#limit(long)
+ * @see PaginationOptions#limit(int)
*/
- public static ListOptions maxResults(int maxKeys) {
+ public static ListOptions limit(int limit) {
ListOptions options = new ListOptions();
- return options.limit(maxKeys);
+ return options.limit(limit);
+ }
+
+ /**
+ *
+ * @see PaginationOptions#limit(int)
+ * @deprecated Please use {@link #limit(int)} as this builder method will be removed in 2.0.
+ */
+ @Deprecated
+ public static ListOptions maxResults(int maxKeys) {
+ return limit(maxKeys);
}
/**
- * @see PaginationOptions#changesSince(Date)
+ * @see ListOptions#changesSince(Date)
*/
public static ListOptions changesSince(Date since) {
ListOptions options = new ListOptions();
http://git-wip-us.apache.org/repos/asf/jclouds/blob/d309e457/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/options/ListOptionsTest.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/options/ListOptionsTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/options/ListOptionsTest.java
new file mode 100644
index 0000000..b234153
--- /dev/null
+++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/options/ListOptionsTest.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.options;
+
+import static org.jclouds.openstack.nova.v2_0.options.ListOptions.Builder.changesSince;
+import static org.testng.Assert.assertEquals;
+
+import java.util.Date;
+
+import org.jclouds.openstack.v2_0.options.PaginationOptions;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.ImmutableList;
+
+/**
+ * Tests behavior of {@code ListOptions}
+ */
+@Test(groups = "unit")
+public class ListOptionsTest {
+
+ public void testChangesSince() {
+ Date ifModifiedSince = new Date();
+ ListOptions options = new ListOptions().changesSince(ifModifiedSince);
+ assertEquals(ImmutableList.of(ifModifiedSince.getTime() / 1000 + ""),
+ options.buildQueryParameters().get("changes-since"));
+ }
+
+ public void testChangesSinceStatic() {
+ Date ifModifiedSince = new Date();
+ PaginationOptions options = changesSince(ifModifiedSince);
+ assertEquals(ImmutableList.of(ifModifiedSince.getTime() / 1000 + ""),
+ options.buildQueryParameters().get("changes-since"));
+ }
+
+}
[38/50] [abbrv] git commit: Support availability zone in
NovaTemplateOptions.
Posted by an...@apache.org.
Support availability zone in NovaTemplateOptions.
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/cf95033b
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/cf95033b
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/cf95033b
Branch: refs/heads/fix-jclouds-538
Commit: cf95033b1a5211b9f7f05ad36add7d6202e47701
Parents: 2c790c8
Author: Evgeny Tarasenko <et...@xored.com>
Authored: Sun Sep 14 17:22:42 2014 +0700
Committer: Jeremy Daggett <jd...@apache.org>
Committed: Wed Sep 24 06:49:38 2014 -0700
----------------------------------------------------------------------
.../v2_0/compute/NovaComputeServiceAdapter.java | 1 +
.../compute/options/NovaTemplateOptions.java | 32 ++++++++++++++++++--
.../nova/v2_0/options/CreateServerOptions.java | 5 +++
.../options/NovaTemplateOptionsTest.java | 7 +++++
4 files changed, 43 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/cf95033b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeServiceAdapter.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeServiceAdapter.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeServiceAdapter.java
index 2762c30..00d5802 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeServiceAdapter.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeServiceAdapter.java
@@ -109,6 +109,7 @@ public class NovaComputeServiceAdapter implements
options.userData(templateOptions.getUserData());
options.diskConfig(templateOptions.getDiskConfig());
options.configDrive(templateOptions.getConfigDrive());
+ options.availabilityZone(templateOptions.getAvailabilityZone());
if (templateOptions.getNovaNetworks() != null) {
options.novaNetworks(templateOptions.getNovaNetworks());
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/cf95033b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/options/NovaTemplateOptions.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/options/NovaTemplateOptions.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/options/NovaTemplateOptions.java
index 519c0c0..f9906ed 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/options/NovaTemplateOptions.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/options/NovaTemplateOptions.java
@@ -78,6 +78,7 @@ public class NovaTemplateOptions extends TemplateOptions implements Cloneable {
eTo.configDrive(getConfigDrive());
eTo.novaNetworks(getNovaNetworks());
+ eTo.availabilityZone(getAvailabilityZone());
}
}
@@ -89,6 +90,7 @@ public class NovaTemplateOptions extends TemplateOptions implements Cloneable {
protected String diskConfig;
protected boolean configDrive;
protected Set<Network> novaNetworks;
+ protected String availabilityZone;
@Override
public boolean equals(Object o) {
@@ -104,12 +106,14 @@ public class NovaTemplateOptions extends TemplateOptions implements Cloneable {
&& Arrays.equals(this.userData, that.userData)
&& equal(this.diskConfig, that.diskConfig)
&& equal(this.configDrive, that.configDrive)
- && equal(this.novaNetworks, that.novaNetworks);
+ && equal(this.novaNetworks, that.novaNetworks)
+ && equal(this.availabilityZone, that.availabilityZone);
}
@Override
public int hashCode() {
- return Objects.hashCode(super.hashCode(), autoAssignFloatingIp, floatingIpPoolNames, generateKeyPair, keyPairName, userData, diskConfig, configDrive, novaNetworks);
+ return Objects.hashCode(super.hashCode(), autoAssignFloatingIp, floatingIpPoolNames, generateKeyPair, keyPairName,
+ userData, diskConfig, configDrive, novaNetworks, availabilityZone);
}
@Override
@@ -126,6 +130,7 @@ public class NovaTemplateOptions extends TemplateOptions implements Cloneable {
toString.add("diskConfig", diskConfig);
toString.add("configDrive", configDrive);
toString.add("novaNetworks", novaNetworks);
+ toString.add("availabilityZone", availabilityZone);
return toString;
}
@@ -207,6 +212,14 @@ public class NovaTemplateOptions extends TemplateOptions implements Cloneable {
}
/**
+ * @see CreateServerOptions#getAvailabilityZone()
+ */
+ public NovaTemplateOptions availabilityZone(String availabilityZone) {
+ this.availabilityZone = availabilityZone;
+ return this;
+ }
+
+ /**
* The floating IP pool name(s) to use when allocating a FloatingIP. Applicable
* only if #shouldAutoAssignFloatingIp() returns true. If not set will attempt to
* use whatever FloatingIP(s) can be found regardless of which pool they originated
@@ -275,6 +288,13 @@ public class NovaTemplateOptions extends TemplateOptions implements Cloneable {
return novaNetworks;
}
+ /**
+ * @see CreateServerOptions#getAvailabilityZone()
+ */
+ public String getAvailabilityZone() {
+ return availabilityZone;
+ }
+
public static class Builder {
/**
@@ -467,6 +487,14 @@ public class NovaTemplateOptions extends TemplateOptions implements Cloneable {
NovaTemplateOptions options = new NovaTemplateOptions();
return NovaTemplateOptions.class.cast(options.novaNetworks(novaNetworks));
}
+
+ /**
+ * @see NovaTemplateOptions#getAvailabilityZone()
+ */
+ public static NovaTemplateOptions availabilityZone(String availabilityZone) {
+ NovaTemplateOptions options = new NovaTemplateOptions();
+ return options.availabilityZone(availabilityZone);
+ }
}
// methods that only facilitate returning the correct object type
http://git-wip-us.apache.org/repos/asf/jclouds/blob/cf95033b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/options/CreateServerOptions.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/options/CreateServerOptions.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/options/CreateServerOptions.java
index dc092bf..eed4b10 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/options/CreateServerOptions.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/options/CreateServerOptions.java
@@ -345,6 +345,11 @@ public class CreateServerOptions implements MapBinder {
return keyName;
}
+ /**
+ * The availability zone in which to launch the server.
+ *
+ * @return the availability zone to be used
+ */
public String getAvailabilityZone() {
return availabilityZone;
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/cf95033b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/options/NovaTemplateOptionsTest.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/options/NovaTemplateOptionsTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/options/NovaTemplateOptionsTest.java
index 94c9919..3801865 100644
--- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/options/NovaTemplateOptionsTest.java
+++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/options/NovaTemplateOptionsTest.java
@@ -196,6 +196,13 @@ public class NovaTemplateOptionsTest {
}
@Test
+ public void testAvailabilityZone() {
+ NovaTemplateOptions options = new NovaTemplateOptions();
+ options.availabilityZone("nova");
+ assertEquals(options.getAvailabilityZone(), "nova");
+ }
+
+ @Test
public void testDiskConfig() {
NovaTemplateOptions options = new NovaTemplateOptions();
options.diskConfig(Server.DISK_CONFIG_AUTO);
[34/50] [abbrv] git commit: Move modernizer from validate to verify
phase
Posted by an...@apache.org.
Move modernizer from validate to verify phase
Validate runs before the compile phase and modernizer requires the
compiled class files so running after the compile phase makes more
sense.
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/1f9c4cc2
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/1f9c4cc2
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/1f9c4cc2
Branch: refs/heads/fix-jclouds-538
Commit: 1f9c4cc2a7c2a8bed97842eff479f39e4d31eb4e
Parents: 2d70087
Author: Andrew Gaul <ga...@apache.org>
Authored: Mon Sep 22 22:02:59 2014 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Mon Sep 22 22:02:59 2014 -0700
----------------------------------------------------------------------
project/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/1f9c4cc2/project/pom.xml
----------------------------------------------------------------------
diff --git a/project/pom.xml b/project/pom.xml
index 3a0c19c..524605e 100644
--- a/project/pom.xml
+++ b/project/pom.xml
@@ -722,7 +722,7 @@
<executions>
<execution>
<id>modernizer</id>
- <phase>validate</phase>
+ <phase>verify</phase>
<goals>
<goal>modernizer</goal>
</goals>
[22/50] [abbrv] git commit: jclouds has to use git core.autocrlf
false (or LF line endings) to pass tests. Without this checkstyle setting,
checkstyle fails on windows (looking for CRLF).
Posted by an...@apache.org.
jclouds has to use git core.autocrlf false (or LF line endings) to pass tests. Without this checkstyle setting, checkstyle fails on windows (looking for CRLF).
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/816e70ea
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/816e70ea
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/816e70ea
Branch: refs/heads/fix-jclouds-538
Commit: 816e70ea7ba7428a54e638be0386917d84b26456
Parents: d309e45
Author: Zack Shoylev <za...@rackspace.com>
Authored: Mon Sep 15 11:30:22 2014 -0500
Committer: Zack Shoylev <za...@rackspace.com>
Committed: Mon Sep 15 13:41:35 2014 -0500
----------------------------------------------------------------------
resources/checkstyle.xml | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/816e70ea/resources/checkstyle.xml
----------------------------------------------------------------------
diff --git a/resources/checkstyle.xml b/resources/checkstyle.xml
index 40e734b..efc4a67 100644
--- a/resources/checkstyle.xml
+++ b/resources/checkstyle.xml
@@ -21,8 +21,10 @@
<module name="Checker">
<property name="severity" value="warning"/>
- <module name="NewlineAtEndOfFile"/>
- <module name="TreeWalker">
+ <module name="NewlineAtEndOfFile">
+ <property name="lineSeparator" value="lf"/>
+ </module>
+ <module name="TreeWalker">
<module name="AvoidStarImport"/>
<module name="EmptyStatement"/>
<module name="IllegalInstantiation">
[25/50] [abbrv] git commit: JCLOUDS-719: Updgrade to Gson 2.3
Posted by an...@apache.org.
JCLOUDS-719: Updgrade to Gson 2.3
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/9f0b86ec
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/9f0b86ec
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/9f0b86ec
Branch: refs/heads/fix-jclouds-538
Commit: 9f0b86ec1a00d6040b5c736f39b5aa93b7a2ca89
Parents: d2f181b
Author: Jeremy Daggett <je...@rackspace.com>
Authored: Tue Sep 16 15:15:19 2014 -0700
Committer: Jeremy Daggett <jd...@apache.org>
Committed: Wed Sep 17 08:52:24 2014 -0700
----------------------------------------------------------------------
core/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/9f0b86ec/core/pom.xml
----------------------------------------------------------------------
diff --git a/core/pom.xml b/core/pom.xml
index e2dd86f..e73b1cb 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -90,7 +90,7 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
- <version>2.2.4</version>
+ <version>2.3</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
[29/50] [abbrv] git commit: Removed deprecated methods from the
VolumeApi and updated related tests
Posted by an...@apache.org.
Removed deprecated methods from the VolumeApi and updated related tests
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/2db654fb
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/2db654fb
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/2db654fb
Branch: refs/heads/fix-jclouds-538
Commit: 2db654fbe3e32c3799cf2cb8999cd422878d3928
Parents: 1223772
Author: Jeremy Daggett <je...@rackspace.com>
Authored: Mon Jul 21 08:43:15 2014 -0700
Committer: Jeremy Daggett <jd...@apache.org>
Committed: Fri Sep 19 16:38:59 2014 -0700
----------------------------------------------------------------------
.../nova/v2_0/config/NovaHttpApiModule.java | 3 +-
.../v2_0/extensions/ExtensionNamespaces.java | 5 +
.../nova/v2_0/extensions/VolumeApi.java | 67 ------------
.../v2_0/extensions/VolumeAttachmentApi.java | 10 +-
.../v2_0/extensions/VolumeApiExpectTest.java | 109 -------------------
.../nova/v2_0/extensions/VolumeApiLiveTest.java | 66 -----------
.../src/test/resources/extension_list_full.json | 8 ++
7 files changed, 20 insertions(+), 248 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/2db654fb/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaHttpApiModule.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaHttpApiModule.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaHttpApiModule.java
index 0956c48..f2a410f 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaHttpApiModule.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaHttpApiModule.java
@@ -48,7 +48,6 @@ import com.google.inject.Provides;
*
*/
@ConfiguresRestClient
-
public class NovaHttpApiModule extends HttpApiModule<NovaApi> {
public NovaHttpApiModule() {
@@ -92,6 +91,8 @@ public class NovaHttpApiModule extends HttpApiModule<NovaApi> {
URI.create("http://docs.openstack.org/compute/ext/volume_types/api/v1.1"))
.put(URI.create(ExtensionNamespaces.AVAILABILITY_ZONE),
URI.create("http://docs.openstack.org/compute/ext/availabilityzone/api/v1.1"))
+ .put(URI.create(ExtensionNamespaces.VOLUME_ATTACHMENTS),
+ URI.create("http://docs.openstack.org/compute/ext/os-volume-attachment-update/api/v2"))
.build();
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/2db654fb/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ExtensionNamespaces.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ExtensionNamespaces.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ExtensionNamespaces.java
index 1a98e7c..a81decb 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ExtensionNamespaces.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/ExtensionNamespaces.java
@@ -31,6 +31,11 @@ public final class ExtensionNamespaces {
*/
public static final String VOLUMES = "http://docs.openstack.org/ext/volumes/api/v1.1";
/**
+ * Volume attachment support
+ */
+ public static final String VOLUME_ATTACHMENTS = "http://docs.openstack.org/compute/ext/os-volume-attachment-update/api/v2";
+
+ /**
* Volume types support
*/
public static final String VOLUME_TYPES = "http://docs.openstack.org/ext/volume_types/api/v1.1";
http://git-wip-us.apache.org/repos/asf/jclouds/blob/2db654fb/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeApi.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeApi.java
index 485fb09..4e80d5b 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeApi.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeApi.java
@@ -32,7 +32,6 @@ import org.jclouds.Fallbacks.NullOnNotFoundOr404;
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
import org.jclouds.openstack.nova.v2_0.domain.Volume;
-import org.jclouds.openstack.nova.v2_0.domain.VolumeAttachment;
import org.jclouds.openstack.nova.v2_0.domain.VolumeSnapshot;
import org.jclouds.openstack.nova.v2_0.options.CreateVolumeOptions;
import org.jclouds.openstack.nova.v2_0.options.CreateVolumeSnapshotOptions;
@@ -43,7 +42,6 @@ import org.jclouds.rest.annotations.MapBinder;
import org.jclouds.rest.annotations.PayloadParam;
import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.annotations.SelectJson;
-import org.jclouds.rest.annotations.WrapWith;
import com.google.common.annotations.Beta;
import com.google.common.collect.FluentIterable;
@@ -118,71 +116,6 @@ public interface VolumeApi {
@Fallback(FalseOnNotFoundOr404.class)
boolean delete(@PathParam("volumeId") String volumeId);
- /**
- * List volume attachments for a given instance.
- *
- * @return all Floating IPs
- * @deprecated To be removed in jclouds 1.7
- * @see VolumeAttachmentApi#listAttachmentsOnServer(String)
- */
- @Deprecated
- @Named("volume:listAttachments")
- @GET
- @Path("/servers/{id}/os-volume_attachments")
- @SelectJson("volumeAttachments")
- @Consumes(MediaType.APPLICATION_JSON)
- @Fallback(EmptyFluentIterableOnNotFoundOr404.class)
- FluentIterable<VolumeAttachment> listAttachmentsOnServer(@PathParam("id") String serverId);
-
- /**
- * Get a specific attached volume.
- *
- * @return data about the given volume attachment.
- * @deprecated To be removed in jclouds 1.7
- * @see VolumeAttachmentApi#getAttachmentForVolumeOnServer(String, String)
- */
- @Deprecated
- @Named("volume:getAttachments")
- @GET
- @Path("/servers/{serverId}/os-volume_attachments/{id}")
- @SelectJson("volumeAttachment")
- @Consumes(MediaType.APPLICATION_JSON)
- @Fallback(NullOnNotFoundOr404.class)
- @Nullable
- VolumeAttachment getAttachmentForVolumeOnServer(@PathParam("id") String volumeId,
- @PathParam("serverId") String serverId);
-
- /**
- * Attach a volume to an instance
- *
- * @return data about the new volume attachment
- * @deprecated To be removed in jclouds 1.7
- * @see VolumeAttachmentApi#attachVolumeToServerAsDevice(String, String, String)
- */
- @Deprecated
- @Named("volume:attach")
- @POST
- @Path("/servers/{serverId}/os-volume_attachments")
- @SelectJson("volumeAttachment")
- @Produces(MediaType.APPLICATION_JSON)
- @WrapWith("volumeAttachment")
- VolumeAttachment attachVolumeToServerAsDevice(@PayloadParam("volumeId") String volumeId,
- @PathParam("serverId") String serverId, @PayloadParam("device") String device);
-
- /**
- * Detach a Volume from an instance.
- *
- * @return true if successful
- * @deprecated To be removed in jclouds 1.7
- * @see VolumeAttachmentApi#detachVolumeFromServer(String, String)
- */
- @Deprecated
- @Named("volume:detach")
- @DELETE
- @Path("/servers/{serverId}/os-volume_attachments/{id}")
- @Fallback(FalseOnNotFoundOr404.class)
- Boolean detachVolumeFromServer(@PathParam("id") String volumeId,
- @PathParam("serverId") String serverId);
/**
* Returns a summary list of snapshots.
http://git-wip-us.apache.org/repos/asf/jclouds/blob/2db654fb/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeAttachmentApi.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeAttachmentApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeAttachmentApi.java
index c280fa9..bc24036 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeAttachmentApi.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeAttachmentApi.java
@@ -59,13 +59,13 @@ import com.google.common.collect.FluentIterable;
*
*/
@Beta
-@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.VOLUMES)
+@Extension(of = ServiceType.COMPUTE, namespace = ExtensionNamespaces.VOLUME_ATTACHMENTS)
@RequestFilters(AuthenticateRequest.class)
@Consumes(MediaType.APPLICATION_JSON)
@Path("/servers")
public interface VolumeAttachmentApi {
/**
- * List Volume Attachments for a given Server.
+ * Lists Volume Attachments for a given Server.
*
* @param serverId The ID of the Server
* @return All VolumeAttachments for the Server
@@ -78,7 +78,7 @@ public interface VolumeAttachmentApi {
FluentIterable<VolumeAttachment> listAttachmentsOnServer(@PathParam("serverId") String serverId);
/**
- * Get a specific Volume Attachment for a Volume and Server.
+ * Gets a specific Volume Attachment for a Volume and Server.
*
* @param volumeId The ID of the Volume
* @param serverId The ID of the Server
@@ -94,7 +94,7 @@ public interface VolumeAttachmentApi {
@PathParam("serverId") String serverId);
/**
- * Attach a Volume to a Server.
+ * Attaches a Volume to a Server.
*
* Note: If you are using KVM as your hypervisor then the actual device name in the Server will be different than
* the one specified. When the Server sees a new device, it picks the next available name (which in most cases is
@@ -115,7 +115,7 @@ public interface VolumeAttachmentApi {
@PathParam("serverId") String serverId, @PayloadParam("device") String device);
/**
- * Detach a Volume from a server.
+ * Detaches a Volume from a server.
*
* Note: Make sure you've unmounted the volume first. Failure to do so could result in failure or data loss.
*
http://git-wip-us.apache.org/repos/asf/jclouds/blob/2db654fb/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeApiExpectTest.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeApiExpectTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeApiExpectTest.java
index 520ead2..fde97ee 100644
--- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeApiExpectTest.java
+++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeApiExpectTest.java
@@ -190,115 +190,6 @@ public class VolumeApiExpectTest extends BaseNovaApiExpectTest {
assertFalse(api.delete("1"));
}
- public void testListAttachments() {
- URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/servers/instance-1/os-volume_attachments");
- VolumeApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPasswordAndTenantName,
- responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
- authenticatedGET().endpoint(endpoint).build(),
- HttpResponse.builder().statusCode(200).payload(payloadFromResource("/attachment_list.json")).build()
- ).getVolumeApi("az-1.region-a.geo-1").get();
-
- Set<? extends VolumeAttachment> attachments = api.listAttachmentsOnServer("instance-1").toSet();
- assertEquals(attachments, ImmutableSet.of(testAttachment()));
- // double-check individual fields
- VolumeAttachment attachment = Iterables.getOnlyElement(attachments);
- assertEquals(attachment.getDevice(), "/dev/vdc");
- assertEquals(attachment.getServerId(), "b4785058-cb80-491b-baa3-e4ee6546450e");
- assertEquals(attachment.getId(), "1");
- assertEquals(attachment.getVolumeId(), "1");
- }
-
- @Test(expectedExceptions = AuthorizationException.class)
- public void testListAttachmentsFail() {
- URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/servers/instance-2/os-volume_attachments");
- VolumeApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPasswordAndTenantName,
- responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
- authenticatedGET().endpoint(endpoint).build(),
- HttpResponse.builder().statusCode(401).build()
- ).getVolumeApi("az-1.region-a.geo-1").get();
-
- api.listAttachmentsOnServer("instance-2");
- }
-
- public void testGetAttachment() {
- URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/servers/instance-1/os-volume_attachments/1");
- VolumeApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPasswordAndTenantName,
- responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
- authenticatedGET().endpoint(endpoint).build(),
- HttpResponse.builder().statusCode(200).payload(payloadFromResource("/attachment_details.json")).build()
- ).getVolumeApi("az-1.region-a.geo-1").get();
-
- VolumeAttachment attachment = api.getAttachmentForVolumeOnServer("1", "instance-1");
- assertEquals(attachment, testAttachment());
- }
-
- public void testGetAttachmentFail() {
- URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/servers/instance-1/os-volume_attachments/1");
- VolumeApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPasswordAndTenantName,
- responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
- authenticatedGET().endpoint(endpoint).build(),
- HttpResponse.builder().statusCode(404).build()
- ).getVolumeApi("az-1.region-a.geo-1").get();
-
- assertNull(api.getAttachmentForVolumeOnServer("1", "instance-1"));
- }
-
- public void testAttachVolume() {
- URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/servers/instance-1/os-volume_attachments");
- VolumeApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPasswordAndTenantName,
- responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
- authenticatedGET().endpoint(endpoint).method("POST")
- .payload(payloadFromStringWithContentType("{\"volumeAttachment\":{\"volumeId\":\"1\",\"device\":\"/dev/vdc\"}}", MediaType.APPLICATION_JSON)).endpoint(endpoint).build(),
- HttpResponse.builder().statusCode(200).payload(payloadFromResource("/attachment_details.json")).build()
- ).getVolumeApi("az-1.region-a.geo-1").get();
-
- VolumeAttachment result = api.attachVolumeToServerAsDevice("1", "instance-1", "/dev/vdc");
- assertEquals(result, testAttachment());
- }
-
- @Test(expectedExceptions = ResourceNotFoundException.class)
- public void testAttachVolumeFail() {
- URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/servers/instance-1/os-volume_attachments");
- VolumeApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPasswordAndTenantName,
- responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
- authenticatedGET().endpoint(endpoint).method("POST")
- .payload(payloadFromStringWithContentType("{\"volumeAttachment\":{\"volumeId\":\"1\",\"device\":\"/dev/vdc\"}}", MediaType.APPLICATION_JSON)).endpoint(endpoint).build(),
- HttpResponse.builder().statusCode(404).build()
- ).getVolumeApi("az-1.region-a.geo-1").get();
-
- api.attachVolumeToServerAsDevice("1", "instance-1", "/dev/vdc");
- }
-
- public void testDetachVolume() {
- URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/servers/instance-1/os-volume_attachments/1");
- VolumeApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPasswordAndTenantName,
- responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
- authenticatedGET().endpoint(endpoint).method("DELETE").build(),
- HttpResponse.builder().statusCode(200).payload(payloadFromResource("/attachment_details.json")).build()
- ).getVolumeApi("az-1.region-a.geo-1").get();
-
- assertTrue(api.detachVolumeFromServer("1", "instance-1"));
- }
-
- public void testDetachVolumeFail() {
- URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/servers/instance-1/os-volume_attachments/1");
- VolumeApi api = requestsSendResponses(
- keystoneAuthWithUsernameAndPasswordAndTenantName,
- responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse,
- authenticatedGET().endpoint(endpoint).method("DELETE").build(),
- HttpResponse.builder().statusCode(404).build()
- ).getVolumeApi("az-1.region-a.geo-1").get();
-
- assertFalse(api.detachVolumeFromServer("1", "instance-1"));
- }
-
public void testListSnapshots() {
URI endpoint = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/os-snapshots");
VolumeApi api = requestsSendResponses(
http://git-wip-us.apache.org/repos/asf/jclouds/blob/2db654fb/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeApiLiveTest.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeApiLiveTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeApiLiveTest.java
index d1d701d..2e4d780 100644
--- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeApiLiveTest.java
+++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeApiLiveTest.java
@@ -24,10 +24,8 @@ import static org.testng.Assert.assertTrue;
import java.util.Set;
import org.jclouds.openstack.nova.v2_0.domain.Volume;
-import org.jclouds.openstack.nova.v2_0.domain.VolumeAttachment;
import org.jclouds.openstack.nova.v2_0.domain.VolumeSnapshot;
import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiLiveTest;
-import org.jclouds.openstack.nova.v2_0.options.CreateServerOptions;
import org.jclouds.openstack.nova.v2_0.options.CreateVolumeOptions;
import org.jclouds.openstack.nova.v2_0.options.CreateVolumeSnapshotOptions;
import org.testng.annotations.AfterClass;
@@ -215,68 +213,4 @@ public class VolumeApiLiveTest extends BaseNovaApiLiveTest {
assertEquals(a.getVolumeId(), b.getVolumeId());
}
- @Test(dependsOnMethods = "testCreateVolume")
- public void testAttachments() {
- if (volumeOption.isPresent()) {
- String server_id = null;
- try {
- CreateServerOptions createServerOptions = CreateServerOptions.Builder.availabilityZone(availabilityZone);
- final String serverId = server_id = createServerInRegion(region, createServerOptions).getId();
-
- Set<? extends VolumeAttachment> attachments = volumeOption.get().listAttachmentsOnServer(serverId).toSet();
- assertNotNull(attachments);
- final int before = attachments.size();
-
- VolumeAttachment testAttachment = volumeOption.get().attachVolumeToServerAsDevice(testVolume.getId(),
- serverId, "/dev/vdf");
- assertNotNull(testAttachment.getId());
- assertEquals(testAttachment.getVolumeId(), testVolume.getId());
-
- assertTrue(retry(new Predicate<VolumeApi>() {
- public boolean apply(VolumeApi volumeApi) {
- return volumeOption.get().listAttachmentsOnServer(serverId).size() > before;
- }
- }, 60 * 1000L).apply(volumeOption.get()));
-
- attachments = volumeOption.get().listAttachmentsOnServer(serverId).toSet();
- assertNotNull(attachments);
- assertEquals(attachments.size(), before + 1);
-
- assertTrue(retry(new Predicate<VolumeApi>() {
- public boolean apply(VolumeApi volumeApi) {
- return volumeApi.get(testVolume.getId()).getStatus() == Volume.Status.IN_USE;
- }
- }, 30 * 1000L).apply(volumeOption.get()), "Volume status did not show in-use after 30 seconds");
-
- boolean foundIt = false;
- for (VolumeAttachment att : attachments) {
- VolumeAttachment details = volumeOption.get()
- .getAttachmentForVolumeOnServer(att.getVolumeId(), serverId);
- assertNotNull(details);
- assertNotNull(details.getId());
- assertNotNull(details.getServerId());
- assertNotNull(details.getVolumeId());
- if (Objects.equal(details.getVolumeId(), testVolume.getId())) {
- foundIt = true;
- assertEquals(details.getDevice(), "/dev/vdf");
- assertEquals(details.getServerId(), serverId);
- }
- }
-
- assertTrue(foundIt, "Failed to find the attachment we created in listAttachments() response");
-
- volumeOption.get().detachVolumeFromServer(testVolume.getId(), serverId);
- assertTrue(retry(new Predicate<VolumeApi>() {
- public boolean apply(VolumeApi volumeApi) {
- return volumeOption.get().listAttachmentsOnServer(serverId).size() == before;
- }
- }, 60 * 1000L).apply(volumeOption.get()));
-
- } finally {
- if (server_id != null)
- api.getServerApi(region).delete(server_id);
- }
-
- }
- }
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/2db654fb/apis/openstack-nova/src/test/resources/extension_list_full.json
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/test/resources/extension_list_full.json b/apis/openstack-nova/src/test/resources/extension_list_full.json
index c54a010..123592b 100644
--- a/apis/openstack-nova/src/test/resources/extension_list_full.json
+++ b/apis/openstack-nova/src/test/resources/extension_list_full.json
@@ -279,6 +279,14 @@
"namespace": "http://docs.openstack.org/compute/ext/availabilityzone/api/v1.1",
"alias": "os-availability-zone",
"description": "1. Add availability_zone to the Create Server v1.1 API.\n 2. Add availability zones describing.\n "
+ },
+ {
+ "alias": "os-volume-attachment-update",
+ "description": "Support for updating a volume attachment.",
+ "links": [],
+ "name": "VolumeAttachmentUpdate",
+ "namespace": "http://docs.openstack.org/compute/ext/os-volume-attachment-update/api/v2",
+ "updated": "2013-06-20T00:00:00Z"
}
]
}
[07/50] [abbrv] git commit: JCLOUDS-699: Properly deprecate OpenStack
Nova zonescoped package
Posted by an...@apache.org.
JCLOUDS-699: Properly deprecate OpenStack Nova zonescoped package
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/15d81667
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/15d81667
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/15d81667
Branch: refs/heads/fix-jclouds-538
Commit: 15d816670156677e8e99706b5e671e2c7e971462
Parents: 58438d7
Author: Jeremy Daggett <je...@rackspace.com>
Authored: Tue Sep 2 10:36:17 2014 -0700
Committer: Jeremy Daggett <jd...@apache.org>
Committed: Fri Sep 5 08:04:44 2014 -0700
----------------------------------------------------------------------
apis/openstack-nova/pom.xml | 2 +-
.../nova/v2_0/compute/NovaComputeService.java | 3 +-
.../config/NovaComputeServiceContextModule.java | 16 +--
.../AllocateAndAddFloatingIpToNode.java | 1 +
.../functions/CreateSecurityGroupIfNeeded.java | 2 +-
...ovaSecurityGroupInRegionToSecurityGroup.java | 1 -
.../NovaSecurityGroupToSecurityGroup.java | 5 +-
.../SecurityGroupRuleToIpPermission.java | 3 +-
.../loaders/FindSecurityGroupOrCreate.java | 3 +-
...desWithGroupEncodedIntoNameThenAddToSet.java | 2 +-
.../domain/regionscoped/AvailabilityZone.java | 69 -----------
.../domain/regionscoped/FlavorInRegion.java | 20 +++-
.../v2_0/domain/regionscoped/ImageInRegion.java | 10 +-
.../v2_0/domain/regionscoped/RegionAndId.java | 21 ++--
.../v2_0/domain/regionscoped/RegionAndName.java | 11 +-
.../RegionSecurityGroupNameAndPorts.java | 10 +-
.../regionscoped/SecurityGroupInRegion.java | 11 +-
.../domain/regionscoped/ServerInRegion.java | 9 +-
.../v2_0/domain/regionscoped/ZoneState.java | 57 ---------
.../domain/zonescoped/AvailabilityZone.java | 69 +++++++++++
.../v2_0/domain/zonescoped/FlavorInRegion.java | 49 ++++++++
.../v2_0/domain/zonescoped/ImageInRegion.java | 49 ++++++++
.../v2_0/domain/zonescoped/RegionAndId.java | 89 ++++++++++++++
.../v2_0/domain/zonescoped/RegionAndName.java | 115 +++++++++++++++++++
.../RegionSecurityGroupNameAndPorts.java | 65 +++++++++++
.../zonescoped/SecurityGroupInRegion.java | 49 ++++++++
.../v2_0/domain/zonescoped/ServerInRegion.java | 49 ++++++++
.../nova/v2_0/domain/zonescoped/ZoneState.java | 57 +++++++++
.../v2_0/extensions/AvailabilityZoneApi.java | 2 +-
.../FindSecurityGroupWithNameAndReturnTrue.java | 2 +-
.../NovaComputeServiceAdapterExpectTest.java | 2 +-
.../functions/OrphanedGroupsByRegionIdTest.java | 2 +-
.../loaders/FindSecurityGroupOrCreateTest.java | 2 +-
.../AvailabilityZoneApiExpectTest.java | 2 +-
.../AvailabilityZonesApiLiveTest.java | 10 +-
35 files changed, 687 insertions(+), 182 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/pom.xml
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/pom.xml b/apis/openstack-nova/pom.xml
index 75a8095..1a3de0e 100644
--- a/apis/openstack-nova/pom.xml
+++ b/apis/openstack-nova/pom.xml
@@ -27,7 +27,7 @@
</parent>
<groupId>org.apache.jclouds.api</groupId>
<artifactId>openstack-nova</artifactId>
- <name>jclouds openstack-nova api</name>
+ <name>Apache jclouds :: OpenStack :: Nova API</name>
<description>jclouds components to access an implementation of OpenStack Nova</description>
<packaging>bundle</packaging>
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeService.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeService.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeService.java
index 6586395..c2161b9 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeService.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeService.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
package org.jclouds.openstack.nova.v2_0.compute;
+
import static com.google.common.base.Preconditions.checkNotNull;
import static org.jclouds.compute.config.ComputeServiceProperties.TIMEOUT_NODE_RUNNING;
import static org.jclouds.compute.config.ComputeServiceProperties.TIMEOUT_NODE_SUSPENDED;
@@ -61,8 +62,8 @@ import org.jclouds.openstack.nova.v2_0.NovaApi;
import org.jclouds.openstack.nova.v2_0.compute.options.NovaTemplateOptions;
import org.jclouds.openstack.nova.v2_0.domain.KeyPair;
import org.jclouds.openstack.nova.v2_0.domain.SecurityGroup;
-import org.jclouds.openstack.nova.v2_0.domain.regionscoped.SecurityGroupInRegion;
import org.jclouds.openstack.nova.v2_0.domain.regionscoped.RegionAndName;
+import org.jclouds.openstack.nova.v2_0.domain.regionscoped.SecurityGroupInRegion;
import org.jclouds.openstack.nova.v2_0.extensions.KeyPairApi;
import org.jclouds.openstack.nova.v2_0.extensions.SecurityGroupApi;
import org.jclouds.openstack.nova.v2_0.predicates.SecurityGroupPredicates;
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/config/NovaComputeServiceContextModule.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/config/NovaComputeServiceContextModule.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/config/NovaComputeServiceContextModule.java
index cabca59..029c374 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/config/NovaComputeServiceContextModule.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/config/NovaComputeServiceContextModule.java
@@ -71,11 +71,11 @@ import org.jclouds.openstack.nova.v2_0.domain.SecurityGroupRule;
import org.jclouds.openstack.nova.v2_0.domain.Server;
import org.jclouds.openstack.nova.v2_0.domain.regionscoped.FlavorInRegion;
import org.jclouds.openstack.nova.v2_0.domain.regionscoped.ImageInRegion;
-import org.jclouds.openstack.nova.v2_0.domain.regionscoped.SecurityGroupInRegion;
-import org.jclouds.openstack.nova.v2_0.domain.regionscoped.ServerInRegion;
import org.jclouds.openstack.nova.v2_0.domain.regionscoped.RegionAndId;
import org.jclouds.openstack.nova.v2_0.domain.regionscoped.RegionAndName;
import org.jclouds.openstack.nova.v2_0.domain.regionscoped.RegionSecurityGroupNameAndPorts;
+import org.jclouds.openstack.nova.v2_0.domain.regionscoped.SecurityGroupInRegion;
+import org.jclouds.openstack.nova.v2_0.domain.regionscoped.ServerInRegion;
import org.jclouds.openstack.nova.v2_0.predicates.FindSecurityGroupWithNameAndReturnTrue;
import com.google.common.annotations.VisibleForTesting;
@@ -108,9 +108,9 @@ public class NovaComputeServiceContextModule extends
super.configure();
bind(new TypeLiteral<ComputeServiceAdapter<ServerInRegion, FlavorInRegion, ImageInRegion, Location>>() {
}).to(NovaComputeServiceAdapter.class);
-
+
bind(ComputeService.class).to(NovaComputeService.class);
-
+
bind(new TypeLiteral<Function<ServerInRegion, NodeMetadata>>() {
}).to(ServerInRegionToNodeMetadata.class);
@@ -154,7 +154,7 @@ public class NovaComputeServiceContextModule extends
bind(new TypeLiteral<CacheLoader<RegionAndName, KeyPair>>() {
}).to(CreateUniqueKeyPair.class);
-
+
bind(new TypeLiteral<ImageExtension>() {
}).to(NovaImageExtension.class);
@@ -185,7 +185,7 @@ public class NovaComputeServiceContextModule extends
CacheLoader<RegionAndName, SecurityGroupInRegion> in) {
return CacheBuilder.newBuilder().build(in);
}
-
+
@Override
protected Map<OsFamily, LoginCredentials> osFamilyToCredentials(Injector injector) {
return ImmutableMap.of(OsFamily.WINDOWS, LoginCredentials.builder().user("Administrator").build(),
@@ -264,7 +264,7 @@ public class NovaComputeServiceContextModule extends
protected Map<Server.Status, NodeMetadata.Status> toPortableNodeStatus() {
return toPortableNodeStatus;
}
-
+
@VisibleForTesting
public static final Map<org.jclouds.openstack.nova.v2_0.domain.Image.Status, Image.Status> toPortableImageStatus = ImmutableMap
.<org.jclouds.openstack.nova.v2_0.domain.Image.Status, Image.Status> builder()
@@ -280,7 +280,7 @@ public class NovaComputeServiceContextModule extends
protected Map<org.jclouds.openstack.nova.v2_0.domain.Image.Status, Image.Status> toPortableImageStatus() {
return toPortableImageStatus;
}
-
+
@Override
protected Optional<ImageExtension> provideImageExtension(Injector i) {
return Optional.of(i.getInstance(ImageExtension.class));
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/AllocateAndAddFloatingIpToNode.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/AllocateAndAddFloatingIpToNode.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/AllocateAndAddFloatingIpToNode.java
index 1de8fd8..12b6b91 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/AllocateAndAddFloatingIpToNode.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/AllocateAndAddFloatingIpToNode.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
package org.jclouds.openstack.nova.v2_0.compute.functions;
+
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
import static org.jclouds.compute.config.ComputeServiceProperties.TIMEOUT_NODE_RUNNING;
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/CreateSecurityGroupIfNeeded.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/CreateSecurityGroupIfNeeded.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/CreateSecurityGroupIfNeeded.java
index 4c2c8cc..4e9b11c 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/CreateSecurityGroupIfNeeded.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/CreateSecurityGroupIfNeeded.java
@@ -32,8 +32,8 @@ import org.jclouds.net.domain.IpProtocol;
import org.jclouds.openstack.nova.v2_0.NovaApi;
import org.jclouds.openstack.nova.v2_0.domain.Ingress;
import org.jclouds.openstack.nova.v2_0.domain.SecurityGroup;
-import org.jclouds.openstack.nova.v2_0.domain.regionscoped.SecurityGroupInRegion;
import org.jclouds.openstack.nova.v2_0.domain.regionscoped.RegionSecurityGroupNameAndPorts;
+import org.jclouds.openstack.nova.v2_0.domain.regionscoped.SecurityGroupInRegion;
import org.jclouds.openstack.nova.v2_0.extensions.SecurityGroupApi;
import com.google.common.base.Function;
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/NovaSecurityGroupInRegionToSecurityGroup.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/NovaSecurityGroupInRegionToSecurityGroup.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/NovaSecurityGroupInRegionToSecurityGroup.java
index 08b4e2d..33b641e 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/NovaSecurityGroupInRegionToSecurityGroup.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/NovaSecurityGroupInRegionToSecurityGroup.java
@@ -36,7 +36,6 @@ import com.google.common.base.Function;
import com.google.common.base.Supplier;
import com.google.inject.Inject;
-
/**
* A function for transforming a Nova-specific SecurityGroup into a generic
* SecurityGroup object.
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/NovaSecurityGroupToSecurityGroup.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/NovaSecurityGroupToSecurityGroup.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/NovaSecurityGroupToSecurityGroup.java
index 6bd2e64..bdb7ba6 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/NovaSecurityGroupToSecurityGroup.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/NovaSecurityGroupToSecurityGroup.java
@@ -32,7 +32,6 @@ import org.jclouds.openstack.nova.v2_0.domain.SecurityGroupRule;
import com.google.common.base.Function;
import com.google.inject.Inject;
-
/**
* A function for transforming a Nova-specific SecurityGroup into a generic
* SecurityGroup object.
@@ -44,7 +43,7 @@ public class NovaSecurityGroupToSecurityGroup implements Function<org.jclouds.op
protected Logger logger = Logger.NULL;
protected Function<SecurityGroupRule, IpPermission> ruleToPermission;
-
+
@Inject
public NovaSecurityGroupToSecurityGroup(Function<SecurityGroupRule, IpPermission> ruleToPermission) {
this.ruleToPermission = ruleToPermission;
@@ -53,7 +52,7 @@ public class NovaSecurityGroupToSecurityGroup implements Function<org.jclouds.op
@Override
public SecurityGroup apply(org.jclouds.openstack.nova.v2_0.domain.SecurityGroup group) {
SecurityGroupBuilder builder = new SecurityGroupBuilder();
-
+
builder.id(group.getId());
builder.providerId(group.getId());
builder.ownerId(group.getTenantId());
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/SecurityGroupRuleToIpPermission.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/SecurityGroupRuleToIpPermission.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/SecurityGroupRuleToIpPermission.java
index 4f80b7b..6dddcc8 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/SecurityGroupRuleToIpPermission.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/SecurityGroupRuleToIpPermission.java
@@ -32,8 +32,8 @@ import org.jclouds.domain.Location;
import org.jclouds.logging.Logger;
import org.jclouds.net.domain.IpPermission;
import org.jclouds.openstack.nova.v2_0.domain.SecurityGroupRule;
-import org.jclouds.openstack.nova.v2_0.domain.regionscoped.SecurityGroupInRegion;
import org.jclouds.openstack.nova.v2_0.domain.regionscoped.RegionAndName;
+import org.jclouds.openstack.nova.v2_0.domain.regionscoped.SecurityGroupInRegion;
import com.google.common.base.Function;
import com.google.common.base.Predicate;
@@ -41,7 +41,6 @@ import com.google.common.base.Supplier;
import com.google.common.cache.LoadingCache;
import com.google.common.util.concurrent.Atomics;
-
/**
* A function for transforming a nova-specific SecurityGroupRule into a generic
* IpPermission object.
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/loaders/FindSecurityGroupOrCreate.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/loaders/FindSecurityGroupOrCreate.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/loaders/FindSecurityGroupOrCreate.java
index 23ee514..1a980e5 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/loaders/FindSecurityGroupOrCreate.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/loaders/FindSecurityGroupOrCreate.java
@@ -15,6 +15,7 @@
* limitations under the License.
*/
package org.jclouds.openstack.nova.v2_0.compute.loaders;
+
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
@@ -23,9 +24,9 @@ import java.util.concurrent.atomic.AtomicReference;
import javax.inject.Inject;
import javax.inject.Named;
-import org.jclouds.openstack.nova.v2_0.domain.regionscoped.SecurityGroupInRegion;
import org.jclouds.openstack.nova.v2_0.domain.regionscoped.RegionAndName;
import org.jclouds.openstack.nova.v2_0.domain.regionscoped.RegionSecurityGroupNameAndPorts;
+import org.jclouds.openstack.nova.v2_0.domain.regionscoped.SecurityGroupInRegion;
import com.google.common.base.Function;
import com.google.common.base.Predicate;
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/strategy/ApplyNovaTemplateOptionsCreateNodesWithGroupEncodedIntoNameThenAddToSet.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/strategy/ApplyNovaTemplateOptionsCreateNodesWithGroupEncodedIntoNameThenAddToSet.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/strategy/ApplyNovaTemplateOptionsCreateNodesWithGroupEncodedIntoNameThenAddToSet.java
index 9361999..8085c6c 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/strategy/ApplyNovaTemplateOptionsCreateNodesWithGroupEncodedIntoNameThenAddToSet.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/strategy/ApplyNovaTemplateOptionsCreateNodesWithGroupEncodedIntoNameThenAddToSet.java
@@ -45,9 +45,9 @@ import org.jclouds.openstack.nova.v2_0.compute.functions.AllocateAndAddFloatingI
import org.jclouds.openstack.nova.v2_0.compute.options.NodeAndNovaTemplateOptions;
import org.jclouds.openstack.nova.v2_0.compute.options.NovaTemplateOptions;
import org.jclouds.openstack.nova.v2_0.domain.KeyPair;
-import org.jclouds.openstack.nova.v2_0.domain.regionscoped.SecurityGroupInRegion;
import org.jclouds.openstack.nova.v2_0.domain.regionscoped.RegionAndName;
import org.jclouds.openstack.nova.v2_0.domain.regionscoped.RegionSecurityGroupNameAndPorts;
+import org.jclouds.openstack.nova.v2_0.domain.regionscoped.SecurityGroupInRegion;
import com.google.common.base.Function;
import com.google.common.base.Throwables;
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/AvailabilityZone.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/AvailabilityZone.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/AvailabilityZone.java
deleted file mode 100644
index e59e4dd..0000000
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/AvailabilityZone.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.openstack.nova.v2_0.domain.regionscoped;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-import com.google.gson.annotations.SerializedName;
-
-import java.beans.ConstructorProperties;
-
-public class AvailabilityZone {
-
- @SerializedName("zoneName")
- private final String name;
- private final ZoneState state;
-
- @ConstructorProperties({"zoneName" , "zoneState"})
- protected AvailabilityZone(String name, ZoneState state) {
- this.name = name;
- this.state = state;
- }
-
- public String getName() {
- return name;
- }
-
- public ZoneState getState() {
- return state;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(name, state);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this != obj) return false;
- if (obj == null || getClass() != obj.getClass()) return false;
- AvailabilityZone that = AvailabilityZone.class.cast(obj);
- return Objects.equal(this.name, that.name) && Objects.equal(this.state, that.state);
- }
-
- protected MoreObjects.ToStringHelper string() {
- return MoreObjects.toStringHelper(this)
- .add("name", name)
- .add("state", state);
- }
-
- @Override
- public String toString() {
- return string().toString();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/FlavorInRegion.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/FlavorInRegion.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/FlavorInRegion.java
index 5617673..ec69213 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/FlavorInRegion.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/FlavorInRegion.java
@@ -20,24 +20,32 @@ import static com.google.common.base.Preconditions.checkNotNull;
import org.jclouds.openstack.nova.v2_0.domain.Flavor;
+import com.google.common.base.MoreObjects;
+import com.google.common.base.MoreObjects.ToStringHelper;
+
public class FlavorInRegion extends RegionAndId {
- protected final Flavor image;
+ protected final Flavor flavor;
- public FlavorInRegion(Flavor image, String regionId) {
- super(regionId, checkNotNull(image, "image").getId());
- this.image = image;
+ public FlavorInRegion(Flavor flavor, String regionId) {
+ super(regionId, checkNotNull(flavor, "flavor").getId());
+ this.flavor = flavor;
}
public Flavor getFlavor() {
- return image;
+ return flavor;
}
// superclass hashCode/equals are good enough, and help us use RegionAndId and FlavorInRegion
// interchangeably as Map keys
@Override
+ protected ToStringHelper string() {
+ return super.string().add("flavor", flavor);
+ }
+
+ @Override
public String toString() {
- return "[image=" + image + ", regionId=" + regionId + "]";
+ return string().toString();
}
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/ImageInRegion.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/ImageInRegion.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/ImageInRegion.java
index e1bf68e..bc58130 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/ImageInRegion.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/ImageInRegion.java
@@ -20,6 +20,9 @@ import static com.google.common.base.Preconditions.checkNotNull;
import org.jclouds.openstack.nova.v2_0.domain.Image;
+import com.google.common.base.MoreObjects;
+import com.google.common.base.MoreObjects.ToStringHelper;
+
public class ImageInRegion extends RegionAndId {
protected final Image image;
@@ -36,8 +39,13 @@ public class ImageInRegion extends RegionAndId {
// interchangeably as Map keys
@Override
+ protected ToStringHelper string() {
+ return super.string().add("image", image);
+ }
+
+ @Override
public String toString() {
- return "[image=" + image + ", regionId=" + regionId + "]";
+ return string().toString();
}
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/RegionAndId.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/RegionAndId.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/RegionAndId.java
index b8602e2..dab5b69 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/RegionAndId.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/RegionAndId.java
@@ -19,11 +19,14 @@ package org.jclouds.openstack.nova.v2_0.domain.regionscoped;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
+import com.google.common.base.MoreObjects;
+import com.google.common.base.MoreObjects.ToStringHelper;
import com.google.common.base.Objects;
import com.google.common.base.Splitter;
import com.google.common.collect.Iterables;
public class RegionAndId {
+
public static RegionAndId fromSlashEncoded(String id) {
Iterable<String> parts = Splitter.on('/').split(checkNotNull(id, "id"));
checkArgument(Iterables.size(parts) == 2, "id must be in format regionId/id");
@@ -50,6 +53,14 @@ public class RegionAndId {
this.id = checkNotNull(id, "id");
}
+ public String getRegion() {
+ return regionId;
+ }
+
+ public String getId() {
+ return id;
+ }
+
@Override
public int hashCode() {
return Objects.hashCode(regionId, id);
@@ -67,17 +78,13 @@ public class RegionAndId {
return Objects.equal(regionId, other.regionId) && Objects.equal(id, other.id);
}
- public String getRegion() {
- return regionId;
- }
-
- public String getId() {
- return id;
+ protected ToStringHelper string() {
+ return MoreObjects.toStringHelper(this).add("regionId", regionId).add("id", id);
}
@Override
public String toString() {
- return "[regionId=" + regionId + ", id=" + id + "]";
+ return string().toString();
}
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/RegionAndName.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/RegionAndName.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/RegionAndName.java
index e91d1fa..13a666b 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/RegionAndName.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/RegionAndName.java
@@ -33,21 +33,17 @@ import com.google.common.collect.Iterables;
public class RegionAndName {
public static final Function<RegionAndName, String> NAME_FUNCTION = new Function<RegionAndName, String>() {
-
@Override
public String apply(RegionAndName input) {
return input.getName();
}
-
};
public static final Function<RegionAndName, String> REGION_FUNCTION = new Function<RegionAndName, String>() {
-
@Override
public String apply(RegionAndName input) {
return input.getRegion();
}
-
};
public static RegionAndName fromSlashEncoded(String name) {
@@ -99,12 +95,13 @@ public class RegionAndName {
return Objects.hashCode(regionId, name);
}
+ protected ToStringHelper string() {
+ return MoreObjects.toStringHelper(this).add("regionId", regionId).add("name", name);
+ }
+
@Override
public String toString() {
return string().toString();
}
- protected ToStringHelper string() {
- return MoreObjects.toStringHelper("").add("regionId", regionId).add("name", name);
- }
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/RegionSecurityGroupNameAndPorts.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/RegionSecurityGroupNameAndPorts.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/RegionSecurityGroupNameAndPorts.java
index f7866e0..789b49c 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/RegionSecurityGroupNameAndPorts.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/RegionSecurityGroupNameAndPorts.java
@@ -21,8 +21,8 @@ import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Set;
-import com.google.common.base.Objects;
import com.google.common.base.MoreObjects.ToStringHelper;
+import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;
public class RegionSecurityGroupNameAndPorts extends RegionAndName {
@@ -53,7 +53,13 @@ public class RegionSecurityGroupNameAndPorts extends RegionAndName {
}
@Override
- public ToStringHelper string() {
+ protected ToStringHelper string() {
return super.string().add("ports", ports);
}
+
+ @Override
+ public String toString() {
+ return string().toString();
+ }
+
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/SecurityGroupInRegion.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/SecurityGroupInRegion.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/SecurityGroupInRegion.java
index a3898af..5f33b68 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/SecurityGroupInRegion.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/SecurityGroupInRegion.java
@@ -20,6 +20,8 @@ import static com.google.common.base.Preconditions.checkNotNull;
import org.jclouds.openstack.nova.v2_0.domain.SecurityGroup;
+import com.google.common.base.MoreObjects.ToStringHelper;
+
public class SecurityGroupInRegion extends RegionAndName {
protected final SecurityGroup securityGroup;
@@ -32,12 +34,17 @@ public class SecurityGroupInRegion extends RegionAndName {
return securityGroup;
}
- // superclass hashCode/equals are good enough, and help us use RegionAndName and ServerInRegion
+ // superclass hashCode/equals are good enough, and help us use RegionAndName and SecurityGroupInRegion
// interchangeably as Map keys
@Override
+ protected ToStringHelper string() {
+ return super.string().add("securityGroup", securityGroup);
+ }
+
+ @Override
public String toString() {
- return "[securityGroup=" + securityGroup + ", regionId=" + regionId + "]";
+ return string().toString();
}
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/ServerInRegion.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/ServerInRegion.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/ServerInRegion.java
index a5c1803..18c3071 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/ServerInRegion.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/ServerInRegion.java
@@ -20,6 +20,8 @@ import static com.google.common.base.Preconditions.checkNotNull;
import org.jclouds.openstack.nova.v2_0.domain.Server;
+import com.google.common.base.MoreObjects.ToStringHelper;
+
public class ServerInRegion extends RegionAndId {
protected final Server server;
@@ -36,8 +38,13 @@ public class ServerInRegion extends RegionAndId {
// interchangeably as Map keys
@Override
+ protected ToStringHelper string() {
+ return super.string().add("server", server);
+ }
+
+ @Override
public String toString() {
- return "[server=" + server + ", regionId=" + regionId + "]";
+ return string().toString();
}
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/ZoneState.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/ZoneState.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/ZoneState.java
deleted file mode 100644
index 814800a..0000000
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/regionscoped/ZoneState.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.openstack.nova.v2_0.domain.regionscoped;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-
-public class ZoneState {
-
- private final boolean available;
-
- protected ZoneState(boolean available) {
- this.available = available;
- }
-
- public boolean available() {
- return this.available;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(available);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this != obj) return false;
- if (obj == null || getClass() != obj.getClass()) return false;
- ZoneState that = ZoneState.class.cast(obj);
- return Objects.equal(this.available, that.available);
- }
-
- protected MoreObjects.ToStringHelper string() {
- return MoreObjects.toStringHelper(this)
- .add("available", available);
- }
-
- @Override
- public String toString() {
- return string().toString();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/AvailabilityZone.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/AvailabilityZone.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/AvailabilityZone.java
new file mode 100644
index 0000000..a963dcd
--- /dev/null
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/AvailabilityZone.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.domain.zonescoped;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+import com.google.gson.annotations.SerializedName;
+
+import java.beans.ConstructorProperties;
+
+public class AvailabilityZone {
+
+ @SerializedName("zoneName")
+ private final String name;
+ private final ZoneState state;
+
+ @ConstructorProperties({"zoneName" , "zoneState"})
+ protected AvailabilityZone(String name, ZoneState state) {
+ this.name = name;
+ this.state = state;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public ZoneState getState() {
+ return state;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(name, state);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this != obj) return false;
+ if (obj == null || getClass() != obj.getClass()) return false;
+ AvailabilityZone that = AvailabilityZone.class.cast(obj);
+ return Objects.equal(this.name, that.name) && Objects.equal(this.state, that.state);
+ }
+
+ protected MoreObjects.ToStringHelper string() {
+ return MoreObjects.toStringHelper(this)
+ .add("name", name)
+ .add("state", state);
+ }
+
+ @Override
+ public String toString() {
+ return string().toString();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/FlavorInRegion.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/FlavorInRegion.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/FlavorInRegion.java
new file mode 100644
index 0000000..b547f96
--- /dev/null
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/FlavorInRegion.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.domain.zonescoped;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import org.jclouds.openstack.nova.v2_0.domain.Flavor;
+
+/**
+ * @deprecated This package has been replaced with {@link org.jclouds.openstack.nova.v2_0.domain.regionscoped}.
+ * Please use {@link org.jclouds.openstack.nova.v2_0.domain.regionscoped.FlavorInRegion FlavorInRegion},
+ * as this class will be removed in jclouds 2.1.0.
+ */
+@Deprecated
+public class FlavorInRegion extends RegionAndId {
+ protected final Flavor flavor;
+
+ public FlavorInRegion(Flavor flavor, String regionId) {
+ super(regionId, checkNotNull(flavor, "image").getId());
+ this.flavor = flavor;
+ }
+
+ public Flavor getFlavor() {
+ return flavor;
+ }
+
+ // superclass hashCode/equals are good enough, and help us use RegionAndId and FlavorInRegion
+ // interchangeably as Map keys
+
+ @Override
+ public String toString() {
+ return "[flavor=" + flavor + ", regionId=" + regionId + "]";
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ImageInRegion.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ImageInRegion.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ImageInRegion.java
new file mode 100644
index 0000000..cf818ff
--- /dev/null
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ImageInRegion.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.domain.zonescoped;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import org.jclouds.openstack.nova.v2_0.domain.Image;
+
+/**
+ * @deprecated This package has been replaced with {@link org.jclouds.openstack.nova.v2_0.domain.regionscoped}.
+ * Please use {@link org.jclouds.openstack.nova.v2_0.domain.regionscoped.ImageInRegion ImageInRegion},
+ * as this class will be removed in jclouds 2.1.0.
+ */
+@Deprecated
+public class ImageInRegion extends RegionAndId {
+ protected final Image image;
+
+ public ImageInRegion(Image image, String regionId) {
+ super(regionId, checkNotNull(image, "image").getId());
+ this.image = image;
+ }
+
+ public Image getImage() {
+ return image;
+ }
+
+ // superclass hashCode/equals are good enough, and help us use RegionAndId and ImageInRegion
+ // interchangeably as Map keys
+
+ @Override
+ public String toString() {
+ return "[image=" + image + ", regionId=" + regionId + "]";
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/RegionAndId.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/RegionAndId.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/RegionAndId.java
new file mode 100644
index 0000000..7d45bff
--- /dev/null
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/RegionAndId.java
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.domain.zonescoped;
+
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import com.google.common.base.Objects;
+import com.google.common.base.Splitter;
+import com.google.common.collect.Iterables;
+
+/**
+ * @deprecated This package has been replaced with {@link org.jclouds.openstack.nova.v2_0.domain.regionscoped}.
+ * Please use {@link org.jclouds.openstack.nova.v2_0.domain.regionscoped.RegionAndId RegionAndId},
+ * as this class will be removed in jclouds 2.1.0.
+ */
+@Deprecated
+public class RegionAndId {
+ public static RegionAndId fromSlashEncoded(String id) {
+ Iterable<String> parts = Splitter.on('/').split(checkNotNull(id, "id"));
+ checkArgument(Iterables.size(parts) == 2, "id must be in format regionId/id");
+ return new RegionAndId(Iterables.get(parts, 0), Iterables.get(parts, 1));
+ }
+
+ public static RegionAndId fromRegionAndId(String regionId, String id) {
+ return new RegionAndId(regionId, id);
+ }
+
+ private static String slashEncodeRegionAndId(String regionId, String id) {
+ return checkNotNull(regionId, "regionId") + "/" + checkNotNull(id, "id");
+ }
+
+ public String slashEncode() {
+ return slashEncodeRegionAndId(regionId, id);
+ }
+
+ protected final String regionId;
+ protected final String id;
+
+ protected RegionAndId(String regionId, String id) {
+ this.regionId = checkNotNull(regionId, "regionId");
+ this.id = checkNotNull(id, "id");
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(regionId, id);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ RegionAndId other = (RegionAndId) obj;
+ return Objects.equal(regionId, other.regionId) && Objects.equal(id, other.id);
+ }
+
+ public String getRegion() {
+ return regionId;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ @Override
+ public String toString() {
+ return "[regionId=" + regionId + ", id=" + id + "]";
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/RegionAndName.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/RegionAndName.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/RegionAndName.java
new file mode 100644
index 0000000..c7d07e2
--- /dev/null
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/RegionAndName.java
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.domain.zonescoped;
+
+import static com.google.common.base.Objects.equal;
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import com.google.common.base.Function;
+import com.google.common.base.MoreObjects;
+import com.google.common.base.MoreObjects.ToStringHelper;
+import com.google.common.base.Objects;
+import com.google.common.base.Splitter;
+import com.google.common.collect.Iterables;
+
+/**
+ * Helpful when looking for resources by region and name
+ *
+ * @deprecated This package has been replaced with {@link org.jclouds.openstack.nova.v2_0.domain.regionscoped}.
+ * Please use {@link org.jclouds.openstack.nova.v2_0.domain.regionscoped.RegionAndName RegionAndName},
+ * as this class will be removed in jclouds 2.1.0.
+ */
+@Deprecated
+public class RegionAndName {
+
+ public static final Function<RegionAndName, String> NAME_FUNCTION = new Function<RegionAndName, String>() {
+
+ @Override
+ public String apply(RegionAndName input) {
+ return input.getName();
+ }
+
+ };
+
+ public static final Function<RegionAndName, String> REGION_FUNCTION = new Function<RegionAndName, String>() {
+
+ @Override
+ public String apply(RegionAndName input) {
+ return input.getRegion();
+ }
+
+ };
+
+ public static RegionAndName fromSlashEncoded(String name) {
+ Iterable<String> parts = Splitter.on('/').split(checkNotNull(name, "name"));
+ checkArgument(Iterables.size(parts) == 2, "name must be in format regionId/name");
+ return new RegionAndName(Iterables.get(parts, 0), Iterables.get(parts, 1));
+ }
+
+ public static RegionAndName fromRegionAndName(String regionId, String name) {
+ return new RegionAndName(regionId, name);
+ }
+
+ private static String slashEncodeRegionAndName(String regionId, String name) {
+ return checkNotNull(regionId, "regionId") + "/" + checkNotNull(name, "name");
+ }
+
+ public String slashEncode() {
+ return slashEncodeRegionAndName(regionId, name);
+ }
+
+ protected final String regionId;
+ protected final String name;
+
+ protected RegionAndName(String regionId, String name) {
+ this.regionId = checkNotNull(regionId, "regionId");
+ this.name = checkNotNull(name, "name");
+ }
+
+ public String getRegion() {
+ return regionId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o)
+ return true;
+ if (o == null || getClass() != o.getClass())
+ return false;
+ RegionAndName that = RegionAndName.class.cast(o);
+ return equal(this.regionId, that.regionId) && equal(this.name, that.name);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(regionId, name);
+ }
+
+ @Override
+ public String toString() {
+ return string().toString();
+ }
+
+ protected ToStringHelper string() {
+ return MoreObjects.toStringHelper("").add("regionId", regionId).add("name", name);
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/RegionSecurityGroupNameAndPorts.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/RegionSecurityGroupNameAndPorts.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/RegionSecurityGroupNameAndPorts.java
new file mode 100644
index 0000000..b464925
--- /dev/null
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/RegionSecurityGroupNameAndPorts.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.domain.zonescoped;
+
+import static com.google.common.base.Objects.equal;
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.util.Set;
+
+import com.google.common.base.Objects;
+import com.google.common.base.MoreObjects.ToStringHelper;
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * @deprecated This package has been replaced with {@link org.jclouds.openstack.nova.v2_0.domain.regionscoped}.
+ * Please use {@link org.jclouds.openstack.nova.v2_0.domain.regionscoped.RegionSecurityGroupNameAndPorts RegionSecurityGroupNameAndPorts},
+ * as this class will be removed in jclouds 2.1.0.
+ */
+@Deprecated
+public class RegionSecurityGroupNameAndPorts extends RegionAndName {
+ protected final Set<Integer> ports;
+
+ public RegionSecurityGroupNameAndPorts(String regionId, String name, Iterable<Integer> ports) {
+ super(regionId, name);
+ this.ports = ImmutableSet.<Integer> copyOf(checkNotNull(ports, "ports"));
+ }
+
+ public Set<Integer> getPorts() {
+ return ports;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o)
+ return true;
+ if (o == null || getClass() != o.getClass())
+ return false;
+ RegionSecurityGroupNameAndPorts that = RegionSecurityGroupNameAndPorts.class.cast(o);
+ return super.equals(that) && equal(this.ports, that.ports);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(super.hashCode(), ports);
+ }
+
+ @Override
+ public ToStringHelper string() {
+ return super.string().add("ports", ports);
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/SecurityGroupInRegion.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/SecurityGroupInRegion.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/SecurityGroupInRegion.java
new file mode 100644
index 0000000..fb2793b
--- /dev/null
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/SecurityGroupInRegion.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.domain.zonescoped;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import org.jclouds.openstack.nova.v2_0.domain.SecurityGroup;
+
+/**
+ * @deprecated This package has been replaced with {@link org.jclouds.openstack.nova.v2_0.domain.regionscoped}.
+ * Please use {@link org.jclouds.openstack.nova.v2_0.domain.regionscoped.SecurityGroupInRegion SecurityGroupInRegion},
+ * as this class will be removed in jclouds 2.1.0.
+ */
+@Deprecated
+public class SecurityGroupInRegion extends RegionAndName {
+ protected final SecurityGroup securityGroup;
+
+ public SecurityGroupInRegion(SecurityGroup securityGroup, String regionId) {
+ super(regionId, checkNotNull(securityGroup, "securityGroup").getName());
+ this.securityGroup = securityGroup;
+ }
+
+ public SecurityGroup getSecurityGroup() {
+ return securityGroup;
+ }
+
+ // superclass hashCode/equals are good enough, and help us use RegionAndName and ServerInRegion
+ // interchangeably as Map keys
+
+ @Override
+ public String toString() {
+ return "[securityGroup=" + securityGroup + ", regionId=" + regionId + "]";
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ServerInRegion.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ServerInRegion.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ServerInRegion.java
new file mode 100644
index 0000000..9e7c405
--- /dev/null
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ServerInRegion.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.domain.zonescoped;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import org.jclouds.openstack.nova.v2_0.domain.Server;
+
+/**
+ * @deprecated This package has been replaced with {@link org.jclouds.openstack.nova.v2_0.domain.regionscoped}.
+ * Please use {@link org.jclouds.openstack.nova.v2_0.domain.regionscoped.ServerInRegion ServerInRegion},
+ * as this class will be removed in jclouds 2.1.0.
+ */
+@Deprecated
+public class ServerInRegion extends RegionAndId {
+ protected final Server server;
+
+ public ServerInRegion(Server server, String regionId) {
+ super(regionId, checkNotNull(server, "server").getId());
+ this.server = server;
+ }
+
+ public Server getServer() {
+ return server;
+ }
+
+ // superclass hashCode/equals are good enough, and help us use RegionAndId and ServerInRegion
+ // interchangeably as Map keys
+
+ @Override
+ public String toString() {
+ return "[server=" + server + ", regionId=" + regionId + "]";
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ZoneState.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ZoneState.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ZoneState.java
new file mode 100644
index 0000000..6beea92
--- /dev/null
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/zonescoped/ZoneState.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.domain.zonescoped;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+
+public class ZoneState {
+
+ private final boolean available;
+
+ protected ZoneState(boolean available) {
+ this.available = available;
+ }
+
+ public boolean available() {
+ return this.available;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(available);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this != obj) return false;
+ if (obj == null || getClass() != obj.getClass()) return false;
+ ZoneState that = ZoneState.class.cast(obj);
+ return Objects.equal(this.available, that.available);
+ }
+
+ protected MoreObjects.ToStringHelper string() {
+ return MoreObjects.toStringHelper(this)
+ .add("available", available);
+ }
+
+ @Override
+ public String toString() {
+ return string().toString();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneApi.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneApi.java
index 7624e69..7b894fb 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneApi.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneApi.java
@@ -24,7 +24,7 @@ import javax.ws.rs.core.MediaType;
import org.jclouds.Fallbacks.EmptyFluentIterableOnNotFoundOr404;
import org.jclouds.openstack.keystone.v2_0.filters.AuthenticateRequest;
-import org.jclouds.openstack.nova.v2_0.domain.regionscoped.AvailabilityZone;
+import org.jclouds.openstack.nova.v2_0.domain.zonescoped.AvailabilityZone;
import org.jclouds.openstack.v2_0.ServiceType;
import org.jclouds.openstack.v2_0.services.Extension;
import org.jclouds.rest.annotations.Fallback;
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/predicates/FindSecurityGroupWithNameAndReturnTrue.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/predicates/FindSecurityGroupWithNameAndReturnTrue.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/predicates/FindSecurityGroupWithNameAndReturnTrue.java
index 578a484..b7b7f0d 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/predicates/FindSecurityGroupWithNameAndReturnTrue.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/predicates/FindSecurityGroupWithNameAndReturnTrue.java
@@ -28,8 +28,8 @@ import javax.inject.Singleton;
import org.jclouds.logging.Logger;
import org.jclouds.openstack.nova.v2_0.NovaApi;
import org.jclouds.openstack.nova.v2_0.domain.SecurityGroup;
-import org.jclouds.openstack.nova.v2_0.domain.regionscoped.SecurityGroupInRegion;
import org.jclouds.openstack.nova.v2_0.domain.regionscoped.RegionAndName;
+import org.jclouds.openstack.nova.v2_0.domain.regionscoped.SecurityGroupInRegion;
import org.jclouds.openstack.nova.v2_0.extensions.SecurityGroupApi;
import org.jclouds.rest.ResourceNotFoundException;
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeServiceAdapterExpectTest.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeServiceAdapterExpectTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeServiceAdapterExpectTest.java
index 35c5b39..5cb02a7 100644
--- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeServiceAdapterExpectTest.java
+++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/NovaComputeServiceAdapterExpectTest.java
@@ -35,8 +35,8 @@ import org.jclouds.openstack.nova.v2_0.compute.options.NovaTemplateOptions;
import org.jclouds.openstack.nova.v2_0.domain.KeyPair;
import org.jclouds.openstack.nova.v2_0.domain.Network;
import org.jclouds.openstack.nova.v2_0.domain.Server;
-import org.jclouds.openstack.nova.v2_0.domain.regionscoped.ServerInRegion;
import org.jclouds.openstack.nova.v2_0.domain.regionscoped.RegionAndName;
+import org.jclouds.openstack.nova.v2_0.domain.regionscoped.ServerInRegion;
import org.jclouds.openstack.nova.v2_0.internal.BaseNovaComputeServiceContextExpectTest;
import org.testng.annotations.Test;
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/functions/OrphanedGroupsByRegionIdTest.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/functions/OrphanedGroupsByRegionIdTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/functions/OrphanedGroupsByRegionIdTest.java
index 27b976d..0398fab 100644
--- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/functions/OrphanedGroupsByRegionIdTest.java
+++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/functions/OrphanedGroupsByRegionIdTest.java
@@ -29,8 +29,8 @@ import org.jclouds.domain.Location;
import org.jclouds.domain.LocationBuilder;
import org.jclouds.domain.LocationScope;
import org.jclouds.openstack.nova.v2_0.compute.config.NovaComputeServiceContextModule;
-import org.jclouds.openstack.nova.v2_0.domain.regionscoped.ServerInRegion;
import org.jclouds.openstack.nova.v2_0.domain.regionscoped.RegionAndName;
+import org.jclouds.openstack.nova.v2_0.domain.regionscoped.ServerInRegion;
import org.jclouds.openstack.nova.v2_0.parse.ParseServerTest;
import org.testng.annotations.Test;
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/loaders/FindSecurityGroupOrCreateTest.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/loaders/FindSecurityGroupOrCreateTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/loaders/FindSecurityGroupOrCreateTest.java
index 83585bc..9e3182f 100644
--- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/loaders/FindSecurityGroupOrCreateTest.java
+++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/compute/loaders/FindSecurityGroupOrCreateTest.java
@@ -22,9 +22,9 @@ import static org.testng.Assert.fail;
import java.util.concurrent.atomic.AtomicReference;
-import org.jclouds.openstack.nova.v2_0.domain.regionscoped.SecurityGroupInRegion;
import org.jclouds.openstack.nova.v2_0.domain.regionscoped.RegionAndName;
import org.jclouds.openstack.nova.v2_0.domain.regionscoped.RegionSecurityGroupNameAndPorts;
+import org.jclouds.openstack.nova.v2_0.domain.regionscoped.SecurityGroupInRegion;
import org.testng.annotations.Test;
import com.google.common.base.Function;
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneApiExpectTest.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneApiExpectTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneApiExpectTest.java
index fd60811..e2e31bd 100644
--- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneApiExpectTest.java
+++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZoneApiExpectTest.java
@@ -23,7 +23,7 @@ import com.google.common.collect.ImmutableSet;
import org.jclouds.http.HttpRequest;
import org.jclouds.http.HttpResponse;
import org.jclouds.openstack.nova.v2_0.NovaApi;
-import org.jclouds.openstack.nova.v2_0.domain.regionscoped.AvailabilityZone;
+import org.jclouds.openstack.nova.v2_0.domain.zonescoped.AvailabilityZone;
import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiExpectTest;
import org.testng.annotations.Test;
http://git-wip-us.apache.org/repos/asf/jclouds/blob/15d81667/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZonesApiLiveTest.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZonesApiLiveTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZonesApiLiveTest.java
index 1c0a93b..25ff002 100644
--- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZonesApiLiveTest.java
+++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/AvailabilityZonesApiLiveTest.java
@@ -16,15 +16,15 @@
*/
package org.jclouds.openstack.nova.v2_0.extensions;
-import com.google.common.base.Optional;
-import com.google.common.collect.FluentIterable;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertTrue;
-import org.jclouds.openstack.nova.v2_0.domain.regionscoped.AvailabilityZone;
+import org.jclouds.openstack.nova.v2_0.domain.zonescoped.AvailabilityZone;
import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiLiveTest;
import org.testng.annotations.Test;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
+import com.google.common.base.Optional;
+import com.google.common.collect.FluentIterable;
@Test(groups = "live", testName = "AvailabilityZonesApiLiveTest")
public class AvailabilityZonesApiLiveTest extends BaseNovaApiLiveTest {
[13/50] [abbrv] git commit: Remove ByteArrayPayload
Posted by an...@apache.org.
Remove ByteArrayPayload
Callers should use ByteSourcePayload instead.
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/ac223836
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/ac223836
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/ac223836
Branch: refs/heads/fix-jclouds-538
Commit: ac2238364840915597b860e395973859b3f447ab
Parents: bd5b685
Author: Andrew Gaul <ga...@apache.org>
Authored: Sat Sep 6 16:36:34 2014 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Sun Sep 7 07:43:14 2014 -0700
----------------------------------------------------------------------
core/src/main/java/org/jclouds/io/Payloads.java | 9 ----
.../jclouds/io/payloads/ByteArrayPayload.java | 49 --------------------
2 files changed, 58 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/ac223836/core/src/main/java/org/jclouds/io/Payloads.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/jclouds/io/Payloads.java b/core/src/main/java/org/jclouds/io/Payloads.java
index 0a65d63..106c037 100644
--- a/core/src/main/java/org/jclouds/io/Payloads.java
+++ b/core/src/main/java/org/jclouds/io/Payloads.java
@@ -21,7 +21,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
import java.io.File;
import java.io.InputStream;
-import org.jclouds.io.payloads.ByteArrayPayload;
import org.jclouds.io.payloads.ByteSourcePayload;
import org.jclouds.io.payloads.FilePayload;
import org.jclouds.io.payloads.InputStreamPayload;
@@ -65,14 +64,6 @@ public class Payloads {
return new InputStreamPayload(checkNotNull(data, "data"));
}
- /**
- * @deprecated see newPayload(ByteSource)
- */
- @Deprecated
- public static ByteArrayPayload newByteArrayPayload(byte[] data) {
- return new ByteArrayPayload(checkNotNull(data, "data"));
- }
-
public static ByteSourcePayload newByteSourcePayload(ByteSource data) {
return new ByteSourcePayload(checkNotNull(data, "data"));
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/ac223836/core/src/main/java/org/jclouds/io/payloads/ByteArrayPayload.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/jclouds/io/payloads/ByteArrayPayload.java b/core/src/main/java/org/jclouds/io/payloads/ByteArrayPayload.java
deleted file mode 100644
index 5bcf514..0000000
--- a/core/src/main/java/org/jclouds/io/payloads/ByteArrayPayload.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.io.payloads;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-
-/**
- * @deprecated see ByteSourcePayload
- */
-@Deprecated
-public class ByteArrayPayload extends BasePayload<byte[]> {
- public ByteArrayPayload(byte[] content) {
- this(content, null);
- }
-
- public ByteArrayPayload(byte[] content, byte[] md5) {
- super(content);
- getContentMetadata().setContentLength(Long.valueOf(checkNotNull(content, "content").length));
- getContentMetadata().setContentMD5(md5);
- checkArgument(content.length >= 0, "length cannot me negative");
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public InputStream openStream() {
- return new ByteArrayInputStream(content);
- }
-
-}
[30/50] [abbrv] git commit: Prefer Charsets.UTF_8 over string literal
Posted by an...@apache.org.
Prefer Charsets.UTF_8 over string literal
Found with modernizer-maven-plugin.
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/dc301146
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/dc301146
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/dc301146
Branch: refs/heads/fix-jclouds-538
Commit: dc3011469b5de4acb90e03829ae0c5a51e667afa
Parents: 2db654f
Author: Andrew Gaul <ga...@apache.org>
Authored: Sat Sep 20 18:30:56 2014 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Sat Sep 20 18:31:24 2014 -0700
----------------------------------------------------------------------
.../v2_0/internal/BaseOpenStackMockTest.java | 3 +-
...tpCommandExecutorServiceIntegrationTest.java | 29 ++++++++++----------
.../OkHttpCommandExecutorServiceTest.java | 13 +++++----
3 files changed, 24 insertions(+), 21 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/dc301146/apis/openstack-keystone/src/test/java/org/jclouds/openstack/v2_0/internal/BaseOpenStackMockTest.java
----------------------------------------------------------------------
diff --git a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/v2_0/internal/BaseOpenStackMockTest.java b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/v2_0/internal/BaseOpenStackMockTest.java
index 1ec2c62..d6fb2f9 100644
--- a/apis/openstack-keystone/src/test/java/org/jclouds/openstack/v2_0/internal/BaseOpenStackMockTest.java
+++ b/apis/openstack-keystone/src/test/java/org/jclouds/openstack/v2_0/internal/BaseOpenStackMockTest.java
@@ -34,6 +34,7 @@ import org.jclouds.ContextBuilder;
import org.jclouds.concurrent.config.ExecutorServiceModule;
import org.jclouds.util.Strings2;
+import com.google.common.base.Charsets;
import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableSet;
import com.google.common.net.HttpHeaders;
@@ -223,7 +224,7 @@ public class BaseOpenStackMockTest<A extends Closeable> {
JsonElement requestJson = null; // to be compared
JsonElement resourceJson; // to be compared
try {
- requestJson = parser.parse(new String(request.getBody(), "UTF-8"));
+ requestJson = parser.parse(new String(request.getBody(), Charsets.UTF_8));
} catch (Exception e) {
Throwables.propagate(e);
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/dc301146/core/src/test/java/org/jclouds/http/BaseHttpCommandExecutorServiceIntegrationTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/jclouds/http/BaseHttpCommandExecutorServiceIntegrationTest.java b/core/src/test/java/org/jclouds/http/BaseHttpCommandExecutorServiceIntegrationTest.java
index 708301c..4d04704 100644
--- a/core/src/test/java/org/jclouds/http/BaseHttpCommandExecutorServiceIntegrationTest.java
+++ b/core/src/test/java/org/jclouds/http/BaseHttpCommandExecutorServiceIntegrationTest.java
@@ -42,6 +42,7 @@ import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
+import com.google.common.base.Charsets;
import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Multimap;
@@ -299,7 +300,7 @@ public abstract class BaseHttpCommandExecutorServiceIntegrationTest extends Base
String result = client.post("", "foo");
// Verify that the body is properly populated
RecordedRequest request = server.takeRequest();
- assertEquals(new String(request.getBody(), "UTF-8"), "foo");
+ assertEquals(new String(request.getBody(), Charsets.UTF_8), "foo");
assertEquals(result, "fooPOST");
} finally {
close(client, true);
@@ -315,7 +316,7 @@ public abstract class BaseHttpCommandExecutorServiceIntegrationTest extends Base
client.postNothing("");
assertEquals(server.getRequestCount(), 1);
RecordedRequest request = server.takeRequest();
- assertEquals(new String(request.getBody(), "UTF-8"), "");
+ assertEquals(new String(request.getBody(), Charsets.UTF_8), "");
} finally {
close(client, true);
server.shutdown();
@@ -333,9 +334,9 @@ public abstract class BaseHttpCommandExecutorServiceIntegrationTest extends Base
assertEquals(result, "fooPOST");
// Verify that the body was properly sent in the two requests
RecordedRequest request = server.takeRequest();
- assertEquals(new String(request.getBody(), "UTF-8"), "foo");
+ assertEquals(new String(request.getBody(), Charsets.UTF_8), "foo");
request = server.takeRequest();
- assertEquals(new String(request.getBody(), "UTF-8"), "foo");
+ assertEquals(new String(request.getBody(), Charsets.UTF_8), "foo");
} finally {
close(client, true);
server.shutdown();
@@ -356,9 +357,9 @@ public abstract class BaseHttpCommandExecutorServiceIntegrationTest extends Base
assertEquals(redirectTarget.getRequestCount(), 1);
// Verify that the body was populated after the redirect
RecordedRequest request = server.takeRequest();
- assertEquals(new String(request.getBody(), "UTF-8"), "foo");
+ assertEquals(new String(request.getBody(), Charsets.UTF_8), "foo");
request = redirectTarget.takeRequest();
- assertEquals(new String(request.getBody(), "UTF-8"), "foo");
+ assertEquals(new String(request.getBody(), Charsets.UTF_8), "foo");
} finally {
close(client, true);
redirectTarget.shutdown();
@@ -374,7 +375,7 @@ public abstract class BaseHttpCommandExecutorServiceIntegrationTest extends Base
String result = client.postAsInputStream("", "foo");
// Verify that the body is properly populated
RecordedRequest request = server.takeRequest();
- assertEquals(new String(request.getBody(), "UTF-8"), "foo");
+ assertEquals(new String(request.getBody(), Charsets.UTF_8), "foo");
assertEquals(result, "fooPOST");
} finally {
close(client, true);
@@ -405,7 +406,7 @@ public abstract class BaseHttpCommandExecutorServiceIntegrationTest extends Base
String result = client.postJson("", "foo");
// Verify that the body is properly populated
RecordedRequest request = server.takeRequest();
- assertEquals(new String(request.getBody(), "UTF-8"), "{\"key\":\"foo\"}");
+ assertEquals(new String(request.getBody(), Charsets.UTF_8), "{\"key\":\"foo\"}");
assertEquals(result, "fooPOSTJSON");
} finally {
close(client, true);
@@ -491,7 +492,7 @@ public abstract class BaseHttpCommandExecutorServiceIntegrationTest extends Base
String result = client.upload("", "foo");
// Verify that the body is properly populated
RecordedRequest request = server.takeRequest();
- assertEquals(new String(request.getBody(), "UTF-8"), "foo");
+ assertEquals(new String(request.getBody(), Charsets.UTF_8), "foo");
assertEquals(result, "fooPUT");
} finally {
close(client, true);
@@ -513,9 +514,9 @@ public abstract class BaseHttpCommandExecutorServiceIntegrationTest extends Base
assertEquals(redirectTarget.getRequestCount(), 1);
// Verify that the body was populated after the redirect
RecordedRequest request = server.takeRequest();
- assertEquals(new String(request.getBody(), "UTF-8"), "foo");
+ assertEquals(new String(request.getBody(), Charsets.UTF_8), "foo");
request = redirectTarget.takeRequest();
- assertEquals(new String(request.getBody(), "UTF-8"), "foo");
+ assertEquals(new String(request.getBody(), Charsets.UTF_8), "foo");
} finally {
close(client, true);
redirectTarget.shutdown();
@@ -531,7 +532,7 @@ public abstract class BaseHttpCommandExecutorServiceIntegrationTest extends Base
client.putNothing("");
assertEquals(server.getRequestCount(), 1);
RecordedRequest request = server.takeRequest();
- assertEquals(new String(request.getBody(), "UTF-8"), "");
+ assertEquals(new String(request.getBody(), Charsets.UTF_8), "");
} finally {
close(client, true);
server.shutdown();
@@ -549,9 +550,9 @@ public abstract class BaseHttpCommandExecutorServiceIntegrationTest extends Base
assertEquals(result, "fooPUT");
// Verify that the body was properly sent in the two requests
RecordedRequest request = server.takeRequest();
- assertEquals(new String(request.getBody(), "UTF-8"), "foo");
+ assertEquals(new String(request.getBody(), Charsets.UTF_8), "foo");
request = server.takeRequest();
- assertEquals(new String(request.getBody(), "UTF-8"), "foo");
+ assertEquals(new String(request.getBody(), Charsets.UTF_8), "foo");
} finally {
close(client, true);
server.shutdown();
http://git-wip-us.apache.org/repos/asf/jclouds/blob/dc301146/drivers/okhttp/src/test/java/org/jclouds/http/okhttp/OkHttpCommandExecutorServiceTest.java
----------------------------------------------------------------------
diff --git a/drivers/okhttp/src/test/java/org/jclouds/http/okhttp/OkHttpCommandExecutorServiceTest.java b/drivers/okhttp/src/test/java/org/jclouds/http/okhttp/OkHttpCommandExecutorServiceTest.java
index 20c1cdc..deb2106 100644
--- a/drivers/okhttp/src/test/java/org/jclouds/http/okhttp/OkHttpCommandExecutorServiceTest.java
+++ b/drivers/okhttp/src/test/java/org/jclouds/http/okhttp/OkHttpCommandExecutorServiceTest.java
@@ -36,6 +36,7 @@ import org.jclouds.rest.annotations.PATCH;
import org.jclouds.rest.binders.BindToStringPayload;
import org.testng.annotations.Test;
+import com.google.common.base.Charsets;
import com.google.inject.Module;
import com.squareup.okhttp.mockwebserver.MockResponse;
import com.squareup.okhttp.mockwebserver.MockWebServer;
@@ -80,7 +81,7 @@ public class OkHttpCommandExecutorServiceTest extends BaseHttpCommandExecutorSer
// Verify that the body is properly populated
RecordedRequest request = server.takeRequest();
assertEquals(request.getMethod(), "PATCH");
- assertEquals(new String(request.getBody(), "UTF-8"), "foo");
+ assertEquals(new String(request.getBody(), Charsets.UTF_8), "foo");
assertEquals(result, "fooPATCH");
} finally {
close(api, true);
@@ -100,10 +101,10 @@ public class OkHttpCommandExecutorServiceTest extends BaseHttpCommandExecutorSer
// Verify that the body was properly sent in the two requests
RecordedRequest request = server.takeRequest();
assertEquals(request.getMethod(), "PATCH");
- assertEquals(new String(request.getBody(), "UTF-8"), "foo");
+ assertEquals(new String(request.getBody(), Charsets.UTF_8), "foo");
request = server.takeRequest();
assertEquals(request.getMethod(), "PATCH");
- assertEquals(new String(request.getBody(), "UTF-8"), "foo");
+ assertEquals(new String(request.getBody(), Charsets.UTF_8), "foo");
} finally {
close(api, true);
server.shutdown();
@@ -125,10 +126,10 @@ public class OkHttpCommandExecutorServiceTest extends BaseHttpCommandExecutorSer
// Verify that the body was populated after the redirect
RecordedRequest request = server.takeRequest();
assertEquals(request.getMethod(), "PATCH");
- assertEquals(new String(request.getBody(), "UTF-8"), "foo");
+ assertEquals(new String(request.getBody(), Charsets.UTF_8), "foo");
request = redirectTarget.takeRequest();
assertEquals(request.getMethod(), "PATCH");
- assertEquals(new String(request.getBody(), "UTF-8"), "foo");
+ assertEquals(new String(request.getBody(), Charsets.UTF_8), "foo");
} finally {
close(api, true);
redirectTarget.shutdown();
@@ -145,7 +146,7 @@ public class OkHttpCommandExecutorServiceTest extends BaseHttpCommandExecutorSer
assertEquals(server.getRequestCount(), 1);
RecordedRequest request = server.takeRequest();
assertEquals(request.getMethod(), "PATCH");
- assertEquals(new String(request.getBody(), "UTF-8"), "");
+ assertEquals(new String(request.getBody(), Charsets.UTF_8), "");
} finally {
close(api, true);
server.shutdown();
[27/50] [abbrv] git commit: JCLOUDS-514: Support attaching volumes at
boot in Nova
Posted by an...@apache.org.
JCLOUDS-514: Support attaching volumes at boot in Nova
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/3f2b9376
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/3f2b9376
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/3f2b9376
Branch: refs/heads/fix-jclouds-538
Commit: 3f2b9376a1f2ea54fa979d1338b9ed11ea176c4b
Parents: 0ac7dfd
Author: jasdeep-hundal <ja...@gmail.com>
Authored: Tue Mar 25 14:12:37 2014 -0700
Committer: Jeremy Daggett <jd...@apache.org>
Committed: Thu Sep 18 16:32:24 2014 -0700
----------------------------------------------------------------------
.../nova/v2_0/domain/BlockDeviceMapping.java | 279 +++++++++++++++++++
.../nova/v2_0/options/CreateServerOptions.java | 37 ++-
.../extensions/VolumeAttachmentApiLiveTest.java | 38 +++
.../nova/v2_0/features/ServerApiExpectTest.java | 27 ++
4 files changed, 380 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/3f2b9376/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/BlockDeviceMapping.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/BlockDeviceMapping.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/BlockDeviceMapping.java
new file mode 100644
index 0000000..efb3ba4
--- /dev/null
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/domain/BlockDeviceMapping.java
@@ -0,0 +1,279 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jclouds.openstack.nova.v2_0.domain;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import javax.inject.Named;
+import java.beans.ConstructorProperties;
+
+import org.jclouds.javax.annotation.Nullable;
+
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Objects;
+
+/**
+ * A representation of a block device that should be attached to the Nova instance to be launched
+ *
+ */
+public class BlockDeviceMapping {
+
+ @Named("delete_on_termination")
+ String deleteOnTermination = "0";
+ @Named("device_name")
+ String deviceName = null;
+ @Named("volume_id")
+ String volumeId = null;
+ @Named("volume_size")
+ String volumeSize = "";
+
+ @ConstructorProperties({"volume_id", "volume_size", "device_name", "delete_on_termination"})
+ private BlockDeviceMapping(String volumeId, String volumeSize, String deviceName, String deleteOnTermination) {
+ checkNotNull(volumeId);
+ checkNotNull(deviceName);
+ this.volumeId = volumeId;
+ this.volumeSize = volumeSize;
+ this.deviceName = deviceName;
+ if (deleteOnTermination != null) {
+ this.deleteOnTermination = deleteOnTermination;
+ }
+ }
+
+ /**
+ * Default constructor.
+ */
+ private BlockDeviceMapping() {}
+
+ /**
+ * Copy constructor
+ * @param blockDeviceMapping
+ */
+ private BlockDeviceMapping(BlockDeviceMapping blockDeviceMapping) {
+ this(blockDeviceMapping.volumeId,
+ blockDeviceMapping.volumeSize,
+ blockDeviceMapping.deviceName,
+ blockDeviceMapping.deleteOnTermination);
+ }
+
+ /**
+ * @return the volume id of the block device
+ */
+ @Nullable
+ public String getVolumeId() {
+ return volumeId;
+ }
+
+ /**
+ * @return the size of the block device
+ */
+ @Nullable
+ public String getVolumeSize() {
+ return volumeSize;
+ }
+
+ /**
+ * @return the device name to which the volume is attached
+ */
+ @Nullable
+ public String getDeviceName() {
+ return deviceName;
+ }
+
+ /**
+ * @return whether the volume should be deleted on terminating the instance
+ */
+ public String getDeleteOnTermination() {
+ return deviceName;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(volumeId, volumeSize, deviceName, deleteOnTermination);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null || getClass() != obj.getClass())
+ return false;
+ BlockDeviceMapping that = BlockDeviceMapping.class.cast(obj);
+ return Objects.equal(this.volumeId, that.volumeId)
+ && Objects.equal(this.volumeSize, that.volumeSize)
+ && Objects.equal(this.deviceName, that.deviceName)
+ && Objects.equal(this.deleteOnTermination, that.deleteOnTermination);
+ }
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(this)
+ .add("volumeId", volumeId)
+ .add("volumeSize", volumeSize)
+ .add("deviceName", deviceName)
+ .add("deleteOnTermination", deleteOnTermination)
+ .toString();
+ }
+
+ /*
+ * Methods to get the Create and Update builders follow
+ */
+
+ /**
+ * @return the Builder for creating a new block device mapping
+ */
+ public static CreateBuilder createOptions(String volumeId, String deviceName) {
+ return new CreateBuilder(volumeId, deviceName);
+ }
+
+ /**
+ * @return the Builder for updating a block device mapping
+ */
+ public static UpdateBuilder updateOptions() {
+ return new UpdateBuilder();
+ }
+
+ private abstract static class Builder<ParameterizedBuilderType> {
+ protected BlockDeviceMapping blockDeviceMapping;
+
+ /**
+ * No-parameters constructor used when updating.
+ * */
+ private Builder() {
+ blockDeviceMapping = new BlockDeviceMapping();
+ }
+
+ protected abstract ParameterizedBuilderType self();
+
+ /**
+ * Provide the volume id to the BlockDeviceMapping's Builder.
+ *
+ * @return the Builder.
+ * @see BlockDeviceMapping#getVolumeId()
+ */
+ public ParameterizedBuilderType volumeId(String volumeId) {
+ blockDeviceMapping.volumeId = volumeId;
+ return self();
+ }
+
+ /**
+ * Provide the volume size in GB to the BlockDeviceMapping's Builder.
+ *
+ * @return the Builder.
+ * @see BlockDeviceMapping#getVolumeSize()
+ */
+ public ParameterizedBuilderType volumeSize(int volumeSize) {
+ blockDeviceMapping.volumeSize = Integer.toString(volumeSize);
+ return self();
+ }
+
+ /**
+ * Provide the deviceName to the BlockDeviceMapping's Builder.
+ *
+ * @return the Builder.
+ * @see BlockDeviceMapping#getDeviceName()
+ */
+ public ParameterizedBuilderType deviceName(String deviceName) {
+ blockDeviceMapping.deviceName = deviceName;
+ return self();
+ }
+
+ /**
+ * Provide an option indicated to delete the volume on instance deletion to BlockDeviceMapping's Builder.
+ *
+ * @return the Builder.
+ * @see BlockDeviceMapping#getVolumeSize()
+ */
+ public ParameterizedBuilderType deleteOnTermination(boolean deleteOnTermination) {
+ blockDeviceMapping.deleteOnTermination = deleteOnTermination ? "1" : "0";
+ return self();
+ }
+ }
+
+ /**
+ * Create and Update builders (inheriting from Builder)
+ */
+ public static class CreateBuilder extends Builder<CreateBuilder> {
+ /**
+ * Supply required properties for creating a Builder
+ */
+ private CreateBuilder(String volumeId, String deviceName) {
+ blockDeviceMapping.volumeId = volumeId;
+ blockDeviceMapping.deviceName = deviceName;
+ }
+
+ /**
+ * @return a CreateOptions constructed with this Builder.
+ */
+ public CreateOptions build() {
+ return new CreateOptions(blockDeviceMapping);
+ }
+
+ protected CreateBuilder self() {
+ return this;
+ }
+ }
+
+ /**
+ * Create and Update builders (inheriting from Builder)
+ */
+ public static class UpdateBuilder extends Builder<UpdateBuilder> {
+ /**
+ * Supply required properties for updating a Builder
+ */
+ private UpdateBuilder() {
+ }
+
+ /**
+ * @return a UpdateOptions constructed with this Builder.
+ */
+ public UpdateOptions build() {
+ return new UpdateOptions(blockDeviceMapping);
+ }
+
+ protected UpdateBuilder self() {
+ return this;
+ }
+ }
+
+ /**
+ * Create and Update options - extend the domain class, passed to API update and create calls.
+ * Essentially the same as the domain class. Ensure validation and safe typing.
+ */
+ public static class CreateOptions extends BlockDeviceMapping {
+ /**
+ * Copy constructor
+ */
+ private CreateOptions(BlockDeviceMapping blockDeviceMapping) {
+ super(blockDeviceMapping);
+ checkNotNull(blockDeviceMapping.volumeId, "volume id should not be null");
+ checkNotNull(blockDeviceMapping.deviceName, "device name should not be null");
+ }
+ }
+
+ /**
+ * Create and Update options - extend the domain class, passed to API update and create calls.
+ * Essentially the same as the domain class. Ensure validation and safe typing.
+ */
+ public static class UpdateOptions extends BlockDeviceMapping {
+ /**
+ * Copy constructor
+ */
+ private UpdateOptions(BlockDeviceMapping blockDeviceMapping) {
+ super(blockDeviceMapping);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/3f2b9376/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/options/CreateServerOptions.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/options/CreateServerOptions.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/options/CreateServerOptions.java
index f3f7a6f..dc092bf 100644
--- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/options/CreateServerOptions.java
+++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/options/CreateServerOptions.java
@@ -16,8 +16,8 @@
*/
package org.jclouds.openstack.nova.v2_0.options;
-import static com.google.common.base.Objects.equal;
import static com.google.common.base.MoreObjects.toStringHelper;
+import static com.google.common.base.Objects.equal;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
@@ -33,6 +33,7 @@ import javax.inject.Inject;
import javax.inject.Named;
import org.jclouds.http.HttpRequest;
+import org.jclouds.openstack.nova.v2_0.domain.BlockDeviceMapping;
import org.jclouds.openstack.nova.v2_0.domain.Network;
import org.jclouds.rest.MapBinder;
import org.jclouds.rest.binders.BindToJsonPayload;
@@ -109,6 +110,7 @@ public class CreateServerOptions implements MapBinder {
private Set<Network> novaNetworks = ImmutableSet.of();
private String availabilityZone;
private boolean configDrive;
+ private Set<BlockDeviceMapping> blockDeviceMapping = ImmutableSet.of();
@Override
public boolean equals(Object object) {
@@ -151,6 +153,8 @@ public class CreateServerOptions implements MapBinder {
toString.add("networks", networks);
toString.add("availability_zone", availabilityZone == null ? null : availabilityZone);
toString.add("configDrive", configDrive);
+ if (!blockDeviceMapping.isEmpty())
+ toString.add("blockDeviceMapping", blockDeviceMapping);
return toString;
}
@@ -177,6 +181,8 @@ public class CreateServerOptions implements MapBinder {
Set<Map<String, String>> networks;
@Named("config_drive")
String configDrive;
+ @Named("block_device_mapping")
+ Set<BlockDeviceMapping> blockDeviceMapping;
private ServerRequest(String name, String imageRef, String flavorRef) {
this.name = name;
@@ -238,6 +244,10 @@ public class CreateServerOptions implements MapBinder {
}
}
+ if (!blockDeviceMapping.isEmpty()) {
+ server.blockDeviceMapping = blockDeviceMapping;
+ }
+
return bindToRequest(request, ImmutableMap.of("server", server));
}
@@ -459,6 +469,23 @@ public class CreateServerOptions implements MapBinder {
return networks(ImmutableSet.copyOf(networks));
}
+ /**
+ * @see #getBlockDeviceMapping
+ */
+ public CreateServerOptions blockDeviceMapping(Set<BlockDeviceMapping> blockDeviceMapping) {
+ this.blockDeviceMapping = ImmutableSet.copyOf(blockDeviceMapping);
+ return this;
+ }
+
+ /**
+ * Block volumes that should be attached to the instance at boot time.
+ *
+ * @see <a href="http://docs.openstack.org/trunk/openstack-ops/content/attach_block_storage.html">Attach Block Storage<a/>
+ */
+ public Set<BlockDeviceMapping> getBlockDeviceMapping() {
+ return blockDeviceMapping;
+ }
+
public static class Builder {
/**
@@ -545,6 +572,14 @@ public class CreateServerOptions implements MapBinder {
CreateServerOptions options = new CreateServerOptions();
return options.availabilityZone(availabilityZone);
}
+
+ /**
+ * @see org.jclouds.openstack.nova.v2_0.options.CreateServerOptions#getBlockDeviceMapping()
+ */
+ public static CreateServerOptions blockDeviceMapping (Set<BlockDeviceMapping> blockDeviceMapping) {
+ CreateServerOptions options = new CreateServerOptions();
+ return options.blockDeviceMapping(blockDeviceMapping);
+ }
}
@Override
http://git-wip-us.apache.org/repos/asf/jclouds/blob/3f2b9376/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeAttachmentApiLiveTest.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeAttachmentApiLiveTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeAttachmentApiLiveTest.java
index 3c34563..dd7f39e 100644
--- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeAttachmentApiLiveTest.java
+++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/extensions/VolumeAttachmentApiLiveTest.java
@@ -23,9 +23,11 @@ import static org.testng.Assert.assertTrue;
import java.util.Set;
+import org.jclouds.openstack.nova.v2_0.domain.BlockDeviceMapping;
import org.jclouds.openstack.nova.v2_0.domain.Volume;
import org.jclouds.openstack.nova.v2_0.domain.VolumeAttachment;
import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiLiveTest;
+import org.jclouds.openstack.nova.v2_0.options.CreateServerOptions;
import org.jclouds.openstack.nova.v2_0.options.CreateVolumeOptions;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
@@ -34,6 +36,7 @@ import org.testng.annotations.Test;
import com.google.common.base.Objects;
import com.google.common.base.Optional;
import com.google.common.base.Predicate;
+import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
/**
@@ -148,7 +151,42 @@ public class VolumeAttachmentApiLiveTest extends BaseNovaApiLiveTest {
if (server_id != null)
api.getServerApi(region).delete(server_id);
}
+ }
+ }
+
+ @Test(dependsOnMethods = "testCreateVolume")
+ public void testAttachmentAtBoot() {
+ if (volumeApi.isPresent()) {
+ String server_id = null;
+ BlockDeviceMapping blockDeviceMapping = BlockDeviceMapping.createOptions(testVolume.getId(), "/dev/vdf").build();
+ try {
+ CreateServerOptions createServerOptions =
+ CreateServerOptions.Builder.blockDeviceMapping(ImmutableSet.of(blockDeviceMapping));
+ final String serverId = server_id = createServerInRegion(region, createServerOptions).getId();
+
+ Set<? extends VolumeAttachment> attachments = volumeAttachmentApi.get()
+ .listAttachmentsOnServer(serverId).toSet();
+ VolumeAttachment attachment = Iterables.getOnlyElement(attachments);
+
+ VolumeAttachment details = volumeAttachmentApi.get()
+ .getAttachmentForVolumeOnServer(attachment.getVolumeId(), serverId);
+ assertNotNull(details.getId()); // Probably same as volumeId? Not necessarily true though
+ assertEquals(details.getVolumeId(), testVolume.getId());
+ assertEquals(details.getDevice(), "/dev/vdf");
+ assertEquals(details.getServerId(), serverId);
+
+ assertEquals(volumeApi.get().get(testVolume.getId()).getStatus(), Volume.Status.IN_USE);
+
+ assertTrue(volumeAttachmentApi.get().detachVolumeFromServer(testVolume.getId(), serverId),
+ "Could not detach volume " + testVolume.getId() + " from server " + serverId);
+ assertEquals(volumeAttachmentApi.get().listAttachmentsOnServer(serverId).size(), 0,
+ "Number of volumes on server " + serverId + " was not zero.");
+ } finally {
+ if (server_id != null) {
+ api.getServerApi(region).delete(server_id);
+ }
+ }
}
}
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/3f2b9376/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ServerApiExpectTest.java
----------------------------------------------------------------------
diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ServerApiExpectTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ServerApiExpectTest.java
index e5fecfc..3092bb6 100644
--- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ServerApiExpectTest.java
+++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ServerApiExpectTest.java
@@ -23,6 +23,7 @@ import static org.testng.Assert.fail;
import org.jclouds.http.HttpRequest;
import org.jclouds.http.HttpResponse;
import org.jclouds.openstack.nova.v2_0.NovaApi;
+import org.jclouds.openstack.nova.v2_0.domain.BlockDeviceMapping;
import org.jclouds.openstack.nova.v2_0.domain.Server;
import org.jclouds.openstack.nova.v2_0.internal.BaseNovaApiExpectTest;
import org.jclouds.openstack.nova.v2_0.options.CreateServerOptions;
@@ -199,6 +200,32 @@ public class ServerApiExpectTest extends BaseNovaApiExpectTest {
new ParseCreatedServerTest().expected().toString());
}
+ public void testCreateServerWithAttachedDiskWhenResponseIs202() throws Exception {
+
+ HttpRequest createServer = HttpRequest
+ .builder()
+ .method("POST")
+ .endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/servers")
+ .addHeader("Accept", "application/json")
+ .addHeader("X-Auth-Token", authToken)
+ .payload(payloadFromStringWithContentType(
+ "{\"server\":{\"name\":\"test-e92\",\"imageRef\":\"1241\",\"flavorRef\":\"100\",\"block_device_mapping\":[{\"volume_size\":\"\",\"volume_id\":\"f0c907a5-a26b-48ba-b803-83f6b7450ba5\",\"delete_on_termination\":\"1\",\"device_name\":\"vdb\"}]}}", "application/json"))
+ .build();
+
+
+ HttpResponse createServerResponse = HttpResponse.builder().statusCode(202).message("HTTP/1.1 202 Accepted")
+ .payload(payloadFromResourceWithContentType("/new_server.json", "application/json; charset=UTF-8")).build();
+
+
+ NovaApi apiWithNewServer = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
+ responseWithKeystoneAccess, createServer, createServerResponse);
+
+ BlockDeviceMapping blockDeviceMapping = BlockDeviceMapping.createOptions("f0c907a5-a26b-48ba-b803-83f6b7450ba5", "vdb").deleteOnTermination(true).build();
+ assertEquals(apiWithNewServer.getServerApi("az-1.region-a.geo-1").create("test-e92", "1241",
+ "100", new CreateServerOptions().blockDeviceMapping(ImmutableSet.of(blockDeviceMapping))).toString(),
+ new ParseCreatedServerTest().expected().toString());
+ }
+
public void testCreateServerWithDiskConfigAuto() throws Exception {
HttpRequest createServer = HttpRequest.builder()
.method("POST")
[28/50] [abbrv] git commit: Prefer Charsets.UTF_8 over string literal
Posted by an...@apache.org.
Prefer Charsets.UTF_8 over string literal
Found with modernizer-maven-plugin.
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/12237728
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/12237728
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/12237728
Branch: refs/heads/fix-jclouds-538
Commit: 12237728523db0f6d759a61ab2e81fb656a2c2da
Parents: 3f2b937
Author: Andrew Gaul <ga...@apache.org>
Authored: Tue Sep 16 13:18:17 2014 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Thu Sep 18 18:11:19 2014 -0700
----------------------------------------------------------------------
.../java/org/jclouds/dynect/v3/config/DynECTHttpApiModule.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/12237728/providers/dynect/src/main/java/org/jclouds/dynect/v3/config/DynECTHttpApiModule.java
----------------------------------------------------------------------
diff --git a/providers/dynect/src/main/java/org/jclouds/dynect/v3/config/DynECTHttpApiModule.java b/providers/dynect/src/main/java/org/jclouds/dynect/v3/config/DynECTHttpApiModule.java
index e32b556..1d96c7b 100644
--- a/providers/dynect/src/main/java/org/jclouds/dynect/v3/config/DynECTHttpApiModule.java
+++ b/providers/dynect/src/main/java/org/jclouds/dynect/v3/config/DynECTHttpApiModule.java
@@ -54,6 +54,7 @@ import org.jclouds.io.ContentMetadataCodec;
import org.jclouds.rest.ConfiguresHttpApi;
import org.jclouds.rest.config.HttpApiModule;
+import com.google.common.base.Charsets;
import com.google.common.base.Function;
import com.google.common.base.Supplier;
import com.google.common.util.concurrent.ListeningExecutorService;
@@ -118,7 +119,7 @@ public class DynECTHttpApiModule extends HttpApiModule<DynECTApi> {
HttpResponse response = super.invoke(connection);
if (response.getStatusCode() == 200) {
byte[] data = closeClientButKeepContentStream(response);
- String message = data != null ? new String(data, "UTF-8") : null;
+ String message = data != null ? new String(data, Charsets.UTF_8) : null;
if (message != null && !message.startsWith("{\"status\": \"success\"")) {
response = response.toBuilder().statusCode(400).build();
}
[43/50] [abbrv] JCLOUDS-692 Remove the CloudSigma v1 provider.
Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToDriveInfo.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToDriveInfo.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToDriveInfo.java
deleted file mode 100644
index 9744bc3..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToDriveInfo.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import java.net.URI;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import javax.annotation.Resource;
-import javax.inject.Singleton;
-
-import org.jclouds.cloudsigma.domain.ClaimType;
-import org.jclouds.cloudsigma.domain.DriveInfo;
-import org.jclouds.cloudsigma.domain.DriveMetrics;
-import org.jclouds.cloudsigma.domain.DriveStatus;
-import org.jclouds.cloudsigma.domain.DriveType;
-import org.jclouds.logging.Logger;
-
-import com.google.common.base.Function;
-import com.google.common.base.Splitter;
-import com.google.common.collect.Maps;
-
-@Singleton
-public class MapToDriveInfo implements Function<Map<String, String>, DriveInfo> {
-
- @Resource
- protected Logger logger = Logger.NULL;
-
- @Override
- public DriveInfo apply(Map<String, String> from) {
- if (from.isEmpty())
- return null;
- DriveInfo.Builder builder = new DriveInfo.Builder();
- builder.name(from.get("name"));
- if (from.containsKey("use"))
- builder.use(Splitter.on(' ').split(from.get("use")));
- if (from.containsKey("status"))
- builder.status(DriveStatus.fromValue(from.get("status")));
- builder.metrics(buildMetrics(from));
- builder.user(from.get("user"));
- builder.encryptionCipher(from.get("encryption:cipher"));
- builder.uuid(from.get("drive"));
- if (from.containsKey("claim:type"))
- builder.claimType(ClaimType.fromValue(from.get("claim:type")));
- if (from.containsKey("claimed"))
- builder.claimed(Splitter.on(' ').split(from.get("claimed")));
- if (from.containsKey("tags"))
- builder.tags(Splitter.on(' ').split(from.get("tags")));
- if (from.containsKey("readers"))
- builder.readers(Splitter.on(' ').split(from.get("readers")));
- if (from.containsKey("size"))
- builder.size(Long.parseLong(from.get("size")));
- Map<String, String> metadata = Maps.newLinkedHashMap();
- for (Entry<String, String> entry : from.entrySet()) {
- if (entry.getKey().startsWith("user:"))
- metadata.put(entry.getKey().substring(entry.getKey().indexOf(':') + 1), entry.getValue());
- }
- if (from.containsKey("use"))
- builder.use(Splitter.on(' ').split(from.get("use")));
- if (from.containsKey("bits"))
- builder.bits(Integer.parseInt(from.get("bits")));
- if (from.containsKey("url"))
- builder.url(URI.create(from.get("url")));
- builder.encryptionKey(from.get("encryption:key"));
- builder.description(from.get("description"));
- builder.installNotes(from.get("install_notes"));
- builder.os(from.get("os"));
- if (from.containsKey("drive_type"))
- builder.driveType(Splitter.on(',').split(from.get("drive_type")));
- if (from.containsKey("autoexpanding"))
- builder.autoexpanding(Boolean.valueOf(from.get("autoexpanding")));
- if (from.containsKey("free"))
- builder.free(Boolean.valueOf(from.get("free")));
- if (from.containsKey("type"))
- builder.type(DriveType.fromValue(from.get("type")));
- try {
- return builder.build();
- } catch (NullPointerException e) {
- logger.trace("entry missing data: %s; %s", e.getMessage(), from);
- return null;
- }
- }
-
- protected DriveMetrics buildMetrics(Map<String, String> from) {
- DriveMetrics.Builder metricsBuilder = new DriveMetrics.Builder();
- if (from.containsKey("read:bytes"))
- metricsBuilder.readBytes(Long.parseLong(from.get("read:bytes")));
- if (from.containsKey("read:requests"))
- metricsBuilder.readRequests(Long.parseLong(from.get("read:requests")));
- if (from.containsKey("write:bytes"))
- metricsBuilder.writeBytes(Long.parseLong(from.get("write:bytes")));
- if (from.containsKey("write:requests"))
- metricsBuilder.writeRequests(Long.parseLong(from.get("write:requests")));
- return metricsBuilder.build();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToDriveMetrics.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToDriveMetrics.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToDriveMetrics.java
deleted file mode 100644
index c5aef9d..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToDriveMetrics.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import java.util.Map;
-
-import javax.inject.Singleton;
-
-import org.jclouds.cloudsigma.domain.DriveMetrics;
-
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableMap.Builder;
-
-@Singleton
-public class MapToDriveMetrics implements Function<Map<String, String>, Map<String, ? extends DriveMetrics>> {
-
- public Map<String, ? extends DriveMetrics> apply(Map<String, String> from) {
- Builder<String, DriveMetrics> builder = ImmutableMap.builder();
- addIDEDevices(from, builder);
- addSCSIDevices(from, builder);
- addBlockDevices(from, builder);
- return builder.build();
- }
-
- protected void addBlockDevices(Map<String, String> from, Builder<String, DriveMetrics> devices) {
- BLOCK: for (int index : new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }) {
- String key = String.format("block:0:%d", index);
- if (!from.containsKey(key))
- break BLOCK;
- devices.put(key, buildMetrics(key, from));
- }
- }
-
- protected void addSCSIDevices(Map<String, String> from, Builder<String, DriveMetrics> devices) {
- SCSI: for (int unit : new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }) {
- String key = String.format("scsi:0:%d", unit);
- if (!from.containsKey(key))
- break SCSI;
- devices.put(key, buildMetrics(key, from));
- }
- }
-
- protected void addIDEDevices(Map<String, String> from, Builder<String, DriveMetrics> devices) {
- IDE: for (int bus : new int[] { 0, 1 })
- for (int unit : new int[] { 0, 1 }) {
- String key = String.format("ide:%d:%d", bus, unit);
- if (!from.containsKey(key))
- break IDE;
- devices.put(key, buildMetrics(key, from));
- }
- }
-
- protected DriveMetrics buildMetrics(String key, Map<String, String> from) {
- DriveMetrics.Builder builder = new DriveMetrics.Builder();
- if (from.containsKey(key + ":read:bytes"))
- builder.readBytes(Long.parseLong(from.get(key + ":read:bytes")));
- if (from.containsKey(key + ":read:requests"))
- builder.readRequests(Long.parseLong(from.get(key + ":read:requests")));
- if (from.containsKey(key + ":write:bytes"))
- builder.writeBytes(Long.parseLong(from.get(key + ":write:bytes")));
- if (from.containsKey(key + ":write:requests"))
- builder.writeRequests(Long.parseLong(from.get(key + ":write:requests")));
- return builder.build();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToNICs.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToNICs.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToNICs.java
deleted file mode 100644
index 76f2461..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToNICs.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import java.util.List;
-import java.util.Map;
-
-import javax.inject.Singleton;
-
-import org.jclouds.cloudsigma.domain.Model;
-import org.jclouds.cloudsigma.domain.NIC;
-
-import com.google.common.base.Function;
-import com.google.common.base.Splitter;
-import com.google.common.collect.ImmutableList;
-
-@Singleton
-public class MapToNICs implements Function<Map<String, String>, List<NIC>> {
-
- @Override
- public List<NIC> apply(Map<String, String> from) {
- ImmutableList.Builder<NIC> nics = ImmutableList.builder();
- NIC: for (int id : new int[] { 0, 1 }) {
- String key = String.format("nic:%d", id);
- if (!from.containsKey(key + ":model"))
- break NIC;
- NIC.Builder nicBuilder = new NIC.Builder();
- nicBuilder.dhcp(from.get(key + ":dhcp"));
- nicBuilder.model(Model.fromValue(from.get(key + ":model")));
- nicBuilder.vlan(from.get(key + ":vlan"));
- nicBuilder.mac(from.get(key + ":mac"));
- if (from.containsKey(key + ":block"))
- nicBuilder.block(Splitter.on(' ').split(from.get(key + ":block")));
- nics.add(nicBuilder.build());
- }
- return nics.build();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToProfileInfo.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToProfileInfo.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToProfileInfo.java
deleted file mode 100644
index 50d24e4..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToProfileInfo.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import java.util.Map;
-
-import javax.annotation.Resource;
-import javax.inject.Singleton;
-
-import org.jclouds.cloudsigma.domain.ProfileInfo;
-import org.jclouds.cloudsigma.domain.ProfileType;
-import org.jclouds.logging.Logger;
-
-import com.google.common.base.Function;
-
-@Singleton
-public class MapToProfileInfo implements Function<Map<String, String>, ProfileInfo> {
-
- @Resource
- protected Logger logger = Logger.NULL;
-
- @Override
- public ProfileInfo apply(Map<String, String> from) {
- if (from.isEmpty())
- return null;
- ProfileInfo.Builder builder = new ProfileInfo.Builder();
- builder.uuid(from.get("uuid"));
- builder.email(from.get("email"));
- builder.firstName(from.get("first_name"));
- builder.lastName(from.get("last_name"));
- builder.nickName(from.get("nick_name"));
- builder.type(ProfileType.fromValue(from.get("type")));
- try {
- return builder.build();
- } catch (NullPointerException e) {
- logger.trace("entry missing data: %s; %s", e.getMessage(), from);
- return null;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToServerInfo.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToServerInfo.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToServerInfo.java
deleted file mode 100644
index 6a493d0..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToServerInfo.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.cloudsigma.domain.Device;
-import org.jclouds.cloudsigma.domain.NIC;
-import org.jclouds.cloudsigma.domain.ServerInfo;
-import org.jclouds.cloudsigma.domain.ServerMetrics;
-import org.jclouds.cloudsigma.domain.ServerStatus;
-import org.jclouds.cloudsigma.domain.VNC;
-
-import com.google.common.base.Function;
-import com.google.common.base.Splitter;
-import com.google.common.collect.Maps;
-
-@Singleton
-public class MapToServerInfo implements Function<Map<String, String>, ServerInfo> {
- private final Function<Map<String, String>, Map<String, ? extends Device>> mapToDevices;
- private final Function<Map<String, String>, ServerMetrics> mapToMetrics;
- private final Function<Map<String, String>, List<NIC>> mapToNICs;
-
- @Inject
- public MapToServerInfo(Function<Map<String, String>, Map<String, ? extends Device>> mapToDevices,
- Function<Map<String, String>, ServerMetrics> mapToMetrics, Function<Map<String, String>, List<NIC>> mapToNICs) {
- this.mapToDevices = mapToDevices;
- this.mapToMetrics = mapToMetrics;
- this.mapToNICs = mapToNICs;
- }
-
- @Override
- public ServerInfo apply(Map<String, String> from) {
- if (from.isEmpty())
- return null;
- ServerInfo.Builder builder = new ServerInfo.Builder();
- builder.name(from.get("name"));
- builder.description(from.get("description"));
- builder.persistent(Boolean.parseBoolean(from.get("persistent")));
- if (from.containsKey("use"))
- builder.use(Splitter.on(' ').split(from.get("use")));
- if (from.containsKey("status"))
- builder.status(ServerStatus.fromValue(from.get("status")));
- if (from.containsKey("smp") && !"auto".equals(from.get("smp")))
- builder.smp(Integer.parseInt(from.get("smp")));
- builder.cpu(Integer.parseInt(from.get("cpu")));
- builder.mem(Integer.parseInt(from.get("mem")));
- builder.user(from.get("user"));
- if (from.containsKey("started"))
- builder.started(new Date(Long.parseLong(from.get("started"))));
- builder.uuid(from.get("server"));
- builder.vnc(new VNC(from.get("vnc:ip"), from.get("vnc:password"), from.containsKey("vnc:tls")
- && Boolean.valueOf(from.get("vnc:tls"))));
- if (from.containsKey("boot"))
- builder.bootDeviceIds(Splitter.on(' ').split(from.get("boot")));
-
- Map<String, String> metadata = Maps.newLinkedHashMap();
- for (Entry<String, String> entry : from.entrySet()) {
- if (entry.getKey().startsWith("user:"))
- metadata.put(entry.getKey().substring(entry.getKey().indexOf(':') + 1), entry.getValue());
- }
- builder.nics(mapToNICs.apply(from));
- builder.devices(mapToDevices.apply(from));
- builder.metrics(mapToMetrics.apply(from));
- return builder.build();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToServerMetrics.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToServerMetrics.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToServerMetrics.java
deleted file mode 100644
index 3138b0e..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToServerMetrics.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import java.util.Map;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.cloudsigma.domain.DriveMetrics;
-import org.jclouds.cloudsigma.domain.ServerMetrics;
-
-import com.google.common.base.Function;
-
-@Singleton
-public class MapToServerMetrics implements Function<Map<String, String>, ServerMetrics> {
- private final Function<Map<String, String>, Map<String, ? extends DriveMetrics>> mapToDriveMetrics;
-
- @Inject
- public MapToServerMetrics(Function<Map<String, String>, Map<String, ? extends DriveMetrics>> mapToDriveMetrics) {
- this.mapToDriveMetrics = mapToDriveMetrics;
- }
-
- public ServerMetrics apply(Map<String, String> from) {
- ServerMetrics.Builder metricsBuilder = new ServerMetrics.Builder();
- if (from.containsKey("tx:packets"))
- metricsBuilder.txPackets(Long.parseLong(from.get("tx:packets")));
- if (from.containsKey("tx"))
- metricsBuilder.tx(Long.parseLong(from.get("tx")));
- if (from.containsKey("rx:packets"))
- metricsBuilder.rxPackets(Long.parseLong(from.get("rx:packets")));
- if (from.containsKey("rx"))
- metricsBuilder.rx(Long.parseLong(from.get("rx")));
- metricsBuilder.driveMetrics(mapToDriveMetrics.apply(from));
-
- ServerMetrics metrics = metricsBuilder.build();
- return metrics;
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToStaticIPInfo.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToStaticIPInfo.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToStaticIPInfo.java
deleted file mode 100644
index 0a18cfa..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToStaticIPInfo.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import java.util.Map;
-
-import javax.annotation.Resource;
-import javax.inject.Singleton;
-
-import org.jclouds.cloudsigma.domain.StaticIPInfo;
-import org.jclouds.logging.Logger;
-
-import com.google.common.base.Function;
-import com.google.common.base.Splitter;
-
-@Singleton
-public class MapToStaticIPInfo implements Function<Map<String, String>, StaticIPInfo> {
-
- @Resource
- protected Logger logger = Logger.NULL;
-
- @Override
- public StaticIPInfo apply(Map<String, String> from) {
- if (from.isEmpty())
- return null;
- StaticIPInfo.Builder builder = new StaticIPInfo.Builder();
- builder.ip(from.get("resource"));
- builder.user(from.get("user"));
- builder.netmask(from.get("netmask"));
- builder.nameservers(Splitter.on(' ').split(from.get("nameserver")));
- builder.gateway(from.get("gateway"));
-
- try {
- return builder.build();
- } catch (NullPointerException e) {
- logger.trace("entry missing data: %s; %s", e.getMessage(), from);
- return null;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToVLANInfo.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToVLANInfo.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToVLANInfo.java
deleted file mode 100644
index 6b404e3..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToVLANInfo.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import java.util.Map;
-
-import javax.annotation.Resource;
-import javax.inject.Singleton;
-
-import org.jclouds.cloudsigma.domain.VLANInfo;
-import org.jclouds.logging.Logger;
-
-import com.google.common.base.Function;
-
-@Singleton
-public class MapToVLANInfo implements Function<Map<String, String>, VLANInfo> {
-
- @Resource
- protected Logger logger = Logger.NULL;
-
- @Override
- public VLANInfo apply(Map<String, String> from) {
- if (from.isEmpty())
- return null;
- VLANInfo.Builder builder = new VLANInfo.Builder();
- builder.uuid(from.get("resource"));
- builder.name(from.get("name"));
- builder.user(from.get("user"));
- try {
- return builder.build();
- } catch (NullPointerException e) {
- logger.trace("entry missing data: %s; %s", e.getMessage(), from);
- return null;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ReturnPayload.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ReturnPayload.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ReturnPayload.java
deleted file mode 100644
index 922599d..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ReturnPayload.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import javax.inject.Singleton;
-
-import org.jclouds.http.HttpResponse;
-import org.jclouds.io.Payload;
-
-import com.google.common.base.Function;
-
-@Singleton
-public class ReturnPayload implements Function<HttpResponse, Payload> {
-
- public Payload apply(HttpResponse from) {
- return from.getPayload();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ServerToMap.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ServerToMap.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ServerToMap.java
deleted file mode 100644
index c529db3..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ServerToMap.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Map;
-import java.util.Map.Entry;
-
-import javax.inject.Singleton;
-
-import org.jclouds.cloudsigma.domain.Device;
-import org.jclouds.cloudsigma.domain.NIC;
-import org.jclouds.cloudsigma.domain.Server;
-
-import com.google.common.base.Function;
-import com.google.common.base.Joiner;
-import com.google.common.collect.ImmutableMap;
-
-@Singleton
-public class ServerToMap implements Function<Server, Map<String, String>> {
- @Override
- public Map<String, String> apply(Server from) {
- checkNotNull(from, "server");
- ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
- builder.put("name", from.getName());
- builder.put("cpu", from.getCpu() + "");
- if (from.getSmp() != null)
- builder.put("smp", from.getSmp() + "");
- else
- builder.put("smp", "auto");
- builder.put("mem", from.getMem() + "");
- builder.put("persistent", from.isPersistent() + "");
- if (!from.getBootDeviceIds().isEmpty())
- builder.put("boot", Joiner.on(' ').join(from.getBootDeviceIds()));
- for (Entry<String, ? extends Device> entry : from.getDevices().entrySet()) {
- builder.put(entry.getKey(), entry.getValue().getDriveUuid());
- builder.put(entry.getKey() + ":media", entry.getValue().getMediaType().toString());
- }
- int nicId = 0;
- for (NIC nic : from.getNics()) {
- builder.put("nic:" + nicId + ":model", nic.getModel().toString());
- if (nic.getDhcp() != null)
- builder.put("nic:" + nicId + ":dhcp", nic.getDhcp());
- if (nic.getVlan() != null)
- builder.put("nic:" + nicId + ":vlan", nic.getVlan());
- if (nic.getMac() != null)
- builder.put("nic:" + nicId + ":mac", nic.getMac());
- nicId++;
- }
- builder.put("vnc:ip", from.getVnc().getIp() == null ? "auto" : from.getVnc().getIp());
- if (from.getVnc().getPassword() != null)
- builder.put("vnc:password", from.getVnc().getPassword());
- if (from.getVnc().isTls())
- builder.put("vnc:tls", "on");
- if (!from.getUse().isEmpty())
- builder.put("use", Joiner.on(' ').join(from.getUse()));
- return builder.build();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/SplitNewlines.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/SplitNewlines.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/SplitNewlines.java
deleted file mode 100644
index f90584c..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/SplitNewlines.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import static com.google.common.collect.Sets.newTreeSet;
-
-import java.util.Set;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ReturnStringIf2xx;
-
-import com.google.common.base.Function;
-import com.google.common.base.Splitter;
-
-@Singleton
-public class SplitNewlines implements Function<HttpResponse, Set<String>> {
- private final ReturnStringIf2xx returnStringIf200;
-
- @Inject
- protected SplitNewlines(ReturnStringIf2xx returnStringIf200) {
- this.returnStringIf200 = returnStringIf200;
- }
-
- @Override
- public Set<String> apply(HttpResponse response) {
- return newTreeSet(Splitter.on('\n').omitEmptyStrings().split(returnStringIf200.apply(response)));
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/SplitNewlinesAndReturnSecondField.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/SplitNewlinesAndReturnSecondField.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/SplitNewlinesAndReturnSecondField.java
deleted file mode 100644
index cf118cc..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/SplitNewlinesAndReturnSecondField.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import java.util.Set;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ReturnStringIf2xx;
-
-import com.google.common.base.Function;
-import com.google.common.base.Predicates;
-import com.google.common.base.Splitter;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Iterables;
-
-@Singleton
-public class SplitNewlinesAndReturnSecondField extends SplitNewlines {
-
- @Inject
- SplitNewlinesAndReturnSecondField(ReturnStringIf2xx returnStringIf200) {
- super(returnStringIf200);
- }
-
- @Override
- public Set<String> apply(HttpResponse response) {
- return ImmutableSet.copyOf(Iterables.filter(
- Iterables.transform(super.apply(response), new Function<String, String>() {
-
- @Override
- public String apply(String arg0) {
- if (arg0 == null)
- return null;
- Iterable<String> parts = Splitter.on(' ').split(arg0);
- if (Iterables.size(parts) == 2)
- return Iterables.get(parts, 1);
- else if (Iterables.size(parts) == 1)
- return Iterables.get(parts, 0);
- return null;
- }
-
- }), Predicates.notNull()));
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/handlers/CloudSigmaErrorHandler.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/handlers/CloudSigmaErrorHandler.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/handlers/CloudSigmaErrorHandler.java
deleted file mode 100644
index 56d9aa3..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/handlers/CloudSigmaErrorHandler.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.handlers;
-
-import java.io.IOException;
-
-import javax.annotation.Resource;
-import javax.inject.Singleton;
-
-import org.jclouds.http.HttpCommand;
-import org.jclouds.http.HttpErrorHandler;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.HttpResponseException;
-import org.jclouds.logging.Logger;
-import org.jclouds.rest.AuthorizationException;
-import org.jclouds.rest.ResourceNotFoundException;
-import org.jclouds.util.Closeables2;
-import org.jclouds.util.Strings2;
-
-import com.google.common.base.Throwables;
-
-/**
- * This will parse and set an appropriate exception on the command object.
- *
- * <p/>
- * Errors are returned with an appropriate HTTP status code, an X-Elastic- Error header specifying
- * the error type, and a text description in the HTTP body.
- */
-@Singleton
-public class CloudSigmaErrorHandler implements HttpErrorHandler {
- @Resource
- protected Logger logger = Logger.NULL;
-
- public void handleError(HttpCommand command, HttpResponse response) {
- // it is important to always read fully and close streams
- String message = parseMessage(response);
- Exception exception = message != null ? new HttpResponseException(command, response, message)
- : new HttpResponseException(command, response);
- try {
- message = message != null ? message : String.format("%s -> %s", command.getCurrentRequest().getRequestLine(),
- response.getStatusLine());
- switch (response.getStatusCode()) {
- case 400:
- if ((command.getCurrentRequest().getEndpoint().getPath().endsWith("/info"))
- || (message != null && message.indexOf("could not be found") != -1))
- exception = new ResourceNotFoundException(message, exception);
- else if (message != null && message.indexOf("currently in use") != -1)
- exception = new IllegalStateException(message, exception);
- else
- exception = new IllegalArgumentException(message, exception);
- break;
- case 401:
- exception = new AuthorizationException(message, exception);
- break;
- case 404:
- if (!command.getCurrentRequest().getMethod().equals("DELETE")) {
- exception = new ResourceNotFoundException(message, exception);
- }
- break;
- case 405:
- exception = new IllegalArgumentException(message, exception);
- break;
- case 409:
- exception = new IllegalStateException(message, exception);
- break;
- }
- } finally {
- Closeables2.closeQuietly(response.getPayload());
- command.setException(exception);
- }
- }
-
- public String parseMessage(HttpResponse response) {
- if (response.getPayload() == null)
- return null;
- try {
- return Strings2.toStringAndClose(response.getPayload().openStream());
- } catch (IOException e) {
- throw new RuntimeException(e);
- } finally {
- try {
- response.getPayload().getInput().close();
- } catch (IOException e) {
- Throwables.propagate(e);
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/options/CloneDriveOptions.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/options/CloneDriveOptions.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/options/CloneDriveOptions.java
deleted file mode 100644
index b984d0a..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/options/CloneDriveOptions.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.options;
-
-import static com.google.common.base.Preconditions.checkArgument;
-
-import java.util.HashSet;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.jclouds.cloudsigma.domain.AffinityType;
-
-import com.google.common.base.Joiner;
-import com.google.common.base.Splitter;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
-
-/**
- * Contains options supported for clone drive operations. <h2>
- * Usage</h2> The recommended way to instantiate a CloneDriveOptions object is to statically import
- * CloneDriveOptions.Builder.* and invoke a static creation method followed by an instance mutator
- * (if needed):
- * <p/>
- * <code>
- * import static org.jclouds.cloudsigma.options.CloneDriveOptions.Builder.*;
- *
- *
- * Payload payload = client.cloneDrive("drive-uuid","newName", size(2*1024*1024l));
- * <code>
- */
-public class CloneDriveOptions {
- private static final String SSD_AFFINITY_TAG = "affinity:ssd";
- private final Map<String, String> options = Maps.newLinkedHashMap();
-
- /**
- * adjust to new size in bytes
- */
- public CloneDriveOptions size(long size) {
- checkArgument(size >= 0, "size must be >= 0");
- options.put("size", size + "");
- return this;
- }
-
- public CloneDriveOptions tags(String... tags) {
- // Affinity is conveyed using regular tags; make sure to preserve any already-set affinity tag.
- String currentTagsString = options.remove("tags");
- Set<String> currentTags = (currentTagsString == null) ? new HashSet<String>() :
- Sets.newLinkedHashSet(Splitter.on(' ').split(currentTagsString));
-
- Set<String> newTags = Sets.newLinkedHashSet();
- for (String tag : tags)
- newTags.add(tag);
-
- if (currentTags.contains(SSD_AFFINITY_TAG))
- newTags.add(SSD_AFFINITY_TAG);
-
- options.put("tags", Joiner.on(' ').join(newTags));
- return this;
- }
-
- /**
- * Specifies whether the new drive has 'HDD' affinity (the default) or 'SSD' (for solid-state drives).
- * Affinity is conveyed via a special value among the drive's tags.
- */
- public CloneDriveOptions affinity(AffinityType affinity) {
- // Affinity is conveyed using regular tags; make sure to avoid multiple affinity tags in the options.
- String currentTagsString = options.remove("tags");
- Set<String> tags = (currentTagsString == null) ? new LinkedHashSet<String>() :
- Sets.newLinkedHashSet(Splitter.on(' ').split(currentTagsString));
-
- switch (affinity) {
- // SSD affinity is conveyed as a special tag: "affinity:ssd".
- case SSD:
- tags.add(SSD_AFFINITY_TAG);
- break;
-
- // HDD affinity (the default) is conveyed by the *absence* of the "affinity:ssd" tag.
- case HDD:
- tags.remove(SSD_AFFINITY_TAG);
- break;
- }
-
- if (!tags.isEmpty())
- options.put("tags", Joiner.on(' ').join(tags));
-
- return this;
- }
-
- public static class Builder {
-
- /**
- * @see CloneDriveOptions#size
- */
- public static CloneDriveOptions size(long size) {
- CloneDriveOptions options = new CloneDriveOptions();
- return options.size(size);
- }
-
- /**
- * @see CloneDriveOptions#tags
- */
- public static CloneDriveOptions tags(String... tags) {
- CloneDriveOptions options = new CloneDriveOptions();
- return options.tags(tags);
- }
-
- /**
- * @see CloneDriveOptions#affinity
- */
- public static CloneDriveOptions affinity(AffinityType affinity) {
- CloneDriveOptions options = new CloneDriveOptions();
- return options.affinity(affinity);
- }
-
- }
-
- public Map<String, String> getOptions() {
- return ImmutableMap.copyOf(options);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/predicates/DriveClaimed.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/predicates/DriveClaimed.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/predicates/DriveClaimed.java
deleted file mode 100644
index ce1b95b..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/predicates/DriveClaimed.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.predicates;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.annotation.Resource;
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.cloudsigma.CloudSigmaApi;
-import org.jclouds.cloudsigma.domain.DriveInfo;
-import org.jclouds.logging.Logger;
-
-import com.google.common.base.Predicate;
-
-@Singleton
-public class DriveClaimed implements Predicate<DriveInfo> {
-
- private final CloudSigmaApi client;
-
- @Resource
- protected Logger logger = Logger.NULL;
-
- @Inject
- public DriveClaimed(CloudSigmaApi client) {
- this.client = client;
- }
-
- public boolean apply(DriveInfo drive) {
- logger.trace("looking for claims on drive %s", checkNotNull(drive, "drive"));
- drive = refresh(drive);
- if (drive == null)
- return false;
- logger.trace("%s: looking for drive claims: currently: %s", drive.getUuid(), drive.getClaimed());
- return !drive.getClaimed().isEmpty();
- }
-
- private DriveInfo refresh(DriveInfo drive) {
- return client.getDriveInfo(drive.getUuid());
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/reference/CloudSigmaConstants.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/reference/CloudSigmaConstants.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/reference/CloudSigmaConstants.java
deleted file mode 100644
index e05cc42..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/reference/CloudSigmaConstants.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.reference;
-
-public final class CloudSigmaConstants {
-
- /**
- * default VNC password used on new machines
- */
- public static final String PROPERTY_VNC_PASSWORD = "jclouds.cloudsigma.vnc-password";
-
- private CloudSigmaConstants() {
- throw new AssertionError("intentionally unimplemented");
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/util/Servers.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/util/Servers.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/util/Servers.java
deleted file mode 100644
index d4fa25a..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/util/Servers.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.util;
-
-import org.jclouds.cloudsigma.domain.IDEDevice;
-import org.jclouds.cloudsigma.domain.Model;
-import org.jclouds.cloudsigma.domain.NIC;
-import org.jclouds.cloudsigma.domain.Server;
-import org.jclouds.cloudsigma.domain.VNC;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-
-public class Servers {
- /**
- * Helper to create a small persistent server
- *
- * @param name
- * what to name the server
- * @param driveUuuid
- * id of the boot drive
- * @param vncPassword
- * password for vnc
- * @return a builder for a persistent 1Ghz 512m server with DHCP enabled network.
- */
- public static Server.Builder small(String name, String driveUuuid, String vncPassword) {
- return smallWithStaticIP(name, driveUuuid, vncPassword, "auto");
- }
-
- /**
- * Helper to create a small persistent server
- *
- * @param name
- * what to name the server
- * @param driveUuuid
- * id of the boot drive
- * @param vncPassword
- * password for vnc
- * @param ip
- * static IP
- * @return a builder for a persistent 1Ghz 512m server with DHCP enabled network.
- */
- public static Server.Builder smallWithStaticIP(String name, String driveUuuid, String vncPassword, String ip) {
- return new Server.Builder().name(name).cpu(1000).mem(512).persistent(true)
- .devices(ImmutableMap.of("ide:0:0", new IDEDevice.Builder(0, 0).uuid(driveUuuid).build()))
- .bootDeviceIds(ImmutableSet.of("ide:0:0"))
- .nics(ImmutableSet.of(new NIC.Builder().model(Model.E1000).dhcp(ip).build()))
- .vnc(new VNC(null, vncPassword, false));
- }
-
- /**
- * Takes the input server and changes its primary ip to a new address. To make this happen,
- * you'll need to invoke {@link org.jclouds.cloudsigma.CloudSigmaApi#setServerConfiguration}
- *
- * @param in
- * server to change
- * @param ip
- * new ip address
- * @return server with its primary nic set to the new address.
- */
- public static Server changeIP(Server in, String ip) {
- return Server.Builder.fromServer(in).nics(ImmutableSet.of(new NIC.Builder().model(Model.E1000).dhcp(ip).build()))
- .build();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata b/apis/cloudsigma/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
deleted file mode 100644
index 768b102..0000000
--- a/apis/cloudsigma/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
+++ /dev/null
@@ -1 +0,0 @@
-org.jclouds.cloudsigma.CloudSigmaApiMetadata
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/CloudSigmaApiMetadataTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/CloudSigmaApiMetadataTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/CloudSigmaApiMetadataTest.java
deleted file mode 100644
index adfb1c5..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/CloudSigmaApiMetadataTest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma;
-
-import org.jclouds.compute.internal.BaseComputeServiceApiMetadataTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "CloudSigmaApiMetadataTest")
-public class CloudSigmaApiMetadataTest extends BaseComputeServiceApiMetadataTest {
-
- public CloudSigmaApiMetadataTest() {
- super(new CloudSigmaApiMetadata());
- }
-}
[47/50] [abbrv] git commit: JCLOUDS-735 Remove ninefold providers.
Posted by an...@apache.org.
JCLOUDS-735 Remove ninefold providers.
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/a32292fa
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/a32292fa
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/a32292fa
Branch: refs/heads/fix-jclouds-538
Commit: a32292fa0553a8c2b6c4a0fd357fe0ba18d3e01d
Parents: f7aea98
Author: Adrian Cole <ad...@gmail.com>
Authored: Tue Sep 30 15:43:01 2014 -0700
Committer: Jeremy Daggett <jd...@apache.org>
Committed: Thu Oct 2 10:54:50 2014 -0700
----------------------------------------------------------------------
allblobstore/pom.xml | 5 -
allcompute/pom.xml | 5 -
providers/ninefold-compute/pom.xml | 126 -------------------
.../NinefoldComputeProviderMetadata.java | 86 -------------
.../org.jclouds.providers.ProviderMetadata | 1 -
.../compute/NinefoldComputeProviderTest.java | 33 -----
.../compute/NinefoldComputeServiceLiveTest.java | 28 -----
.../NinefoldComputeTemplateBuilderLiveTest.java | 91 --------------
providers/ninefold-storage/pom.xml | 120 ------------------
.../NinefoldStorageProviderMetadata.java | 79 ------------
.../org.jclouds.providers.ProviderMetadata | 1 -
.../storage/NinefoldStorageAsyncClientTest.java | 29 -----
.../storage/NinefoldStorageClientLiveTest.java | 30 -----
.../storage/NinefoldStorageProviderTest.java | 33 -----
.../NinefoldStorageBlobIntegrationLiveTest.java | 28 -----
.../NinefoldStorageBlobLiveTest.java | 28 -----
.../NinefoldStorageBlobSignerLiveTest.java | 28 -----
...foldStorageContainerIntegrationLiveTest.java | 28 -----
.../NinefoldStorageContainerLiveTest.java | 28 -----
...nefoldStorageServiceIntegrationLiveTest.java | 37 ------
providers/pom.xml | 2 -
21 files changed, 846 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a32292fa/allblobstore/pom.xml
----------------------------------------------------------------------
diff --git a/allblobstore/pom.xml b/allblobstore/pom.xml
index f943cdc..6bc82cc 100644
--- a/allblobstore/pom.xml
+++ b/allblobstore/pom.xml
@@ -40,11 +40,6 @@
</dependency>
<dependency>
<groupId>org.apache.jclouds.provider</groupId>
- <artifactId>ninefold-storage</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.provider</groupId>
<artifactId>cloudonestorage</artifactId>
<version>${project.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a32292fa/allcompute/pom.xml
----------------------------------------------------------------------
diff --git a/allcompute/pom.xml b/allcompute/pom.xml
index 488a108..4b61b0a 100644
--- a/allcompute/pom.xml
+++ b/allcompute/pom.xml
@@ -140,11 +140,6 @@
</dependency>
<dependency>
<groupId>org.apache.jclouds.provider</groupId>
- <artifactId>ninefold-compute</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.provider</groupId>
<artifactId>hpcloud-compute</artifactId>
<version>${project.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a32292fa/providers/ninefold-compute/pom.xml
----------------------------------------------------------------------
diff --git a/providers/ninefold-compute/pom.xml b/providers/ninefold-compute/pom.xml
deleted file mode 100644
index a0a0f54..0000000
--- a/providers/ninefold-compute/pom.xml
+++ /dev/null
@@ -1,126 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-project</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- <relativePath>../../project/pom.xml</relativePath>
- </parent>
- <groupId>org.apache.jclouds.provider</groupId>
- <artifactId>ninefold-compute</artifactId>
- <name>jclouds Ninefold Compute provider</name>
- <description>Ninefold Compute powered by CloudStack</description>
- <packaging>bundle</packaging>
-
- <properties>
- <test.ninefold-compute.endpoint>https://api.ninefold.com/compute/v1.0/</test.ninefold-compute.endpoint>
- <test.ninefold-compute.api-version>2.2.12</test.ninefold-compute.api-version>
- <test.ninefold-compute.build-version />
- <test.ninefold-compute.identity>FIXME_IDENTITY</test.ninefold-compute.identity>
- <test.ninefold-compute.credential>FIXME_CREDENTIAL</test.ninefold-compute.credential>
- <test.ninefold-compute.template />
- <jclouds.osgi.export>org.jclouds.ninefold.compute*;version="${project.version}"</jclouds.osgi.export>
- <jclouds.osgi.import>
- org.jclouds.compute.internal;version="${project.version}",
- org.jclouds.rest.internal;version="${project.version}",
- org.jclouds*;version="${project.version}",
- *
- </jclouds.osgi.import>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>cloudstack</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>cloudstack</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-compute</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.driver</groupId>
- <artifactId>jclouds-log4j</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.driver</groupId>
- <artifactId>jclouds-sshj</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>live</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <executions>
- <execution>
- <id>integration</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <threadCount>1</threadCount>
- <systemPropertyVariables>
- <test.ninefold-compute.endpoint>${test.ninefold-compute.endpoint}</test.ninefold-compute.endpoint>
- <test.ninefold-compute.api-version>${test.ninefold-compute.api-version}</test.ninefold-compute.api-version>
- <test.ninefold-compute.build-version>${test.ninefold-compute.build-version}</test.ninefold-compute.build-version>
- <test.ninefold-compute.identity>${test.ninefold-compute.identity}</test.ninefold-compute.identity>
- <test.ninefold-compute.credential>${test.ninefold-compute.credential}</test.ninefold-compute.credential>
- <test.ninefold-compute.template>${test.ninefold-compute.template}</test.ninefold-compute.template>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-
-</project>
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a32292fa/providers/ninefold-compute/src/main/java/org/jclouds/ninefold/compute/NinefoldComputeProviderMetadata.java
----------------------------------------------------------------------
diff --git a/providers/ninefold-compute/src/main/java/org/jclouds/ninefold/compute/NinefoldComputeProviderMetadata.java b/providers/ninefold-compute/src/main/java/org/jclouds/ninefold/compute/NinefoldComputeProviderMetadata.java
deleted file mode 100644
index ca1f685..0000000
--- a/providers/ninefold-compute/src/main/java/org/jclouds/ninefold/compute/NinefoldComputeProviderMetadata.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.ninefold.compute;
-
-import static org.jclouds.compute.config.ComputeServiceProperties.TEMPLATE;
-
-import java.net.URI;
-import java.util.Properties;
-
-import org.jclouds.cloudstack.CloudStackApiMetadata;
-import org.jclouds.providers.ProviderMetadata;
-import org.jclouds.providers.internal.BaseProviderMetadata;
-
-/**
- * Implementation of {@link org.jclouds.types.ProviderMetadata} for Ninefold
- * Compute.
- */
-public class NinefoldComputeProviderMetadata extends BaseProviderMetadata {
-
- public static Builder builder() {
- return new Builder();
- }
-
- @Override
- public Builder toBuilder() {
- return builder().fromProviderMetadata(this);
- }
-
- public NinefoldComputeProviderMetadata() {
- super(builder());
- }
-
- public NinefoldComputeProviderMetadata(Builder builder) {
- super(builder);
- }
-
- public static Properties defaultProperties() {
- Properties properties = new Properties();
- // https://ninefold.com/support/display/SPT/Ubuntu+10.04+64+Bit+Micro+Server+with+CHEF
- properties.setProperty(TEMPLATE, "imageNameMatches=.*Micro.*,osFamily=UBUNTU,osVersionMatches=1[012].[01][04],loginUser=user:Password01,authenticateSudo=true");
- return properties;
- }
-
- public static class Builder
- extends
- BaseProviderMetadata.Builder {
-
- protected Builder() {
- id("ninefold-compute")
- .name("Ninefold Compute")
- .apiMetadata(new CloudStackApiMetadata().toBuilder().version("2.2.12").build())
- .homepage(URI.create("http://ninefold.com/virtual-servers/"))
- .console(URI.create("https://ninefold.com/portal/portal/login"))
- .iso3166Codes("AU-NSW")
- .endpoint("https://api.ninefold.com/compute/v1.0/")
- .defaultProperties(NinefoldComputeProviderMetadata.defaultProperties());
- }
-
- @Override
- public NinefoldComputeProviderMetadata build() {
- return new NinefoldComputeProviderMetadata(this);
- }
-
- @Override
- public Builder fromProviderMetadata(
- ProviderMetadata in) {
- super.fromProviderMetadata(in);
- return this;
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a32292fa/providers/ninefold-compute/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata
----------------------------------------------------------------------
diff --git a/providers/ninefold-compute/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata b/providers/ninefold-compute/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata
deleted file mode 100644
index 988fb98..0000000
--- a/providers/ninefold-compute/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata
+++ /dev/null
@@ -1 +0,0 @@
-org.jclouds.ninefold.compute.NinefoldComputeProviderMetadata
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a32292fa/providers/ninefold-compute/src/test/java/org/jclouds/ninefold/compute/NinefoldComputeProviderTest.java
----------------------------------------------------------------------
diff --git a/providers/ninefold-compute/src/test/java/org/jclouds/ninefold/compute/NinefoldComputeProviderTest.java b/providers/ninefold-compute/src/test/java/org/jclouds/ninefold/compute/NinefoldComputeProviderTest.java
deleted file mode 100644
index 864e8dc..0000000
--- a/providers/ninefold-compute/src/test/java/org/jclouds/ninefold/compute/NinefoldComputeProviderTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.ninefold.compute;
-
-import org.jclouds.cloudstack.CloudStackApiMetadata;
-import org.jclouds.providers.internal.BaseProviderMetadataTest;
-import org.testng.annotations.Test;
-
-/**
- * The NinefoldComputeProviderTest tests the {@link NinefoldComputeProviderMetadata} class.
- */
-@Test(groups = "unit", testName = "NinefoldComputeProviderTest")
-public class NinefoldComputeProviderTest extends BaseProviderMetadataTest {
-
- public NinefoldComputeProviderTest() {
- super(new NinefoldComputeProviderMetadata(), new CloudStackApiMetadata());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a32292fa/providers/ninefold-compute/src/test/java/org/jclouds/ninefold/compute/compute/NinefoldComputeServiceLiveTest.java
----------------------------------------------------------------------
diff --git a/providers/ninefold-compute/src/test/java/org/jclouds/ninefold/compute/compute/NinefoldComputeServiceLiveTest.java b/providers/ninefold-compute/src/test/java/org/jclouds/ninefold/compute/compute/NinefoldComputeServiceLiveTest.java
deleted file mode 100644
index 57776e3..0000000
--- a/providers/ninefold-compute/src/test/java/org/jclouds/ninefold/compute/compute/NinefoldComputeServiceLiveTest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.ninefold.compute.compute;
-
-import org.jclouds.cloudstack.compute.CloudStackComputeServiceLiveTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "live", singleThreaded = true, testName = "NinefoldComputeServiceLiveTest")
-public class NinefoldComputeServiceLiveTest extends CloudStackComputeServiceLiveTest {
-
- public NinefoldComputeServiceLiveTest() {
- provider = "ninefold-compute";
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a32292fa/providers/ninefold-compute/src/test/java/org/jclouds/ninefold/compute/compute/NinefoldComputeTemplateBuilderLiveTest.java
----------------------------------------------------------------------
diff --git a/providers/ninefold-compute/src/test/java/org/jclouds/ninefold/compute/compute/NinefoldComputeTemplateBuilderLiveTest.java b/providers/ninefold-compute/src/test/java/org/jclouds/ninefold/compute/compute/NinefoldComputeTemplateBuilderLiveTest.java
deleted file mode 100644
index 2f64b1a..0000000
--- a/providers/ninefold-compute/src/test/java/org/jclouds/ninefold/compute/compute/NinefoldComputeTemplateBuilderLiveTest.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.ninefold.compute.compute;
-
-import static org.jclouds.compute.util.ComputeServiceUtils.getCores;
-import static org.testng.Assert.assertEquals;
-
-import java.io.IOException;
-import java.util.Set;
-
-import org.jclouds.compute.domain.OsFamily;
-import org.jclouds.compute.domain.OsFamilyVersion64Bit;
-import org.jclouds.compute.domain.Template;
-import org.jclouds.compute.internal.BaseTemplateBuilderLiveTest;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
-import com.google.common.collect.ImmutableSet;
-
-@Test(groups = "live")
-public class NinefoldComputeTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest {
-
- public NinefoldComputeTemplateBuilderLiveTest() {
- provider = "ninefold-compute";
- }
-
- @Override
- protected Predicate<OsFamilyVersion64Bit> defineUnsupportedOperatingSystems() {
- return Predicates.not(new Predicate<OsFamilyVersion64Bit>() {
-
- @Override
- public boolean apply(OsFamilyVersion64Bit input) {
- switch (input.family) {
- case UBUNTU:
- return input.version.equals("") || input.version.equals("10.04");
- case SUSE:
- return (input.version.equals("") || input.version.equals("11")) && input.is64Bit;
- case DEBIAN:
- return (input.version.equals("") || input.version.equals("6.0")) && !input.is64Bit;
- case CENTOS:
- return (input.version.equals("") || input.version.equals("5.5")) && input.is64Bit;
- case WINDOWS:
- return input.version.equals("") || (input.version.equals("2008") && !input.is64Bit);
- default:
- return false;
- }
- }
-
- });
- }
-
- @Test
- public void testDefaultTemplateBuilder() throws IOException {
- Template defaultTemplate = this.view.getComputeService().templateBuilder().build();
- if (template == null) {
- assert defaultTemplate.getImage().getOperatingSystem().getVersion().matches("1[012].[10][04]") : defaultTemplate
- .getImage().getOperatingSystem().getVersion();
- assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
- assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
- assertEquals(defaultTemplate.getLocation().getId(), "1");
- assertEquals(getCores(defaultTemplate.getHardware()), 1.0d);
- assertEquals(defaultTemplate.getOptions().getLoginUser(), "user");
- assertEquals(defaultTemplate.getOptions().getLoginPassword(), "Password01");
- assertEquals(defaultTemplate.getOptions().getLoginPrivateKey(), null);
- assertEquals(defaultTemplate.getOptions().shouldAuthenticateSudo(), Boolean.TRUE);
- } else {
- assertEquals(defaultTemplate.getImage(), this.view.getComputeService().templateBuilder().from(template)
- .build().getImage());
- }
- }
-
- @Override
- protected Set<String> getIso3166Codes() {
- return ImmutableSet.<String> of("AU-NSW");
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a32292fa/providers/ninefold-storage/pom.xml
----------------------------------------------------------------------
diff --git a/providers/ninefold-storage/pom.xml b/providers/ninefold-storage/pom.xml
deleted file mode 100644
index 29ee699..0000000
--- a/providers/ninefold-storage/pom.xml
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-project</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- <relativePath>../../project/pom.xml</relativePath>
- </parent>
- <groupId>org.apache.jclouds.provider</groupId>
- <artifactId>ninefold-storage</artifactId>
- <name>jclouds ninefold storage provider</name>
- <description>BlobStore implementation targeted to ninefold storage</description>
- <packaging>bundle</packaging>
-
- <properties>
- <test.ninefold-storage.endpoint>http://onlinestorage.ninefold.com</test.ninefold-storage.endpoint>
- <test.ninefold-storage.api-version>1.4.0</test.ninefold-storage.api-version>
- <test.ninefold-storage.build-version />
- <test.ninefold-storage.identity>FIXME_IDENTITY</test.ninefold-storage.identity>
- <test.ninefold-storage.credential>FIXME_CREDENTIAL</test.ninefold-storage.credential>
-
- <jclouds.osgi.export>org.jclouds.ninefold.storage*;version="${project.version}"</jclouds.osgi.export>
- <jclouds.osgi.import>org.jclouds*;version="${project.version}",*</jclouds.osgi.import>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>atmos</artifactId>
- <version>${project.version}</version>
- <type>jar</type>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>atmos</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-blobstore</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.driver</groupId>
- <artifactId>jclouds-log4j</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>live</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <executions>
- <execution>
- <id>integration</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <systemPropertyVariables>
- <test.ninefold-storage.endpoint>${test.ninefold-storage.endpoint}</test.ninefold-storage.endpoint>
- <test.ninefold-storage.api-version>${test.ninefold-storage.api-version}</test.ninefold-storage.api-version>
- <test.ninefold-storage.build-version>${test.ninefold-storage.build-version}</test.ninefold-storage.build-version>
- <test.ninefold-storage.identity>${test.ninefold-storage.identity}</test.ninefold-storage.identity>
- <test.ninefold-storage.credential>${test.ninefold-storage.credential}</test.ninefold-storage.credential>
- <jclouds.blobstore.httpstream.url>${jclouds.blobstore.httpstream.url}</jclouds.blobstore.httpstream.url>
- <jclouds.blobstore.httpstream.md5>${jclouds.blobstore.httpstream.md5}</jclouds.blobstore.httpstream.md5>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a32292fa/providers/ninefold-storage/src/main/java/org/jclouds/ninefold/storage/NinefoldStorageProviderMetadata.java
----------------------------------------------------------------------
diff --git a/providers/ninefold-storage/src/main/java/org/jclouds/ninefold/storage/NinefoldStorageProviderMetadata.java b/providers/ninefold-storage/src/main/java/org/jclouds/ninefold/storage/NinefoldStorageProviderMetadata.java
deleted file mode 100644
index e873b5d..0000000
--- a/providers/ninefold-storage/src/main/java/org/jclouds/ninefold/storage/NinefoldStorageProviderMetadata.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.ninefold.storage;
-
-import java.net.URI;
-import java.util.Properties;
-
-import org.jclouds.atmos.AtmosApiMetadata;
-import org.jclouds.providers.ProviderMetadata;
-import org.jclouds.providers.internal.BaseProviderMetadata;
-
-/**
- * Implementation of {@link org.jclouds.types.ProviderMetadata} for Ninefold's
- * Storage provider.
- */
-public class NinefoldStorageProviderMetadata extends BaseProviderMetadata {
-
- public static Builder builder() {
- return new Builder();
- }
-
- @Override
- public Builder toBuilder() {
- return builder().fromProviderMetadata(this);
- }
-
- public NinefoldStorageProviderMetadata() {
- super(builder());
- }
-
- public NinefoldStorageProviderMetadata(Builder builder) {
- super(builder);
- }
-
- public static Properties defaultProperties() {
- Properties properties = new Properties();
- return properties;
- }
-
- public static class Builder extends BaseProviderMetadata.Builder {
-
- protected Builder() {
- id("ninefold-storage")
- .name("Ninefold Storage")
- .apiMetadata(new AtmosApiMetadata())
- .homepage(URI.create("http://ninefold.com/cloud-storage/"))
- .console(URI.create("https://ninefold.com/portal/"))
- .iso3166Codes("AU-NSW")
- .endpoint("http://onlinestorage.ninefold.com")
- .defaultProperties(NinefoldStorageProviderMetadata.defaultProperties());
- }
-
- @Override
- public NinefoldStorageProviderMetadata build() {
- return new NinefoldStorageProviderMetadata(this);
- }
-
- @Override
- public Builder fromProviderMetadata(
- ProviderMetadata in) {
- super.fromProviderMetadata(in);
- return this;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a32292fa/providers/ninefold-storage/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata
----------------------------------------------------------------------
diff --git a/providers/ninefold-storage/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata b/providers/ninefold-storage/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata
deleted file mode 100644
index f87f414..0000000
--- a/providers/ninefold-storage/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata
+++ /dev/null
@@ -1 +0,0 @@
-org.jclouds.ninefold.storage.NinefoldStorageProviderMetadata
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a32292fa/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/NinefoldStorageAsyncClientTest.java
----------------------------------------------------------------------
diff --git a/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/NinefoldStorageAsyncClientTest.java b/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/NinefoldStorageAsyncClientTest.java
deleted file mode 100644
index 7175165..0000000
--- a/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/NinefoldStorageAsyncClientTest.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.ninefold.storage;
-
-import org.testng.annotations.Test;
-
-// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
-@Test(groups = "unit", testName = "NinefoldStorageAsyncClientTest")
-public class NinefoldStorageAsyncClientTest extends org.jclouds.atmos.AtmosAsyncClientTest {
-
- public NinefoldStorageAsyncClientTest() {
- this.provider = "ninefold-storage";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a32292fa/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/NinefoldStorageClientLiveTest.java
----------------------------------------------------------------------
diff --git a/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/NinefoldStorageClientLiveTest.java b/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/NinefoldStorageClientLiveTest.java
deleted file mode 100644
index 07e7f6e..0000000
--- a/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/NinefoldStorageClientLiveTest.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.ninefold.storage;
-
-import org.jclouds.atmos.AtmosClientLiveTest;
-import org.testng.annotations.Test;
-
-/**
- * Tests behavior of {@code AtmosClient}
- */
-@Test(groups = "live", singleThreaded = true, testName = "NinefoldStorageClientLiveTest")
-public class NinefoldStorageClientLiveTest extends AtmosClientLiveTest {
- public NinefoldStorageClientLiveTest() {
- provider = "ninefold-storage";
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a32292fa/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/NinefoldStorageProviderTest.java
----------------------------------------------------------------------
diff --git a/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/NinefoldStorageProviderTest.java b/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/NinefoldStorageProviderTest.java
deleted file mode 100644
index f2cd462..0000000
--- a/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/NinefoldStorageProviderTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.ninefold.storage;
-
-import org.jclouds.atmos.AtmosApiMetadata;
-import org.jclouds.providers.internal.BaseProviderMetadataTest;
-import org.testng.annotations.Test;
-
-/**
- * The NinefoldStorageProviderTest tests the {@link NinefoldStorageProviderMetadata} class.
- */
-@Test(groups = "unit", testName = "NinefoldStorageProviderTest")
-public class NinefoldStorageProviderTest extends BaseProviderMetadataTest {
-
- public NinefoldStorageProviderTest() {
- super(new NinefoldStorageProviderMetadata(), new AtmosApiMetadata());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a32292fa/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageBlobIntegrationLiveTest.java
----------------------------------------------------------------------
diff --git a/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageBlobIntegrationLiveTest.java b/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageBlobIntegrationLiveTest.java
deleted file mode 100644
index a17953d..0000000
--- a/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageBlobIntegrationLiveTest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.ninefold.storage.blobstore.integration;
-
-import org.jclouds.atmos.blobstore.integration.AtmosIntegrationLiveTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "live", testName = "NinefoldStorageBlobIntegrationLiveTest")
-public class NinefoldStorageBlobIntegrationLiveTest extends AtmosIntegrationLiveTest {
-
- public NinefoldStorageBlobIntegrationLiveTest() {
- provider = "ninefold-storage";
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a32292fa/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageBlobLiveTest.java
----------------------------------------------------------------------
diff --git a/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageBlobLiveTest.java b/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageBlobLiveTest.java
deleted file mode 100644
index 25631c3..0000000
--- a/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageBlobLiveTest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.ninefold.storage.blobstore.integration;
-
-import org.jclouds.atmos.blobstore.integration.AtmosLiveTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "live", testName = "NinefoldStorageBlobLiveTest")
-public class NinefoldStorageBlobLiveTest extends AtmosLiveTest {
-
- public NinefoldStorageBlobLiveTest() {
- provider = "ninefold-storage";
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a32292fa/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageBlobSignerLiveTest.java
----------------------------------------------------------------------
diff --git a/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageBlobSignerLiveTest.java b/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageBlobSignerLiveTest.java
deleted file mode 100644
index b62f164..0000000
--- a/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageBlobSignerLiveTest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.ninefold.storage.blobstore.integration;
-
-import org.jclouds.atmos.blobstore.integration.AtmosBlobSignerLiveTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "live", testName = "NinefoldStorageBlobSignerLiveTest")
-public class NinefoldStorageBlobSignerLiveTest extends AtmosBlobSignerLiveTest {
-
- public NinefoldStorageBlobSignerLiveTest() {
- provider = "ninefold-storage";
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a32292fa/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageContainerIntegrationLiveTest.java
----------------------------------------------------------------------
diff --git a/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageContainerIntegrationLiveTest.java b/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageContainerIntegrationLiveTest.java
deleted file mode 100644
index 755af37..0000000
--- a/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageContainerIntegrationLiveTest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.ninefold.storage.blobstore.integration;
-
-import org.jclouds.atmos.blobstore.integration.AtmosContainerIntegrationLiveTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "live", testName = "NinefoldStorageContainerIntegrationLiveTest")
-public class NinefoldStorageContainerIntegrationLiveTest extends AtmosContainerIntegrationLiveTest {
-
- public NinefoldStorageContainerIntegrationLiveTest() {
- provider = "ninefold-storage";
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a32292fa/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageContainerLiveTest.java
----------------------------------------------------------------------
diff --git a/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageContainerLiveTest.java b/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageContainerLiveTest.java
deleted file mode 100644
index 809da41..0000000
--- a/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageContainerLiveTest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.ninefold.storage.blobstore.integration;
-
-import org.jclouds.atmos.blobstore.integration.AtmosContainerLiveTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "live", testName = "NinefoldStorageContainerLiveTest")
-public class NinefoldStorageContainerLiveTest extends AtmosContainerLiveTest {
-
- public NinefoldStorageContainerLiveTest() {
- provider = "ninefold-storage";
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a32292fa/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageServiceIntegrationLiveTest.java
----------------------------------------------------------------------
diff --git a/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageServiceIntegrationLiveTest.java b/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageServiceIntegrationLiveTest.java
deleted file mode 100644
index 39af9f8..0000000
--- a/providers/ninefold-storage/src/test/java/org/jclouds/ninefold/storage/blobstore/integration/NinefoldStorageServiceIntegrationLiveTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.ninefold.storage.blobstore.integration;
-
-import java.util.Set;
-
-import org.jclouds.atmos.blobstore.integration.AtmosServiceIntegrationLiveTest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableSet;
-
-@Test(groups = "live", testName = "NinefoldStorageServiceIntegrationLiveTest")
-public class NinefoldStorageServiceIntegrationLiveTest extends AtmosServiceIntegrationLiveTest {
-
- public NinefoldStorageServiceIntegrationLiveTest() {
- provider = "ninefold-storage";
- }
-
- @Override
- protected Set<String> getIso3166Codes() {
- return ImmutableSet.<String> of("AU-NSW");
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/a32292fa/providers/pom.xml
----------------------------------------------------------------------
diff --git a/providers/pom.xml b/providers/pom.xml
index 5741614..e7e6c0e 100644
--- a/providers/pom.xml
+++ b/providers/pom.xml
@@ -36,7 +36,6 @@
<module>aws-ec2</module>
<module>aws-sqs</module>
<module>aws-cloudwatch</module>
- <module>ninefold-storage</module>
<module>cloudonestorage</module>
<module>bluelock-vcloud-zone01</module>
<module>elastichosts-lon-p</module>
@@ -54,7 +53,6 @@
<module>greenhousedata-element-vcloud</module>
<module>go2cloud-jhb1</module>
<module>softlayer</module>
- <module>ninefold-compute</module>
<module>hpcloud-compute</module>
<module>hpcloud-blockstorage</module>
<module>hpcloud-objectstorage</module>
[45/50] [abbrv] JCLOUDS-692 Remove the CloudSigma v1 provider.
Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/options/CloudSigmaTemplateOptions.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/options/CloudSigmaTemplateOptions.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/options/CloudSigmaTemplateOptions.java
deleted file mode 100644
index eac1343..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/compute/options/CloudSigmaTemplateOptions.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.compute.options;
-
-import org.jclouds.cloudsigma.domain.AffinityType;
-import org.jclouds.compute.options.TemplateOptions;
-import org.jclouds.domain.LoginCredentials;
-import org.jclouds.scriptbuilder.domain.Statement;
-
-import java.util.Map;
-
-public class CloudSigmaTemplateOptions extends TemplateOptions implements Cloneable {
-
- public static final CloudSigmaTemplateOptions NONE = new CloudSigmaTemplateOptions();
-
- private AffinityType diskDriveAffinity = AffinityType.HDD;
-
- public CloudSigmaTemplateOptions diskDriveAffinity(AffinityType diskDriveAffinity) {
- this.diskDriveAffinity = diskDriveAffinity;
- return this;
- }
-
- public AffinityType getDiskDriveAffinity() {
- return diskDriveAffinity;
- }
-
- @Override
- public CloudSigmaTemplateOptions clone() {
- CloudSigmaTemplateOptions options = new CloudSigmaTemplateOptions();
- copyTo(options);
- return options;
- }
-
- @Override
- public void copyTo(TemplateOptions to) {
- super.copyTo(to);
- if (to instanceof CloudSigmaTemplateOptions) {
- CloudSigmaTemplateOptions cTo = CloudSigmaTemplateOptions.class.cast(to);
- cTo.diskDriveAffinity(getDiskDriveAffinity());
- }
- }
-
- public static class Builder {
-
- /**
- * @see CloudSigmaTemplateOptions#diskDriveAffinity
- */
- public static CloudSigmaTemplateOptions diskDriveAffinity(AffinityType diskDriveAffinity) {
- CloudSigmaTemplateOptions options = new CloudSigmaTemplateOptions();
- return options.diskDriveAffinity(diskDriveAffinity);
- }
-
- // methods that only facilitate returning the correct object type
-
- /**
- * @see TemplateOptions#inboundPorts
- */
- public static CloudSigmaTemplateOptions inboundPorts(int... ports) {
- CloudSigmaTemplateOptions options = new CloudSigmaTemplateOptions();
- return CloudSigmaTemplateOptions.class.cast(options.inboundPorts(ports));
- }
-
- /**
- * @see TemplateOptions#port
- */
- public static CloudSigmaTemplateOptions blockOnPort(int port, int seconds) {
- CloudSigmaTemplateOptions options = new CloudSigmaTemplateOptions();
- return CloudSigmaTemplateOptions.class.cast(options.blockOnPort(port, seconds));
- }
-
- /**
- * @see TemplateOptions#installPrivateKey
- */
- public static CloudSigmaTemplateOptions installPrivateKey(String rsaKey) {
- CloudSigmaTemplateOptions options = new CloudSigmaTemplateOptions();
- return CloudSigmaTemplateOptions.class.cast(options.installPrivateKey(rsaKey));
- }
-
- /**
- * @see TemplateOptions#authorizePublicKey
- */
- public static CloudSigmaTemplateOptions authorizePublicKey(String rsaKey) {
- CloudSigmaTemplateOptions options = new CloudSigmaTemplateOptions();
- return CloudSigmaTemplateOptions.class.cast(options.authorizePublicKey(rsaKey));
- }
-
- /**
- * @see TemplateOptions#userMetadata(Map)
- */
- public static CloudSigmaTemplateOptions userMetadata(Map<String, String> userMetadata) {
- CloudSigmaTemplateOptions options = new CloudSigmaTemplateOptions();
- return CloudSigmaTemplateOptions.class.cast(options.userMetadata(userMetadata));
- }
-
- /**
- * @see TemplateOptions#nodeNames(Iterable)
- */
- public static CloudSigmaTemplateOptions nodeNames(Iterable<String> nodeNames) {
- CloudSigmaTemplateOptions options = new CloudSigmaTemplateOptions();
- return CloudSigmaTemplateOptions.class.cast(options.nodeNames(nodeNames));
- }
-
- /**
- * @see TemplateOptions#nodeNames(Iterable)
- */
- public static CloudSigmaTemplateOptions networks(Iterable<String> networks) {
- CloudSigmaTemplateOptions options = new CloudSigmaTemplateOptions();
- return CloudSigmaTemplateOptions.class.cast(options.networks(networks));
- }
-
- public static CloudSigmaTemplateOptions overrideLoginUser(String user) {
- CloudSigmaTemplateOptions options = new CloudSigmaTemplateOptions();
- return options.overrideLoginUser(user);
- }
-
- public static CloudSigmaTemplateOptions overrideLoginPassword(String password) {
- CloudSigmaTemplateOptions options = new CloudSigmaTemplateOptions();
- return options.overrideLoginPassword(password);
- }
-
- public static CloudSigmaTemplateOptions overrideLoginPrivateKey(String privateKey) {
- CloudSigmaTemplateOptions options = new CloudSigmaTemplateOptions();
- return options.overrideLoginPrivateKey(privateKey);
- }
-
- public static CloudSigmaTemplateOptions overrideAuthenticateSudo(boolean authenticateSudo) {
- CloudSigmaTemplateOptions options = new CloudSigmaTemplateOptions();
- return options.overrideAuthenticateSudo(authenticateSudo);
- }
-
- public static CloudSigmaTemplateOptions overrideLoginCredentials(LoginCredentials credentials) {
- CloudSigmaTemplateOptions options = new CloudSigmaTemplateOptions();
- return options.overrideLoginCredentials(credentials);
- }
- }
-
- // methods that only facilitate returning the correct object type
-
- /**
- * {@inheritDoc}
- */
- @Override
- public CloudSigmaTemplateOptions blockOnPort(int port, int seconds) {
- return CloudSigmaTemplateOptions.class.cast(super.blockOnPort(port, seconds));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public CloudSigmaTemplateOptions inboundPorts(int... ports) {
- return CloudSigmaTemplateOptions.class.cast(super.inboundPorts(ports));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public CloudSigmaTemplateOptions authorizePublicKey(String publicKey) {
- return CloudSigmaTemplateOptions.class.cast(super.authorizePublicKey(publicKey));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public CloudSigmaTemplateOptions installPrivateKey(String privateKey) {
- return CloudSigmaTemplateOptions.class.cast(super.installPrivateKey(privateKey));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public CloudSigmaTemplateOptions blockUntilRunning(boolean blockUntilRunning) {
- return CloudSigmaTemplateOptions.class.cast(super.blockUntilRunning(blockUntilRunning));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public CloudSigmaTemplateOptions dontAuthorizePublicKey() {
- return CloudSigmaTemplateOptions.class.cast(super.dontAuthorizePublicKey());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public CloudSigmaTemplateOptions nameTask(String name) {
- return CloudSigmaTemplateOptions.class.cast(super.nameTask(name));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public CloudSigmaTemplateOptions runAsRoot(boolean runAsRoot) {
- return CloudSigmaTemplateOptions.class.cast(super.runAsRoot(runAsRoot));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public CloudSigmaTemplateOptions runScript(Statement script) {
- return CloudSigmaTemplateOptions.class.cast(super.runScript(script));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public CloudSigmaTemplateOptions overrideLoginCredentials(LoginCredentials overridingCredentials) {
- return CloudSigmaTemplateOptions.class.cast(super.overrideLoginCredentials(overridingCredentials));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public CloudSigmaTemplateOptions overrideLoginPassword(String password) {
- return CloudSigmaTemplateOptions.class.cast(super.overrideLoginPassword(password));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public CloudSigmaTemplateOptions overrideLoginPrivateKey(String privateKey) {
- return CloudSigmaTemplateOptions.class.cast(super.overrideLoginPrivateKey(privateKey));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public CloudSigmaTemplateOptions overrideLoginUser(String loginUser) {
- return CloudSigmaTemplateOptions.class.cast(super.overrideLoginUser(loginUser));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public CloudSigmaTemplateOptions overrideAuthenticateSudo(boolean authenticateSudo) {
- return CloudSigmaTemplateOptions.class.cast(super.overrideAuthenticateSudo(authenticateSudo));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public CloudSigmaTemplateOptions userMetadata(Map<String, String> userMetadata) {
- return CloudSigmaTemplateOptions.class.cast(super.userMetadata(userMetadata));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public CloudSigmaTemplateOptions userMetadata(String key, String value) {
- return CloudSigmaTemplateOptions.class.cast(super.userMetadata(key, value));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public CloudSigmaTemplateOptions nodeNames(Iterable<String> nodeNames) {
- return CloudSigmaTemplateOptions.class.cast(super.nodeNames(nodeNames));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public CloudSigmaTemplateOptions networks(Iterable<String> networks) {
- return CloudSigmaTemplateOptions.class.cast(super.networks(networks));
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- if (!super.equals(o)) return false;
-
- CloudSigmaTemplateOptions that = (CloudSigmaTemplateOptions) o;
-
- if (diskDriveAffinity != that.diskDriveAffinity) return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = super.hashCode();
- result = 31 * result + (diskDriveAffinity != null ? diskDriveAffinity.hashCode() : 0);
- return result;
- }
-
- @Override
- public String toString() {
- return "CloudSigmaTemplateOptions{" +
- "diskDriveAffinity=" + diskDriveAffinity +
- '}';
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/config/CloudSigmaRestClientModule.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/config/CloudSigmaRestClientModule.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/config/CloudSigmaRestClientModule.java
deleted file mode 100644
index 6532fcf..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/config/CloudSigmaRestClientModule.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.config;
-
-import java.util.List;
-import java.util.Map;
-
-import org.jclouds.cloudsigma.CloudSigmaApi;
-import org.jclouds.cloudsigma.domain.Device;
-import org.jclouds.cloudsigma.domain.Drive;
-import org.jclouds.cloudsigma.domain.DriveData;
-import org.jclouds.cloudsigma.domain.DriveMetrics;
-import org.jclouds.cloudsigma.domain.NIC;
-import org.jclouds.cloudsigma.domain.Server;
-import org.jclouds.cloudsigma.domain.ServerMetrics;
-import org.jclouds.cloudsigma.functions.BaseDriveToMap;
-import org.jclouds.cloudsigma.functions.DriveDataToMap;
-import org.jclouds.cloudsigma.functions.MapToDevices;
-import org.jclouds.cloudsigma.functions.MapToDevices.DeviceToId;
-import org.jclouds.cloudsigma.functions.MapToDriveMetrics;
-import org.jclouds.cloudsigma.functions.MapToNICs;
-import org.jclouds.cloudsigma.functions.MapToServerMetrics;
-import org.jclouds.cloudsigma.functions.ServerToMap;
-import org.jclouds.cloudsigma.handlers.CloudSigmaErrorHandler;
-import org.jclouds.http.HttpErrorHandler;
-import org.jclouds.http.annotation.ClientError;
-import org.jclouds.http.annotation.Redirection;
-import org.jclouds.http.annotation.ServerError;
-import org.jclouds.rest.ConfiguresRestClient;
-import org.jclouds.rest.config.HttpApiModule;
-
-import com.google.common.base.Function;
-import com.google.inject.TypeLiteral;
-
-/**
- * Configures the CloudSigma connection.
- */
-@ConfiguresRestClient
-public class CloudSigmaRestClientModule extends HttpApiModule<CloudSigmaApi> {
-
- @Override
- protected void bindErrorHandlers() {
- bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(CloudSigmaErrorHandler.class);
- bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(CloudSigmaErrorHandler.class);
- bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(CloudSigmaErrorHandler.class);
- }
-
- @Override
- protected void configure() {
- super.configure();
- bind(new TypeLiteral<Function<Drive, Map<String, String>>>() {
- }).to(BaseDriveToMap.class);
- bind(new TypeLiteral<Function<DriveData, Map<String, String>>>() {
- }).to(DriveDataToMap.class);
- bind(new TypeLiteral<Function<Map<String, String>, List<NIC>>>() {
- }).to(MapToNICs.class);
- bind(new TypeLiteral<Function<Map<String, String>, Map<String, ? extends Device>>>() {
- }).to(MapToDevices.class);
- bind(new TypeLiteral<Function<Map<String, String>, Map<String, ? extends DriveMetrics>>>() {
- }).to(MapToDriveMetrics.class);
- bind(new TypeLiteral<Function<Map<String, String>, ServerMetrics>>() {
- }).to(MapToServerMetrics.class);
- bind(new TypeLiteral<Function<Device, String>>() {
- }).to(DeviceToId.class);
- bind(new TypeLiteral<Function<Server, Map<String, String>>>() {
- }).to(ServerToMap.class);
- }
-
- @Override
- protected void bindRetryHandlers() {
- // TODO
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/AffinityType.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/AffinityType.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/AffinityType.java
deleted file mode 100644
index ea0f27b..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/AffinityType.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-/**
- * Option for the cloneDrive operation.
- * 'HDD' to specifies a regular "spinning oxide" disk; 'SSD' specifies a solid-state drive.
- */
-public enum AffinityType {
- HDD,
- SSD,
- UNRECOGNIZED;
-
- public String value() {
- return name().toLowerCase();
- }
-
- @Override
- public String toString() {
- return value();
- }
-
- public static AffinityType fromValue(String affinity) {
- try {
- return valueOf(checkNotNull(affinity, "affinity").toUpperCase());
- } catch (IllegalArgumentException e) {
- return UNRECOGNIZED;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/BlockDevice.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/BlockDevice.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/BlockDevice.java
deleted file mode 100644
index d4baeca..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/BlockDevice.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.domain;
-
-import static com.google.common.base.Preconditions.checkArgument;
-
-public class BlockDevice extends Device {
- public static class Builder extends Device.Builder {
- private final int index;
-
- public Builder(int index) {
- this.index = index;
- }
-
- @Override
- public Device build() {
- return new BlockDevice(uuid, mediaType, index);
- }
-
- }
-
- private final int index;
-
- public BlockDevice(String driveUuid, MediaType mediaType, int index) {
- super(driveUuid, mediaType);
- checkArgument(index >= 0 && index < 8, "index must be between 0 and 7");
- this.index = index;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + index;
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- BlockDevice other = (BlockDevice) obj;
- if (index != other.index)
- return false;
- return true;
- }
-
- @Override
- public String getId() {
- return String.format("block:%d", index);
- }
-
- public int getIndex() {
- return index;
- }
-
- @Override
- public String toString() {
- return "[id=" + getId() + ", driveUuid=" + driveUuid + ", mediaType=" + mediaType + "]";
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/ClaimType.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/ClaimType.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/ClaimType.java
deleted file mode 100644
index c8fbcaf..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/ClaimType.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-/**
- * either 'exclusive' (the default) or 'shared' to allow multiple servers to access a drive
- * simultaneously
- */
-public enum ClaimType {
- /**
- *
- */
- EXCLUSIVE,
- /**
- * allow multiple servers to access a drive simultaneously
- */
- SHARED, UNRECOGNIZED;
-
- public String value() {
- return name().toLowerCase();
- }
-
- @Override
- public String toString() {
- return value();
- }
-
- public static ClaimType fromValue(String claim) {
- try {
- return valueOf(checkNotNull(claim, "claim").toUpperCase());
- } catch (IllegalArgumentException e) {
- return UNRECOGNIZED;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/CreateDriveRequest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/CreateDriveRequest.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/CreateDriveRequest.java
deleted file mode 100644
index 316f021..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/CreateDriveRequest.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Set;
-
-import org.jclouds.javax.annotation.Nullable;
-
-import com.google.common.collect.ImmutableSet;
-
-public class CreateDriveRequest extends Drive {
- public static class Builder extends Drive.Builder {
-
- private Set<String> avoid = ImmutableSet.of();
-
- @Nullable
- private String encryptionCipher;
-
- public Builder avoid(Iterable<String> avoid) {
- this.avoid = ImmutableSet.copyOf(checkNotNull(avoid, "avoid"));
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder claimType(ClaimType claimType) {
- return Builder.class.cast(super.claimType(claimType));
- }
-
- public Builder encryptionCipher(String encryptionCipher) {
- this.encryptionCipher = encryptionCipher;
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder name(String name) {
- return Builder.class.cast(super.name(name));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder tags(Iterable<String> tags) {
- return Builder.class.cast(super.tags(tags));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder readers(Iterable<String> readers) {
- return Builder.class.cast(super.readers(readers));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder size(long size) {
- return Builder.class.cast(super.size(size));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder use(Iterable<String> use) {
- return Builder.class.cast(super.use(use));
- }
-
- public CreateDriveRequest build() {
- return new CreateDriveRequest(name, size, claimType, tags, readers, use, encryptionCipher, avoid);
- }
- }
-
- private final Set<String> avoid;
- @Nullable
- private final String encryptionCipher;
-
- public CreateDriveRequest(String name, long size, @Nullable ClaimType claimType, Iterable<String> tags,
- Iterable<String> readers, Iterable<String> use, @Nullable String encryptionCipher, Iterable<String> avoid) {
- super(null, name, size, claimType, tags, readers, use);
- this.encryptionCipher = encryptionCipher;
- this.avoid = ImmutableSet.copyOf(checkNotNull(avoid, "avoid"));
- }
-
- /**
- *
- * @return list of existing drives to ensure this new drive is created on physical different
- * hardware than those existing drives
- */
- public Set<String> getAvoid() {
- return avoid;
- }
-
- /**
- *
- * @return either 'none' or 'aes-xts-plain' (the default)
- */
- @Nullable
- public String getEncryptionCipher() {
- return encryptionCipher;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result + ((avoid == null) ? 0 : avoid.hashCode());
- result = prime * result + ((encryptionCipher == null) ? 0 : encryptionCipher.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (!super.equals(obj))
- return false;
- if (getClass() != obj.getClass())
- return false;
- CreateDriveRequest other = (CreateDriveRequest) obj;
- if (avoid == null) {
- if (other.avoid != null)
- return false;
- } else if (!avoid.equals(other.avoid))
- return false;
- if (encryptionCipher == null) {
- if (other.encryptionCipher != null)
- return false;
- } else if (!encryptionCipher.equals(other.encryptionCipher))
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return "[name=" + name + ", size=" + size + ", claimType=" + claimType + ", tags=" + tags
- + ", readers=" + readers + ", use=" + use + ", avoid=" + avoid
- + ", encryptionCipher=" + encryptionCipher + "]";
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/Device.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/Device.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/Device.java
deleted file mode 100644
index d60b9b9..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/Device.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-public abstract class Device {
- public abstract static class Builder {
- protected String uuid;
- protected MediaType mediaType = MediaType.DISK;
-
- public Builder mediaType(MediaType mediaType) {
- this.mediaType = mediaType;
- return this;
- }
-
- public Builder uuid(String uuid) {
- this.uuid = uuid;
- return this;
- }
-
- public abstract Device build();
- }
-
- protected final String driveUuid;
- protected final MediaType mediaType;
-
- public Device(String driveUuid, MediaType mediaType) {
- this.driveUuid = checkNotNull(driveUuid, "driveUuid");
- this.mediaType = checkNotNull(mediaType, "mediaType");
- }
-
- /**
- * id generated based on the device bus, unit, and/or index numbers;
- */
- public abstract String getId();
-
- /**
- *
- * @return Drive UUID to connect as specified device.
- */
- public String getDriveUuid() {
- return driveUuid;
- }
-
- /**
- *
- * @return set to 'cdrom' to simulate a cdrom, set to 'disk' or leave unset to simulate a hard
- * disk.
- */
- public MediaType getMediaType() {
- return mediaType;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((driveUuid == null) ? 0 : driveUuid.hashCode());
- result = prime * result + ((mediaType == null) ? 0 : mediaType.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Device other = (Device) obj;
- if (driveUuid == null) {
- if (other.driveUuid != null)
- return false;
- } else if (!driveUuid.equals(other.driveUuid))
- return false;
- if (mediaType != other.mediaType)
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return "[driveUuid=" + driveUuid + ", mediaType=" + mediaType + "]";
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/Drive.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/Drive.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/Drive.java
deleted file mode 100644
index 6ced120..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/Drive.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Set;
-
-import org.jclouds.javax.annotation.Nullable;
-
-import com.google.common.base.Objects;
-import com.google.common.collect.ImmutableSet;
-
-public class Drive extends Item {
- public static class Builder extends Item.Builder {
- protected long size;
- protected ClaimType claimType = ClaimType.EXCLUSIVE;
- protected Set<String> tags = ImmutableSet.of();
- protected Set<String> readers = ImmutableSet.of();
-
- public Builder claimType(ClaimType claimType) {
- this.claimType = claimType;
- return this;
- }
-
- public Builder tags(Iterable<String> tags) {
- this.tags = ImmutableSet.copyOf(checkNotNull(tags, "tags"));
- return this;
- }
-
- public Builder readers(Iterable<String> readers) {
- this.readers = ImmutableSet.copyOf(checkNotNull(readers, "readers"));
- return this;
- }
-
- public Builder size(long size) {
- this.size = size;
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder uuid(String uuid) {
- return Builder.class.cast(super.uuid(uuid));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder name(String name) {
- return Builder.class.cast(super.name(name));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder use(Iterable<String> use) {
- return Builder.class.cast(super.use(use));
- }
-
- public Drive build() {
- return new Drive(uuid, name, size, claimType, tags, readers, use);
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result + ((claimType == null) ? 0 : claimType.hashCode());
- result = prime * result + ((tags == null) ? 0 : tags.hashCode());
- result = prime * result + ((readers == null) ? 0 : readers.hashCode());
- result = prime * result + (int) (size ^ (size >>> 32));
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (!super.equals(obj))
- return false;
- if (getClass() != obj.getClass())
- return false;
- Builder other = (Builder) obj;
- if (claimType != other.claimType)
- return false;
- if (!Objects.equal(tags, other.tags))
- return false;
- if (!Objects.equal(readers, other.readers))
- return false;
- if (size != other.size)
- return false;
- return true;
- }
- }
-
- protected final long size;
- protected final ClaimType claimType;
- protected final Set<String> tags;
- protected final Set<String> readers;
-
- public Drive(@Nullable String uuid, String name, long size, @Nullable ClaimType claimType,
- Iterable<String> tags, Iterable<String> readers, Iterable<String> use) {
- super(uuid, name, use);
- this.size = size;
- this.claimType = checkNotNull(claimType, "set claimType to exclusive, not null");
- this.tags = ImmutableSet.copyOf(checkNotNull(tags, "tags"));
- this.readers = ImmutableSet.copyOf(checkNotNull(readers, "readers"));
- }
-
- /**
- *
- * @return either 'exclusive' (the default) or 'shared' to allow multiple servers to access a
- * drive simultaneously
- */
- @Nullable
- public ClaimType getClaimType() {
- return claimType;
- }
-
- /**
- * @return all tags associated with this drive, both user-specified and "system" tags (e.g. "affinity:ssd")
- */
- public Set<String> getTags() {
- return tags;
- }
-
- /**
- *
- * @return list of users allowed to read from a drive or 'ffffffff-ffff-ffff-ffff-ffffffffffff'
- * for all users
- */
- public Set<String> getReaders() {
- return readers;
- }
-
- /**
- *
- * @return size of drive in bytes
- */
- public long getSize() {
- return size;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((claimType == null) ? 0 : claimType.hashCode());
- result = prime * result + ((tags == null) ? 0 : tags.hashCode());
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- result = prime * result + ((readers == null) ? 0 : readers.hashCode());
- result = prime * result + (int) (size ^ (size >>> 32));
- result = prime * result + ((use == null) ? 0 : use.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Drive other = (Drive) obj;
- if (claimType != other.claimType)
- return false;
- if (!Objects.equal(tags, other.tags))
- return false;
- if (!Objects.equal(name, other.name))
- return false;
- if (!Objects.equal(readers, other.readers))
- return false;
- if (size != other.size)
- return false;
- if (use == null) {
- if (other.use != null)
- return false;
- } else if (!use.equals(other.use))
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return "[uuid=" + uuid + ", name=" + name + ", use=" + use + ", size=" + size + ", claimType=" + claimType
- + ", tags=" + tags + ", readers=" + readers + "]";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/DriveData.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/DriveData.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/DriveData.java
deleted file mode 100644
index 550d87a..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/DriveData.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.domain;
-
-import org.jclouds.javax.annotation.Nullable;
-
-public class DriveData extends Drive {
- public static class Builder extends Drive.Builder {
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder claimType(ClaimType claimType) {
- return Builder.class.cast(super.claimType(claimType));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder name(String name) {
- return Builder.class.cast(super.name(name));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder tags(Iterable<String> tags) {
- return Builder.class.cast(super.tags(tags));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder readers(Iterable<String> readers) {
- return Builder.class.cast(super.readers(readers));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder size(long size) {
- return Builder.class.cast(super.size(size));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder use(Iterable<String> use) {
- return Builder.class.cast(super.use(use));
- }
-
- public DriveData build() {
- return new DriveData(uuid, name, size, claimType, tags, readers, use);
- }
- }
-
- public DriveData(@Nullable String uuid, String name, long size, @Nullable ClaimType claimType,
- Iterable<String> tags, Iterable<String> readers, Iterable<String> use) {
- super(uuid, name, size, claimType, tags, readers, use);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/DriveInfo.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/DriveInfo.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/DriveInfo.java
deleted file mode 100644
index a335a38..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/DriveInfo.java
+++ /dev/null
@@ -1,466 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.net.URI;
-import java.util.Set;
-
-import org.jclouds.javax.annotation.Nullable;
-
-import com.google.common.collect.ImmutableSet;
-
-public class DriveInfo extends Drive {
- public static class Builder extends Drive.Builder {
-
- protected DriveStatus status;
- protected String user;
- protected Set<String> claimed = ImmutableSet.of();
- @Nullable
- protected String encryptionCipher;
- @Nullable
- protected String imaging;
- protected DriveMetrics metrics;
- private Boolean autoexpanding;
- private Integer bits;
- private String description;
- private Set<String> driveType = ImmutableSet.of();
- private String encryptionKey;
- private Boolean free;
- private String installNotes;
- private String os;
- private DriveType type;
- private URI url;
-
- public Builder status(DriveStatus status) {
- this.status = status;
- return this;
- }
-
- public Builder user(String user) {
- this.user = user;
- return this;
- }
-
- public Builder claimed(Iterable<String> claimed) {
- this.claimed = ImmutableSet.copyOf(checkNotNull(claimed, "claimed"));
- return this;
- }
-
- public Builder imaging(String imaging) {
- this.imaging = imaging;
- return this;
- }
-
- public Builder metrics(DriveMetrics metrics) {
- this.metrics = metrics;
- return this;
- }
-
- public Builder encryptionCipher(String encryptionCipher) {
- this.encryptionCipher = encryptionCipher;
- return this;
- }
-
- public Builder autoexpanding(Boolean autoexpanding) {
- this.autoexpanding = autoexpanding;
- return this;
- }
-
- public Builder bits(Integer bits) {
- this.bits = bits;
- return this;
- }
-
- public Builder description(String description) {
- this.description = description;
- return this;
- }
-
- public Builder driveType(Iterable<String> driveType) {
- this.driveType = ImmutableSet.copyOf(checkNotNull(driveType, "driveType"));
- return this;
- }
-
- public Builder encryptionKey(String encryptionKey) {
- this.encryptionKey = encryptionKey;
- return this;
- }
-
- public Builder free(Boolean free) {
- this.free = free;
- return this;
- }
-
- public Builder installNotes(String installNotes) {
- this.installNotes = installNotes;
- return this;
- }
-
- public Builder os(String os) {
- this.os = os;
- return this;
- }
-
- public Builder type(DriveType type) {
- this.type = type;
- return this;
- }
-
- public Builder url(URI url) {
- this.url = url;
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder claimType(ClaimType claimType) {
- return Builder.class.cast(super.claimType(claimType));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder tags(Iterable<String> tags) {
- return Builder.class.cast(super.tags(tags));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder readers(Iterable<String> readers) {
- return Builder.class.cast(super.readers(readers));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder size(long size) {
- return Builder.class.cast(super.size(size));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder uuid(String uuid) {
- return Builder.class.cast(super.uuid(uuid));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder name(String name) {
- return Builder.class.cast(super.name(name));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder use(Iterable<String> use) {
- return Builder.class.cast(super.use(use));
- }
-
- public static Builder fromDriveInfo(DriveInfo in) {
- return new Builder().uuid(in.getUuid()).name(in.getName()).size(in.getSize()).claimType(in.getClaimType())
- .readers(in.getReaders()).use(in.getUse()).status(in.getStatus()).user(in.getUser())
- .claimed(in.getClaimed()).encryptionCipher(in.getEncryptionCipher()).imaging(in.getImaging())
- .metrics(in.getMetrics()).autoexpanding(in.getAutoexpanding()).bits(in.getBits())
- .description(in.getDescription()).encryptionKey(in.getEncryptionKey()).free(in.getFree())
- .installNotes(in.getInstallNotes()).type(in.getType()).url(in.getUrl());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public DriveInfo build() {
- return new DriveInfo(uuid, name, size, claimType, tags, readers, use, status, user, claimed, encryptionCipher,
- imaging, metrics, autoexpanding, bits, description, driveType, encryptionKey, free, installNotes, os,
- type, url);
- }
-
- }
-
- protected final DriveStatus status;
- protected final String user;
- protected final Set<String> claimed;
- @Nullable
- protected final String encryptionCipher;
- @Nullable
- protected final String imaging;
- protected final DriveMetrics metrics;
- private final Boolean autoexpanding;
- private final Integer bits;
- private final String description;
- private final ImmutableSet<String> driveType;
- private final String encryptionKey;
- private final Boolean free;
- private final String installNotes;
- private final String os;
- private final DriveType type;
- private final URI url;
-
- public DriveInfo(String uuid, String name, long size, ClaimType claimType, Iterable<String> tags, Iterable<String> readers,
- Iterable<String> use, DriveStatus status, String user, Set<String> claimed, String encryptionCipher,
- String imaging, DriveMetrics metrics, Boolean autoexpanding, Integer bits, String description,
- Iterable<String> driveType, String encryptionKey, Boolean free, String installNotes, String os,
- DriveType type, URI url) {
- super(uuid, name, size, claimType, tags, readers, use);
- this.status = status;
- this.user = user;
- this.claimed = ImmutableSet.copyOf(checkNotNull(claimed, "claimed"));
- this.encryptionCipher = encryptionCipher;
- this.imaging = imaging;
- this.metrics = checkNotNull(metrics, "metrics");
- this.autoexpanding = autoexpanding;
- this.bits = bits;
- this.description = description;
- this.driveType = ImmutableSet.copyOf(driveType);
- this.encryptionKey = encryptionKey;
- this.free = free;
- this.installNotes = installNotes;
- this.os = os;
- this.type = type;
- this.url = url;
- }
-
- /**
- *
- * @return current status of the drive
- */
- public DriveStatus getStatus() {
- return status;
- }
-
- /**
- *
- * @return owner of the drive
- */
- public String getUser() {
- return user;
- }
-
- /**
- *
- * @return if drive is in use by a server, values are the server uuids
- */
- public Set<String> getClaimed() {
- return claimed;
- }
-
- /**
- *
- * @return either 'none' or 'aes-xts-plain' (the default)
- */
- @Nullable
- public String getEncryptionCipher() {
- return encryptionCipher;
- }
-
- /**
- *
- * @return percentage completed of drive imaging if this is underway, or 'queued' if waiting for
- * another imaging operation to complete first
- */
- public String getImaging() {
- return imaging;
- }
-
- /**
- *
- * @return i/o and request metrics for read and write ops
- */
- public DriveMetrics getMetrics() {
- return metrics;
- }
-
- // TODO
- public Boolean getAutoexpanding() {
- return autoexpanding;
- }
-
- // TODO
- public Integer getBits() {
- return bits;
- }
-
- // TODO undocumented
- public String getDescription() {
- return description;
- }
-
- // TODO
- public Set<String> getDriveType() {
- return driveType;
- }
-
- // TODO
- public String getEncryptionKey() {
- return encryptionKey;
- }
-
- // TODO
- public Boolean getFree() {
- return free;
- }
-
- // TODO
- public String getInstallNotes() {
- return installNotes;
- }
-
- // TODO
- public String getOs() {
- return os;
- }
-
- // TODO
- public DriveType getType() {
- return type;
- }
-
- public URI getUrl() {
- return url;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result + ((autoexpanding == null) ? 0 : autoexpanding.hashCode());
- result = prime * result + ((bits == null) ? 0 : bits.hashCode());
- result = prime * result + ((claimed == null) ? 0 : claimed.hashCode());
- result = prime * result + ((description == null) ? 0 : description.hashCode());
- result = prime * result + ((driveType == null) ? 0 : driveType.hashCode());
- result = prime * result + ((encryptionCipher == null) ? 0 : encryptionCipher.hashCode());
- result = prime * result + ((encryptionKey == null) ? 0 : encryptionKey.hashCode());
- result = prime * result + ((free == null) ? 0 : free.hashCode());
- result = prime * result + ((imaging == null) ? 0 : imaging.hashCode());
- result = prime * result + ((installNotes == null) ? 0 : installNotes.hashCode());
- result = prime * result + ((metrics == null) ? 0 : metrics.hashCode());
- result = prime * result + ((os == null) ? 0 : os.hashCode());
- result = prime * result + ((status == null) ? 0 : status.hashCode());
- result = prime * result + ((type == null) ? 0 : type.hashCode());
- result = prime * result + ((url == null) ? 0 : url.hashCode());
- result = prime * result + ((user == null) ? 0 : user.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (!super.equals(obj))
- return false;
- if (getClass() != obj.getClass())
- return false;
- DriveInfo other = (DriveInfo) obj;
- if (autoexpanding == null) {
- if (other.autoexpanding != null)
- return false;
- } else if (!autoexpanding.equals(other.autoexpanding))
- return false;
- if (bits == null) {
- if (other.bits != null)
- return false;
- } else if (!bits.equals(other.bits))
- return false;
- if (claimed == null) {
- if (other.claimed != null)
- return false;
- } else if (!claimed.equals(other.claimed))
- return false;
- if (description == null) {
- if (other.description != null)
- return false;
- } else if (!description.equals(other.description))
- return false;
- if (driveType == null) {
- if (other.driveType != null)
- return false;
- } else if (!driveType.equals(other.driveType))
- return false;
- if (encryptionCipher == null) {
- if (other.encryptionCipher != null)
- return false;
- } else if (!encryptionCipher.equals(other.encryptionCipher))
- return false;
- if (encryptionKey == null) {
- if (other.encryptionKey != null)
- return false;
- } else if (!encryptionKey.equals(other.encryptionKey))
- return false;
- if (free == null) {
- if (other.free != null)
- return false;
- } else if (!free.equals(other.free))
- return false;
- if (imaging == null) {
- if (other.imaging != null)
- return false;
- } else if (!imaging.equals(other.imaging))
- return false;
- if (installNotes == null) {
- if (other.installNotes != null)
- return false;
- } else if (!installNotes.equals(other.installNotes))
- return false;
- if (metrics == null) {
- if (other.metrics != null)
- return false;
- } else if (!metrics.equals(other.metrics))
- return false;
- if (os == null) {
- if (other.os != null)
- return false;
- } else if (!os.equals(other.os))
- return false;
- if (status != other.status)
- return false;
- if (type != other.type)
- return false;
- if (url == null) {
- if (other.url != null)
- return false;
- } else if (!url.equals(other.url))
- return false;
- if (user == null) {
- if (other.user != null)
- return false;
- } else if (!user.equals(other.user))
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return "[size=" + size + ", claimType=" + claimType + ", tags=" + tags + ", readers=" + readers
- + ", uuid=" + uuid + ", name=" + name + ", use=" + use + ", status=" + status
- + ", user=" + user + ", claimed=" + claimed + ", encryptionCipher=" + encryptionCipher
- + ", imaging=" + imaging + ", metrics=" + metrics + "]";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/DriveMetrics.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/DriveMetrics.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/DriveMetrics.java
deleted file mode 100644
index 768cf54..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/DriveMetrics.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.domain;
-
-
-public class DriveMetrics {
- public static class Builder {
- protected long readBytes;
- protected long readRequests;
- protected long writeBytes;
- protected long writeRequests;
-
- public Builder readBytes(long readBytes) {
- this.readBytes = readBytes;
- return this;
- }
-
- public Builder readRequests(long readRequests) {
- this.readRequests = readRequests;
- return this;
- }
-
- public Builder writeBytes(long writeBytes) {
- this.writeBytes = writeBytes;
- return this;
- }
-
- public Builder writeRequests(long writeRequests) {
- this.writeRequests = writeRequests;
- return this;
- }
-
- public DriveMetrics build() {
- return new DriveMetrics(readBytes, readRequests, writeBytes, writeRequests);
- }
- }
-
- protected final long readBytes;
- protected final long readRequests;
- protected final long writeBytes;
- protected final long writeRequests;
-
- public DriveMetrics(long readBytes, long readRequests, long writeBytes, long writeRequests) {
- this.readBytes = readBytes;
- this.readRequests = readRequests;
- this.writeBytes = writeBytes;
- this.writeRequests = writeRequests;
- }
-
- /**
- *
- * @return Cumulative i/o byte/request count for each drive
- */
- public long getReadBytes() {
- return readBytes;
- }
-
- /**
- *
- * @return Cumulative i/o byte/request count for each drive
- */
- public long getReadRequests() {
- return readRequests;
- }
-
- /**
- *
- * @return Cumulative i/o byte/request count for each drive
- */
- public long getWriteBytes() {
- return writeBytes;
- }
-
- /**
- *
- * @return Cumulative i/o byte/request count for each drive
- */
- public long getWriteRequests() {
- return writeRequests;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + (int) (readBytes ^ (readBytes >>> 32));
- result = prime * result + (int) (readRequests ^ (readRequests >>> 32));
- result = prime * result + (int) (writeBytes ^ (writeBytes >>> 32));
- result = prime * result + (int) (writeRequests ^ (writeRequests >>> 32));
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- DriveMetrics other = (DriveMetrics) obj;
- if (readBytes != other.readBytes)
- return false;
- if (readRequests != other.readRequests)
- return false;
- if (writeBytes != other.writeBytes)
- return false;
- if (writeRequests != other.writeRequests)
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return "[readBytes=" + readBytes + ", readRequests=" + readRequests + ", writeBytes=" + writeBytes
- + ", writeRequests=" + writeRequests + "]";
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/DriveStatus.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/DriveStatus.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/DriveStatus.java
deleted file mode 100644
index 118b6e9..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/DriveStatus.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-public enum DriveStatus {
- ACTIVE, INACTIVE, COPYING, IMAGING, UNRECOGNIZED;
-
- public String value() {
- return name().toLowerCase();
- }
-
- @Override
- public String toString() {
- return value();
- }
-
- public static DriveStatus fromValue(String status) {
- try {
- return valueOf(checkNotNull(status, "status").toUpperCase());
- } catch (IllegalArgumentException e) {
- return UNRECOGNIZED;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/DriveType.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/DriveType.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/DriveType.java
deleted file mode 100644
index 4015745..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/DriveType.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-public enum DriveType {
- DISK, CDROM, SHARED, UNRECOGNIZED;
-
- public String value() {
- return name().toLowerCase();
- }
-
- @Override
- public String toString() {
- return value();
- }
-
- public static DriveType fromValue(String type) {
- try {
- return valueOf(checkNotNull(type, "type").toUpperCase());
- } catch (IllegalArgumentException e) {
- return UNRECOGNIZED;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/IDEDevice.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/IDEDevice.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/IDEDevice.java
deleted file mode 100644
index 690b0c8..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/IDEDevice.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.domain;
-
-import static com.google.common.base.Preconditions.checkArgument;
-
-public class IDEDevice extends Device {
- public static class Builder extends Device.Builder {
- private final int bus;
- private final int unit;
-
- public Builder(int bus, int unit) {
- this.bus = bus;
- this.unit = unit;
- }
-
- @Override
- public Device build() {
- return new IDEDevice(uuid, mediaType, bus, unit);
- }
-
- }
-
- private final int bus;
- private final int unit;
-
- public IDEDevice(String driveUuid, MediaType mediaType, int bus, int unit) {
- super(driveUuid, mediaType);
- checkArgument(bus == 0 || bus == 1, "bus must be 0 or 1");
- checkArgument(unit == 0 || unit == 1, "unit must be 0 or 1");
- this.bus = bus;
- this.unit = unit;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + bus;
- result = prime * result + unit;
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- IDEDevice other = (IDEDevice) obj;
- if (bus != other.bus)
- return false;
- if (unit != other.unit)
- return false;
- return true;
- }
-
- @Override
- public String getId() {
- return String.format("ide:%d:%d", bus, unit);
- }
-
- public int getBus() {
- return bus;
- }
-
- public int getUnit() {
- return unit;
- }
-
- @Override
- public String toString() {
- return "[id=" + getId() + ", driveUuid=" + driveUuid + ", mediaType=" + mediaType + "]";
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/Item.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/Item.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/Item.java
deleted file mode 100644
index 8f74ff9..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/Item.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Set;
-
-import org.jclouds.javax.annotation.Nullable;
-
-import com.google.common.collect.ImmutableSet;
-
-public class Item {
- public static class Builder {
- protected String uuid;
- protected String name;
- protected Set<String> use = ImmutableSet.of();
-
- public Builder uuid(String uuid) {
- this.uuid = uuid;
- return this;
- }
-
- public Builder name(String name) {
- this.name = name;
- return this;
- }
-
- public Builder use(Iterable<String> use) {
- this.use = ImmutableSet.copyOf(checkNotNull(use, "use"));
- return this;
- }
-
- public Item build() {
- return new Item(uuid, name, use);
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- result = prime * result + ((use == null) ? 0 : use.hashCode());
- result = prime * result + ((uuid == null) ? 0 : uuid.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Builder other = (Builder) obj;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name))
- return false;
- if (use == null) {
- if (other.use != null)
- return false;
- } else if (!use.equals(other.use))
- return false;
- if (uuid == null) {
- if (other.uuid != null)
- return false;
- } else if (!uuid.equals(other.uuid))
- return false;
- return true;
- }
- }
-
- @Nullable
- protected final String uuid;
- protected final String name;
- protected final Set<String> use;
-
- public Item(@Nullable String uuid, String name, Iterable<String> use) {
- this.uuid = uuid;
- this.name = checkNotNull(name, "name");
- this.use = ImmutableSet.copyOf(checkNotNull(use, "use"));
- }
-
- /**
- *
- * @return uuid of the item.
- */
- @Nullable
- public String getUuid() {
- return uuid;
- }
-
- /**
- *
- * @return name of the item
- */
- public String getName() {
- return name;
- }
-
- /**
- *
- * @return list of use
- */
- public Set<String> getUse() {
- return use;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- result = prime * result + ((use == null) ? 0 : use.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Item other = (Item) obj;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name))
- return false;
- if (use == null) {
- if (other.use != null)
- return false;
- } else if (!use.equals(other.use))
- return false;
-
- return true;
- }
-
- @Override
- public String toString() {
- return "[uuid=" + uuid + ", name=" + name + ", use=" + use + "]";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/MediaType.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/MediaType.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/MediaType.java
deleted file mode 100644
index a04b2ad..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/MediaType.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-/**
- * Media type - set to 'cdrom' to simulate a cdrom, set to 'disk' or leave unset to simulate a hard
- * disk.
- */
-public enum MediaType {
- DISK, CDROM, UNRECOGNIZED;
-
- public String value() {
- return name().toLowerCase();
- }
-
- @Override
- public String toString() {
- return value();
- }
-
- public static MediaType fromValue(String type) {
- try {
- return valueOf(checkNotNull(type, "type").toUpperCase());
- } catch (IllegalArgumentException e) {
- return UNRECOGNIZED;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/Model.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/Model.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/Model.java
deleted file mode 100644
index 28a2d75..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/Model.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-public enum Model {
- E1000, RTl8139, VIRTIO, UNRECOGNIZED;
-
- public String value() {
- return name().toLowerCase();
- }
-
- @Override
- public String toString() {
- return value();
- }
-
- public static Model fromValue(String model) {
- try {
- return valueOf(checkNotNull(model, "model").toUpperCase());
- } catch (IllegalArgumentException e) {
- return UNRECOGNIZED;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/NIC.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/NIC.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/NIC.java
deleted file mode 100644
index 46f6b29..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/NIC.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Set;
-
-import org.jclouds.javax.annotation.Nullable;
-
-import com.google.common.collect.ImmutableSet;
-
-public class NIC {
- public static class Builder {
- private String dhcp;
- private Model model;
- private String vlan;
- private String mac;
- // TODO cloudsigma specific
- private Set<String> block = ImmutableSet.of();
-
- public Builder dhcp(String dhcp) {
- this.dhcp = dhcp;
- return this;
- }
-
- public Builder model(Model model) {
- this.model = model;
- return this;
- }
-
- public Builder vlan(String vlan) {
- this.vlan = vlan;
- return this;
- }
-
- public Builder mac(String mac) {
- this.mac = mac;
- return this;
- }
-
- public Builder block(Iterable<String> block) {
- this.block = ImmutableSet.copyOf(checkNotNull(block, "block"));
- return this;
- }
-
- public NIC build() {
- return new NIC(dhcp, model, vlan, mac, block);
- }
- }
-
- private final String dhcp;
- private final Model model;
- private final String vlan;
- private final String mac;
- private final Set<String> block;
-
- public NIC(@Nullable String dhcp, Model model, @Nullable String vlan, @Nullable String mac, Iterable<String> block) {
- this.dhcp = dhcp;
- this.model = checkNotNull(model, "model");
- this.vlan = vlan;
- this.mac = mac;
- this.block = ImmutableSet.copyOf(checkNotNull(block, "block"));
- }
-
- /**
- *
- * @return The IP address offered by DHCP to network interface 0. If unset, no address is
- * offered. Set to 'auto' to allocate a temporary IP at boot.
- */
- public String getDhcp() {
- return dhcp;
- }
-
- /**
- *
- * @return Create network interface with given type (use 'e1000' as default value; 'rtl8139' or
- * 'virtio' are also available).
- */
- public Model getModel() {
- return model;
- }
-
- /**
- *
- * @return The VLAN to which the network interface is attached.
- */
- public String getVlan() {
- return vlan;
- }
-
- /**
- *
- * @return The MAC address of the network interface. If unset, a randomly generated address is
- * used. If set, should be unique on the VLAN.
- */
- public String getMac() {
- return mac;
- }
-
- // TODO undocumented
- public Set<String> getBlock() {
- return block;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((block == null) ? 0 : block.hashCode());
- result = prime * result + ((dhcp == null) ? 0 : dhcp.hashCode());
- result = prime * result + ((mac == null) ? 0 : mac.hashCode());
- result = prime * result + ((model == null) ? 0 : model.hashCode());
- result = prime * result + ((vlan == null) ? 0 : vlan.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- NIC other = (NIC) obj;
- if (block == null) {
- if (other.block != null)
- return false;
- } else if (!block.equals(other.block))
- return false;
- if (dhcp == null) {
- if (other.dhcp != null)
- return false;
- } else if (!dhcp.equals(other.dhcp))
- return false;
- if (mac == null) {
- if (other.mac != null)
- return false;
- } else if (!mac.equals(other.mac))
- return false;
- if (model != other.model)
- return false;
- if (vlan == null) {
- if (other.vlan != null)
- return false;
- } else if (!vlan.equals(other.vlan))
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return "[dhcp=" + dhcp + ", model=" + model + ", vlan=" + vlan + ", mac=" + mac + ", block=" + block + "]";
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/ProfileInfo.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/ProfileInfo.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/ProfileInfo.java
deleted file mode 100644
index 377df39..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/ProfileInfo.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-public class ProfileInfo {
-
- public static class Builder {
- protected String uuid;
- protected String email;
- protected String firstName;
- protected String lastName;
- protected String nickName;
- protected ProfileType type = ProfileType.REGULAR;
-
- public Builder uuid(String uuid) {
- this.uuid = uuid;
- return this;
- }
-
- public Builder email(String email) {
- this.email = email;
- return this;
- }
-
- public Builder firstName(String firstName) {
- this.firstName = firstName;
- return this;
- }
-
- public Builder lastName(String lastName) {
- this.lastName = lastName;
- return this;
- }
-
- public Builder nickName(String nickName) {
- this.nickName = nickName;
- return this;
- }
-
- public Builder type(ProfileType type) {
- this.type = type;
- return this;
- }
-
- public ProfileInfo build() {
- return new ProfileInfo(uuid, email, firstName, lastName, nickName, type);
- }
-
- }
-
- protected final String uuid;
- protected final String email;
- protected final String firstName;
- protected final String lastName;
- protected final String nickName;
- protected final ProfileType type;
-
- public ProfileInfo(String uuid, String email, String firstName, String lastName, String nickName, ProfileType type) {
- this.uuid = checkNotNull(uuid, "uuid");
- this.email = checkNotNull(email, "email");
- this.firstName = checkNotNull(firstName, "firstName");
- this.lastName = checkNotNull(lastName, "lastName");
- this.nickName = checkNotNull(nickName, "nickName");
- this.type = checkNotNull(type, "type");
- }
-
- /**
- *
- * @return uuid of the profile.
- */
- public String getUuid() {
- return uuid;
- }
-
- /**
- * Checks for valid email address
- *
- * @return email of the profile.
- */
- public String getEmail() {
- return email;
- }
-
- /**
- *
- * @return firstName of the profile.
- */
- protected String getFirstName() {
- return firstName;
- }
-
- /**
- *
- * @return lastName of the profile.
- */
- protected String getLastName() {
- return lastName;
- }
-
- /**
- * Used in phpBB nick name
- *
- * @return nickName of the profile.
- */
- protected String getNickName() {
- return nickName;
- }
-
- /**
- *
- * @return type of the profile.
- */
- protected ProfileType getType() {
- return type;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((email == null) ? 0 : email.hashCode());
- result = prime * result + ((firstName == null) ? 0 : firstName.hashCode());
- result = prime * result + ((lastName == null) ? 0 : lastName.hashCode());
- result = prime * result + ((nickName == null) ? 0 : nickName.hashCode());
- result = prime * result + ((type == null) ? 0 : type.hashCode());
- result = prime * result + ((uuid == null) ? 0 : uuid.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- ProfileInfo other = (ProfileInfo) obj;
- if (email == null) {
- if (other.email != null)
- return false;
- } else if (!email.equals(other.email))
- return false;
- if (firstName == null) {
- if (other.firstName != null)
- return false;
- } else if (!firstName.equals(other.firstName))
- return false;
- if (lastName == null) {
- if (other.lastName != null)
- return false;
- } else if (!lastName.equals(other.lastName))
- return false;
- if (nickName == null) {
- if (other.nickName != null)
- return false;
- } else if (!nickName.equals(other.nickName))
- return false;
- if (type != other.type)
- return false;
- if (uuid == null) {
- if (other.uuid != null)
- return false;
- } else if (!uuid.equals(other.uuid))
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return "[uuid=" + uuid + ", email=" + email + ", firstName=" + firstName + ", lastName=" + lastName
- + ", nickName=" + nickName + ", type=" + type + "]";
- }
-
-}
[40/50] [abbrv] JCLOUDS-692 Remove the CloudSigma v1 provider.
Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/providers/cloudsigma-lvs/src/test/java/org/jclouds/cloudsigma/compute/CloudSigmaLasVegasTemplateBuilderLiveTest.java
----------------------------------------------------------------------
diff --git a/providers/cloudsigma-lvs/src/test/java/org/jclouds/cloudsigma/compute/CloudSigmaLasVegasTemplateBuilderLiveTest.java b/providers/cloudsigma-lvs/src/test/java/org/jclouds/cloudsigma/compute/CloudSigmaLasVegasTemplateBuilderLiveTest.java
deleted file mode 100644
index 317342e..0000000
--- a/providers/cloudsigma-lvs/src/test/java/org/jclouds/cloudsigma/compute/CloudSigmaLasVegasTemplateBuilderLiveTest.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.compute;
-
-import static org.jclouds.compute.util.ComputeServiceUtils.getCores;
-import static org.testng.Assert.assertEquals;
-
-import java.io.IOException;
-import java.util.Set;
-
-import org.jclouds.compute.domain.OsFamily;
-import org.jclouds.compute.domain.OsFamilyVersion64Bit;
-import org.jclouds.compute.domain.Template;
-import org.jclouds.compute.internal.BaseTemplateBuilderLiveTest;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
-import com.google.common.collect.ImmutableSet;
-
-@Test(groups = "live", testName = "CloudSigmaLasVegasTemplateBuilderLiveTest")
-public class CloudSigmaLasVegasTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest {
-
- public CloudSigmaLasVegasTemplateBuilderLiveTest() {
- provider = "cloudsigma-lvs";
- }
-
- @Override
- protected Predicate<OsFamilyVersion64Bit> defineUnsupportedOperatingSystems() {
- return Predicates.not(new Predicate<OsFamilyVersion64Bit>() {
- @Override
- public boolean apply(OsFamilyVersion64Bit input) {
- switch (input.family) {
- case UBUNTU:
- return (ImmutableSet.of("11.04", "10.10").contains(input.version) && input.is64Bit)
- || (input.version.equals("11.10") && !input.is64Bit) || input.version.equals("")
- || input.version.equals("10.04") || input.version.equals("12.04");
- case SOLARIS:
- return (input.version.equals("") || input.version.equals("10")) && input.is64Bit;
- case DEBIAN:
- return input.version.equals("") || (input.version.equals("5.0") && !input.is64Bit)
- || (input.version.equals("6.0") && input.is64Bit);
- case CENTOS:
- return (input.version.equals("") || input.version.equals("5.5") || input.version.equals("5.7") || input.version
- .equals("6.0")) && input.is64Bit;
- case WINDOWS:
- return input.version.equals("2008") || input.version.equals("2003") || input.version.equals("");
- default:
- return false;
- }
- }
-
- });
- }
-
- @Override
- public void testDefaultTemplateBuilder() throws IOException {
- Template defaultTemplate = view.getComputeService().templateBuilder().build();
- assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "11.04");
- assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
- assertEquals(defaultTemplate.getImage().getId(), "6aab1938-71b3-4252-ac1c-a3cb17c284ab");
- assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
- assertEquals(defaultTemplate.getImage().getDefaultCredentials().identity, "root");
- assertEquals(getCores(defaultTemplate.getHardware()), 1.0d);
- }
-
- @Override
- protected Set<String> getIso3166Codes() {
- return ImmutableSet.<String> of("US-NV");
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/providers/cloudsigma-zrh/pom.xml
----------------------------------------------------------------------
diff --git a/providers/cloudsigma-zrh/pom.xml b/providers/cloudsigma-zrh/pom.xml
deleted file mode 100644
index 827b7c4..0000000
--- a/providers/cloudsigma-zrh/pom.xml
+++ /dev/null
@@ -1,126 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-project</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- <relativePath>../../project/pom.xml</relativePath>
- </parent>
- <groupId>org.apache.jclouds.provider</groupId>
- <artifactId>cloudsigma-zrh</artifactId>
- <name>jclouds CloudSigma provider</name>
- <description>ComputeService binding to the CloudSigma datacenter in Zürich</description>
- <packaging>bundle</packaging>
-
- <properties>
- <test.cloudsigma-zrh.endpoint>https://api.zrh.cloudsigma.com</test.cloudsigma-zrh.endpoint>
- <test.cloudsigma-zrh.api-version>1.0</test.cloudsigma-zrh.api-version>
- <test.cloudsigma-zrh.build-version />
- <test.cloudsigma-zrh.identity>FIXME_IDENTITY</test.cloudsigma-zrh.identity>
- <test.cloudsigma-zrh.credential>FIXME_CREDENTIAL</test.cloudsigma-zrh.credential>
- <test.cloudsigma-zrh.template />
- <jclouds.osgi.export>org.jclouds.cloudsigma*;version="${project.version}"</jclouds.osgi.export>
- <jclouds.osgi.import>
- org.jclouds.compute.internal;version="${project.version}",
- org.jclouds.rest.internal;version="${project.version}",
- org.jclouds*;version="${project.version}",
- *
- </jclouds.osgi.import>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>cloudsigma</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>cloudsigma</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-compute</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.driver</groupId>
- <artifactId>jclouds-log4j</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.driver</groupId>
- <artifactId>jclouds-sshj</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>live</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <executions>
- <execution>
- <id>integration</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <systemPropertyVariables>
- <test.cloudsigma-zrh.endpoint>${test.cloudsigma-zrh.endpoint}</test.cloudsigma-zrh.endpoint>
- <test.cloudsigma-zrh.api-version>${test.cloudsigma-zrh.api-version}</test.cloudsigma-zrh.api-version>
- <test.cloudsigma-zrh.build-version>${test.cloudsigma-zrh.build-version}</test.cloudsigma-zrh.build-version>
- <test.cloudsigma-zrh.identity>${test.cloudsigma-zrh.identity}</test.cloudsigma-zrh.identity>
- <test.cloudsigma-zrh.credential>${test.cloudsigma-zrh.credential}</test.cloudsigma-zrh.credential>
- <test.cloudsigma-zrh.template>${test.cloudsigma-zrh.template}</test.cloudsigma-zrh.template>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-
-</project>
-
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/providers/cloudsigma-zrh/src/main/java/org/jclouds/cloudsigma/CloudSigmaZurichProviderMetadata.java
----------------------------------------------------------------------
diff --git a/providers/cloudsigma-zrh/src/main/java/org/jclouds/cloudsigma/CloudSigmaZurichProviderMetadata.java b/providers/cloudsigma-zrh/src/main/java/org/jclouds/cloudsigma/CloudSigmaZurichProviderMetadata.java
deleted file mode 100644
index ec3ce01..0000000
--- a/providers/cloudsigma-zrh/src/main/java/org/jclouds/cloudsigma/CloudSigmaZurichProviderMetadata.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma;
-
-import java.net.URI;
-import java.util.Properties;
-
-import org.jclouds.providers.ProviderMetadata;
-import org.jclouds.providers.internal.BaseProviderMetadata;
-
-/**
- * Implementation of {@link org.jclouds.types.ProviderMetadata} for CloudSigma Zurich.
-
- */
-public class CloudSigmaZurichProviderMetadata extends BaseProviderMetadata {
-
- public static Builder builder() {
- return new Builder();
- }
-
- @Override
- public Builder toBuilder() {
- return builder().fromProviderMetadata(this);
- }
-
- public CloudSigmaZurichProviderMetadata() {
- super(builder());
- }
-
- public CloudSigmaZurichProviderMetadata(Builder builder) {
- super(builder);
- }
-
- public static Properties defaultProperties() {
- Properties properties = new Properties();
- return properties;
- }
-
- public static class Builder
- extends
- BaseProviderMetadata.Builder {
-
- protected Builder() {
- id("cloudsigma-zrh")
- .name("CloudSigma Zurich")
- .apiMetadata(new CloudSigmaApiMetadata())
- .homepage(URI.create("http://www.cloudsigma.com/en/our-cloud/features"))
- .console(URI.create("https://gui.zrh.cloudsigma.com/"))
- .iso3166Codes("CH-ZH")
- .endpoint("https://api.zrh.cloudsigma.com")
- .defaultProperties(CloudSigmaZurichProviderMetadata.defaultProperties());
- }
-
- @Override
- public CloudSigmaZurichProviderMetadata build() {
- return new CloudSigmaZurichProviderMetadata(this);
- }
-
- @Override
- public Builder fromProviderMetadata(
- ProviderMetadata in) {
- super.fromProviderMetadata(in);
- return this;
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/providers/cloudsigma-zrh/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata
----------------------------------------------------------------------
diff --git a/providers/cloudsigma-zrh/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata b/providers/cloudsigma-zrh/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata
deleted file mode 100644
index 8a1ef55..0000000
--- a/providers/cloudsigma-zrh/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata
+++ /dev/null
@@ -1 +0,0 @@
-org.jclouds.cloudsigma.CloudSigmaZurichProviderMetadata
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/providers/cloudsigma-zrh/src/test/java/org/jclouds/cloudsigma/CloudSigmaZurichClientLiveTest.java
----------------------------------------------------------------------
diff --git a/providers/cloudsigma-zrh/src/test/java/org/jclouds/cloudsigma/CloudSigmaZurichClientLiveTest.java b/providers/cloudsigma-zrh/src/test/java/org/jclouds/cloudsigma/CloudSigmaZurichClientLiveTest.java
deleted file mode 100644
index 189c057..0000000
--- a/providers/cloudsigma-zrh/src/test/java/org/jclouds/cloudsigma/CloudSigmaZurichClientLiveTest.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma;
-
-import org.testng.annotations.Test;
-
-@Test(groups = "live", singleThreaded = true, testName = "CloudSigmaZurichClientLiveTest")
-public class CloudSigmaZurichClientLiveTest extends CloudSigmaClientLiveTest {
- public CloudSigmaZurichClientLiveTest() {
- provider = "cloudsigma-zrh";
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/providers/cloudsigma-zrh/src/test/java/org/jclouds/cloudsigma/CloudSigmaZurichProviderTest.java
----------------------------------------------------------------------
diff --git a/providers/cloudsigma-zrh/src/test/java/org/jclouds/cloudsigma/CloudSigmaZurichProviderTest.java b/providers/cloudsigma-zrh/src/test/java/org/jclouds/cloudsigma/CloudSigmaZurichProviderTest.java
deleted file mode 100644
index e17cedf..0000000
--- a/providers/cloudsigma-zrh/src/test/java/org/jclouds/cloudsigma/CloudSigmaZurichProviderTest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma;
-
-import org.jclouds.providers.internal.BaseProviderMetadataTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "CloudSigmaZurichProviderTest")
-public class CloudSigmaZurichProviderTest extends BaseProviderMetadataTest {
-
- public CloudSigmaZurichProviderTest() {
- super(new CloudSigmaZurichProviderMetadata(), new CloudSigmaApiMetadata());
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/providers/cloudsigma-zrh/src/test/java/org/jclouds/cloudsigma/compute/CloudSigmaZurichComputeServiceLiveTest.java
----------------------------------------------------------------------
diff --git a/providers/cloudsigma-zrh/src/test/java/org/jclouds/cloudsigma/compute/CloudSigmaZurichComputeServiceLiveTest.java b/providers/cloudsigma-zrh/src/test/java/org/jclouds/cloudsigma/compute/CloudSigmaZurichComputeServiceLiveTest.java
deleted file mode 100644
index 11a0e15..0000000
--- a/providers/cloudsigma-zrh/src/test/java/org/jclouds/cloudsigma/compute/CloudSigmaZurichComputeServiceLiveTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.compute;
-
-import static com.google.common.collect.Iterables.contains;
-import static com.google.common.collect.Iterables.get;
-import static org.jclouds.cloudsigma.compute.options.CloudSigmaTemplateOptions.Builder.diskDriveAffinity;
-import static org.jclouds.compute.predicates.NodePredicates.inGroup;
-import static org.testng.Assert.assertTrue;
-
-import java.util.Set;
-
-import org.jclouds.cloudsigma.CloudSigmaApi;
-import org.jclouds.cloudsigma.compute.options.CloudSigmaTemplateOptions;
-import org.jclouds.cloudsigma.domain.AffinityType;
-import org.jclouds.cloudsigma.domain.Device;
-import org.jclouds.cloudsigma.domain.DriveInfo;
-import org.jclouds.cloudsigma.domain.ServerInfo;
-import org.jclouds.compute.RunNodesException;
-import org.jclouds.compute.domain.NodeMetadata;
-import org.jclouds.compute.domain.Template;
-import org.jclouds.compute.domain.TemplateBuilder;
-import org.testng.annotations.Test;
-
-@Test(groups = "live", singleThreaded = true, testName = "CloudSigmaZurichComputeServiceLiveTest")
-public class CloudSigmaZurichComputeServiceLiveTest extends CloudSigmaComputeServiceLiveTest {
-
- public CloudSigmaZurichComputeServiceLiveTest() {
- provider = "cloudsigma-zrh";
- }
-
- @Test
- public void testStartNodeWithSSD() throws RunNodesException {
- String group = this.group + "-ssd";
-
- TemplateBuilder builder = client.templateBuilder();
- assert builder instanceof CloudSigmaTemplateBuilderImpl;
-
- Template template = builder.options(diskDriveAffinity(AffinityType.SSD)).build();
- assert template.getOptions() instanceof CloudSigmaTemplateOptions;
-
- try {
- Set<? extends NodeMetadata> nodes = client.createNodesInGroup(group, 1, template);
- NodeMetadata node = get(nodes, 0);
-
- CloudSigmaApi api = client.getContext().unwrapApi(CloudSigmaApi.class);
-
- // Note: I wanted to use node.getHardware().getVolumes() but there is no
- // way to go from a Volume to a DriveInfo
-
- ServerInfo serverInfo = api.getServerInfo(node.getId());
- Device rootDevice = get(serverInfo.getDevices().values(), 0);
- DriveInfo driveInfo = api.getDriveInfo(rootDevice.getDriveUuid());
- assertTrue(contains(driveInfo.getTags(), "affinity:ssd"));
-
- } finally {
- client.destroyNodesMatching(inGroup(group));
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/providers/cloudsigma-zrh/src/test/java/org/jclouds/cloudsigma/compute/CloudSigmaZurichTemplateBuilderLiveTest.java
----------------------------------------------------------------------
diff --git a/providers/cloudsigma-zrh/src/test/java/org/jclouds/cloudsigma/compute/CloudSigmaZurichTemplateBuilderLiveTest.java b/providers/cloudsigma-zrh/src/test/java/org/jclouds/cloudsigma/compute/CloudSigmaZurichTemplateBuilderLiveTest.java
deleted file mode 100644
index cb9409e..0000000
--- a/providers/cloudsigma-zrh/src/test/java/org/jclouds/cloudsigma/compute/CloudSigmaZurichTemplateBuilderLiveTest.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.compute;
-
-import static org.jclouds.compute.util.ComputeServiceUtils.getCores;
-import static org.testng.Assert.assertEquals;
-
-import java.io.IOException;
-import java.util.Set;
-
-import org.jclouds.compute.domain.OsFamily;
-import org.jclouds.compute.domain.OsFamilyVersion64Bit;
-import org.jclouds.compute.domain.Template;
-import org.jclouds.compute.internal.BaseTemplateBuilderLiveTest;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
-import com.google.common.collect.ImmutableSet;
-
-@Test(groups = "live", singleThreaded = true, testName = "CloudSigmaZurichTemplateBuilderLiveTest")
-public class CloudSigmaZurichTemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest {
-
- public CloudSigmaZurichTemplateBuilderLiveTest() {
- provider = "cloudsigma-zrh";
- }
-
- @Override
- protected Predicate<OsFamilyVersion64Bit> defineUnsupportedOperatingSystems() {
- return Predicates.not(new Predicate<OsFamilyVersion64Bit>() {
- @Override
- public boolean apply(OsFamilyVersion64Bit input) {
- switch (input.family) {
- case UBUNTU:
- return input.version.equals("") || input.version.equals("10.04")
- || (input.version.equals("10.10") && input.is64Bit)
- || (input.version.equals("11.04") && !input.is64Bit);
- case DEBIAN:
- return (input.version.equals("") || input.version.equals("6.0")) && input.is64Bit;
- case CENTOS:
- return (input.version.equals("") || input.version.equals("5.7")) && input.is64Bit;
- case WINDOWS:
- return input.version.equals("") || input.version.matches("200[38]")
- || (input.version.equals("2008 R2") && input.is64Bit);
- default:
- return false;
- }
- }
-
- });
- }
-
- @Override
- public void testDefaultTemplateBuilder() throws IOException {
- Template defaultTemplate = view.getComputeService().templateBuilder().build();
- assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "");
- assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true);
- assertEquals(defaultTemplate.getImage().getId(), "c9df6b90-420c-4c46-b7f2-8d9e99929a09");
- assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.UBUNTU);
- assertEquals(defaultTemplate.getImage().getDefaultCredentials().identity, "root");
- assertEquals(getCores(defaultTemplate.getHardware()), 1.0d);
- }
-
- @Override
- protected Set<String> getIso3166Codes() {
- return ImmutableSet.<String> of("CH-ZH");
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/providers/pom.xml
----------------------------------------------------------------------
diff --git a/providers/pom.xml b/providers/pom.xml
index a49bb96..5741614 100644
--- a/providers/pom.xml
+++ b/providers/pom.xml
@@ -31,8 +31,6 @@
<name>jclouds providers project</name>
<modules>
<module>gogrid</module>
- <module>cloudsigma-zrh</module>
- <module>cloudsigma-lvs</module>
<module>azureblob</module>
<module>aws-s3</module>
<module>aws-ec2</module>
[18/50] [abbrv] git commit: Prefer ByteSource payload
Posted by an...@apache.org.
Prefer ByteSource payload
Also use randomByteSource for test input.
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/0e3d1475
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/0e3d1475
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/0e3d1475
Branch: refs/heads/fix-jclouds-538
Commit: 0e3d1475ab50e1232d5eac16eee1d3a207e36f42
Parents: a73340a
Author: Andrew Gaul <ga...@apache.org>
Authored: Tue Sep 9 15:28:55 2014 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Tue Sep 9 15:32:39 2014 -0700
----------------------------------------------------------------------
.../internal/BaseContainerLiveTest.java | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/0e3d1475/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseContainerLiveTest.java
----------------------------------------------------------------------
diff --git a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseContainerLiveTest.java b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseContainerLiveTest.java
index b2f7d68..5564d42 100644
--- a/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseContainerLiveTest.java
+++ b/blobstore/src/test/java/org/jclouds/blobstore/integration/internal/BaseContainerLiveTest.java
@@ -25,6 +25,7 @@ import static org.testng.Assert.assertTrue;
import java.io.IOException;
import java.net.MalformedURLException;
+import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.List;
import java.util.logging.Logger;
@@ -35,16 +36,18 @@ import org.jclouds.blobstore.domain.BlobMetadata;
import org.jclouds.blobstore.domain.StorageMetadata;
import org.jclouds.domain.Location;
import org.jclouds.javax.annotation.Nullable;
+import org.jclouds.io.ByteStreams2;
import org.jclouds.predicates.SocketOpen;
import org.jclouds.util.Strings2;
+import org.jclouds.utils.TestUtils;
import org.testng.SkipException;
import org.testng.annotations.Test;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
-import com.google.common.base.Strings;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
+import com.google.common.io.ByteSource;
public class BaseContainerLiveTest extends BaseBlobStoreIntegrationTest {
@@ -100,7 +103,7 @@ public class BaseContainerLiveTest extends BaseBlobStoreIntegrationTest {
public void testPublicAccessInNonDefaultLocation() throws InterruptedException, MalformedURLException, IOException {
Location nonDefault = findNonDefaultLocationOrSkip(view.getBlobStore(), defaultLocation);
- String payload = "my data";
+ ByteSource payload = ByteSource.wrap("my data".getBytes(StandardCharsets.UTF_8));
runCreateContainerInLocation(payload, nonDefault);
}
@@ -108,11 +111,11 @@ public class BaseContainerLiveTest extends BaseBlobStoreIntegrationTest {
public void testPublicAccessInNonDefaultLocationWithBigBlob() throws InterruptedException, MalformedURLException,
IOException {
Location nonDefault = findNonDefaultLocationOrSkip(view.getBlobStore(), defaultLocation);
- String payload = Strings.repeat("a", 1024 * 1024); // 1MB
+ ByteSource payload = TestUtils.randomByteSource().slice(0, 1024 * 1024);
runCreateContainerInLocation(payload, nonDefault);
}
- private void runCreateContainerInLocation(String payload, Location nonDefault) throws InterruptedException,
+ private void runCreateContainerInLocation(ByteSource payload, Location nonDefault) throws InterruptedException,
IOException {
String blobName = "hello";
BlobStore blobStore = view.getBlobStore();
@@ -124,12 +127,15 @@ public class BaseContainerLiveTest extends BaseBlobStoreIntegrationTest {
assertConsistencyAwareContainerExists(containerName);
assertConsistencyAwareContainerInLocation(containerName, nonDefault);
- blobStore.putBlob(containerName, blobStore.blobBuilder(blobName).payload(payload).build());
+ blobStore.putBlob(containerName, blobStore.blobBuilder(blobName)
+ .payload(payload)
+ .contentLength(payload.size())
+ .build());
assertConsistencyAwareContainerSize(containerName, 1);
BlobMetadata metadata = view.getBlobStore().blobMetadata(containerName, blobName);
- assertEquals(Strings2.toStringAndClose(view.utils().http().get(metadata.getPublicUri())), payload);
+ assertEquals(ByteStreams2.toByteArrayAndClose(view.utils().http().get(metadata.getPublicUri())), payload.read());
assertConsistencyAwareBlobInLocation(containerName, blobName, nonDefault);
[32/50] [abbrv] git commit: Enforce that interfaces are types via
Checkstyle
Posted by an...@apache.org.
Enforce that interfaces are types via Checkstyle
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/b9f54a33
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/b9f54a33
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/b9f54a33
Branch: refs/heads/fix-jclouds-538
Commit: b9f54a3301a5a482c6660d4a7c4cf54b4d87a11c
Parents: 2004813
Author: Andrew Gaul <ga...@apache.org>
Authored: Sat Sep 6 11:20:56 2014 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Sat Sep 20 18:48:40 2014 -0700
----------------------------------------------------------------------
resources/checkstyle.xml | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/b9f54a33/resources/checkstyle.xml
----------------------------------------------------------------------
diff --git a/resources/checkstyle.xml b/resources/checkstyle.xml
index d08ce5b..0be56a3 100644
--- a/resources/checkstyle.xml
+++ b/resources/checkstyle.xml
@@ -30,6 +30,7 @@
<module name="IllegalInstantiation">
<property name="classes" value="java.lang.Boolean,java.lang.Short,java.lang.Integer,java.lang.Long"/>
</module>
+ <module name="InterfaceIsType"/>
<!--
jclouds prefers 120 character line lengths but has many files with
longer lines
[26/50] [abbrv] git commit: Add assertj-core and assertj-guava
dependencies to project pom
Posted by an...@apache.org.
Add assertj-core and assertj-guava dependencies to project pom
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/0ac7dfd3
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/0ac7dfd3
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/0ac7dfd3
Branch: refs/heads/fix-jclouds-538
Commit: 0ac7dfd37715b22b4ad4b7d611004889490e3839
Parents: 9f0b86e
Author: Jeremy Daggett <je...@rackspace.com>
Authored: Tue Sep 16 13:18:10 2014 -0700
Committer: Jeremy Daggett <jd...@apache.org>
Committed: Wed Sep 17 15:06:00 2014 -0700
----------------------------------------------------------------------
project/pom.xml | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/0ac7dfd3/project/pom.xml
----------------------------------------------------------------------
diff --git a/project/pom.xml b/project/pom.xml
index 286bfe3..45c8e73 100644
--- a/project/pom.xml
+++ b/project/pom.xml
@@ -202,6 +202,8 @@
<sourceReleaseAssemblyDescriptor>source-release-zip-tar</sourceReleaseAssemblyDescriptor>
<okhttp.version>1.6.0</okhttp.version>
<surefire.version>2.17</surefire.version>
+ <assertj-core.version>1.6.1</assertj-core.version>
+ <assertj-guava.version>1.2.0</assertj-guava.version>
</properties>
<dependencyManagement>
@@ -277,6 +279,16 @@
<artifactId>logback-core</artifactId>
<version>1.1.2</version>
</dependency>
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-core</artifactId>
+ <version>${assertj-core.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-guava</artifactId>
+ <version>${assertj-guava.version}</version>
+ </dependency>
</dependencies>
</dependencyManagement>
<dependencies>
@@ -310,6 +322,16 @@
<artifactId>core.incubator</artifactId>
<optional>true</optional>
</dependency>
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-guava</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
[44/50] [abbrv] JCLOUDS-692 Remove the CloudSigma v1 provider.
Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/ProfileType.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/ProfileType.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/ProfileType.java
deleted file mode 100644
index 383a691..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/ProfileType.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-public enum ProfileType {
- REGULAR, UNRECOGNIZED;
- public String value() {
- return name().toLowerCase();
- }
-
- @Override
- public String toString() {
- return value();
- }
-
- public static ProfileType fromValue(String type) {
- try {
- return valueOf(checkNotNull(type, "type").toUpperCase());
- } catch (IllegalArgumentException e) {
- return UNRECOGNIZED;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/SCSIDevice.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/SCSIDevice.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/SCSIDevice.java
deleted file mode 100644
index 932a722..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/SCSIDevice.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.domain;
-
-import static com.google.common.base.Preconditions.checkArgument;
-
-public class SCSIDevice extends Device {
- public static class Builder extends Device.Builder {
- private final int unit;
-
- public Builder(int unit) {
- this.unit = unit;
- }
-
- @Override
- public Device build() {
- return new SCSIDevice(uuid, mediaType, unit);
- }
-
- }
-
- private static final int bus = 0;
- private final int unit;
-
- public SCSIDevice(String driveUuid, MediaType mediaType, int unit) {
- super(driveUuid, mediaType);
- checkArgument(unit >= 0 && unit < 8, "unit must be between 0 and 7");
- this.unit = unit;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + bus;
- result = prime * result + unit;
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- SCSIDevice other = (SCSIDevice) obj;
- if (unit != other.unit)
- return false;
- return true;
- }
-
- public int getBus() {
- return bus;
- }
-
- public int getUnit() {
- return unit;
- }
-
- @Override
- public String getId() {
- return String.format("scsi:%d:%d", bus, unit);
- }
-
- @Override
- public String toString() {
- return "[id=" + getId() + ", driveUuid=" + driveUuid + ", mediaType=" + mediaType + "]";
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/Server.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/Server.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/Server.java
deleted file mode 100644
index ea92d1d..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/Server.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.jclouds.javax.annotation.Nullable;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-
-public class Server extends Item {
-
- public static class Builder extends Item.Builder {
- protected int cpu;
- protected Integer smp;
- protected int mem;
- protected boolean persistent;
- protected Map<String, ? extends Device> devices = ImmutableMap.of();
- protected Set<String> bootDeviceIds = ImmutableSet.of();
- protected List<NIC> nics = ImmutableList.of();
- protected VNC vnc;
- // TODO cloudsigma specific
- protected String description;
-
- public Builder cpu(int cpu) {
- this.cpu = cpu;
- return this;
- }
-
- public Builder smp(Integer smp) {
- this.smp = smp;
- return this;
- }
-
- public Builder mem(int mem) {
- this.mem = mem;
- return this;
- }
-
- public Builder persistent(boolean persistent) {
- this.persistent = persistent;
- return this;
- }
-
- public Builder devices(Map<String, ? extends Device> devices) {
- this.devices = ImmutableMap.copyOf(checkNotNull(devices, "devices"));
- return this;
- }
-
- public Builder bootDeviceIds(Iterable<String> bootDeviceIds) {
- this.bootDeviceIds = ImmutableSet.copyOf(checkNotNull(bootDeviceIds, "bootDeviceIds"));
- return this;
- }
-
- public Builder nics(Iterable<NIC> nics) {
- this.nics = ImmutableList.copyOf(checkNotNull(nics, "nics"));
- return this;
- }
-
- public Builder vnc(VNC vnc) {
- this.vnc = vnc;
- return this;
- }
-
- public Builder description(String description) {
- this.description = description;
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder uuid(String uuid) {
- return Builder.class.cast(super.uuid(uuid));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder name(String name) {
- return Builder.class.cast(super.name(name));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder use(Iterable<String> use) {
- return Builder.class.cast(super.use(use));
- }
-
- public Server build() {
- return new Server(uuid, name, cpu, smp, mem, persistent, devices, bootDeviceIds, use, nics, vnc, description);
- }
-
- public static Builder fromServer(Server in) {
- return new Builder().uuid(in.getUuid()).name(in.getName()).cpu(in.getCpu()).mem(in.getMem())
- .persistent(in.isPersistent()).description(in.getDescription()).devices(in.getDevices())
- .bootDeviceIds(in.getBootDeviceIds()).use(in.getUse()).nics(in.getNics()).vnc(in.getVnc());
- }
- }
-
- protected final int cpu;
- protected final Integer smp;
- protected final int mem;
- protected final boolean persistent;
- @Nullable
- protected final Map<String, Device> devices;
- protected final Set<String> bootDeviceIds;
- protected final List<NIC> nics;
- protected final VNC vnc;
- @Nullable
- private final String description;
-
- public Server(@Nullable String uuid, String name, int cpu, @Nullable Integer smp, int mem, boolean persistent,
- Map<String, ? extends Device> devices, Iterable<String> bootDeviceIds, Iterable<String> use,
- Iterable<NIC> nics, VNC vnc, String description) {
- super(uuid, name, use);
- this.cpu = cpu;
- this.smp = smp;
- this.mem = mem;
- this.persistent = persistent;
- this.devices = ImmutableMap.copyOf(checkNotNull(devices, "devices"));
- this.bootDeviceIds = ImmutableSet.copyOf(checkNotNull(bootDeviceIds, "bootDeviceIds"));
- this.nics = ImmutableList.copyOf(checkNotNull(nics, "nics"));
- this.vnc = checkNotNull(vnc, "vnc");
- this.description = description;
- }
-
- /**
- *
- * @return CPU quota in core MHz.
- */
- public int getCpu() {
- return cpu;
- }
-
- /**
- *
- * @return number of virtual processors or null if calculated based on cpu.
- */
- public Integer getSmp() {
- return smp;
- }
-
- /**
- *
- * @return virtual memory size in MB.
- */
- public int getMem() {
- return mem;
- }
-
- /**
- *
- * @return 'true' means that server will revert to a 'stopped' status on server stop or shutdown,
- * rather than being destroyed automatically.
- */
- public boolean isPersistent() {
- return persistent;
- }
-
- /**
- *
- * @return devices present, mapped by id
- */
- public Map<String, Device> getDevices() {
- return devices;
- }
-
- /**
- *
- * @return ids of the devices to boot, e.g. ide:0:0 or ide:1:0
- * @see Device#getId()
- */
- public Set<String> getBootDeviceIds() {
- return bootDeviceIds;
- }
-
- public List<NIC> getNics() {
- return nics;
- }
-
- public VNC getVnc() {
- return vnc;
- }
-
- // TODO undocumented
- public String getDescription() {
- return description;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result + ((bootDeviceIds == null) ? 0 : bootDeviceIds.hashCode());
- result = prime * result + cpu;
- result = prime * result + ((description == null) ? 0 : description.hashCode());
- result = prime * result + ((devices == null) ? 0 : devices.hashCode());
- result = prime * result + mem;
- result = prime * result + ((nics == null) ? 0 : nics.hashCode());
- result = prime * result + (persistent ? 1231 : 1237);
- result = prime * result + ((smp == null) ? 0 : smp.hashCode());
- result = prime * result + ((vnc == null) ? 0 : vnc.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (!super.equals(obj))
- return false;
- if (getClass() != obj.getClass())
- return false;
- Server other = (Server) obj;
- if (bootDeviceIds == null) {
- if (other.bootDeviceIds != null)
- return false;
- } else if (!bootDeviceIds.equals(other.bootDeviceIds))
- return false;
- if (cpu != other.cpu)
- return false;
- if (description == null) {
- if (other.description != null)
- return false;
- } else if (!description.equals(other.description))
- return false;
- if (devices == null) {
- if (other.devices != null)
- return false;
- } else if (!devices.equals(other.devices))
- return false;
- if (mem != other.mem)
- return false;
- if (nics == null) {
- if (other.nics != null)
- return false;
- } else if (!nics.equals(other.nics))
- return false;
- if (persistent != other.persistent)
- return false;
- if (smp == null) {
- if (other.smp != null)
- return false;
- } else if (!smp.equals(other.smp))
- return false;
- if (vnc == null) {
- if (other.vnc != null)
- return false;
- } else if (!vnc.equals(other.vnc))
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return "[uuid=" + uuid + ", name=" + name + ", use=" + use + ", cpu=" + cpu + ", smp=" + smp + ", mem=" + mem
- + ", persistent=" + persistent + ", devices=" + devices + ", bootDeviceIds=" + bootDeviceIds + ", nics="
- + nics + ", vnc=" + vnc + ", description=" + description + "]";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/ServerInfo.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/ServerInfo.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/ServerInfo.java
deleted file mode 100644
index 0763bd7..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/ServerInfo.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.domain;
-
-import java.util.Date;
-import java.util.Map;
-
-import org.jclouds.javax.annotation.Nullable;
-
-public class ServerInfo extends Server {
-
- public static class Builder extends Server.Builder {
- protected ServerStatus status;
- protected Date started;
- protected String user;
- protected ServerMetrics metrics;
-
- public Builder status(ServerStatus status) {
- this.status = status;
- return this;
- }
-
- public Builder started(Date started) {
- this.started = started;
- return this;
- }
-
- public Builder user(String user) {
- this.user = user;
- return this;
- }
-
- public Builder metrics(ServerMetrics metrics) {
- this.metrics = metrics;
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder cpu(int cpu) {
- return Builder.class.cast(super.cpu(cpu));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder smp(Integer smp) {
- return Builder.class.cast(super.smp(smp));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder mem(int mem) {
- return Builder.class.cast(super.mem(mem));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder persistent(boolean persistent) {
- return Builder.class.cast(super.persistent(persistent));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder devices(Map<String, ? extends Device> devices) {
- return Builder.class.cast(super.devices(devices));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder bootDeviceIds(Iterable<String> bootDeviceIds) {
- return Builder.class.cast(super.bootDeviceIds(bootDeviceIds));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder nics(Iterable<NIC> nics) {
- return Builder.class.cast(super.nics(nics));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder vnc(VNC vnc) {
- return Builder.class.cast(super.vnc(vnc));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder description(String description) {
- return Builder.class.cast(super.description(description));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder uuid(String uuid) {
- return Builder.class.cast(super.uuid(uuid));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder name(String name) {
- return Builder.class.cast(super.name(name));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder use(Iterable<String> use) {
- return Builder.class.cast(super.use(use));
- }
-
- public ServerInfo build() {
- return new ServerInfo(uuid, name, cpu, smp, mem, persistent, devices, bootDeviceIds, use, nics, vnc,
- description, status, started, user, metrics);
- }
- }
-
- protected final ServerStatus status;
- @Nullable
- protected final Date started;
- @Nullable
- protected final String user;
- protected final ServerMetrics metrics;
-
- public ServerInfo(String uuid, String name, int cpu, Integer smp, int mem, boolean persistent,
- Map<String, ? extends Device> devices, Iterable<String> bootDeviceIds, Iterable<String> use,
- Iterable<NIC> nics, VNC vnc, String description, ServerStatus status, Date started, String user,
- @Nullable ServerMetrics metrics) {
- super(uuid, name, cpu, smp, mem, persistent, devices, bootDeviceIds, use, nics, vnc, description);
- this.status = status;
- this.started = started;
- this.user = user;
- this.metrics = metrics;
- }
-
- /**
- *
- * @return active | stopped | paused | dumped | dead
- */
- public ServerStatus getStatus() {
- return status;
- }
-
- // TODO undocumented
- public Date getStarted() {
- return started;
- }
-
- /**
- *
- * @return metrics, if the server is running, or null
- */
- @Nullable
- public ServerMetrics getMetrics() {
- return metrics;
- }
-
- // TODO undocumented
- /**
- *
- * @return owner of the server.
- */
- public String getUser() {
- return user;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result + ((metrics == null) ? 0 : metrics.hashCode());
- result = prime * result + ((started == null) ? 0 : started.hashCode());
- result = prime * result + ((status == null) ? 0 : status.hashCode());
- result = prime * result + ((user == null) ? 0 : user.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (!super.equals(obj))
- return false;
- if (getClass() != obj.getClass())
- return false;
- ServerInfo other = (ServerInfo) obj;
- if (metrics == null) {
- if (other.metrics != null)
- return false;
- } else if (!metrics.equals(other.metrics))
- return false;
- if (started == null) {
- if (other.started != null)
- return false;
- } else if (!started.equals(other.started))
- return false;
- if (status != other.status)
- return false;
- if (user == null) {
- if (other.user != null)
- return false;
- } else if (!user.equals(other.user))
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return "[cpu=" + cpu + ", smp=" + smp + ", mem=" + mem + ", persistent=" + persistent + ", devices=" + devices
- + ", bootDeviceIds=" + bootDeviceIds + ", nics=" + nics + ", vnc=" + vnc + ", uuid=" + uuid + ", name="
- + name + ", use=" + use + ", status=" + status + ", started=" + started + ", user=" + user + ", metrics="
- + metrics + "]";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/ServerMetrics.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/ServerMetrics.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/ServerMetrics.java
deleted file mode 100644
index 7c39b8d..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/ServerMetrics.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Map;
-
-import com.google.common.collect.ImmutableMap;
-
-public class ServerMetrics {
-
- public static class Builder {
- protected long txPackets;
- protected long tx;
- protected long rxPackets;
- protected long rx;
- protected Map<String, DriveMetrics> driveMetrics = ImmutableMap.<String, DriveMetrics> of();
-
- public Builder txPackets(long txPackets) {
- this.txPackets = txPackets;
- return this;
- }
-
- public Builder tx(long tx) {
- this.tx = tx;
- return this;
- }
-
- public Builder rxPackets(long rxPackets) {
- this.rxPackets = rxPackets;
- return this;
- }
-
- public Builder rx(long rx) {
- this.rx = rx;
- return this;
- }
-
- public Builder driveMetrics(Map<String, ? extends DriveMetrics> driveMetrics) {
- this.driveMetrics = ImmutableMap.copyOf(checkNotNull(driveMetrics, "driveMetrics"));
- return this;
- }
-
- public ServerMetrics build() {
- return new ServerMetrics(tx, txPackets, rx, rxPackets, driveMetrics);
- }
- }
-
- protected final long txPackets;
- protected final long tx;
- protected final long rxPackets;
- protected final long rx;
- protected final Map<String, DriveMetrics> driveMetrics;
-
- public ServerMetrics(long tx, long txPackets, long rx, long rxPackets, Map<String, DriveMetrics> driveMetrics) {
- this.txPackets = txPackets;
- this.tx = tx;
- this.rxPackets = rxPackets;
- this.rx = rx;
- this.driveMetrics = ImmutableMap.copyOf(checkNotNull(driveMetrics, "driveMetrics"));
- }
-
- // TODO undocumented
- public long getTxPackets() {
- return txPackets;
- }
-
- // TODO undocumented
- public long getTx() {
- return tx;
- }
-
- // TODO undocumented
- public long getRxPackets() {
- return rxPackets;
- }
-
- // TODO undocumented
- public long getRx() {
- return rx;
- }
-
- /**
- *
- * @return metrics keyed on device id ex. {@code ide:0:0}
- */
- public Map<String, DriveMetrics> getDriveMetrics() {
- return driveMetrics;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((driveMetrics == null) ? 0 : driveMetrics.hashCode());
- result = prime * result + (int) (rx ^ (rx >>> 32));
- result = prime * result + (int) (rxPackets ^ (rxPackets >>> 32));
- result = prime * result + (int) (tx ^ (tx >>> 32));
- result = prime * result + (int) (txPackets ^ (txPackets >>> 32));
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- ServerMetrics other = (ServerMetrics) obj;
- if (driveMetrics == null) {
- if (other.driveMetrics != null)
- return false;
- } else if (!driveMetrics.equals(other.driveMetrics))
- return false;
- if (rx != other.rx)
- return false;
- if (rxPackets != other.rxPackets)
- return false;
- if (tx != other.tx)
- return false;
- if (txPackets != other.txPackets)
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return "[ txPackets=" + txPackets + ", tx=" + tx + ", rxPackets=" + rxPackets + ", rx=" + rx + ", driveMetrics="
- + driveMetrics + "]";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/ServerStatus.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/ServerStatus.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/ServerStatus.java
deleted file mode 100644
index 19c164a..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/ServerStatus.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-public enum ServerStatus {
- ACTIVE, STOPPED, PAUSED, DUMPED, DEAD, UNRECOGNIZED;
- public String value() {
- return name().toLowerCase();
- }
-
- @Override
- public String toString() {
- return value();
- }
-
- public static ServerStatus fromValue(String status) {
- try {
- return valueOf(checkNotNull(status, "status").toUpperCase());
- } catch (IllegalArgumentException e) {
- return UNRECOGNIZED;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/StaticIPInfo.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/StaticIPInfo.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/StaticIPInfo.java
deleted file mode 100644
index fdef081..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/StaticIPInfo.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Set;
-
-import org.jclouds.javax.annotation.Nullable;
-
-import com.google.common.collect.ImmutableSet;
-
-public class StaticIPInfo {
- public static class Builder {
- protected String ip;
- protected String user;
- protected String netmask;
- protected Set<String> nameservers = ImmutableSet.of();
- protected String gateway;
-
- public Builder ip(String ip) {
- this.ip = ip;
- return this;
- }
-
- public Builder user(String user) {
- this.user = user;
- return this;
- }
-
- public Builder nameservers(Iterable<String> nameservers) {
- this.nameservers = ImmutableSet.copyOf(checkNotNull(nameservers, "nameservers"));
- return this;
- }
-
- public Builder gateway(String gateway) {
- this.gateway = gateway;
- return this;
- }
-
- public Builder netmask(String netmask) {
- this.netmask = netmask;
- return this;
- }
-
- public StaticIPInfo build() {
- return new StaticIPInfo(ip, user, netmask, nameservers, gateway);
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((gateway == null) ? 0 : gateway.hashCode());
- result = prime * result + ((nameservers == null) ? 0 : nameservers.hashCode());
- result = prime * result + ((netmask == null) ? 0 : netmask.hashCode());
- result = prime * result + ((user == null) ? 0 : user.hashCode());
- result = prime * result + ((ip == null) ? 0 : ip.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Builder other = (Builder) obj;
- if (gateway == null) {
- if (other.gateway != null)
- return false;
- } else if (!gateway.equals(other.gateway))
- return false;
- if (nameservers == null) {
- if (other.nameservers != null)
- return false;
- } else if (!nameservers.equals(other.nameservers))
- return false;
- if (netmask == null) {
- if (other.netmask != null)
- return false;
- } else if (!netmask.equals(other.netmask))
- return false;
- if (user == null) {
- if (other.user != null)
- return false;
- } else if (!user.equals(other.user))
- return false;
- if (ip == null) {
- if (other.ip != null)
- return false;
- } else if (!ip.equals(other.ip))
- return false;
- return true;
- }
- }
-
- protected final String ip;
- protected final String user;
- protected final String netmask;
- protected final Set<String> nameservers;
- protected final String gateway;
-
- public StaticIPInfo(String ip, String user, String netmask, Iterable<String> nameservers, String gateway) {
- this.ip = checkNotNull(ip, "ip");
- this.user = checkNotNull(user, "user");
- this.netmask = checkNotNull(netmask, "netmask");
- this.nameservers = ImmutableSet.copyOf(checkNotNull(nameservers, "nameservers"));
- this.gateway = checkNotNull(gateway, "gateway");
- }
-
- /**
- *
- * @return ip of the ip.
- */
- @Nullable
- public String getAddress() {
- return ip;
- }
-
- /**
- *
- * @return user owning the ip
- */
- public String getUser() {
- return user;
- }
-
- /**
- *
- * @return netmask of the ip
- */
- public String getNetmask() {
- return netmask;
- }
-
- /**
- *
- * @return nameservers of the ip
- */
- public Set<String> getNameservers() {
- return nameservers;
- }
-
- /**
- *
- * @return gateway of the ip
- */
- public String getGateway() {
- return gateway;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((gateway == null) ? 0 : gateway.hashCode());
- result = prime * result + ((nameservers == null) ? 0 : nameservers.hashCode());
- result = prime * result + ((netmask == null) ? 0 : netmask.hashCode());
- result = prime * result + ((user == null) ? 0 : user.hashCode());
- result = prime * result + ((ip == null) ? 0 : ip.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- StaticIPInfo other = (StaticIPInfo) obj;
- if (gateway == null) {
- if (other.gateway != null)
- return false;
- } else if (!gateway.equals(other.gateway))
- return false;
- if (nameservers == null) {
- if (other.nameservers != null)
- return false;
- } else if (!nameservers.equals(other.nameservers))
- return false;
- if (netmask == null) {
- if (other.netmask != null)
- return false;
- } else if (!netmask.equals(other.netmask))
- return false;
- if (user == null) {
- if (other.user != null)
- return false;
- } else if (!user.equals(other.user))
- return false;
- if (ip == null) {
- if (other.ip != null)
- return false;
- } else if (!ip.equals(other.ip))
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return "[ip=" + ip + ", user=" + user + ", netmask=" + netmask + ", nameservers="
- + nameservers + ", gateway=" + gateway + "]";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/VLANInfo.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/VLANInfo.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/VLANInfo.java
deleted file mode 100644
index 87635e2..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/VLANInfo.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.javax.annotation.Nullable;
-
-public class VLANInfo {
- public static class Builder {
- protected String uuid;
- protected String name;
- protected String user;
-
- public Builder uuid(String uuid) {
- this.uuid = uuid;
- return this;
- }
-
- public Builder name(String name) {
- this.name = name;
- return this;
- }
-
- public Builder user(String user) {
- this.user = user;
- return this;
- }
-
- public VLANInfo build() {
- return new VLANInfo(uuid, name, user);
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- result = prime * result + ((user == null) ? 0 : user.hashCode());
- result = prime * result + ((uuid == null) ? 0 : uuid.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Builder other = (Builder) obj;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name))
- return false;
- if (user == null) {
- if (other.user != null)
- return false;
- } else if (!user.equals(other.user))
- return false;
- if (uuid == null) {
- if (other.uuid != null)
- return false;
- } else if (!uuid.equals(other.uuid))
- return false;
- return true;
- }
- }
-
- @Nullable
- protected final String uuid;
- protected final String name;
- protected final String user;
-
- public VLANInfo(String uuid, String name, String user) {
- this.uuid = checkNotNull(uuid, "uuid");
- this.name = checkNotNull(name, "name");
- this.user = checkNotNull(user, "user");
- }
-
- /**
- *
- * @return uuid of the vlan.
- */
- @Nullable
- public String getUuid() {
- return uuid;
- }
-
- /**
- *
- * @return name of the vlan
- */
- public String getName() {
- return name;
- }
-
- /**
- *
- * @return user owning the vlan
- */
- public String getUser() {
- return user;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- result = prime * result + ((user == null) ? 0 : user.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- VLANInfo other = (VLANInfo) obj;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name))
- return false;
- if (user == null) {
- if (other.user != null)
- return false;
- } else if (!user.equals(other.user))
- return false;
-
- return true;
- }
-
- @Override
- public String toString() {
- return "[uuid=" + uuid + ", name=" + name + ", user=" + user + "]";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/VNC.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/VNC.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/VNC.java
deleted file mode 100644
index f28a553..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/domain/VNC.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.domain;
-
-import org.jclouds.javax.annotation.Nullable;
-
-public class VNC {
- @Nullable
- private final String ip;
- @Nullable
- private final String password;
- private final boolean tls;
-
- public VNC(String ip, String password, boolean tls) {
- this.ip = ip;
- this.password = password;
- this.tls = tls;
- }
-
- /**
- *
- * @return IP address for overlay VNC access on port 5900. Set to 'auto', to reuse nic:0:dhcp if
- * available, or otherwise allocate a temporary IP at boot.
- */
- public String getIp() {
- return ip;
- }
-
- /**
- *
- * @return Password for VNC access. If unset, VNC is disabled.
- */
- public String getPassword() {
- return password;
- }
-
- /**
- *
- * @return Set to 'on' to require VeNCrypt-style TLS auth in addition to the password. If this is
- * unset, only unencrypted VNC is available.
- */
- public boolean isTls() {
- return tls;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((ip == null) ? 0 : ip.hashCode());
- result = prime * result + ((password == null) ? 0 : password.hashCode());
- result = prime * result + (tls ? 1231 : 1237);
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- VNC other = (VNC) obj;
- if (ip == null) {
- if (other.ip != null)
- return false;
- } else if (!ip.equals(other.ip))
- return false;
- if (password == null) {
- if (other.password != null)
- return false;
- } else if (!password.equals(other.password))
- return false;
- if (tls != other.tls)
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return "[ip=" + ip + ", password=" + password + ", tls=" + tls + "]";
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/BaseDriveToMap.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/BaseDriveToMap.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/BaseDriveToMap.java
deleted file mode 100644
index 47e9d2a..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/BaseDriveToMap.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Map;
-
-import javax.inject.Singleton;
-
-import org.jclouds.cloudsigma.domain.ClaimType;
-import org.jclouds.cloudsigma.domain.Drive;
-
-import com.google.common.base.Function;
-import com.google.common.base.Joiner;
-import com.google.common.collect.ImmutableMap;
-
-@Singleton
-public class BaseDriveToMap implements Function<Drive, Map<String, String>> {
- @Override
- public Map<String, String> apply(Drive from) {
- checkNotNull(from, "drive");
- ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
- builder.put("name", from.getName());
- builder.put("size", from.getSize() + "");
- if (from.getClaimType() != ClaimType.EXCLUSIVE)
- builder.put("claim:type", from.getClaimType().toString());
- if (!from.getTags().isEmpty())
- builder.put("tags", Joiner.on(' ').join(from.getTags()));
- if (!from.getReaders().isEmpty())
- builder.put("readers", Joiner.on(' ').join(from.getReaders()));
- if (!from.getUse().isEmpty())
- builder.put("use", Joiner.on(' ').join(from.getUse()));
- return builder.build();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/DriveDataToMap.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/DriveDataToMap.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/DriveDataToMap.java
deleted file mode 100644
index 469f888..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/DriveDataToMap.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Predicates.equalTo;
-import static com.google.common.base.Predicates.not;
-import static com.google.common.collect.Maps.filterKeys;
-
-import java.util.Map;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.cloudsigma.domain.DriveData;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableMap.Builder;
-
-@Singleton
-public class DriveDataToMap implements Function<DriveData, Map<String, String>> {
- private final BaseDriveToMap baseDriveToMap;
-
- @Inject
- public DriveDataToMap(BaseDriveToMap baseDriveToMap) {
- this.baseDriveToMap = baseDriveToMap;
- }
-
- @Override
- public Map<String, String> apply(DriveData from) {
- return renameKey(baseDriveToMap.apply(from), "use", "use");
- }
-
- /**
- * If the supplied map contains the key {@code k1}, its value will be assigned to the key {@code
- * k2}. Note that this doesn't modify the input map.
- *
- * @param <V>
- * type of value the map holds
- * @param in
- * the map you wish to make a copy of
- * @param k1
- * old key
- * @param k2
- * new key
- * @return copy of the map with the value of the key re-routed, or the original, if it {@code k1}
- * wasn't present.
- */
- @VisibleForTesting
- static <V> Map<String, V> renameKey(Map<String, V> in, String k1, String k2) {
- if (checkNotNull(in, "input map").containsKey(checkNotNull(k1, "old key"))) {
- Builder<String, V> builder = ImmutableMap.builder();
- builder.putAll(filterKeys(in, not(equalTo(k1))));
- V tags = in.get(k1);
- builder.put(checkNotNull(k2, "new key"), tags);
- in = builder.build();
- }
- return in;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToDriveInfo.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToDriveInfo.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToDriveInfo.java
deleted file mode 100644
index e247adc..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToDriveInfo.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import java.util.Set;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.cloudsigma.domain.DriveInfo;
-import org.jclouds.http.HttpResponse;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-
-@Singleton
-public class KeyValuesDelimitedByBlankLinesToDriveInfo implements Function<HttpResponse, DriveInfo> {
- private final ListOfKeyValuesDelimitedByBlankLinesToDriveInfoSet setParser;
-
- @Inject
- public KeyValuesDelimitedByBlankLinesToDriveInfo(ListOfKeyValuesDelimitedByBlankLinesToDriveInfoSet setParser) {
- this.setParser = setParser;
- }
-
- @Override
- public DriveInfo apply(HttpResponse response) {
- Set<DriveInfo> drives = setParser.apply(response);
- if (drives.isEmpty())
- return null;
- return Iterables.get(drives, 0);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToProfileInfo.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToProfileInfo.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToProfileInfo.java
deleted file mode 100644
index 282787e..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToProfileInfo.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import java.util.Set;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.cloudsigma.domain.ProfileInfo;
-import org.jclouds.http.HttpResponse;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-
-@Singleton
-public class KeyValuesDelimitedByBlankLinesToProfileInfo implements Function<HttpResponse, ProfileInfo> {
- private final ListOfKeyValuesDelimitedByBlankLinesToProfileInfoSet setParser;
-
- @Inject
- public KeyValuesDelimitedByBlankLinesToProfileInfo(ListOfKeyValuesDelimitedByBlankLinesToProfileInfoSet setParser) {
- this.setParser = setParser;
- }
-
- @Override
- public ProfileInfo apply(HttpResponse response) {
- Set<ProfileInfo> drives = setParser.apply(response);
- if (drives.isEmpty())
- return null;
- return Iterables.get(drives, 0);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToServerInfo.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToServerInfo.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToServerInfo.java
deleted file mode 100644
index 0f68bb2..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToServerInfo.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import java.util.Set;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.cloudsigma.domain.ServerInfo;
-import org.jclouds.http.HttpResponse;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-
-@Singleton
-public class KeyValuesDelimitedByBlankLinesToServerInfo implements Function<HttpResponse, ServerInfo> {
- private final ListOfKeyValuesDelimitedByBlankLinesToServerInfoSet setParser;
-
- @Inject
- public KeyValuesDelimitedByBlankLinesToServerInfo(ListOfKeyValuesDelimitedByBlankLinesToServerInfoSet setParser) {
- this.setParser = setParser;
- }
-
- @Override
- public ServerInfo apply(HttpResponse response) {
- Set<ServerInfo> drives = setParser.apply(response);
- if (drives.isEmpty())
- return null;
- return Iterables.get(drives, 0);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToStaticIPInfo.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToStaticIPInfo.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToStaticIPInfo.java
deleted file mode 100644
index 7e81d84..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToStaticIPInfo.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import java.util.Set;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.cloudsigma.domain.StaticIPInfo;
-import org.jclouds.http.HttpResponse;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-
-@Singleton
-public class KeyValuesDelimitedByBlankLinesToStaticIPInfo implements Function<HttpResponse, StaticIPInfo> {
- private final ListOfKeyValuesDelimitedByBlankLinesToStaticIPInfoSet setParser;
-
- @Inject
- public KeyValuesDelimitedByBlankLinesToStaticIPInfo(ListOfKeyValuesDelimitedByBlankLinesToStaticIPInfoSet setParser) {
- this.setParser = setParser;
- }
-
- @Override
- public StaticIPInfo apply(HttpResponse response) {
- Set<StaticIPInfo> drives = setParser.apply(response);
- if (drives.isEmpty())
- return null;
- return Iterables.get(drives, 0);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToVLANInfo.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToVLANInfo.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToVLANInfo.java
deleted file mode 100644
index 85b2b2b..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToVLANInfo.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import java.util.Set;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.cloudsigma.domain.VLANInfo;
-import org.jclouds.http.HttpResponse;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-
-@Singleton
-public class KeyValuesDelimitedByBlankLinesToVLANInfo implements Function<HttpResponse, VLANInfo> {
- private final ListOfKeyValuesDelimitedByBlankLinesToVLANInfoSet setParser;
-
- @Inject
- public KeyValuesDelimitedByBlankLinesToVLANInfo(ListOfKeyValuesDelimitedByBlankLinesToVLANInfoSet setParser) {
- this.setParser = setParser;
- }
-
- @Override
- public VLANInfo apply(HttpResponse response) {
- Set<VLANInfo> drives = setParser.apply(response);
- if (drives.isEmpty())
- return null;
- return Iterables.get(drives, 0);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToDriveInfoSet.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToDriveInfoSet.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToDriveInfoSet.java
deleted file mode 100644
index 1292d66..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToDriveInfoSet.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import java.util.Set;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.cloudsigma.domain.DriveInfo;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ReturnStringIf2xx;
-
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Iterables;
-
-@Singleton
-public class ListOfKeyValuesDelimitedByBlankLinesToDriveInfoSet implements Function<HttpResponse, Set<DriveInfo>> {
- private final ReturnStringIf2xx returnStringIf200;
- private final ListOfKeyValuesDelimitedByBlankLinesToListOfMaps mapConverter;
- private final MapToDriveInfo mapToDrive;
-
- @Inject
- ListOfKeyValuesDelimitedByBlankLinesToDriveInfoSet(ReturnStringIf2xx returnStringIf200,
- ListOfKeyValuesDelimitedByBlankLinesToListOfMaps mapConverter, MapToDriveInfo mapToDrive) {
- this.returnStringIf200 = returnStringIf200;
- this.mapConverter = mapConverter;
- this.mapToDrive = mapToDrive;
- }
-
- @Override
- public Set<DriveInfo> apply(HttpResponse response) {
- String text = returnStringIf200.apply(response);
- if (text == null || text.trim().equals(""))
- return ImmutableSet.<DriveInfo> of();
- return ImmutableSet.copyOf(Iterables.transform(mapConverter.apply(text), mapToDrive));
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToListOfMaps.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToListOfMaps.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToListOfMaps.java
deleted file mode 100644
index 92d8331..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToListOfMaps.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import java.util.List;
-import java.util.Map;
-
-import javax.inject.Singleton;
-
-import com.google.common.base.Function;
-import com.google.common.base.Splitter;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-@Singleton
-public class ListOfKeyValuesDelimitedByBlankLinesToListOfMaps implements Function<String, List<Map<String, String>>> {
-
- @Override
- public List<Map<String, String>> apply(String from) {
- List<Map<String, String>> maps = Lists.newArrayList();
- for (String listOfKeyValues : Splitter.on("\n\n").split(from)) {
- if (!"".equals(listOfKeyValues)) {
- Map<String, String> map = Maps.newLinkedHashMap();
- for (String keyValueLine : Splitter.on('\n').split(listOfKeyValues)) {
- if (!"".equals(keyValueLine)) {
- int firstIndex = keyValueLine.indexOf(' ');
- if (firstIndex != -1) {
- String key = keyValueLine.substring(0, firstIndex);
- String value = keyValueLine.substring(firstIndex + 1).replace("\\n", "\n");
- map.put(key, value);
- }
- }
- }
- if (!map.isEmpty())
- maps.add(map);
- }
- }
- return maps;
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToProfileInfoSet.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToProfileInfoSet.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToProfileInfoSet.java
deleted file mode 100644
index 00bc07d..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToProfileInfoSet.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import java.util.Set;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.cloudsigma.domain.ProfileInfo;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ReturnStringIf2xx;
-
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Iterables;
-
-@Singleton
-public class ListOfKeyValuesDelimitedByBlankLinesToProfileInfoSet implements Function<HttpResponse, Set<ProfileInfo>> {
- private final ReturnStringIf2xx returnStringIf200;
- private final ListOfKeyValuesDelimitedByBlankLinesToListOfMaps mapConverter;
- private final MapToProfileInfo mapToProfile;
-
- @Inject
- ListOfKeyValuesDelimitedByBlankLinesToProfileInfoSet(ReturnStringIf2xx returnStringIf200,
- ListOfKeyValuesDelimitedByBlankLinesToListOfMaps mapConverter, MapToProfileInfo mapToProfile) {
- this.returnStringIf200 = returnStringIf200;
- this.mapConverter = mapConverter;
- this.mapToProfile = mapToProfile;
- }
-
- @Override
- public Set<ProfileInfo> apply(HttpResponse response) {
- String text = returnStringIf200.apply(response);
- if (text == null || text.trim().equals(""))
- return ImmutableSet.<ProfileInfo> of();
- return ImmutableSet.copyOf(Iterables.transform(mapConverter.apply(text), mapToProfile));
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToServerInfoSet.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToServerInfoSet.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToServerInfoSet.java
deleted file mode 100644
index f1eec32..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToServerInfoSet.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import java.util.Set;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.cloudsigma.domain.ServerInfo;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ReturnStringIf2xx;
-
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Iterables;
-
-
-@Singleton
-public class ListOfKeyValuesDelimitedByBlankLinesToServerInfoSet implements Function<HttpResponse, Set<ServerInfo>> {
- private final ReturnStringIf2xx returnStringIf200;
- private final ListOfKeyValuesDelimitedByBlankLinesToListOfMaps mapConverter;
- private final MapToServerInfo mapToServer;
-
- @Inject
- ListOfKeyValuesDelimitedByBlankLinesToServerInfoSet(ReturnStringIf2xx returnStringIf200,
- ListOfKeyValuesDelimitedByBlankLinesToListOfMaps mapConverter, MapToServerInfo mapToServer) {
- this.returnStringIf200 = returnStringIf200;
- this.mapConverter = mapConverter;
- this.mapToServer = mapToServer;
- }
-
- @Override
- public Set<ServerInfo> apply(HttpResponse response) {
- String text = returnStringIf200.apply(response);
- if (text == null || text.trim().equals(""))
- return ImmutableSet.<ServerInfo> of();
- return ImmutableSet.copyOf(Iterables.transform(mapConverter.apply(text), mapToServer));
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToStaticIPInfoSet.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToStaticIPInfoSet.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToStaticIPInfoSet.java
deleted file mode 100644
index 669164a..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToStaticIPInfoSet.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import java.util.Set;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.cloudsigma.domain.StaticIPInfo;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ReturnStringIf2xx;
-
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Iterables;
-
-@Singleton
-public class ListOfKeyValuesDelimitedByBlankLinesToStaticIPInfoSet implements Function<HttpResponse, Set<StaticIPInfo>> {
- private final ReturnStringIf2xx returnStringIf200;
- private final ListOfKeyValuesDelimitedByBlankLinesToListOfMaps mapConverter;
- private final MapToStaticIPInfo mapToProfile;
-
- @Inject
- ListOfKeyValuesDelimitedByBlankLinesToStaticIPInfoSet(ReturnStringIf2xx returnStringIf200,
- ListOfKeyValuesDelimitedByBlankLinesToListOfMaps mapConverter, MapToStaticIPInfo mapToProfile) {
- this.returnStringIf200 = returnStringIf200;
- this.mapConverter = mapConverter;
- this.mapToProfile = mapToProfile;
- }
-
- @Override
- public Set<StaticIPInfo> apply(HttpResponse response) {
- String text = returnStringIf200.apply(response);
- if (text == null || text.trim().equals(""))
- return ImmutableSet.<StaticIPInfo> of();
- return ImmutableSet.copyOf(Iterables.transform(mapConverter.apply(text), mapToProfile));
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToVLANInfoSet.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToVLANInfoSet.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToVLANInfoSet.java
deleted file mode 100644
index 3413279..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToVLANInfoSet.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import java.util.Set;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.cloudsigma.domain.VLANInfo;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ReturnStringIf2xx;
-
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Iterables;
-
-@Singleton
-public class ListOfKeyValuesDelimitedByBlankLinesToVLANInfoSet implements Function<HttpResponse, Set<VLANInfo>> {
- private final ReturnStringIf2xx returnStringIf200;
- private final ListOfKeyValuesDelimitedByBlankLinesToListOfMaps mapConverter;
- private final MapToVLANInfo mapToProfile;
-
- @Inject
- ListOfKeyValuesDelimitedByBlankLinesToVLANInfoSet(ReturnStringIf2xx returnStringIf200,
- ListOfKeyValuesDelimitedByBlankLinesToListOfMaps mapConverter, MapToVLANInfo mapToProfile) {
- this.returnStringIf200 = returnStringIf200;
- this.mapConverter = mapConverter;
- this.mapToProfile = mapToProfile;
- }
-
- @Override
- public Set<VLANInfo> apply(HttpResponse response) {
- String text = returnStringIf200.apply(response);
- if (text == null || text.trim().equals(""))
- return ImmutableSet.<VLANInfo> of();
- return ImmutableSet.copyOf(Iterables.transform(mapConverter.apply(text), mapToProfile));
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfMapsToListOfKeyValuesDelimitedByBlankLines.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfMapsToListOfKeyValuesDelimitedByBlankLines.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfMapsToListOfKeyValuesDelimitedByBlankLines.java
deleted file mode 100644
index f9da173..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/ListOfMapsToListOfKeyValuesDelimitedByBlankLines.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import java.util.Map;
-
-import javax.inject.Singleton;
-
-import com.google.common.base.Function;
-import com.google.common.base.Joiner;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Maps;
-
-@Singleton
-public class ListOfMapsToListOfKeyValuesDelimitedByBlankLines implements
- Function<Iterable<Map<String, String>>, String> {
-
- @Override
- public String apply(Iterable<Map<String, String>> from) {
- return Joiner.on("\n\n").join(Iterables.transform(from, new Function<Map<String, String>, String>() {
-
- @Override
- public String apply(Map<String, String> from) {
- return Joiner.on('\n').withKeyValueSeparator(" ")
- .join(Maps.transformValues(from, new Function<String, String>() {
-
- @Override
- public String apply(String from) {
- return from.replace("\n", "\\n");
- }
-
- }));
- }
-
- }));
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToDevices.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToDevices.java b/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToDevices.java
deleted file mode 100644
index b25a3f0..0000000
--- a/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/functions/MapToDevices.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import java.util.Map;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.cloudsigma.domain.BlockDevice;
-import org.jclouds.cloudsigma.domain.Device;
-import org.jclouds.cloudsigma.domain.IDEDevice;
-import org.jclouds.cloudsigma.domain.MediaType;
-import org.jclouds.cloudsigma.domain.SCSIDevice;
-
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.ImmutableSet.Builder;
-import com.google.common.collect.Maps;
-
-@Singleton
-public class MapToDevices implements Function<Map<String, String>, Map<String, ? extends Device>> {
- @Singleton
- public static class DeviceToId implements Function<Device, String> {
- @Override
- public String apply(Device input) {
- return input.getId();
- }
- }
-
- private final Function<Device, String> deviceToId;
-
- @Inject
- public MapToDevices(Function<Device, String> deviceToId) {
- this.deviceToId = deviceToId;
- }
-
- public Map<String, ? extends Device> apply(Map<String, String> from) {
- Builder<Device> devices = ImmutableSet.builder();
- addIDEDevices(from, devices);
- addSCSIDevices(from, devices);
- addBlockDevices(from, devices);
-
- return Maps.uniqueIndex(devices.build(), deviceToId);
- }
-
- protected void addBlockDevices(Map<String, String> from, Builder<Device> devices) {
- BLOCK: for (int index : new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }) {
- String key = String.format("block:0:%d", index);
- if (!from.containsKey(key))
- break BLOCK;
- devices.add(populateBuilder(new BlockDevice.Builder(index), key, from).build());
- }
- }
-
- protected void addSCSIDevices(Map<String, String> from, Builder<Device> devices) {
- SCSI: for (int unit : new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }) {
- String key = String.format("scsi:0:%d", unit);
- if (!from.containsKey(key))
- break SCSI;
- devices.add(populateBuilder(new SCSIDevice.Builder(unit), key, from).build());
- }
- }
-
- protected void addIDEDevices(Map<String, String> from, Builder<Device> devices) {
- IDE: for (int bus : new int[] { 0, 1 })
- for (int unit : new int[] { 0, 1 }) {
- String key = String.format("ide:%d:%d", bus, unit);
- if (!from.containsKey(key))
- break IDE;
- devices.add(populateBuilder(new IDEDevice.Builder(bus, unit), key, from).build());
- }
- }
-
- protected Device.Builder populateBuilder(Device.Builder deviceBuilder, String key, Map<String, String> from) {
- deviceBuilder.uuid(from.get(key));
- if (from.containsKey(key + ":media"))
- deviceBuilder.mediaType(MediaType.fromValue(from.get(key + ":media")));
- return deviceBuilder;
- }
-}
[11/50] [abbrv] git commit: Skip test when filesystem does not have
xattr
Posted by an...@apache.org.
Skip test when filesystem does not have xattr
Addresses regression from a104944 seen on CloudBees.
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/7869d92b
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/7869d92b
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/7869d92b
Branch: refs/heads/fix-jclouds-538
Commit: 7869d92b299de3e82a0555056b850b01111ac45f
Parents: e1a5c52
Author: Andrew Gaul <ga...@apache.org>
Authored: Fri Sep 5 16:25:57 2014 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Fri Sep 5 17:53:59 2014 -0700
----------------------------------------------------------------------
.../strategy/internal/FilesystemStorageStrategyImplTest.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/7869d92b/apis/filesystem/src/test/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImplTest.java
----------------------------------------------------------------------
diff --git a/apis/filesystem/src/test/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImplTest.java b/apis/filesystem/src/test/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImplTest.java
index c24458e..10bc59e 100644
--- a/apis/filesystem/src/test/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImplTest.java
+++ b/apis/filesystem/src/test/java/org/jclouds/filesystem/strategy/internal/FilesystemStorageStrategyImplTest.java
@@ -16,7 +16,7 @@
*/
package org.jclouds.filesystem.strategy.internal;
-import static org.jclouds.utils.TestUtils.isMacOSX;
+import static java.nio.file.Files.getFileStore;
import static org.jclouds.utils.TestUtils.randomByteSource;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
@@ -27,6 +27,8 @@ import static org.testng.Assert.fail;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
+import java.nio.file.Paths;
+import java.nio.file.attribute.UserDefinedFileAttributeView;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -531,8 +533,8 @@ public class FilesystemStorageStrategyImplTest {
}
public void testOverwriteBlobMetadata() throws Exception {
- if (isMacOSX()) {
- throw new SkipException("blob metadata not supported on Mac OS X");
+ if (!getFileStore(Paths.get(TestUtils.TARGET_BASE_DIR)).supportsFileAttributeView(UserDefinedFileAttributeView.class)) {
+ throw new SkipException("Filesystem does not support xattr");
}
String blobKey = TestUtils.createRandomBlobKey("writePayload-", ".img");
[42/50] [abbrv] JCLOUDS-692 Remove the CloudSigma v1 provider.
Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/CloudSigmaApiTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/CloudSigmaApiTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/CloudSigmaApiTest.java
deleted file mode 100644
index 4dfcb45..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/CloudSigmaApiTest.java
+++ /dev/null
@@ -1,644 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma;
-
-import static org.jclouds.reflect.Reflection2.method;
-import static org.testng.Assert.assertEquals;
-
-import java.io.IOException;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.Fallbacks.VoidOnNotFoundOr404;
-import org.jclouds.apis.ApiMetadata;
-import org.jclouds.cloudsigma.binders.BindServerToPlainTextStringTest;
-import org.jclouds.cloudsigma.domain.CreateDriveRequest;
-import org.jclouds.cloudsigma.domain.Drive;
-import org.jclouds.cloudsigma.domain.DriveData;
-import org.jclouds.cloudsigma.domain.Server;
-import org.jclouds.cloudsigma.functions.KeyValuesDelimitedByBlankLinesToDriveInfo;
-import org.jclouds.cloudsigma.functions.KeyValuesDelimitedByBlankLinesToProfileInfo;
-import org.jclouds.cloudsigma.functions.KeyValuesDelimitedByBlankLinesToServerInfo;
-import org.jclouds.cloudsigma.functions.KeyValuesDelimitedByBlankLinesToStaticIPInfo;
-import org.jclouds.cloudsigma.functions.KeyValuesDelimitedByBlankLinesToVLANInfo;
-import org.jclouds.cloudsigma.functions.ListOfKeyValuesDelimitedByBlankLinesToDriveInfoSet;
-import org.jclouds.cloudsigma.functions.ListOfKeyValuesDelimitedByBlankLinesToServerInfoSet;
-import org.jclouds.cloudsigma.functions.ListOfKeyValuesDelimitedByBlankLinesToStaticIPInfoSet;
-import org.jclouds.cloudsigma.functions.ListOfKeyValuesDelimitedByBlankLinesToVLANInfoSet;
-import org.jclouds.cloudsigma.functions.SplitNewlines;
-import org.jclouds.cloudsigma.functions.SplitNewlinesAndReturnSecondField;
-import org.jclouds.cloudsigma.options.CloneDriveOptions;
-import org.jclouds.fallbacks.MapHttp4xxCodesToExceptions;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.filters.BasicAuthentication;
-import org.jclouds.http.functions.ReleasePayloadAndReturn;
-import org.jclouds.rest.internal.BaseAsyncClientTest;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-import com.google.common.reflect.Invokable;
-/**
- * Tests behavior of {@code CloudSigmaApi}
- */
-// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
-@Test(groups = "unit", testName = "CloudSigmaApiTest")
-public class CloudSigmaApiTest extends BaseAsyncClientTest<CloudSigmaApi> {
-
- public void testGetProfileInfo() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "getProfileInfo");
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.of());
-
- assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/profile/info HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- assertResponseParserClassEquals(method, httpRequest, KeyValuesDelimitedByBlankLinesToProfileInfo.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
- checkFilters(httpRequest);
-
- }
-
- public void testListStandardDrives() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "listStandardDrives");
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.of());
-
- assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/drives/standard/list HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- assertResponseParserClassEquals(method, httpRequest, SplitNewlines.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, null);
-
- checkFilters(httpRequest);
- }
-
- public void testListStandardCds() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "listStandardCds");
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.of());
-
- assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/drives/standard/cd/list HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- assertResponseParserClassEquals(method, httpRequest, SplitNewlines.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, null);
-
- checkFilters(httpRequest);
- }
-
- public void testListStandardImages() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "listStandardImages");
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.of());
-
- assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/drives/standard/img/list HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- assertResponseParserClassEquals(method, httpRequest, SplitNewlines.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, null);
-
- checkFilters(httpRequest);
- }
-
- public void testListDriveInfo() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "listDriveInfo");
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.of());
-
- assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/drives/info HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- assertResponseParserClassEquals(method, httpRequest, ListOfKeyValuesDelimitedByBlankLinesToDriveInfoSet.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, null);
-
- checkFilters(httpRequest);
- }
-
- public void testGetDriveInfo() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "getDriveInfo", String.class);
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("uuid"));
-
- assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/drives/uuid/info HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- assertResponseParserClassEquals(method, httpRequest, KeyValuesDelimitedByBlankLinesToDriveInfo.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
- checkFilters(httpRequest);
-
- }
-
- public void testCreateDrive() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "createDrive", Drive.class);
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(
- new CreateDriveRequest.Builder().name("foo").use(ImmutableList.of("production", "candy")).size(10000l)
- .build()));
-
- assertRequestLineEquals(httpRequest, "POST https://api.cloudsigma.com/drives/create HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, "name foo\nsize 10000\nuse production candy", "text/plain", false);
-
- assertResponseParserClassEquals(method, httpRequest, KeyValuesDelimitedByBlankLinesToDriveInfo.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
- checkFilters(httpRequest);
-
- }
-
- public void testCloneDrive() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "cloneDrive", String.class, String.class,
- CloneDriveOptions[].class);
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("sourceid", "newname"));
-
- assertRequestLineEquals(httpRequest, "POST https://api.cloudsigma.com/drives/sourceid/clone HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, "name newname", "text/plain", false);
-
- assertResponseParserClassEquals(method, httpRequest, KeyValuesDelimitedByBlankLinesToDriveInfo.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, MapHttp4xxCodesToExceptions.class);
-
- checkFilters(httpRequest);
-
- }
-
- public void testCloneDriveOptions() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "cloneDrive", String.class, String.class,
- CloneDriveOptions[].class);
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("sourceid", "newname",
- new CloneDriveOptions().size(1024l)));
-
- assertRequestLineEquals(httpRequest, "POST https://api.cloudsigma.com/drives/sourceid/clone HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, "name newname\nsize 1024", "text/plain", false);
-
- assertResponseParserClassEquals(method, httpRequest, KeyValuesDelimitedByBlankLinesToDriveInfo.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, MapHttp4xxCodesToExceptions.class);
-
- checkFilters(httpRequest);
-
- }
-
- public void testSetDriveData() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "setDriveData", String.class, DriveData.class);
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("100", new DriveData.Builder().name("foo").size(10000l)
- .use(ImmutableList.of("production", "candy")).build()));
-
- assertRequestLineEquals(httpRequest, "POST https://api.cloudsigma.com/drives/100/set HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, "name foo\nsize 10000\nuse production candy", "text/plain", false);
-
- assertResponseParserClassEquals(method, httpRequest, KeyValuesDelimitedByBlankLinesToDriveInfo.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, MapHttp4xxCodesToExceptions.class);
-
- checkFilters(httpRequest);
-
- }
-
- public void testListServers() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "listServers");
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.of());
-
- assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/servers/list HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- // now make sure request filters apply by replaying
- httpRequest = (GeneratedHttpRequest) Iterables.getOnlyElement(httpRequest.getFilters()).filter(httpRequest);
- httpRequest = (GeneratedHttpRequest) Iterables.getOnlyElement(httpRequest.getFilters()).filter(httpRequest);
-
- assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/servers/list HTTP/1.1");
- // for example, using basic authentication, we should get "only one"
- // header
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\nAuthorization: Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- // TODO: insert expected response class, which probably extends ParseJson
- assertResponseParserClassEquals(method, httpRequest, SplitNewlines.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, null);
-
- checkFilters(httpRequest);
-
- }
-
- public void testListServerInfo() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "listServerInfo");
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.of());
-
- assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/servers/info HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- assertResponseParserClassEquals(method, httpRequest, ListOfKeyValuesDelimitedByBlankLinesToServerInfoSet.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, null);
-
- checkFilters(httpRequest);
- }
-
- public void testGetServerInfo() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "getServerInfo", String.class);
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("uuid"));
-
- assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/servers/uuid/info HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- assertResponseParserClassEquals(method, httpRequest, KeyValuesDelimitedByBlankLinesToServerInfo.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
- checkFilters(httpRequest);
-
- }
-
- public void testCreateServer() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "createServer", Server.class);
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(BindServerToPlainTextStringTest.SERVER));
-
- assertRequestLineEquals(httpRequest, "POST https://api.cloudsigma.com/servers/create HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, BindServerToPlainTextStringTest.CREATED_SERVER, "text/plain", false);
-
- assertResponseParserClassEquals(method, httpRequest, KeyValuesDelimitedByBlankLinesToServerInfo.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
- checkFilters(httpRequest);
-
- }
-
- public void testSetServerConfiguration() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "setServerConfiguration", String.class, Server.class);
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("100", BindServerToPlainTextStringTest.SERVER));
-
- assertRequestLineEquals(httpRequest, "POST https://api.cloudsigma.com/servers/100/set HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, BindServerToPlainTextStringTest.CREATED_SERVER, "text/plain", false);
-
- assertResponseParserClassEquals(method, httpRequest, KeyValuesDelimitedByBlankLinesToServerInfo.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
- checkFilters(httpRequest);
-
- }
-
- public void testDestroyServer() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "destroyServer", String.class);
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("uuid"));
-
- assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/servers/uuid/destroy HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- assertResponseParserClassEquals(method, httpRequest, ReleasePayloadAndReturn.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, VoidOnNotFoundOr404.class);
-
- checkFilters(httpRequest);
-
- }
-
- public void testStartServer() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "startServer", String.class);
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("uuid"));
-
- assertRequestLineEquals(httpRequest, "POST https://api.cloudsigma.com/servers/uuid/start HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- assertResponseParserClassEquals(method, httpRequest, ReleasePayloadAndReturn.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, MapHttp4xxCodesToExceptions.class);
-
- checkFilters(httpRequest);
-
- }
-
- public void testStopServer() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "stopServer", String.class);
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("uuid"));
-
- assertRequestLineEquals(httpRequest, "POST https://api.cloudsigma.com/servers/uuid/stop HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- assertResponseParserClassEquals(method, httpRequest, ReleasePayloadAndReturn.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, MapHttp4xxCodesToExceptions.class);
-
- checkFilters(httpRequest);
-
- }
-
- public void testShutdownServer() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "shutdownServer", String.class);
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("uuid"));
-
- assertRequestLineEquals(httpRequest, "POST https://api.cloudsigma.com/servers/uuid/shutdown HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- assertResponseParserClassEquals(method, httpRequest, ReleasePayloadAndReturn.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, MapHttp4xxCodesToExceptions.class);
-
- checkFilters(httpRequest);
-
- }
-
- public void testResetServer() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "resetServer", String.class);
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("uuid"));
-
- assertRequestLineEquals(httpRequest, "POST https://api.cloudsigma.com/servers/uuid/reset HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- assertResponseParserClassEquals(method, httpRequest, ReleasePayloadAndReturn.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, MapHttp4xxCodesToExceptions.class);
-
- checkFilters(httpRequest);
-
- }
-
- public void testListDrives() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "listDrives");
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.of());
-
- assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/drives/list HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- // now make sure request filters apply by replaying
- httpRequest = (GeneratedHttpRequest) Iterables.getOnlyElement(httpRequest.getFilters()).filter(httpRequest);
- httpRequest = (GeneratedHttpRequest) Iterables.getOnlyElement(httpRequest.getFilters()).filter(httpRequest);
-
- assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/drives/list HTTP/1.1");
- // for example, using basic authentication, we should get "only one"
- // header
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\nAuthorization: Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- // TODO: insert expected response class, which probably extends ParseJson
- assertResponseParserClassEquals(method, httpRequest, SplitNewlines.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, null);
-
- checkFilters(httpRequest);
-
- }
-
- public void testDestroyDrive() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "destroyDrive", String.class);
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("uuid"));
-
- assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/drives/uuid/destroy HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- assertResponseParserClassEquals(method, httpRequest, ReleasePayloadAndReturn.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, VoidOnNotFoundOr404.class);
-
- checkFilters(httpRequest);
-
- }
-
- public void testListVLANs() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "listVLANs");
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.of());
-
- assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/resources/vlan/list HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- // now make sure request filters apply by replaying
- httpRequest = (GeneratedHttpRequest) Iterables.getOnlyElement(httpRequest.getFilters()).filter(httpRequest);
- httpRequest = (GeneratedHttpRequest) Iterables.getOnlyElement(httpRequest.getFilters()).filter(httpRequest);
-
- assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/resources/vlan/list HTTP/1.1");
- // for example, using basic authentication, we should get "only one"
- // header
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\nAuthorization: Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- // TODO: insert expected response class, which probably extends ParseJson
- assertResponseParserClassEquals(method, httpRequest, SplitNewlinesAndReturnSecondField.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, null);
-
- checkFilters(httpRequest);
-
- }
-
- public void testListVLANInfo() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "listVLANInfo");
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.of());
-
- assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/resources/vlan/info HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- assertResponseParserClassEquals(method, httpRequest, ListOfKeyValuesDelimitedByBlankLinesToVLANInfoSet.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, null);
-
- checkFilters(httpRequest);
- }
-
- public void testGetVLANInfo() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "getVLANInfo", String.class);
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("uuid"));
-
- assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/resources/vlan/uuid/info HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- assertResponseParserClassEquals(method, httpRequest, KeyValuesDelimitedByBlankLinesToVLANInfo.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
- checkFilters(httpRequest);
-
- }
-
- public void testCreateVLAN() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "createVLAN", String.class);
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("poohbear"));
-
- assertRequestLineEquals(httpRequest, "POST https://api.cloudsigma.com/resources/vlan/create HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, "name poohbear\n", "text/plain", false);
-
- assertResponseParserClassEquals(method, httpRequest, KeyValuesDelimitedByBlankLinesToVLANInfo.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
- checkFilters(httpRequest);
-
- }
-
- public void testRenameVLAN() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "renameVLAN", String.class, String.class);
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("100", "poohbear"));
-
- assertRequestLineEquals(httpRequest, "POST https://api.cloudsigma.com/resources/vlan/100/set HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, "name poohbear\n", "text/plain", false);
-
- assertResponseParserClassEquals(method, httpRequest, KeyValuesDelimitedByBlankLinesToVLANInfo.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, MapHttp4xxCodesToExceptions.class);
-
- checkFilters(httpRequest);
-
- }
-
- public void testDestroyVLAN() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "destroyVLAN", String.class);
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("uuid"));
-
- assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/resources/vlan/uuid/destroy HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- assertResponseParserClassEquals(method, httpRequest, ReleasePayloadAndReturn.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, VoidOnNotFoundOr404.class);
-
- checkFilters(httpRequest);
-
- }
-
- public void testListStaticIPs() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "listStaticIPs");
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.of());
-
- assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/resources/ip/list HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- // now make sure request filters apply by replaying
- httpRequest = (GeneratedHttpRequest) Iterables.getOnlyElement(httpRequest.getFilters()).filter(httpRequest);
- httpRequest = (GeneratedHttpRequest) Iterables.getOnlyElement(httpRequest.getFilters()).filter(httpRequest);
-
- assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/resources/ip/list HTTP/1.1");
- // for example, using basic authentication, we should get "only one"
- // header
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\nAuthorization: Basic aWRlbnRpdHk6Y3JlZGVudGlhbA==\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- // TODO: insert expected response class, which probably extends ParseJson
- assertResponseParserClassEquals(method, httpRequest, SplitNewlinesAndReturnSecondField.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, null);
-
- checkFilters(httpRequest);
-
- }
-
- public void testListStaticIPInfo() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "listStaticIPInfo");
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.of());
-
- assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/resources/ip/info HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- assertResponseParserClassEquals(method, httpRequest, ListOfKeyValuesDelimitedByBlankLinesToStaticIPInfoSet.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, null);
-
- checkFilters(httpRequest);
- }
-
- public void testGetStaticIPInfo() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "getStaticIPInfo", String.class);
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("uuid"));
-
- assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/resources/ip/uuid/info HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- assertResponseParserClassEquals(method, httpRequest, KeyValuesDelimitedByBlankLinesToStaticIPInfo.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
- checkFilters(httpRequest);
-
- }
-
- public void testCreateStaticIP() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "createStaticIP");
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.of());
-
- assertRequestLineEquals(httpRequest, "POST https://api.cloudsigma.com/resources/ip/create HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- assertResponseParserClassEquals(method, httpRequest, KeyValuesDelimitedByBlankLinesToStaticIPInfo.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
- checkFilters(httpRequest);
-
- }
-
- public void testDestroyStaticIP() throws SecurityException, NoSuchMethodException, IOException {
- Invokable<?, ?> method = method(CloudSigmaApi.class, "destroyStaticIP", String.class);
- GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("uuid"));
-
- assertRequestLineEquals(httpRequest, "GET https://api.cloudsigma.com/resources/ip/uuid/destroy HTTP/1.1");
- assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
- assertPayloadEquals(httpRequest, null, null, false);
-
- assertResponseParserClassEquals(method, httpRequest, ReleasePayloadAndReturn.class);
- assertSaxResponseParserClassEquals(method, null);
- assertFallbackClassEquals(method, VoidOnNotFoundOr404.class);
-
- checkFilters(httpRequest);
-
- }
-
- @Override
- protected void checkFilters(HttpRequest request) {
- assertEquals(request.getFilters().size(), 1);
- assertEquals(request.getFilters().get(0).getClass(), BasicAuthentication.class);
- }
-
- @Override
- protected ApiMetadata createApiMetadata() {
- return new CloudSigmaApiMetadata();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/CloudSigmaClientLiveTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/CloudSigmaClientLiveTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/CloudSigmaClientLiveTest.java
deleted file mode 100644
index f3c59eb..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/CloudSigmaClientLiveTest.java
+++ /dev/null
@@ -1,441 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma;
-import static java.util.concurrent.TimeUnit.SECONDS;
-import static org.jclouds.util.Predicates2.retry;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-import java.io.IOException;
-import java.util.Set;
-import java.util.logging.Logger;
-
-import org.jclouds.cloudsigma.domain.ClaimType;
-import org.jclouds.cloudsigma.domain.CreateDriveRequest;
-import org.jclouds.cloudsigma.domain.DriveData;
-import org.jclouds.cloudsigma.domain.DriveInfo;
-import org.jclouds.cloudsigma.domain.DriveStatus;
-import org.jclouds.cloudsigma.domain.DriveType;
-import org.jclouds.cloudsigma.domain.IDEDevice;
-import org.jclouds.cloudsigma.domain.Model;
-import org.jclouds.cloudsigma.domain.ProfileInfo;
-import org.jclouds.cloudsigma.domain.Server;
-import org.jclouds.cloudsigma.domain.ServerInfo;
-import org.jclouds.cloudsigma.domain.ServerStatus;
-import org.jclouds.cloudsigma.domain.StaticIPInfo;
-import org.jclouds.cloudsigma.domain.VLANInfo;
-import org.jclouds.cloudsigma.options.CloneDriveOptions;
-import org.jclouds.cloudsigma.predicates.DriveClaimed;
-import org.jclouds.cloudsigma.util.Servers;
-import org.jclouds.compute.domain.ExecResponse;
-import org.jclouds.compute.internal.BaseComputeServiceContextLiveTest;
-import org.jclouds.domain.LoginCredentials;
-import org.jclouds.predicates.SocketOpen;
-import org.jclouds.ssh.SshClient;
-import org.jclouds.sshj.config.SshjSshClientModule;
-import org.testng.annotations.AfterGroups;
-import org.testng.annotations.BeforeGroups;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.net.HostAndPort;
-import com.google.gson.Gson;
-import com.google.inject.Guice;
-
-/**
- * Tests behavior of {@code CloudSigmaApi}
- */
-@Test(groups = "live", singleThreaded = true, testName = "CloudSigmaClientLiveTest")
-public class CloudSigmaClientLiveTest extends BaseComputeServiceContextLiveTest {
-
- public CloudSigmaClientLiveTest() {
- provider = "cloudsigma";
- }
-
- protected long driveSize = 8 * 1024 * 1024 * 1024l;
- protected int maxDriveImageTime = 300;
- protected String vncPassword = "Il0veVNC";
- protected CloudSigmaApi client;
- protected Predicate<HostAndPort> socketTester;
-
- protected Predicate<DriveInfo> driveNotClaimed;
- protected String imageId;
-
- @BeforeGroups(groups = { "integration", "live" })
- @Override
- public void setupContext() {
- super.setupContext();
-
- client = view.utils().injector().getInstance(CloudSigmaApi.class);
- driveNotClaimed = retry(Predicates.not(new DriveClaimed(client)), maxDriveImageTime, 1, SECONDS);
- SocketOpen socketOpten = context.utils().injector().getInstance(SocketOpen.class);
- socketTester = retry(socketOpten, maxDriveImageTime, 1, SECONDS);
-
- if (template == null || template.getImageId() == null) {
- imageId = view.getComputeService().templateBuilder().build().getImage().getId();
- }
- }
-
- @Test
- public void testGetProfileInfo() throws Exception {
- ProfileInfo profile = client.getProfileInfo();
- assertNotNull(profile);
- }
-
- @Test
- public void testListVLANs() throws Exception {
- Set<String> vlans = client.listVLANs();
- assertNotNull(vlans);
- }
-
- @Test
- public void testListVLANInfo() throws Exception {
- Set<? extends VLANInfo> vlans = client.listVLANInfo();
- assertNotNull(vlans);
- }
-
- @Test
- public void testGetVLAN() throws Exception {
- for (String vlanUUID : client.listVLANs()) {
- assert !"".equals(vlanUUID);
- assertNotNull(client.getVLANInfo(vlanUUID));
- }
- }
-
- @Test
- public void testListStaticIPs() throws Exception {
- Set<String> ips = client.listStaticIPs();
- assertNotNull(ips);
- }
-
- @Test
- public void testListStaticIPInfo() throws Exception {
- Set<? extends StaticIPInfo> ips = client.listStaticIPInfo();
- assertNotNull(ips);
- }
-
- @Test
- public void testGetStaticIP() throws Exception {
- for (String ipUUID : client.listStaticIPs()) {
- assert !"".equals(ipUUID);
- assertNotNull(client.getStaticIPInfo(ipUUID));
- }
- }
-
- @Test
- public void testListServers() throws Exception {
- Set<String> servers = client.listServers();
- assertNotNull(servers);
- }
-
- @Test
- public void testListServerInfo() throws Exception {
- Set<? extends ServerInfo> servers = client.listServerInfo();
- assertNotNull(servers);
- }
-
- @Test
- public void testGetServer() throws Exception {
- for (String serverUUID : client.listServers()) {
- assert !"".equals(serverUUID);
- assertNotNull(client.getServerInfo(serverUUID));
- }
- }
-
- @Test
- public void testListDrives() throws Exception {
- Set<String> drives = client.listDrives();
- assertNotNull(drives);
- }
-
- @Test
- public void testListDriveInfo() throws Exception {
- Set<? extends DriveInfo> drives = client.listDriveInfo();
- assertNotNull(drives);
- }
-
- @Test
- public void testGetDrive() throws Exception {
- for (String driveUUID : client.listStandardDrives()) {
- assert !"".equals(driveUUID);
- DriveInfo drive = client.getDriveInfo(driveUUID);
- assertNotNull(drive);
- assert !drive.getType().equals(DriveType.UNRECOGNIZED) : drive;
- if (drive.getType() == DriveType.DISK && drive.getDriveType().contains("preinstalled"))
- System.out.println(drive.getName());
- }
- }
-
- protected String prefix = System.getProperty("user.name") + ".test";
- protected DriveInfo drive;
-
- @Test
- public void testCreateDrive() throws Exception {
- drive = client.createDrive(new CreateDriveRequest.Builder().name(prefix).size(driveSize).build());
- checkCreatedDrive();
-
- DriveInfo newInfo = client.getDriveInfo(drive.getUuid());
- checkDriveMatchesGet(newInfo);
-
- }
-
- protected void checkDriveMatchesGet(DriveInfo newInfo) {
- assertEquals(newInfo.getUuid(), drive.getUuid());
- assertEquals(newInfo.getType(), DriveType.DISK);
- }
-
- protected void checkCreatedDrive() {
- assertNotNull(drive.getUuid());
- assertNotNull(drive.getUser());
- assertEquals(drive.getName(), prefix);
- assertEquals(drive.getSize(), driveSize);
- assertEquals(drive.getStatus(), DriveStatus.ACTIVE);
- // for some reason, these occasionally return as 4096,1
- // assertEquals(info.getReadBytes(), 0l);
- // assertEquals(info.getWriteBytes(), 0l);
- // assertEquals(info.getReadRequests(), 0l);
- // assertEquals(info.getWriteRequests(), 0l);
- assertEquals(drive.getEncryptionCipher(), "aes-xts-plain");
- assertEquals(drive.getType(), null);
- }
-
- @Test(dependsOnMethods = "testCreateDrive")
- public void testSetDriveData() throws Exception {
-
- DriveInfo drive2 = client.setDriveData(
- drive.getUuid(),
- new DriveData.Builder().claimType(ClaimType.SHARED).name("rediculous")
- .readers(ImmutableSet.of("ffffffff-ffff-ffff-ffff-ffffffffffff"))
- .use(ImmutableSet.of("networking", "security", "gateway")).build());
-
- assertNotNull(drive2.getUuid(), drive.getUuid());
- assertEquals(drive2.getName(), "rediculous");
- assertEquals(drive2.getClaimType(), ClaimType.SHARED);
- assertEquals(drive2.getReaders(), ImmutableSet.of("ffffffff-ffff-ffff-ffff-ffffffffffff"));
- assertEquals(drive2.getUse(), ImmutableSet.of("networking", "security", "gateway"));
- drive = drive2;
- }
-
- @Test
- public void testCreateAndDestroyVLAN() throws Exception {
- VLANInfo vlan = client.createVLAN(prefix);
- String id = vlan.getUuid();
- try {
- vlan = client.getVLANInfo(vlan.getUuid());
- assertEquals(vlan.getName(), prefix);
-
- String prefix2 = prefix + "2";
- vlan = client.renameVLAN(vlan.getUuid(), prefix2);
- assertEquals(vlan.getName(), prefix2);
- } finally {
- client.destroyVLAN(id);
- }
- }
-
- @Test(dependsOnMethods = "testSetDriveData")
- public void testCreateAndDestroyStaticIP() throws Exception {
- StaticIPInfo ip = client.createStaticIP();
- StaticIPInfo ip2 = client.createStaticIP();
- Server server = null;
- try {
- ip = client.getStaticIPInfo(ip.getAddress());
- assertNotNull(ip);
- Logger.getAnonymousLogger().info("preparing drive");
- prepareDrive();
-
- Server serverRequest = Servers.smallWithStaticIP(prefix, drive.getUuid(), vncPassword, ip.getAddress())
- .build();
-
- Logger.getAnonymousLogger().info("starting server");
- server = client.createServer(serverRequest);
- assertEquals(server.getNics().get(0).getDhcp(), ip.getAddress());
- client.stopServer(server.getUuid());
- server = client.setServerConfiguration(server.getUuid(), Servers.changeIP(server, ip2.getAddress()));
- assertEquals(server.getNics().get(0).getDhcp(), ip2.getAddress());
- } finally {
- if (server != null) {
- client.destroyServer(server.getUuid());
- client.destroyDrive(drive.getUuid());
- }
- client.destroyStaticIP(ip.getAddress());
- client.destroyStaticIP(ip2.getAddress());
- }
- }
-
- protected ServerInfo server;
-
- @Test(dependsOnMethods = "testCreateAndDestroyStaticIP")
- public void testCreateAndStartServer() throws Exception {
- Logger.getAnonymousLogger().info("preparing drive");
- prepareDrive();
-
- Server serverRequest = Servers.small(prefix, drive.getUuid(), vncPassword).build();
-
- Logger.getAnonymousLogger().info("starting server");
- server = client.createServer(serverRequest);
- client.startServer(server.getUuid());
- server = client.getServerInfo(server.getUuid());
- checkStartedServer();
-
- Server newInfo = client.getServerInfo(server.getUuid());
- checkServerMatchesGet(newInfo);
-
- }
-
- protected void checkServerMatchesGet(Server newInfo) {
- assertEquals(newInfo.getUuid(), server.getUuid());
- }
-
- protected void checkStartedServer() {
- System.out.println(new Gson().toJson(server));
- assertNotNull(server.getUuid());
- assertNotNull(server.getUser());
- assertEquals(server.getName(), prefix);
- assertEquals(server.isPersistent(), true);
- assertEquals(server.getDevices(),
- ImmutableMap.of("ide:0:0", new IDEDevice.Builder(0, 0).uuid(drive.getUuid()).build()));
- assertEquals(server.getBootDeviceIds(), ImmutableSet.of("ide:0:0"));
- assertEquals(server.getNics().get(0).getDhcp(), server.getVnc().getIp());
- assertEquals(server.getNics().get(0).getModel(), Model.E1000);
- assertEquals(server.getStatus(), ServerStatus.ACTIVE);
- }
-
- @Test(dependsOnMethods = "testCreateAndStartServer")
- public void testConnectivity() throws Exception {
- Logger.getAnonymousLogger().info("awaiting vnc");
- assert socketTester.apply(HostAndPort.fromParts(server.getVnc().getIp(), 5900)) : server;
- Logger.getAnonymousLogger().info("awaiting ssh");
- assert socketTester.apply(HostAndPort.fromParts(server.getNics().get(0).getDhcp(), 22)) : server;
- doConnectViaSsh(server, getSshCredentials(server));
- }
-
- @Test(dependsOnMethods = "testConnectivity")
- public void testLifeCycle() throws Exception {
- client.stopServer(server.getUuid());
- assertEquals(client.getServerInfo(server.getUuid()).getStatus(), ServerStatus.STOPPED);
-
- client.startServer(server.getUuid());
- assertEquals(client.getServerInfo(server.getUuid()).getStatus(), ServerStatus.ACTIVE);
-
- client.resetServer(server.getUuid());
- assertEquals(client.getServerInfo(server.getUuid()).getStatus(), ServerStatus.ACTIVE);
-
- client.shutdownServer(server.getUuid());
- // behavior on shutdown depends on how your server OS is set up to respond
- // to an ACPI power
- // button signal
- assert client.getServerInfo(server.getUuid()).getStatus() == ServerStatus.ACTIVE || client.getServerInfo(
- server.getUuid()).getStatus() == ServerStatus.STOPPED;
- }
-
- @Test(dependsOnMethods = "testLifeCycle")
- public void testSetServerConfiguration() throws Exception {
- client.stopServer(server.getUuid());
- assertEquals(client.getServerInfo(server.getUuid()).getStatus(), ServerStatus.STOPPED);
-
- ServerInfo server2 = client.setServerConfiguration(
- server.getUuid(),
- Server.Builder.fromServer(server).name("rediculous")
- .use(ImmutableSet.of("networking", "security", "gateway")).build());
-
- assertNotNull(server2.getUuid(), server.getUuid());
- assertEquals(server2.getName(), "rediculous");
- checkUse(server2);
- server = server2;
- }
-
- protected void checkUse(ServerInfo server2) {
- // bug where use aren't updated
- assertEquals(server2.getUse(), ImmutableSet.<String> of());
- }
-
- @Test(dependsOnMethods = "testSetServerConfiguration")
- public void testDestroyServer() throws Exception {
- client.destroyServer(server.getUuid());
- assertEquals(client.getServerInfo(server.getUuid()), null);
- }
-
- @Test(dependsOnMethods = "testDestroyServer")
- public void testDestroyDrive() throws Exception {
- client.destroyDrive(drive.getUuid());
- assertEquals(client.getDriveInfo(drive.getUuid()), null);
- }
-
- protected void doConnectViaSsh(Server server, LoginCredentials creds) throws IOException {
- SshClient ssh = Guice.createInjector(new SshjSshClientModule()).getInstance(SshClient.Factory.class)
- .create(HostAndPort.fromParts(server.getVnc().getIp(), 22), creds);
- try {
- ssh.connect();
- ExecResponse hello = ssh.exec("echo hello");
- assertEquals(hello.getOutput().trim(), "hello");
- System.err.println(ssh.exec("df -k").getOutput());
- System.err.println(ssh.exec("mount").getOutput());
- System.err.println(ssh.exec("uname -a").getOutput());
- } finally {
- if (ssh != null)
- ssh.disconnect();
- }
- }
-
- @AfterGroups(groups = "live")
- @Override
- protected void tearDownContext() {
- if (server != null)
- client.destroyServer(server.getUuid());
- if (server != null)
- client.destroyDrive(drive.getUuid());
- super.tearDownContext();
- }
-
- @Test
- public void testListStandardDrives() throws Exception {
- Set<String> drives = client.listStandardDrives();
- assertNotNull(drives);
- }
-
- @Test
- public void testListStandardCds() throws Exception {
- Set<String> drives = client.listStandardCds();
- assertNotNull(drives);
- }
-
- @Test
- public void testListStandardImages() throws Exception {
- Set<String> drives = client.listStandardImages();
- assertNotNull(drives);
- }
-
- protected LoginCredentials getSshCredentials(Server server) {
- return LoginCredentials.builder().user("root").password(vncPassword).build();
- }
-
- protected void prepareDrive() {
- client.destroyDrive(drive.getUuid());
- drive = client.cloneDrive(imageId, drive.getName(),
- new CloneDriveOptions().size(driveSize).tags("cat:mouse", "monkey:banana"));
- // Block until the async clone operation has completed.
- assert driveNotClaimed.apply(drive) : client.getDriveInfo(drive.getUuid());
-
- DriveInfo clonedDrive = client.getDriveInfo(drive.getUuid());
- System.err.println("after prepare" + clonedDrive);
- assertEquals(clonedDrive.getTags(), ImmutableSet.of("cat:mouse", "monkey:banana"));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/binders/BindCloneDriveOptionsToPlainTextStringTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/binders/BindCloneDriveOptionsToPlainTextStringTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/binders/BindCloneDriveOptionsToPlainTextStringTest.java
deleted file mode 100644
index 0cc18a6..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/binders/BindCloneDriveOptionsToPlainTextStringTest.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.binders;
-
-import static org.jclouds.reflect.Reflection2.method;
-import static org.testng.Assert.assertEquals;
-
-import java.io.IOException;
-import java.net.URI;
-import java.util.List;
-import java.util.Map;
-
-import org.jclouds.cloudsigma.options.CloneDriveOptions;
-import org.jclouds.reflect.Invocation;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Throwables;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.inject.Guice;
-@Test(groups = "unit")
-public class BindCloneDriveOptionsToPlainTextStringTest {
-
- private static final BindCloneDriveOptionsToPlainTextString binder = Guice.createInjector().getInstance(
- BindCloneDriveOptionsToPlainTextString.class);
-
- public void testDefault() throws IOException {
- String expected = "name newdrive";
- GeneratedHttpRequest request = requestForArgs(ImmutableList.<Object> of());
-
- Map<String, Object> map = ImmutableMap.<String, Object> of("name", "newdrive");
- assertEquals(binder.bindToRequest(request, map).getPayload().getRawContent(), expected);
- }
-
- public void testWithSize() throws IOException {
- String expected = "name newdrive\nsize 1024";
- GeneratedHttpRequest request = requestForArgs(ImmutableList.<Object> of(new CloneDriveOptions().size(1024)));
-
- Map<String, Object> map = ImmutableMap.<String, Object> of("name", "newdrive");
- assertEquals(binder.bindToRequest(request, map).getPayload().getRawContent(), expected);
- }
-
- protected GeneratedHttpRequest requestForArgs(List<Object> args) {
- try {
- Invocation invocation = Invocation.create(method(String.class, "toString"), args);
- return GeneratedHttpRequest.builder().method("POST").endpoint(URI.create("http://localhost/key"))
- .invocation(invocation).build();
- } catch (SecurityException e) {
- throw Throwables.propagate(e);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/binders/BindDriveDataToPlainTextStringTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/binders/BindDriveDataToPlainTextStringTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/binders/BindDriveDataToPlainTextStringTest.java
deleted file mode 100644
index b876a3b..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/binders/BindDriveDataToPlainTextStringTest.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.binders;
-
-import static org.testng.Assert.assertEquals;
-
-import java.io.IOException;
-import java.util.Map;
-
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.cloudsigma.domain.ClaimType;
-import org.jclouds.cloudsigma.domain.Drive;
-import org.jclouds.cloudsigma.domain.DriveData;
-import org.jclouds.cloudsigma.functions.BaseDriveToMap;
-import org.jclouds.cloudsigma.functions.DriveDataToMap;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.util.Strings2;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableSet;
-import com.google.inject.AbstractModule;
-import com.google.inject.Guice;
-import com.google.inject.TypeLiteral;
-
-@Test(groups = { "unit" })
-public class BindDriveDataToPlainTextStringTest {
-
- private static final BindDriveDataToPlainTextString FN = Guice.createInjector(new AbstractModule() {
-
- @Override
- protected void configure() {
- bind(new TypeLiteral<Function<Drive, Map<String, String>>>() {
- }).to(BaseDriveToMap.class);
- bind(new TypeLiteral<Function<DriveData, Map<String, String>>>() {
- }).to(DriveDataToMap.class);
- }
-
- }).getInstance(BindDriveDataToPlainTextString.class);
-
- public void testSimple() {
- HttpRequest request = HttpRequest.builder().method("POST").endpoint("https://host/drives/create").build();
- FN.bindToRequest(request, new DriveData.Builder().name("foo").size(100l).build());
- assertEquals(request.getPayload().getContentMetadata().getContentType(), MediaType.TEXT_PLAIN);
- assertEquals(request.getPayload().getRawContent(), "name foo\nsize 100");
- }
-
- public void testComplete() throws IOException {
- DriveData input = new DriveData.Builder().name("Ubuntu 10.10 Server Edition Linux 64bit Preinstalled System")
- //
- .size(8589934592l)//
- .claimType(ClaimType.SHARED)//
- .tags(ImmutableSet.of("foo", "bar", "baz"))//
- .readers(ImmutableSet.of("ffffffff-ffff-ffff-ffff-ffffffffffff"))//
- .use(ImmutableSet.of("tag1", "tag2"))//
- .build();
-
- HttpRequest request = HttpRequest.builder().method("POST").endpoint("https://host/drives/create").build();
- FN.bindToRequest(request, input);
- assertEquals(request.getPayload().getContentMetadata().getContentType(), MediaType.TEXT_PLAIN);
- assertEquals(request.getPayload().getRawContent(),
- Strings2.toStringAndClose(BindDriveDataToPlainTextStringTest.class.getResourceAsStream("/drive_data.txt")));
-
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/binders/BindDriveToPlainTextStringTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/binders/BindDriveToPlainTextStringTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/binders/BindDriveToPlainTextStringTest.java
deleted file mode 100644
index 1e7b10e..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/binders/BindDriveToPlainTextStringTest.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.binders;
-
-import static org.testng.Assert.assertEquals;
-
-import java.io.IOException;
-import java.util.Map;
-
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.cloudsigma.domain.ClaimType;
-import org.jclouds.cloudsigma.domain.CreateDriveRequest;
-import org.jclouds.cloudsigma.domain.Drive;
-import org.jclouds.cloudsigma.domain.DriveData;
-import org.jclouds.cloudsigma.functions.BaseDriveToMap;
-import org.jclouds.cloudsigma.functions.DriveDataToMap;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.util.Strings2;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableSet;
-import com.google.inject.AbstractModule;
-import com.google.inject.Guice;
-import com.google.inject.TypeLiteral;
-
-@Test(groups = { "unit" })
-public class BindDriveToPlainTextStringTest {
-
- private static final BindDriveToPlainTextString FN = Guice.createInjector(new AbstractModule() {
-
- @Override
- protected void configure() {
- bind(new TypeLiteral<Function<Drive, Map<String, String>>>() {
- }).to(BaseDriveToMap.class);
- bind(new TypeLiteral<Function<DriveData, Map<String, String>>>() {
- }).to(DriveDataToMap.class);
- }
-
- }).getInstance(BindDriveToPlainTextString.class);
-
- public void testSimple() {
- HttpRequest request = HttpRequest.builder().method("POST").endpoint("https://host/drives/create").build();
- FN.bindToRequest(request, new CreateDriveRequest.Builder().name("foo").size(100l).build());
- assertEquals(request.getPayload().getContentMetadata().getContentType(), MediaType.TEXT_PLAIN);
- assertEquals(request.getPayload().getRawContent(), "name foo\nsize 100");
- }
-
- public void testComplete() throws IOException {
- CreateDriveRequest input = new CreateDriveRequest.Builder()
- .name("Ubuntu 10.10 Server Edition Linux 64bit Preinstalled System")
- //
- .size(8589934592l)//
- .claimType(ClaimType.SHARED)//
- .readers(ImmutableSet.of("ffffffff-ffff-ffff-ffff-ffffffffffff"))//
- .use(ImmutableSet.of("tag1", "tag2"))//
- .encryptionCipher("aes-xts-plain").avoid(ImmutableSet.of("avoid1")).build();
-
- HttpRequest request = HttpRequest.builder().method("POST").endpoint("https://host/drives/create").build();
- FN.bindToRequest(request, input);
- assertEquals(request.getPayload().getContentMetadata().getContentType(), MediaType.TEXT_PLAIN);
- assertEquals(request.getPayload().getRawContent(),
- Strings2.toStringAndClose(BindDriveToPlainTextStringTest.class
- .getResourceAsStream("/create_drive.txt")));
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/binders/BindServerToPlainTextStringTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/binders/BindServerToPlainTextStringTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/binders/BindServerToPlainTextStringTest.java
deleted file mode 100644
index efcf460..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/binders/BindServerToPlainTextStringTest.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.binders;
-
-import static org.testng.Assert.assertEquals;
-
-import java.io.IOException;
-import java.util.Map;
-
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.cloudsigma.domain.IDEDevice;
-import org.jclouds.cloudsigma.domain.Model;
-import org.jclouds.cloudsigma.domain.NIC;
-import org.jclouds.cloudsigma.domain.Server;
-import org.jclouds.cloudsigma.domain.VNC;
-import org.jclouds.cloudsigma.functions.ServerToMap;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.util.Strings2;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Function;
-import com.google.common.base.Throwables;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.inject.AbstractModule;
-import com.google.inject.Guice;
-import com.google.inject.TypeLiteral;
-
-@Test(groups = { "unit" })
-public class BindServerToPlainTextStringTest {
-
- public static final String CREATED_SERVER;
- static {
- try {
- CREATED_SERVER = Strings2.toStringAndClose(BindServerToPlainTextStringTest.class
- .getResourceAsStream("/create_server.txt"));
- } catch (IOException e) {
- throw Throwables.propagate(e);
- }
- }
- public static final Server SERVER = new Server.Builder()
- .name("TestServer")
- .cpu(2000)
- .mem(1024)
- .devices(
- ImmutableMap.of("ide:0:0", new IDEDevice.Builder(0, 0).uuid("08c92dd5-70a0-4f51-83d2-835919d254df")
- .build())).bootDeviceIds(ImmutableSet.of("ide:0:0"))
- .nics(ImmutableSet.of(new NIC.Builder().model(Model.E1000).
-
- build())).vnc(new VNC(null, "XXXXXXXX", false)).build();
- private static final BindServerToPlainTextString FN = Guice.createInjector(new AbstractModule() {
-
- @Override
- protected void configure() {
- bind(new TypeLiteral<Function<Server, Map<String, String>>>() {
- }).to(ServerToMap.class);
- bind(new TypeLiteral<Function<Server, Map<String, String>>>() {
- }).to(ServerToMap.class);
- }
-
- }).getInstance(BindServerToPlainTextString.class);
-
- public void testSimple() throws IOException {
- HttpRequest request = HttpRequest.builder().method("POST").endpoint("https://host/drives/create").build();
- FN.bindToRequest(request, SERVER);
- assertEquals(request.getPayload().getContentMetadata().getContentType(), MediaType.TEXT_PLAIN);
- assertEquals(request.getPayload().getRawContent(), CREATED_SERVER);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/compute/CloudSigmaComputeServiceLiveTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/compute/CloudSigmaComputeServiceLiveTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/compute/CloudSigmaComputeServiceLiveTest.java
deleted file mode 100644
index c52ce3b..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/compute/CloudSigmaComputeServiceLiveTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.compute;
-
-import org.jclouds.compute.domain.ExecResponse;
-import org.jclouds.compute.domain.NodeMetadata;
-import org.jclouds.compute.internal.BaseComputeServiceLiveTest;
-import org.jclouds.sshj.config.SshjSshClientModule;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.inject.Module;
-
-@Test(groups = "live", testName = "CloudSigmaComputeServiceLiveTest")
-public class CloudSigmaComputeServiceLiveTest extends BaseComputeServiceLiveTest {
-
- public CloudSigmaComputeServiceLiveTest() {
- provider = "cloudsigma";
- }
-
- @Override
- protected Module getSshModule() {
- return new SshjSshClientModule();
- }
-
- // cloudsigma does not support metadata
- @Override
- protected void checkUserMetadataContains(NodeMetadata node, ImmutableMap<String, String> userMetadata) {
- assert node.getUserMetadata().equals(ImmutableMap.<String, String> of()) : String.format(
- "node userMetadata did not match %s %s", userMetadata, node);
- }
-
- // cloudsigma does not support tags
- @Override
- protected void checkTagsInNodeEquals(final NodeMetadata node, final ImmutableSet<String> tags) {
- assert node.getTags().equals(ImmutableSet.<String> of()) : String.format("node tags did not match %s %s", tags,
- node);
- }
-
- protected void checkResponseEqualsHostname(ExecResponse execResponse, NodeMetadata node1) {
- // hostname is not predictable based on node metadata
- assert execResponse.getOutput().trim().equals("ubuntu");
- }
-
- @Override
- public void testOptionToNotBlock() {
- // start call has to block until we have a pool of reserved pre-cloned drives.
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/BaseDriveToMapTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/BaseDriveToMapTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/BaseDriveToMapTest.java
deleted file mode 100644
index fe7f7b4..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/BaseDriveToMapTest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import java.io.IOException;
-
-import org.jclouds.cloudsigma.domain.ClaimType;
-import org.jclouds.cloudsigma.domain.Drive;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-
-@Test(groups = { "unit" })
-public class BaseDriveToMapTest {
-
- private static final BaseDriveToMap BASEDRIVE_TO_MAP = new BaseDriveToMap();
-
- public void testBasics() {
- assertEquals(BASEDRIVE_TO_MAP.apply(new Drive.Builder().name("foo").size(100l).build()),
- ImmutableMap.of("name", "foo", "size", "100"));
- }
-
- public void testComplete() throws IOException {
- Drive one = new Drive.Builder().name("Ubuntu 10.10 Server Edition Linux 64bit Preinstalled System")
- //
- .size(8589934592l)//
- .claimType(ClaimType.SHARED)//
- .tags(ImmutableSet.of("foo", "bar", "baz"))//
- .readers(ImmutableSet.of("ffffffff-ffff-ffff-ffff-ffffffffffff"))//
- .use(ImmutableSet.of("tag1", "tag2"))//
- .build();
- assertEquals(
- BASEDRIVE_TO_MAP.apply(one),
- ImmutableMap.builder().put("name", "Ubuntu 10.10 Server Edition Linux 64bit Preinstalled System")
- .put("size", "8589934592")
- .put("claim:type", "shared")
- .put("tags", "foo bar baz")
- .put("readers", "ffffffff-ffff-ffff-ffff-ffffffffffff").put("use", "tag1 tag2").build()
-
- );
-
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/DriveDataToMapTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/DriveDataToMapTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/DriveDataToMapTest.java
deleted file mode 100644
index 4140ab3..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/DriveDataToMapTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import java.io.IOException;
-import java.util.Map;
-
-import org.jclouds.cloudsigma.domain.ClaimType;
-import org.jclouds.cloudsigma.domain.DriveData;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.inject.Guice;
-
-@Test(groups = { "unit" })
-public class DriveDataToMapTest {
-
- public void testRenameKeyWhenNotFound() {
- Map<String, String> nothing = ImmutableMap.of();
- assertEquals(DriveDataToMap.renameKey(nothing, "foo", "bar"), nothing);
- }
-
- public void testRenameKeyWhenFound() {
- Map<String, String> nothing = ImmutableMap.of("foo", "bar");
- assertEquals(DriveDataToMap.renameKey(nothing, "foo", "bar"), ImmutableMap.of("bar", "bar"));
- }
-
- private static final DriveDataToMap BASEDRIVE_TO_MAP = Guice.createInjector().getInstance(DriveDataToMap.class);
-
- public void testBasics() {
- assertEquals(BASEDRIVE_TO_MAP.apply(new DriveData.Builder().name("foo").size(100l).build()),
- ImmutableMap.of("name", "foo", "size", "100"));
- }
-
- public void testComplete() throws IOException {
- DriveData one = new DriveData.Builder().name("Ubuntu 10.10 Server Edition Linux 64bit Preinstalled System")
- //
- .size(8589934592l)//
- .claimType(ClaimType.SHARED)//
- .tags(ImmutableSet.of("foo", "bar", "baz"))//
- .readers(ImmutableSet.of("ffffffff-ffff-ffff-ffff-ffffffffffff"))//
- .use(ImmutableSet.of("tag1", "tag2"))//
- .build();
- assertEquals(
- BASEDRIVE_TO_MAP.apply(one),
- ImmutableMap.builder()
- .put("name", "Ubuntu 10.10 Server Edition Linux 64bit Preinstalled System")
- .put("size", "8589934592")
- .put("claim:type", "shared")
- .put("tags", "foo bar baz")
- .put("readers", "ffffffff-ffff-ffff-ffff-ffffffffffff")
- .put("use", "tag1 tag2").build()
-
- );
-
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToDriveInfoTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToDriveInfoTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToDriveInfoTest.java
deleted file mode 100644
index 7898203..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToDriveInfoTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import org.jclouds.http.HttpResponse;
-import org.testng.annotations.Test;
-
-import com.google.inject.Guice;
-
-@Test(groups = { "unit" })
-public class KeyValuesDelimitedByBlankLinesToDriveInfoTest {
-
- private static final KeyValuesDelimitedByBlankLinesToDriveInfo FN = Guice.createInjector().getInstance(
- KeyValuesDelimitedByBlankLinesToDriveInfo.class);
-
- public void testNone() {
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").payload("").build()), null);
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").payload("\n\n").build()), null);
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").build()), null);
- }
-
- public void testOne() {
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").payload(MapToDriveInfoTest.class
- .getResourceAsStream("/drive.txt")).build()), MapToDriveInfoTest.ONE);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToProfileInfoTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToProfileInfoTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToProfileInfoTest.java
deleted file mode 100644
index ed86af8..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToProfileInfoTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import org.jclouds.http.HttpResponse;
-import org.testng.annotations.Test;
-
-import com.google.inject.Guice;
-
-@Test(groups = { "unit" })
-public class KeyValuesDelimitedByBlankLinesToProfileInfoTest {
-
- private static final KeyValuesDelimitedByBlankLinesToProfileInfo FN = Guice.createInjector().getInstance(
- KeyValuesDelimitedByBlankLinesToProfileInfo.class);
-
- public void testNone() {
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").payload("").build()), null);
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").payload("\n\n").build()), null);
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").build()), null);
- }
-
- public void testOne() {
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").payload(MapToProfileInfoTest.class
- .getResourceAsStream("/profile.txt")).build()), MapToProfileInfoTest.ONE);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToServerInfoTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToServerInfoTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToServerInfoTest.java
deleted file mode 100644
index eb7f4d3..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToServerInfoTest.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import java.util.List;
-import java.util.Map;
-
-import org.jclouds.cloudsigma.domain.Device;
-import org.jclouds.cloudsigma.domain.DriveMetrics;
-import org.jclouds.cloudsigma.domain.NIC;
-import org.jclouds.cloudsigma.domain.ServerMetrics;
-import org.jclouds.cloudsigma.functions.MapToDevices.DeviceToId;
-import org.jclouds.http.HttpResponse;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Function;
-import com.google.inject.AbstractModule;
-import com.google.inject.Guice;
-import com.google.inject.TypeLiteral;
-
-@Test(groups = { "unit" })
-public class KeyValuesDelimitedByBlankLinesToServerInfoTest {
-
- private static final KeyValuesDelimitedByBlankLinesToServerInfo FN = Guice.createInjector(new AbstractModule() {
-
- @Override
- protected void configure() {
- bind(new TypeLiteral<Function<Map<String, String>, List<NIC>>>() {
- }).to(MapToNICs.class);
- bind(new TypeLiteral<Function<Map<String, String>, Map<String, ? extends Device>>>() {
- }).to(MapToDevices.class);
- bind(new TypeLiteral<Function<Map<String, String>, Map<String, ? extends DriveMetrics>>>() {
- }).to(MapToDriveMetrics.class);
- bind(new TypeLiteral<Function<Map<String, String>, ServerMetrics>>() {
- }).to(MapToServerMetrics.class);
- bind(new TypeLiteral<Function<Device, String>>() {
- }).to(DeviceToId.class);
- }
-
- }).getInstance(KeyValuesDelimitedByBlankLinesToServerInfo.class);
-
- public void testNone() {
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").payload("").build()), null);
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").payload("\n\n").build()), null);
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").build()), null);
- }
-
- public void testOne() {
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").payload(MapToServerInfoTest.class
- .getResourceAsStream("/servers.txt")).build()), MapToServerInfoTest.ONE);
- }
-
- public void testNew() {
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").payload(MapToServerInfoTest.class
- .getResourceAsStream("/new_server.txt")).build()), MapToServerInfoTest.NEW);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToVLANInfoTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToVLANInfoTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToVLANInfoTest.java
deleted file mode 100644
index 8624b23..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/KeyValuesDelimitedByBlankLinesToVLANInfoTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import org.jclouds.http.HttpResponse;
-import org.testng.annotations.Test;
-
-import com.google.inject.Guice;
-
-@Test(groups = { "unit" })
-public class KeyValuesDelimitedByBlankLinesToVLANInfoTest {
-
- private static final KeyValuesDelimitedByBlankLinesToVLANInfo FN = Guice.createInjector().getInstance(
- KeyValuesDelimitedByBlankLinesToVLANInfo.class);
-
- public void testNone() {
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").payload("").build()), null);
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").payload("\n\n").build()), null);
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").build()), null);
- }
-
- public void testOne() {
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").payload(MapToVLANInfoTest.class
- .getResourceAsStream("/vlan.txt")).build()), MapToVLANInfoTest.ONE);
- }
-}
[14/50] [abbrv] git commit: Replace uses of ByteArrayPayload
Posted by an...@apache.org.
Replace uses of ByteArrayPayload
Prefer ByteSourcePayload which offers a superset of its functionality.
Note that ByteArrayPayload implicitly set the contentLength while
users of ByteSourcePayload must do so explicitly.
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/bd5b6853
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/bd5b6853
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/bd5b6853
Branch: refs/heads/fix-jclouds-538
Commit: bd5b6853ee4d2397f49e27d68818b01123fa7bd2
Parents: a4bc36d
Author: Andrew Gaul <ga...@apache.org>
Authored: Sat Sep 6 16:46:17 2014 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Sun Sep 7 07:43:14 2014 -0700
----------------------------------------------------------------------
blobstore/src/main/clojure/org/jclouds/blobstore2.clj | 2 +-
.../blobstore/strategy/internal/MarkerFileMkdirStrategy.java | 7 ++++---
core/src/main/java/org/jclouds/http/HttpMessage.java | 2 +-
core/src/main/java/org/jclouds/io/Payloads.java | 5 ++++-
.../main/java/org/jclouds/io/internal/BasePayloadSlicer.java | 4 ++--
.../src/main/java/org/jclouds/io/payloads/StringPayload.java | 2 +-
.../org/jclouds/rest/internal/RestAnnotationProcessor.java | 2 +-
.../main/java/org/jclouds/http/apachehc/ApacheHCUtils.java | 6 ------
.../main/java/org/jclouds/gae/ConvertToJcloudsResponse.java | 2 +-
.../test/java/org/jclouds/aws/s3/AWSS3ClientLiveTest.java | 4 ++--
.../java/org/jclouds/azureblob/AzureBlobClientLiveTest.java | 8 ++++----
11 files changed, 21 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/bd5b6853/blobstore/src/main/clojure/org/jclouds/blobstore2.clj
----------------------------------------------------------------------
diff --git a/blobstore/src/main/clojure/org/jclouds/blobstore2.clj b/blobstore/src/main/clojure/org/jclouds/blobstore2.clj
index ed3d977..98d51cb 100644
--- a/blobstore/src/main/clojure/org/jclouds/blobstore2.clj
+++ b/blobstore/src/main/clojure/org/jclouds/blobstore2.clj
@@ -82,7 +82,7 @@ See http://code.google.com/p/jclouds for details."
;; hence separating it from the above
(extend-protocol PayloadSource
(class (make-array Byte/TYPE 0))
- (payload [ba] (Payloads/newByteArrayPayload ba)))
+ (payload [ba] (Payloads/newPayload ba)))
(defn blobstore
"Create a logged in context.
http://git-wip-us.apache.org/repos/asf/jclouds/blob/bd5b6853/blobstore/src/main/java/org/jclouds/blobstore/strategy/internal/MarkerFileMkdirStrategy.java
----------------------------------------------------------------------
diff --git a/blobstore/src/main/java/org/jclouds/blobstore/strategy/internal/MarkerFileMkdirStrategy.java b/blobstore/src/main/java/org/jclouds/blobstore/strategy/internal/MarkerFileMkdirStrategy.java
index d3e56a0..369aa4e 100644
--- a/blobstore/src/main/java/org/jclouds/blobstore/strategy/internal/MarkerFileMkdirStrategy.java
+++ b/blobstore/src/main/java/org/jclouds/blobstore/strategy/internal/MarkerFileMkdirStrategy.java
@@ -16,8 +16,6 @@
*/
package org.jclouds.blobstore.strategy.internal;
-import static org.jclouds.io.Payloads.newByteArrayPayload;
-
import javax.inject.Named;
import javax.inject.Singleton;
@@ -26,6 +24,7 @@ import org.jclouds.blobstore.domain.StorageType;
import org.jclouds.blobstore.reference.BlobStoreConstants;
import org.jclouds.blobstore.strategy.MkdirStrategy;
+import com.google.common.io.ByteSource;
import com.google.inject.Inject;
/**
@@ -50,6 +49,8 @@ public class MarkerFileMkdirStrategy implements MkdirStrategy {
blobStore.putBlob(
containerName,
blobStore.blobBuilder(directory + directorySuffix).type(StorageType.RELATIVE_PATH)
- .payload(newByteArrayPayload(new byte[] {})).contentType("application/directory").build());
+ .payload(ByteSource.empty())
+ .contentLength(0L)
+ .contentType("application/directory").build());
}
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/bd5b6853/core/src/main/java/org/jclouds/http/HttpMessage.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/jclouds/http/HttpMessage.java b/core/src/main/java/org/jclouds/http/HttpMessage.java
index 424a687..d702c69 100644
--- a/core/src/main/java/org/jclouds/http/HttpMessage.java
+++ b/core/src/main/java/org/jclouds/http/HttpMessage.java
@@ -69,7 +69,7 @@ public class HttpMessage extends PayloadEnclosingImpl {
*/
@Deprecated
public T payload(byte [] payload) {
- this.payload = Payloads.newByteArrayPayload(checkNotNull(payload, "payload"));
+ this.payload = Payloads.newPayload(checkNotNull(payload, "payload"));
return self();
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/bd5b6853/core/src/main/java/org/jclouds/io/Payloads.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/jclouds/io/Payloads.java b/core/src/main/java/org/jclouds/io/Payloads.java
index 1ccacf7..0a65d63 100644
--- a/core/src/main/java/org/jclouds/io/Payloads.java
+++ b/core/src/main/java/org/jclouds/io/Payloads.java
@@ -46,7 +46,10 @@ public class Payloads {
} else if (data instanceof InputStream) {
return newInputStreamPayload((InputStream) data);
} else if (data instanceof byte[]) {
- return newByteArrayPayload((byte[]) data);
+ byte[] array = (byte[]) data;
+ Payload payload = newByteSourcePayload(ByteSource.wrap(array));
+ payload.getContentMetadata().setContentLength((long) array.length);
+ return payload;
} else if (data instanceof ByteSource) {
return newByteSourcePayload((ByteSource) data);
} else if (data instanceof String) {
http://git-wip-us.apache.org/repos/asf/jclouds/blob/bd5b6853/core/src/main/java/org/jclouds/io/internal/BasePayloadSlicer.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/jclouds/io/internal/BasePayloadSlicer.java b/core/src/main/java/org/jclouds/io/internal/BasePayloadSlicer.java
index d3a41f3..b9fa973 100644
--- a/core/src/main/java/org/jclouds/io/internal/BasePayloadSlicer.java
+++ b/core/src/main/java/org/jclouds/io/internal/BasePayloadSlicer.java
@@ -33,9 +33,9 @@ import javax.inject.Singleton;
import org.jclouds.io.ContentMetadata;
import org.jclouds.io.Payload;
+import org.jclouds.io.Payloads;
import org.jclouds.io.PayloadSlicer;
import org.jclouds.io.payloads.BaseMutableContentMetadata;
-import org.jclouds.io.payloads.ByteArrayPayload;
import org.jclouds.io.payloads.ByteSourcePayload;
import org.jclouds.io.payloads.InputStreamPayload;
@@ -119,7 +119,7 @@ public class BasePayloadSlicer implements PayloadSlicer {
Payload payload = null;
if (content.length > 0) {
- payload = new ByteArrayPayload(content);
+ payload = Payloads.newPayload(content);
ContentMetadata cm = metaData.toBuilder().contentLength((long)content.length).contentMD5((HashCode) null).build();
payload.setContentMetadata(BaseMutableContentMetadata.fromContentMetadata(cm));
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/bd5b6853/core/src/main/java/org/jclouds/io/payloads/StringPayload.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/jclouds/io/payloads/StringPayload.java b/core/src/main/java/org/jclouds/io/payloads/StringPayload.java
index 3865062..8342324 100644
--- a/core/src/main/java/org/jclouds/io/payloads/StringPayload.java
+++ b/core/src/main/java/org/jclouds/io/payloads/StringPayload.java
@@ -23,7 +23,7 @@ import com.google.common.base.Charsets;
/**
* This implementation converts the String to a byte array using UTF-8 encoding. If you wish to use
- * a different encoding, please use {@link ByteArrayPayload}.
+ * a different encoding, please use {@link ByteSourcePayload}.
*
* @deprecated see ByteSourcePayload
*/
http://git-wip-us.apache.org/repos/asf/jclouds/blob/bd5b6853/core/src/main/java/org/jclouds/rest/internal/RestAnnotationProcessor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/jclouds/rest/internal/RestAnnotationProcessor.java b/core/src/main/java/org/jclouds/rest/internal/RestAnnotationProcessor.java
index e5f1c13..0f12ba3 100644
--- a/core/src/main/java/org/jclouds/rest/internal/RestAnnotationProcessor.java
+++ b/core/src/main/java/org/jclouds/rest/internal/RestAnnotationProcessor.java
@@ -300,7 +300,7 @@ public class RestAnnotationProcessor implements Function<Invocation, HttpRequest
payload = Payloads.newUrlEncodedFormPayload(transformValues(formParams, NullableToStringFunction.INSTANCE));
} else if (headers.containsKey(CONTENT_TYPE) && !HttpRequest.NON_PAYLOAD_METHODS.contains(requestMethod)) {
if (payload == null)
- payload = Payloads.newByteArrayPayload(new byte[] {});
+ payload = Payloads.newPayload(new byte[] {});
payload.getContentMetadata().setContentType(get(headers.get(CONTENT_TYPE), 0));
}
if (payload != null) {
http://git-wip-us.apache.org/repos/asf/jclouds/blob/bd5b6853/drivers/apachehc/src/main/java/org/jclouds/http/apachehc/ApacheHCUtils.java
----------------------------------------------------------------------
diff --git a/drivers/apachehc/src/main/java/org/jclouds/http/apachehc/ApacheHCUtils.java b/drivers/apachehc/src/main/java/org/jclouds/http/apachehc/ApacheHCUtils.java
index c1c5f22..065f303 100644
--- a/drivers/apachehc/src/main/java/org/jclouds/http/apachehc/ApacheHCUtils.java
+++ b/drivers/apachehc/src/main/java/org/jclouds/http/apachehc/ApacheHCUtils.java
@@ -36,7 +36,6 @@ import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.client.methods.HttpUriRequest;
-import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.entity.FileEntity;
import org.apache.http.entity.InputStreamEntity;
import org.apache.http.entity.StringEntity;
@@ -48,7 +47,6 @@ import org.jclouds.io.ContentMetadataCodec;
import org.jclouds.io.MutableContentMetadata;
import org.jclouds.io.Payload;
import org.jclouds.io.payloads.BasePayload;
-import org.jclouds.io.payloads.ByteArrayPayload;
import org.jclouds.io.payloads.DelegatingPayload;
import org.jclouds.io.payloads.FilePayload;
import org.jclouds.io.payloads.StringPayload;
@@ -139,10 +137,6 @@ public class ApacheHCUtils {
} else if (payload instanceof FilePayload) {
apacheRequest.setEntity(new FileEntity((File) payload.getRawContent(), payload.getContentMetadata()
.getContentType()));
- } else if (payload instanceof ByteArrayPayload) {
- ByteArrayEntity Entity = new ByteArrayEntity((byte[]) payload.getRawContent());
- Entity.setContentType(payload.getContentMetadata().getContentType());
- apacheRequest.setEntity(Entity);
} else {
InputStream inputStream = payload.getInput();
if (payload.getContentMetadata().getContentLength() == null)
http://git-wip-us.apache.org/repos/asf/jclouds/blob/bd5b6853/drivers/gae/src/main/java/org/jclouds/gae/ConvertToJcloudsResponse.java
----------------------------------------------------------------------
diff --git a/drivers/gae/src/main/java/org/jclouds/gae/ConvertToJcloudsResponse.java b/drivers/gae/src/main/java/org/jclouds/gae/ConvertToJcloudsResponse.java
index 181585e..7cdf54c 100644
--- a/drivers/gae/src/main/java/org/jclouds/gae/ConvertToJcloudsResponse.java
+++ b/drivers/gae/src/main/java/org/jclouds/gae/ConvertToJcloudsResponse.java
@@ -43,7 +43,7 @@ public class ConvertToJcloudsResponse implements Function<HTTPResponse, HttpResp
@Override
public HttpResponse apply(HTTPResponse gaeResponse) {
- Payload payload = gaeResponse.getContent() != null ? Payloads.newByteArrayPayload(gaeResponse.getContent())
+ Payload payload = gaeResponse.getContent() != null ? Payloads.newPayload(gaeResponse.getContent())
: null;
Multimap<String, String> headers = LinkedHashMultimap.create();
String message = null;
http://git-wip-us.apache.org/repos/asf/jclouds/blob/bd5b6853/providers/aws-s3/src/test/java/org/jclouds/aws/s3/AWSS3ClientLiveTest.java
----------------------------------------------------------------------
diff --git a/providers/aws-s3/src/test/java/org/jclouds/aws/s3/AWSS3ClientLiveTest.java b/providers/aws-s3/src/test/java/org/jclouds/aws/s3/AWSS3ClientLiveTest.java
index 7fe6b8c..14e0c74 100644
--- a/providers/aws-s3/src/test/java/org/jclouds/aws/s3/AWSS3ClientLiveTest.java
+++ b/providers/aws-s3/src/test/java/org/jclouds/aws/s3/AWSS3ClientLiveTest.java
@@ -18,7 +18,6 @@ package org.jclouds.aws.s3;
import static com.google.common.hash.Hashing.md5;
import static org.jclouds.aws.s3.blobstore.options.AWSS3PutOptions.Builder.storageClass;
-import static org.jclouds.io.Payloads.newByteArrayPayload;
import static org.jclouds.s3.options.ListBucketOptions.Builder.withPrefix;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
@@ -42,6 +41,7 @@ import org.jclouds.blobstore.options.PutOptions;
import org.jclouds.domain.Location;
import org.jclouds.io.ByteStreams2;
import org.jclouds.io.Payload;
+import org.jclouds.io.Payloads;
import org.jclouds.s3.S3Client;
import org.jclouds.s3.S3ClientLiveTest;
import org.jclouds.s3.domain.ListBucketResponse;
@@ -93,7 +93,7 @@ public class AWSS3ClientLiveTest extends S3ClientLiveTest {
byte[] buffer = oneHundredOneConstitutions.read();
assertEquals(oneHundredOneConstitutions.size(), (long) buffer.length);
- Payload part1 = newByteArrayPayload(buffer);
+ Payload part1 = Payloads.newPayload(buffer);
part1.getContentMetadata().setContentLength((long) buffer.length);
part1.getContentMetadata().setContentMD5(oneHundredOneConstitutionsMD5);
http://git-wip-us.apache.org/repos/asf/jclouds/blob/bd5b6853/providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobClientLiveTest.java
----------------------------------------------------------------------
diff --git a/providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobClientLiveTest.java b/providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobClientLiveTest.java
index 836d7de..5966e7b 100644
--- a/providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobClientLiveTest.java
+++ b/providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobClientLiveTest.java
@@ -45,7 +45,7 @@ import org.jclouds.blobstore.ContainerNotFoundException;
import org.jclouds.blobstore.integration.internal.BaseBlobStoreIntegrationTest;
import org.jclouds.http.HttpResponseException;
import org.jclouds.http.options.GetOptions;
-import org.jclouds.io.payloads.ByteArrayPayload;
+import org.jclouds.io.Payloads;
import org.jclouds.util.Strings2;
import org.jclouds.util.Throwables2;
import org.testng.annotations.Test;
@@ -361,9 +361,9 @@ public class AzureBlobClientLiveTest extends BaseBlobStoreIntegrationTest {
String blockIdB = BaseEncoding.base64().encode((blockBlob + "-" + B).getBytes());
String blockIdC = BaseEncoding.base64().encode((blockBlob + "-" + C).getBytes());
getApi().createContainer(blockContainer);
- getApi().putBlock(blockContainer, blockBlob, blockIdA, new ByteArrayPayload(A.getBytes()));
- getApi().putBlock(blockContainer, blockBlob, blockIdB, new ByteArrayPayload(B.getBytes()));
- getApi().putBlock(blockContainer, blockBlob, blockIdC, new ByteArrayPayload(C.getBytes()));
+ getApi().putBlock(blockContainer, blockBlob, blockIdA, Payloads.newPayload(A.getBytes()));
+ getApi().putBlock(blockContainer, blockBlob, blockIdB, Payloads.newPayload(B.getBytes()));
+ getApi().putBlock(blockContainer, blockBlob, blockIdC, Payloads.newPayload(C.getBytes()));
getApi().putBlockList(blockContainer, blockBlob, Arrays.asList(blockIdA, blockIdB, blockIdC));
ListBlobBlocksResponse blocks = getApi().getBlockList(blockContainer, blockBlob);
assertEquals(3, blocks.getBlocks().size());
[08/50] [abbrv] git commit: JCLOUDS-706: Upgrade Azure API to
2012-02-12
Posted by an...@apache.org.
JCLOUDS-706: Upgrade Azure API to 2012-02-12
This will allow use of Azure after August 2015:
http://blogs.msdn.com/b/windowsazurestorage/archive/2014/08/05/microsoft-azure-storage-service-version-removal.aspx
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/975c1325
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/975c1325
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/975c1325
Branch: refs/heads/fix-jclouds-538
Commit: 975c1325bcf980ef4da1de00d1d5843a1d788399
Parents: 15d8166
Author: Andrew Gaul <ga...@apache.org>
Authored: Thu Sep 4 17:39:01 2014 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Fri Sep 5 16:35:31 2014 -0700
----------------------------------------------------------------------
providers/azureblob/pom.xml | 2 +-
.../jclouds/azureblob/AzureBlobApiMetadata.java | 2 +-
.../jclouds/azureblob/AzureBlobAsyncClient.java | 2 +-
.../azureblob/AzureBlobAsyncClientTest.java | 38 ++++++++++++--------
.../blobstore/AzureBlobRequestSignerTest.java | 12 ++++---
5 files changed, 34 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/975c1325/providers/azureblob/pom.xml
----------------------------------------------------------------------
diff --git a/providers/azureblob/pom.xml b/providers/azureblob/pom.xml
index 25b59bd..c80c59d 100644
--- a/providers/azureblob/pom.xml
+++ b/providers/azureblob/pom.xml
@@ -33,7 +33,7 @@
<properties>
<test.azureblob.endpoint>https://${jclouds.identity}.blob.core.windows.net</test.azureblob.endpoint>
- <test.azureblob.api-version>2009-09-19</test.azureblob.api-version>
+ <test.azureblob.api-version>2012-02-12</test.azureblob.api-version>
<test.azureblob.build-version />
<test.azureblob.identity>${test.azure.identity}</test.azureblob.identity>
<test.azureblob.credential>${test.azure.credential}</test.azureblob.credential>
http://git-wip-us.apache.org/repos/asf/jclouds/blob/975c1325/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobApiMetadata.java
----------------------------------------------------------------------
diff --git a/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobApiMetadata.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobApiMetadata.java
index c498f26..8c5744a 100644
--- a/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobApiMetadata.java
+++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobApiMetadata.java
@@ -76,7 +76,7 @@ public class AzureBlobApiMetadata extends BaseRestApiMetadata {
.name("Microsoft Azure Blob Service API")
.identityName("Account Name")
.credentialName("Access Key")
- .version("2009-09-19")
+ .version("2012-02-12")
.defaultEndpoint("https://${jclouds.identity}.blob.core.windows.net")
.documentation(URI.create("http://msdn.microsoft.com/en-us/library/dd135733.aspx"))
.defaultProperties(AzureBlobApiMetadata.defaultProperties())
http://git-wip-us.apache.org/repos/asf/jclouds/blob/975c1325/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobAsyncClient.java
----------------------------------------------------------------------
diff --git a/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobAsyncClient.java b/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobAsyncClient.java
index f862689..ea44e96 100644
--- a/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobAsyncClient.java
+++ b/providers/azureblob/src/main/java/org/jclouds/azureblob/AzureBlobAsyncClient.java
@@ -92,7 +92,7 @@ import com.google.inject.Provides;
*/
@Deprecated
@RequestFilters(SharedKeyLiteAuthentication.class)
-@Headers(keys = AzureStorageHeaders.VERSION, values = "2009-09-19")
+@Headers(keys = AzureStorageHeaders.VERSION, values = "2012-02-12")
@SkipEncoding({ '/', '$' })
@Path("/")
public interface AzureBlobAsyncClient {
http://git-wip-us.apache.org/repos/asf/jclouds/blob/975c1325/providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobAsyncClientTest.java
----------------------------------------------------------------------
diff --git a/providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobAsyncClientTest.java b/providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobAsyncClientTest.java
index 5928175..17a9cb8 100644
--- a/providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobAsyncClientTest.java
+++ b/providers/azureblob/src/test/java/org/jclouds/azureblob/AzureBlobAsyncClientTest.java
@@ -64,7 +64,7 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.of());
assertRequestLineEquals(request, "GET https://identity.blob.core.windows.net/?comp=list HTTP/1.1");
- assertNonPayloadHeadersEqual(request, "x-ms-version: 2009-09-19\n");
+ assertNonPayloadHeadersEqual(request, "x-ms-version: 2012-02-12\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@@ -79,7 +79,7 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
assertRequestLineEquals(request,
"GET https://identity.blob.core.windows.net/?comp=list&maxresults=1&marker=marker&prefix=prefix HTTP/1.1");
- assertNonPayloadHeadersEqual(request, "x-ms-version: 2009-09-19\n");
+ assertNonPayloadHeadersEqual(request, "x-ms-version: 2012-02-12\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@@ -94,7 +94,7 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
assertRequestLineEquals(request,
"PUT https://identity.blob.core.windows.net/container?restype=container HTTP/1.1");
- assertNonPayloadHeadersEqual(request, "x-ms-version: 2009-09-19\n");
+ assertNonPayloadHeadersEqual(request, "x-ms-version: 2012-02-12\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ReturnTrueIf2xx.class);
@@ -108,7 +108,7 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
assertRequestLineEquals(request,
"DELETE https://identity.blob.core.windows.net/container?restype=container HTTP/1.1");
- assertNonPayloadHeadersEqual(request, "x-ms-version: 2009-09-19\n");
+ assertNonPayloadHeadersEqual(request, "x-ms-version: 2012-02-12\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
@@ -125,7 +125,9 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
assertRequestLineEquals(request,
"PUT https://identity.blob.core.windows.net/container?restype=container HTTP/1.1");
assertNonPayloadHeadersEqual(request,
- "x-ms-blob-public-access: blob\nx-ms-meta-foo: bar\nx-ms-version: 2009-09-19\n");
+ "x-ms-blob-public-access: blob\n" +
+ "x-ms-meta-foo: bar\n" +
+ "x-ms-version: 2012-02-12\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ReturnTrueIf2xx.class);
@@ -139,7 +141,7 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.of());
assertRequestLineEquals(request, "PUT https://identity.blob.core.windows.net/$root?restype=container HTTP/1.1");
- assertNonPayloadHeadersEqual(request, "x-ms-version: 2009-09-19\n");
+ assertNonPayloadHeadersEqual(request, "x-ms-version: 2012-02-12\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ReturnTrueIf2xx.class);
@@ -152,7 +154,7 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.of());
assertRequestLineEquals(request, "DELETE https://identity.blob.core.windows.net/$root?restype=container HTTP/1.1");
- assertNonPayloadHeadersEqual(request, "x-ms-version: 2009-09-19\n");
+ assertNonPayloadHeadersEqual(request, "x-ms-version: 2012-02-12\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
@@ -167,7 +169,9 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
assertRequestLineEquals(request, "PUT https://identity.blob.core.windows.net/$root?restype=container HTTP/1.1");
assertNonPayloadHeadersEqual(request,
- "x-ms-blob-public-access: blob\nx-ms-meta-foo: bar\nx-ms-version: 2009-09-19\n");
+ "x-ms-blob-public-access: blob\n" +
+ "x-ms-meta-foo: bar\n" +
+ "x-ms-version: 2012-02-12\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ReturnTrueIf2xx.class);
@@ -181,7 +185,7 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
assertRequestLineEquals(request,
"GET https://identity.blob.core.windows.net/container?restype=container&comp=list HTTP/1.1");
- assertNonPayloadHeadersEqual(request, "x-ms-version: 2009-09-19\n");
+ assertNonPayloadHeadersEqual(request, "x-ms-version: 2012-02-12\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@@ -195,7 +199,7 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
assertRequestLineEquals(request,
"GET https://identity.blob.core.windows.net/$root?restype=container&comp=list HTTP/1.1");
- assertNonPayloadHeadersEqual(request, "x-ms-version: 2009-09-19\n");
+ assertNonPayloadHeadersEqual(request, "x-ms-version: 2012-02-12\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ParseSax.class);
@@ -209,7 +213,7 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
assertRequestLineEquals(request,
"HEAD https://identity.blob.core.windows.net/container?restype=container HTTP/1.1");
- assertNonPayloadHeadersEqual(request, "x-ms-version: 2009-09-19\n");
+ assertNonPayloadHeadersEqual(request, "x-ms-version: 2012-02-12\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ParseContainerPropertiesFromHeaders.class);
@@ -223,7 +227,7 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
assertRequestLineEquals(request,
"HEAD https://identity.blob.core.windows.net/container?restype=container&comp=acl HTTP/1.1");
- assertNonPayloadHeadersEqual(request, "x-ms-version: 2009-09-19\n");
+ assertNonPayloadHeadersEqual(request, "x-ms-version: 2012-02-12\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ParsePublicAccessHeader.class);
@@ -238,7 +242,9 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
assertRequestLineEquals(request,
"PUT https://identity.blob.core.windows.net/container?restype=container&comp=metadata HTTP/1.1");
- assertNonPayloadHeadersEqual(request, "x-ms-meta-key: value\nx-ms-version: 2009-09-19\n");
+ assertNonPayloadHeadersEqual(request,
+ "x-ms-meta-key: value\n" +
+ "x-ms-version: 2012-02-12\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
@@ -251,7 +257,7 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.<Object> of("container", "blob"));
assertRequestLineEquals(request, "GET https://identity.blob.core.windows.net/container/blob HTTP/1.1");
- assertNonPayloadHeadersEqual(request, "x-ms-version: 2009-09-19\n");
+ assertNonPayloadHeadersEqual(request, "x-ms-version: 2012-02-12\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ParseBlobFromHeadersAndHttpContent.class);
@@ -265,7 +271,9 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
assertRequestLineEquals(request,
"PUT https://identity.blob.core.windows.net/container/blob?comp=metadata HTTP/1.1");
- assertNonPayloadHeadersEqual(request, "x-ms-meta-key: value\nx-ms-version: 2009-09-19\n");
+ assertNonPayloadHeadersEqual(request,
+ "x-ms-meta-key: value\n" +
+ "x-ms-version: 2012-02-12\n");
assertPayloadEquals(request, null, null, false);
assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
http://git-wip-us.apache.org/repos/asf/jclouds/blob/975c1325/providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/AzureBlobRequestSignerTest.java
----------------------------------------------------------------------
diff --git a/providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/AzureBlobRequestSignerTest.java b/providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/AzureBlobRequestSignerTest.java
index 96ae9da..b2ba5f2 100644
--- a/providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/AzureBlobRequestSignerTest.java
+++ b/providers/azureblob/src/test/java/org/jclouds/azureblob/blobstore/AzureBlobRequestSignerTest.java
@@ -60,7 +60,9 @@ public class AzureBlobRequestSignerTest extends BaseAsyncClientTest<AzureBlobAsy
assertRequestLineEquals(request, "GET https://identity.blob.core.windows.net/container/name HTTP/1.1");
assertNonPayloadHeadersEqual(
request,
- "Authorization: SharedKeyLite identity:nutCr98JWBu7wbe1p9rDiyOXg3o6UqI4tEZ29bctKEU=\nDate: Thu, 05 Jun 2008 16:38:19 GMT\nx-ms-version: 2009-09-19\n");
+ "Authorization: SharedKeyLite identity:3rx56J9eAw/0GH2pym1hBmMGQmGju4DkVDcRsBWBtAk=\n" +
+ "Date: Thu, 05 Jun 2008 16:38:19 GMT\n" +
+ "x-ms-version: 2012-02-12\n");
assertPayloadEquals(request, null, null, false);
assertEquals(request.getFilters().size(), 0);
@@ -73,7 +75,9 @@ public class AzureBlobRequestSignerTest extends BaseAsyncClientTest<AzureBlobAsy
assertRequestLineEquals(request, "DELETE https://identity.blob.core.windows.net/container/name HTTP/1.1");
assertNonPayloadHeadersEqual(
request,
- "Authorization: SharedKeyLite identity:GRixvGXJ05tuWANrM5xeWOAAVqfztvmPLpwCRcWPZEk=\nDate: Thu, 05 Jun 2008 16:38:19 GMT\nx-ms-version: 2009-09-19\n");
+ "Authorization: SharedKeyLite identity:EN3SE/jB9anhgqIqJMmrTCzZpuqjL41BIZnaE9PEBaU=\n" +
+ "Date: Thu, 05 Jun 2008 16:38:19 GMT\n" +
+ "x-ms-version: 2012-02-12\n");
assertPayloadEquals(request, null, null, false);
assertEquals(request.getFilters().size(), 0);
@@ -95,11 +99,11 @@ public class AzureBlobRequestSignerTest extends BaseAsyncClientTest<AzureBlobAsy
assertRequestLineEquals(request, "PUT https://identity.blob.core.windows.net/container/name HTTP/1.1");
assertNonPayloadHeadersEqual(
request,
- "Authorization: SharedKeyLite identity:8kilG1mKxSWaKMLIQPI/aBlTFvaRRbmGOBqKaE+/R5A=\n" +
+ "Authorization: SharedKeyLite identity:V0gyrdMZzwQrCvxEfq6eBe8PL233yJ91+aNcISEzjfE=\n" +
"Date: Thu, 05 Jun 2008 16:38:19 GMT\n" +
"Expect: 100-continue\n" +
"x-ms-blob-type: BlockBlob\n" +
- "x-ms-version: 2009-09-19\n");
+ "x-ms-version: 2012-02-12\n");
assertContentHeadersEqual(request, "text/plain", null, null, null, 2L, hashCode.asBytes(), new Date(1000));
assertEquals(request.getFilters().size(), 0);
[16/50] [abbrv] git commit: Prefer Files.delete(Path) over File.delete
Posted by an...@apache.org.
Prefer Files.delete(Path) over File.delete
The former throws an exception including the cause if the operation
fails while the latter merely returns a boolean.
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/000a5053
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/000a5053
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/000a5053
Branch: refs/heads/fix-jclouds-538
Commit: 000a5053602597f7b9b9968ddde450d476854c1b
Parents: fc4b072
Author: Andrew Gaul <ga...@apache.org>
Authored: Mon Jul 21 13:24:32 2014 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Mon Sep 8 18:41:27 2014 -0700
----------------------------------------------------------------------
.../src/main/java/org/jclouds/filesystem/util/Utils.java | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/000a5053/apis/filesystem/src/main/java/org/jclouds/filesystem/util/Utils.java
----------------------------------------------------------------------
diff --git a/apis/filesystem/src/main/java/org/jclouds/filesystem/util/Utils.java b/apis/filesystem/src/main/java/org/jclouds/filesystem/util/Utils.java
index 6a3bbf9..95f5f57 100644
--- a/apis/filesystem/src/main/java/org/jclouds/filesystem/util/Utils.java
+++ b/apis/filesystem/src/main/java/org/jclouds/filesystem/util/Utils.java
@@ -18,6 +18,7 @@ package org.jclouds.filesystem.util;
import java.io.File;
import java.io.IOException;
+import java.nio.file.Files;
/**
* Utilities for the filesystem blobstore.
@@ -38,8 +39,6 @@ public class Utils {
}
}
}
- if (!file.delete()) {
- throw new IOException("Could not delete: " + file);
- }
+ Files.delete(file.toPath());
}
}
[36/50] [abbrv] git commit: Revert "Unhook modernizer from verify
phase"
Posted by an...@apache.org.
Revert "Unhook modernizer from verify phase"
This reverts commit 0d67da75e9295742d44e041489206c9f79472e9d.
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/bc4b89fe
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/bc4b89fe
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/bc4b89fe
Branch: refs/heads/fix-jclouds-538
Commit: bc4b89feb153fa3cff3bb89259c5ae1629970ba2
Parents: 0d67da7
Author: Andrew Gaul <ga...@apache.org>
Authored: Tue Sep 23 11:29:25 2014 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Tue Sep 23 11:29:25 2014 -0700
----------------------------------------------------------------------
project/pom.xml | 9 +++++++++
1 file changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/bc4b89fe/project/pom.xml
----------------------------------------------------------------------
diff --git a/project/pom.xml b/project/pom.xml
index f765537..524605e 100644
--- a/project/pom.xml
+++ b/project/pom.xml
@@ -719,6 +719,15 @@
<groupId>org.gaul</groupId>
<artifactId>modernizer-maven-plugin</artifactId>
<version>1.1.0</version>
+ <executions>
+ <execution>
+ <id>modernizer</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>modernizer</goal>
+ </goals>
+ </execution>
+ </executions>
<configuration>
<javaVersion>1.7</javaVersion>
<exclusionsFile>resources/modernizer_exclusions.txt</exclusionsFile>
[33/50] [abbrv] git commit: Add modernizer-maven-plugin to build
Posted by an...@apache.org.
Add modernizer-maven-plugin to build
This plugin finds uses of legacy APIs:
https://github.com/andrewgaul/modernizer-maven-plugin
Project: http://git-wip-us.apache.org/repos/asf/jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds/commit/2d70087b
Tree: http://git-wip-us.apache.org/repos/asf/jclouds/tree/2d70087b
Diff: http://git-wip-us.apache.org/repos/asf/jclouds/diff/2d70087b
Branch: refs/heads/fix-jclouds-538
Commit: 2d70087bfa6491ee822874576f8e893c44647276
Parents: b9f54a3
Author: Andrew Gaul <ga...@apache.org>
Authored: Tue Sep 16 13:18:37 2014 -0700
Committer: Andrew Gaul <ga...@apache.org>
Committed: Mon Sep 22 21:57:55 2014 -0700
----------------------------------------------------------------------
.../JavaUrlHttpCommandExecutorService.java | 2 +-
project/pom.xml | 30 +++++++++++++++
resources/checkstyle.xml | 40 --------------------
resources/modernizer_exclusions.txt | 19 ++++++++++
resources/pom.xml | 1 +
5 files changed, 51 insertions(+), 41 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jclouds/blob/2d70087b/core/src/main/java/org/jclouds/http/internal/JavaUrlHttpCommandExecutorService.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/jclouds/http/internal/JavaUrlHttpCommandExecutorService.java b/core/src/main/java/org/jclouds/http/internal/JavaUrlHttpCommandExecutorService.java
index 712ea28..3647ef2 100644
--- a/core/src/main/java/org/jclouds/http/internal/JavaUrlHttpCommandExecutorService.java
+++ b/core/src/main/java/org/jclouds/http/internal/JavaUrlHttpCommandExecutorService.java
@@ -280,7 +280,7 @@ public class JavaUrlHttpCommandExecutorService extends BaseHttpCommandExecutorSe
// HttpUrlConnection strips Content-Length: 0 without setDoOutput(true)
String method = connection.getRequestMethod();
if ("POST".equals(method) || "PUT".equals(method)) {
- connection.setFixedLengthStreamingMode(0);
+ connection.setFixedLengthStreamingMode(0L);
connection.setDoOutput(true);
}
}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/2d70087b/project/pom.xml
----------------------------------------------------------------------
diff --git a/project/pom.xml b/project/pom.xml
index 45c8e73..3a0c19c 100644
--- a/project/pom.xml
+++ b/project/pom.xml
@@ -434,6 +434,7 @@
<exclude>**/.gitignore</exclude>
<exclude>**/.gitattributes</exclude>
<exclude>**/.java-version</exclude>
+ <exclude>**/modernizer_exclusions.txt</exclude>
<!-- Temporary files generated on CloudBees slaves -->
<exclude>.repository/**</exclude>
@@ -714,6 +715,24 @@
<violationSeverity>warning</violationSeverity>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.gaul</groupId>
+ <artifactId>modernizer-maven-plugin</artifactId>
+ <version>1.1.0</version>
+ <executions>
+ <execution>
+ <id>modernizer</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>modernizer</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <javaVersion>1.7</javaVersion>
+ <exclusionsFile>resources/modernizer_exclusions.txt</exclusionsFile>
+ </configuration>
+ </plugin>
</plugins>
<pluginManagement>
<plugins>
@@ -1107,6 +1126,17 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.gaul</groupId>
+ <artifactId>modernizer-maven-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.jclouds</groupId>
+ <artifactId>jclouds-resources</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+ </plugin>
</plugins>
</build>
</profile>
http://git-wip-us.apache.org/repos/asf/jclouds/blob/2d70087b/resources/checkstyle.xml
----------------------------------------------------------------------
diff --git a/resources/checkstyle.xml b/resources/checkstyle.xml
index 0be56a3..da62202 100644
--- a/resources/checkstyle.xml
+++ b/resources/checkstyle.xml
@@ -88,44 +88,4 @@
<property name="format" value="@author"/>
<property name="message" value="Do not use Javadoc @author annotation"/>
</module>
- <module name="RegexpMultiline">
- <property name="format" value="=\s*new ArrayList<[^>]"/>
- <property name="message" value="Prefer com.google.common.collect.Lists"/>
- </module>
- <module name="RegexpMultiline">
- <property name="format" value="=\s*new HashMap<[^>]"/>
- <property name="message" value="Prefer com.google.common.collect.Maps"/>
- </module>
- <module name="RegexpMultiline">
- <property name="format" value="=\s*new HashSet<[^>]"/>
- <property name="message" value="Prefer com.google.common.collect.Sets"/>
- </module>
- <module name="RegexpMultiline">
- <property name="format" value="=\s*new LinkedHashMap<[^>]"/>
- <property name="message" value="Prefer com.google.common.collect.Maps"/>
- </module>
- <module name="RegexpMultiline">
- <property name="format" value="=\s*new LinkedHashSet<[^>]"/>
- <property name="message" value="Prefer com.google.common.collect.Sets"/>
- </module>
- <module name="RegexpMultiline">
- <property name="format" value="=\s*new LinkedList<[^>]"/>
- <property name="message" value="Prefer com.google.common.collect.Lists"/>
- </module>
- <module name="RegexpMultiline">
- <property name="format" value="=\s*new TreeMap<[^>]"/>
- <property name="message" value="Prefer com.google.common.collect.Maps"/>
- </module>
- <module name="RegexpMultiline">
- <property name="format" value="=\s*new TreeSet<[^>]"/>
- <property name="message" value="Prefer com.google.common.collect.Sets"/>
- </module>
- <module name="RegexpMultiline">
- <property name="format" value="=\s*new AtomicReference<[^>]"/>
- <property name="message" value="Prefer com.google.common.util.concurrent.Atomics"/>
- </module>
- <module name="RegexpMultiline">
- <property name="format" value="new StringBuffer"/>
- <property name="message" value="Prefer java.lang.StringBuilder"/>
- </module>
</module>
http://git-wip-us.apache.org/repos/asf/jclouds/blob/2d70087b/resources/modernizer_exclusions.txt
----------------------------------------------------------------------
diff --git a/resources/modernizer_exclusions.txt b/resources/modernizer_exclusions.txt
new file mode 100644
index 0000000..7fec5af
--- /dev/null
+++ b/resources/modernizer_exclusions.txt
@@ -0,0 +1,19 @@
+com/google/common/base/Charsets.ISO_8859_1:Ljava/nio/charset/Charset;
+com/google/common/base/Charsets.US_ASCII:Ljava/nio/charset/Charset;
+com/google/common/base/Charsets.UTF_8:Ljava/nio/charset/Charset;
+com/google/common/base/Objects.equal:(Ljava/lang/Object;Ljava/lang/Object;)Z
+com/google/common/base/Objects.hashCode:([Ljava/lang/Object;)I
+com/google/common/collect/Lists.newArrayList:()Ljava/util/ArrayList;
+com/google/common/collect/Lists.newArrayListWithCapacity:(I)Ljava/util/ArrayList;
+com/google/common/collect/Lists.newLinkedList:()Ljava/util/LinkedList;
+com/google/common/collect/Maps.newConcurrentMap:()Ljava/util/concurrent/ConcurrentMap;
+com/google/common/collect/Maps.newHashMap:()Ljava/util/HashMap;
+com/google/common/collect/Maps.newHashMap:(Ljava/util/Map;)Ljava/util/HashMap;
+com/google/common/collect/Maps.newLinkedHashMap:()Ljava/util/LinkedHashMap;
+com/google/common/collect/Maps.newLinkedHashMap:(Ljava/util/Map;)Ljava/util/LinkedHashMap;
+com/google/common/collect/Maps.newTreeMap:()Ljava/util/TreeMap;
+com/google/common/collect/Sets.newHashSet:()Ljava/util/HashSet;
+com/google/common/collect/Sets.newLinkedHashSet:()Ljava/util/LinkedHashSet;
+com/google/common/collect/Sets.newTreeSet:()Ljava/util/TreeSet;
+com/google/common/primitives/Ints.compare:(II)I
+com/google/common/primitives/Longs.compare:(JJ)I
http://git-wip-us.apache.org/repos/asf/jclouds/blob/2d70087b/resources/pom.xml
----------------------------------------------------------------------
diff --git a/resources/pom.xml b/resources/pom.xml
index 02eac53..6404210 100644
--- a/resources/pom.xml
+++ b/resources/pom.xml
@@ -37,6 +37,7 @@
<directory>${project.basedir}</directory>
<includes>
<include>checkstyle.xml</include>
+ <include>modernizer_exclusions.txt</include>
</includes>
</resource>
</resources>
[41/50] [abbrv] JCLOUDS-692 Remove the CloudSigma v1 provider.
Posted by an...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToDriveInfoSetTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToDriveInfoSetTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToDriveInfoSetTest.java
deleted file mode 100644
index 6a7b3b5..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToDriveInfoSetTest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import org.jclouds.cloudsigma.domain.DriveInfo;
-import org.jclouds.http.HttpResponse;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.inject.Guice;
-
-@Test(groups = { "unit" })
-public class ListOfKeyValuesDelimitedByBlankLinesToDriveInfoSetTest {
-
- private static final ListOfKeyValuesDelimitedByBlankLinesToDriveInfoSet FN = Guice.createInjector().getInstance(
- ListOfKeyValuesDelimitedByBlankLinesToDriveInfoSet.class);
-
- public void testNone() {
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").payload("").build()), ImmutableSet.<DriveInfo> of());
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").payload("\n\n").build()), ImmutableSet.<DriveInfo> of());
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").build()), ImmutableSet.<DriveInfo> of());
- }
-
- public void testOne() {
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").payload(MapToDriveInfoTest.class
- .getResourceAsStream("/drive.txt")).build()), ImmutableSet.<DriveInfo> of(MapToDriveInfoTest.ONE));
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToListOfMapsTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToListOfMapsTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToListOfMapsTest.java
deleted file mode 100644
index fb1fd19..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToListOfMapsTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Lists;
-
-@Test(groups = { "unit" })
-public class ListOfKeyValuesDelimitedByBlankLinesToListOfMapsTest {
-
- private static final ListOfKeyValuesDelimitedByBlankLinesToListOfMaps FN = new ListOfKeyValuesDelimitedByBlankLinesToListOfMaps();
-
- public void testNone() {
- assertEquals(FN.apply(""), Lists.newArrayList());
- assertEquals(FN.apply("\n\n\n"), Lists.newArrayList());
- }
-
- public void testOneMap() {
- assertEquals(FN.apply("key1 value1\nkey2 value2"),
- ImmutableList.of(ImmutableMap.of("key1", "value1", "key2", "value2")));
- assertEquals(FN.apply("key1 value1\nkey2 value2\n\n"),
- ImmutableList.of(ImmutableMap.of("key1", "value1", "key2", "value2")));
- }
-
- public void testValueEncodesNewlines() {
- assertEquals(FN.apply("key1 value1\\n\nkey2 value2"),
- ImmutableList.of(ImmutableMap.of("key1", "value1\n", "key2", "value2")));
- }
-
- public void testTwoMaps() {
- assertEquals(
- FN.apply("key1 value1\nkey2 value2\n\nkey1 v1\nkey2 v2"),
- ImmutableList.of(ImmutableMap.of("key1", "value1", "key2", "value2"),
- ImmutableMap.of("key1", "v1", "key2", "v2")));
- assertEquals(
- FN.apply("key1 value1\nkey2 value2\n\nkey1 v1\nkey2 v2\n\n"),
- ImmutableList.of(ImmutableMap.of("key1", "value1", "key2", "value2"),
- ImmutableMap.of("key1", "v1", "key2", "v2")));
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToServerInfoSetTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToServerInfoSetTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToServerInfoSetTest.java
deleted file mode 100644
index 7870ff6..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToServerInfoSetTest.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import java.util.List;
-import java.util.Map;
-
-import org.jclouds.cloudsigma.domain.Device;
-import org.jclouds.cloudsigma.domain.DriveMetrics;
-import org.jclouds.cloudsigma.domain.NIC;
-import org.jclouds.cloudsigma.domain.ServerInfo;
-import org.jclouds.cloudsigma.domain.ServerMetrics;
-import org.jclouds.cloudsigma.functions.MapToDevices.DeviceToId;
-import org.jclouds.http.HttpResponse;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableSet;
-import com.google.inject.AbstractModule;
-import com.google.inject.Guice;
-import com.google.inject.TypeLiteral;
-
-@Test(groups = { "unit" })
-public class ListOfKeyValuesDelimitedByBlankLinesToServerInfoSetTest {
-
- private static final ListOfKeyValuesDelimitedByBlankLinesToServerInfoSet FN = Guice.createInjector(
- new AbstractModule() {
-
- @Override
- protected void configure() {
- bind(new TypeLiteral<Function<Map<String, String>, List<NIC>>>() {
- }).to(MapToNICs.class);
- bind(new TypeLiteral<Function<Map<String, String>, Map<String, ? extends Device>>>() {
- }).to(MapToDevices.class);
- bind(new TypeLiteral<Function<Map<String, String>, Map<String, ? extends DriveMetrics>>>() {
- }).to(MapToDriveMetrics.class);
- bind(new TypeLiteral<Function<Map<String, String>, ServerMetrics>>() {
- }).to(MapToServerMetrics.class);
- bind(new TypeLiteral<Function<Device, String>>() {
- }).to(DeviceToId.class);
- }
-
- }).getInstance(ListOfKeyValuesDelimitedByBlankLinesToServerInfoSet.class);
-
- public void testNone() {
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").payload("").build()), ImmutableSet.<ServerInfo> of());
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").payload("\n\n").build()),
- ImmutableSet.<ServerInfo> of());
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").build()), ImmutableSet.<ServerInfo> of());
- }
-
- public void testOne() {
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").payload(MapToServerInfoTest.class
- .getResourceAsStream("/servers.txt")).build()), ImmutableSet.<ServerInfo> of(MapToServerInfoTest.ONE,
- MapToServerInfoTest.TWO));
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToVLANInfoSetTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToVLANInfoSetTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToVLANInfoSetTest.java
deleted file mode 100644
index 168d55f..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ListOfKeyValuesDelimitedByBlankLinesToVLANInfoSetTest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import org.jclouds.cloudsigma.domain.VLANInfo;
-import org.jclouds.http.HttpResponse;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.inject.Guice;
-
-@Test(groups = { "unit" })
-public class ListOfKeyValuesDelimitedByBlankLinesToVLANInfoSetTest {
-
- private static final ListOfKeyValuesDelimitedByBlankLinesToVLANInfoSet FN = Guice.createInjector().getInstance(
- ListOfKeyValuesDelimitedByBlankLinesToVLANInfoSet.class);
-
- public void testNone() {
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").payload("").build()), ImmutableSet.<VLANInfo> of());
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").payload("\n\n").build()), ImmutableSet.<VLANInfo> of());
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").build()), ImmutableSet.<VLANInfo> of());
- }
-
- public void testOne() {
- assertEquals(FN.apply(HttpResponse.builder().statusCode(200).message("").payload(MapToVLANInfoTest.class
- .getResourceAsStream("/vlan.txt")).build()), ImmutableSet.<VLANInfo> of(MapToVLANInfoTest.ONE));
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ListOfMapsToListOfKeyValuesDelimitedByBlankLinesTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ListOfMapsToListOfKeyValuesDelimitedByBlankLinesTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ListOfMapsToListOfKeyValuesDelimitedByBlankLinesTest.java
deleted file mode 100644
index cabcc89..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ListOfMapsToListOfKeyValuesDelimitedByBlankLinesTest.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import java.util.Map;
-
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-
-@Test(groups = { "unit" })
-public class ListOfMapsToListOfKeyValuesDelimitedByBlankLinesTest {
-
- private static final ListOfMapsToListOfKeyValuesDelimitedByBlankLines FN = new ListOfMapsToListOfKeyValuesDelimitedByBlankLines();
-
- public void testNone() {
- assertEquals(FN.apply(ImmutableList.<Map<String, String>> of()), "");
- }
-
- public void testOneMap() {
- assertEquals(
- FN.apply(ImmutableList.<Map<String, String>> of(ImmutableMap.of("key1", "value1", "key2", "value2"))),
- "key1 value1\nkey2 value2");
- }
-
- public void testValueEncodesNewlines() {
- assertEquals(
- FN.apply(ImmutableList.<Map<String, String>> of(ImmutableMap.of("key1", "value1\n", "key2", "value2"))),
- "key1 value1\\n\nkey2 value2");
- }
-
- public void testTwoMaps() {
- assertEquals(FN.apply(ImmutableList.<Map<String, String>> of(ImmutableMap.of("key1", "value1", "key2", "value2"),
- ImmutableMap.of("key1", "v1", "key2", "v2"))), "key1 value1\nkey2 value2\n\nkey1 v1\nkey2 v2");
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/MapToDriveInfoTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/MapToDriveInfoTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/MapToDriveInfoTest.java
deleted file mode 100644
index 411a2f3..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/MapToDriveInfoTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import java.io.IOException;
-import java.net.URI;
-import java.util.Map;
-
-import org.jclouds.cloudsigma.domain.ClaimType;
-import org.jclouds.cloudsigma.domain.DriveInfo;
-import org.jclouds.cloudsigma.domain.DriveMetrics;
-import org.jclouds.cloudsigma.domain.DriveStatus;
-import org.jclouds.cloudsigma.domain.DriveType;
-import org.jclouds.util.Strings2;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-
-@Test(groups = { "unit" })
-public class MapToDriveInfoTest {
- public static DriveInfo ONE = new DriveInfo.Builder()
- .status(DriveStatus.ACTIVE)
- .use(ImmutableSet.of("networking", "security", "gateway"))
- .name("Ubuntu 10.10 Server Edition Linux 64bit Preinstalled System")
- .bits(64)
- .url(URI.create("http://www.ubuntu.com"))
- .metrics(
- new DriveMetrics.Builder().readBytes(4096l).writeBytes(8589938688l).readRequests(1l)
- .writeRequests(2097153l).build())
- .user("58ca3c1f-7629-4771-9b71-863f40153ba4")
- .encryptionCipher("aes-xts-plain")
- .encryptionKey("ba6c2a4897072e9f25920ed73bd522e9c10d89f30a215158cccf8d0f654ac643")
- .description("The Ubuntu Linux distribution brings the spirit of Ubuntu to the software world.")
- .tags(ImmutableSet.of("foo", "bar", "baz"))
- .uuid("b8171d28-755a-4271-b891-7998871a160e")
- .installNotes("first line\n\n")
- .os("linux")
- .claimType(ClaimType.SHARED)
- .claimed(
- ImmutableSet.of(
- "00109617-2c6b-424b-9cfa-5b572c17bafe:guest:692cd1c7-a863-4a22-8170-fc6e6feb68af:ide:0:0",
- "00031836-a624-4b22-bc7d-41ff8977087b:guest:a1414360-7c24-4730-8c97-180bf7775a71:ide:0:0",
- "0002c6df-a1d2-4d1d-96f0-f95405a28183:guest:386f1cc7-affc-49c1-82a5-2f8e412170e4:ide:0:0",
- "00031836-a624-4b22-bc7d-41ff8977087b:guest:17b076be-430d-4a76-9df3-b9896fec82a5:ide:0:0",
- "000663ee-9fb6-4461-90f6-01327a4aff07:guest:f83b519f-feab-42cf-859c-f61495681ada:ide:0:1"))//
- .driveType(ImmutableSet.of("installcd", "livecd"))//
- .autoexpanding(false).readers(ImmutableSet.of("ffffffff-ffff-ffff-ffff-ffffffffffff"))//
- .free(true)//
- .type(DriveType.DISK)//
- .size(8589934592l)//
- .build();
-
- private static final MapToDriveInfo MAP_TO_DRIVE = new MapToDriveInfo();
-
- public void testEmptyMapReturnsNull() {
- assertEquals(MAP_TO_DRIVE.apply(ImmutableMap.<String, String> of()), null);
- }
-
- public void testBasics() {
- DriveInfo expects = new DriveInfo.Builder().name("foo").size(100l).metrics(new DriveMetrics.Builder().build())
- .build();
- assertEquals(MAP_TO_DRIVE.apply(ImmutableMap.of("name", "foo", "size", "100")), expects);
- }
-
- public void testComplete() throws IOException {
-
- Map<String, String> input = new ListOfKeyValuesDelimitedByBlankLinesToListOfMaps().apply(
- Strings2.toStringAndClose(MapToDriveInfoTest.class.getResourceAsStream("/drive.txt"))).get(0);
-
- assertEquals(MAP_TO_DRIVE.apply(input), ONE);
-
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/MapToProfileInfoTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/MapToProfileInfoTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/MapToProfileInfoTest.java
deleted file mode 100644
index 74929b4..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/MapToProfileInfoTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import java.io.IOException;
-import java.util.Map;
-
-import org.jclouds.cloudsigma.domain.ProfileInfo;
-import org.jclouds.cloudsigma.domain.ProfileType;
-import org.jclouds.util.Strings2;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableMap;
-
-@Test(groups = { "unit" })
-public class MapToProfileInfoTest {
- public static ProfileInfo ONE = new ProfileInfo.Builder().type(ProfileType.REGULAR)//
- .uuid("58ca3c1f-7629-4771-9b71-863f40153ba4")//
- .email("adrian@jclouds.org").firstName("Adrian").lastName("Cole").nickName("jclouds").build();
-
- private static final MapToProfileInfo MAP_TO_PROFILE = new MapToProfileInfo();
-
- public void testEmptyMapReturnsNull() {
- assertEquals(MAP_TO_PROFILE.apply(ImmutableMap.<String, String> of()), null);
- }
-
- public void test() throws IOException {
-
- Map<String, String> input = new ListOfKeyValuesDelimitedByBlankLinesToListOfMaps().apply(
- Strings2.toStringAndClose(MapToProfileInfoTest.class.getResourceAsStream("/profile.txt"))).get(0);
-
- assertEquals(MAP_TO_PROFILE.apply(input), ONE);
-
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/MapToServerInfoTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/MapToServerInfoTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/MapToServerInfoTest.java
deleted file mode 100644
index c407027..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/MapToServerInfoTest.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import java.io.IOException;
-import java.util.Date;
-import java.util.Map;
-
-import org.jclouds.cloudsigma.domain.DriveMetrics;
-import org.jclouds.cloudsigma.domain.IDEDevice;
-import org.jclouds.cloudsigma.domain.MediaType;
-import org.jclouds.cloudsigma.domain.Model;
-import org.jclouds.cloudsigma.domain.NIC;
-import org.jclouds.cloudsigma.domain.ServerInfo;
-import org.jclouds.cloudsigma.domain.ServerMetrics;
-import org.jclouds.cloudsigma.domain.ServerStatus;
-import org.jclouds.cloudsigma.domain.VNC;
-import org.jclouds.cloudsigma.functions.MapToDevices.DeviceToId;
-import org.jclouds.util.Strings2;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-
-@Test(groups = { "unit" })
-public class MapToServerInfoTest {
- public static ServerInfo ONE = new ServerInfo.Builder()
- .persistent(true)
- .uuid("f8bee9cd-8e4b-4a05-8593-1314e3bfe49b")
- .cpu(2000)
- .bootDeviceIds(ImmutableSet.of("ide:0:0"))
- .smp(1)
- .mem(1024)
- .status(ServerStatus.ACTIVE)
- .started(new Date(1291493868l))
- .user("2f6244eb-50bc-4403-847e-f03cc3706a1f")
- .name("jo")
- .vnc(new VNC("46.20.114.124", "HfHzVmLT", false))
- .nics(ImmutableSet.of(new NIC.Builder()
- .model(Model.E1000)
- .dhcp("46.20.114.124")
- .block(
- ImmutableList.of("tcp/43594", "tcp/5902", "udp/5060", "tcp/5900", "tcp/5901", "tcp/21", "tcp/22",
- "tcp/23", "tcp/25", "tcp/110", "tcp/143", "tcp/43595")).build()))
- .devices(
- ImmutableMap.of("ide:0:0",
- new IDEDevice.Builder(0, 0).uuid("4af85ed3-0caa-4736-8a26-a33d7de0a122").build()
-
- ))
- .metrics(
- new ServerMetrics.Builder()
- .tx(2550)
- .txPackets(31)
- .rx(455530)
- .rxPackets(7583)
- .driveMetrics(
- ImmutableMap.of("ide:0:0", new DriveMetrics.Builder().readRequests(11154)
- .readBytes(45686784).writeRequests(3698).writeBytes(15147008).build())).build())
- .build();
-
- public static ServerInfo TWO = new ServerInfo.Builder()
- .status(ServerStatus.STOPPED)
- .name("Demo")
- .mem(1024)
- .cpu(2000)
- .persistent(true)
- .uuid("0f962616-2071-4173-be79-7dd084271edf")
- .bootDeviceIds(ImmutableSet.of("ide:0:0"))
- .user("2f6244eb-50bc-4403-847e-f03cc3706a1f")
- .vnc(new VNC("auto", "HWbjvrg2", false))
- .nics(ImmutableSet.of(new NIC.Builder().model(Model.E1000).dhcp("auto").build()))
- .devices(
- ImmutableMap.of(
- "ide:0:0",
- new IDEDevice.Builder(0, 0).uuid("853bb98a-4fff-4c2f-a265-97c363f19ea5")
- .mediaType(MediaType.CDROM).build()))
- .metrics(
- new ServerMetrics.Builder().driveMetrics(ImmutableMap.of("ide:0:0", new DriveMetrics.Builder().build()))
- .build()).build();
-
- private static final MapToServerInfo MAP_TO_DRIVE = new MapToServerInfo(new MapToDevices(new DeviceToId()),
- new MapToServerMetrics(new MapToDriveMetrics()), new MapToNICs());
-
- public void testEmptyMapReturnsNull() {
- assertEquals(MAP_TO_DRIVE.apply(ImmutableMap.<String, String> of()), null);
- }
-
- public void testBasics() {
- ServerInfo expects = new ServerInfo.Builder().name("foo").uuid("hello").vnc(new VNC("auto", null, false))
- .cpu(1000).mem(2048).metrics(new ServerMetrics.Builder().build()).build();
- assertEquals(MAP_TO_DRIVE.apply(ImmutableMap.of("name", "foo", "server", "hello", "vnc:ip", "auto", "cpu",
- "1000", "mem", "2048")), expects);
- }
-
- public void testComplete() throws IOException {
-
- Map<String, String> input = new ListOfKeyValuesDelimitedByBlankLinesToListOfMaps().apply(
- Strings2.toStringAndClose(MapToServerInfoTest.class.getResourceAsStream("/servers.txt"))).get(0);
-
- assertEquals(MAP_TO_DRIVE.apply(input), ONE);
-
- }
-
- public static ServerInfo NEW = new ServerInfo.Builder()
- .persistent(true)
- .uuid("bd98615a-6f74-4d63-ad1e-b13338b9356a")
- .cpu(1000)
- .bootDeviceIds(ImmutableSet.of("ide:0:0"))
- .smp(1)
- .mem(512)
- .status(ServerStatus.ACTIVE)
- .started(new Date(1292695612))
- .user("2f6244eb-50bc-4403-847e-f03cc3706a1f")
- .name("adriancole.test")
- .vnc(new VNC("83.222.249.221", "XXXXXXXX", false))
- .nics(ImmutableSet.of(new NIC.Builder()
- .model(Model.E1000)
- .block(
- ImmutableList.of("tcp/43594", "tcp/5902", "udp/5060", "tcp/5900", "tcp/5901", "tcp/21", "tcp/22",
- "tcp/23", "tcp/25", "tcp/110", "tcp/143", "tcp/43595")).build()))
- .devices(
- ImmutableMap.of("ide:0:0",
- new IDEDevice.Builder(0, 0).uuid("403c9a86-0aab-4e47-aa95-e9768021c4c1").build()
-
- ))
- .metrics(
- new ServerMetrics.Builder().driveMetrics(ImmutableMap.of("ide:0:0", new DriveMetrics.Builder().build()))
- .build()).build();
-
- public void testNew() throws IOException {
-
- Map<String, String> input = new ListOfKeyValuesDelimitedByBlankLinesToListOfMaps().apply(
- Strings2.toStringAndClose(MapToServerInfoTest.class.getResourceAsStream("/new_server.txt"))).get(0);
-
- assertEquals(MAP_TO_DRIVE.apply(input), NEW);
-
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/MapToVLANInfoTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/MapToVLANInfoTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/MapToVLANInfoTest.java
deleted file mode 100644
index 7ef52eb..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/MapToVLANInfoTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import java.io.IOException;
-import java.util.Map;
-
-import org.jclouds.cloudsigma.domain.VLANInfo;
-import org.jclouds.util.Strings2;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableMap;
-
-@Test(groups = { "unit" })
-public class MapToVLANInfoTest {
- public static VLANInfo ONE = new VLANInfo.Builder()//
- .uuid("6e2d1f6a-03c8-422b-bc8e-d744612cf46a")//
- .name("My VLAN1").user("f2e19d5c-eaa1-44e5-94aa-dc194594bd7b").build();
- private static final MapToVLANInfo MAP_TO_VLAN = new MapToVLANInfo();
-
- public void testEmptyMapReturnsNull() {
- assertEquals(MAP_TO_VLAN.apply(ImmutableMap.<String, String> of()), null);
- }
-
- public void test() throws IOException {
-
- Map<String, String> input = new ListOfKeyValuesDelimitedByBlankLinesToListOfMaps().apply(
- Strings2.toStringAndClose(MapToVLANInfoTest.class.getResourceAsStream("/vlan.txt"))).get(0);
-
- assertEquals(MAP_TO_VLAN.apply(input), ONE);
-
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ParseOsFamilyVersion64BitFromImageNameTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ParseOsFamilyVersion64BitFromImageNameTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ParseOsFamilyVersion64BitFromImageNameTest.java
deleted file mode 100644
index c55ba6d..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ParseOsFamilyVersion64BitFromImageNameTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import static com.google.common.collect.Iterables.transform;
-import static com.google.common.collect.Lists.newArrayList;
-import static org.testng.Assert.assertEquals;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.jclouds.cloudsigma.compute.functions.ParseOsFamilyVersion64BitFromImageName;
-import org.jclouds.compute.config.BaseComputeServiceContextModule;
-import org.jclouds.compute.domain.OsFamilyVersion64Bit;
-import org.jclouds.compute.reference.ComputeServiceConstants;
-import org.jclouds.json.Json;
-import org.jclouds.json.config.GsonModule;
-import org.jclouds.json.internal.GsonWrapper;
-import org.jclouds.util.Strings2;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Function;
-import com.google.gson.Gson;
-import com.google.inject.Guice;
-import com.google.inject.TypeLiteral;
-
-@Test(groups = "unit")
-public class ParseOsFamilyVersion64BitFromImageNameTest {
- Json json = new GsonWrapper(new Gson());
-
- @DataProvider(name = "data")
- public Object[][] createData() throws IOException {
- InputStream is = ParseOsFamilyVersion64BitFromImageNameTest.class.getResourceAsStream("/osmatches.json");
- Map<String, OsFamilyVersion64Bit> values = json.fromJson(Strings2.toStringAndClose(is),
- new TypeLiteral<Map<String, OsFamilyVersion64Bit>>() {
- }.getType());
-
- return newArrayList(
- transform(values.entrySet(), new Function<Map.Entry<String, OsFamilyVersion64Bit>, Object[]>() {
-
- @Override
- public Object[] apply(Entry<String, OsFamilyVersion64Bit> input) {
- return new Object[] { input.getKey(), input.getValue() };
- }
-
- })).toArray(new Object[][] {});
- }
-
- ParseOsFamilyVersion64BitFromImageName parser = new ParseOsFamilyVersion64BitFromImageName(new BaseComputeServiceContextModule() {
- }.provideOsVersionMap(new ComputeServiceConstants.ReferenceData(), Guice.createInjector(new GsonModule())
- .getInstance(Json.class)));
-
- @Test(dataProvider = "data")
- public void test(String input, OsFamilyVersion64Bit expected) {
- assertEquals(parser.apply(input), expected);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ServerToMapTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ServerToMapTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ServerToMapTest.java
deleted file mode 100644
index 5105228..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/ServerToMapTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import org.jclouds.cloudsigma.domain.IDEDevice;
-import org.jclouds.cloudsigma.domain.Model;
-import org.jclouds.cloudsigma.domain.NIC;
-import org.jclouds.cloudsigma.domain.Server;
-import org.jclouds.cloudsigma.domain.VNC;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-
-@Test(groups = { "unit" })
-public class ServerToMapTest {
-
- private static final ServerToMap SERVER_TO_MAP = new ServerToMap();
-
- public void testBasics() {
- assertEquals(
- SERVER_TO_MAP.apply(new Server.Builder()
- .name("TestServer")
- .cpu(2000)
- .mem(1024)
- .devices(
- ImmutableMap.of("ide:0:0",
- new IDEDevice.Builder(0, 0).uuid("08c92dd5-70a0-4f51-83d2-835919d254df").build()))
- .bootDeviceIds(ImmutableSet.of("ide:0:0")).nics(ImmutableSet.of(new NIC.Builder().model(Model.E1000).
-
- build())).vnc(new VNC(null, "XXXXXXXX", false)).build()),
- ImmutableMap
- .builder()
- .putAll(ImmutableMap.of("name", "TestServer", "cpu", "2000", "smp", "auto", "mem", "1024"))
- .putAll(
- ImmutableMap.of("persistent", "false", "boot", "ide:0:0", "ide:0:0",
- "08c92dd5-70a0-4f51-83d2-835919d254df"))
- .putAll(
- ImmutableMap.of("ide:0:0:media", "disk", "nic:0:model", "e1000", "vnc:ip", "auto",
- "vnc:password", "XXXXXXXX")).build());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/SplitNewlinesTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/SplitNewlinesTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/SplitNewlinesTest.java
deleted file mode 100644
index f9938d9..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/functions/SplitNewlinesTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import java.io.InputStream;
-import java.util.Set;
-
-import org.jclouds.http.HttpResponse;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableSortedSet;
-import com.google.inject.Guice;
-
-/**
- * Tests behavior of {@code NewlineDelimitedStringHandler}
- */
-@Test(groups = "unit")
-public class SplitNewlinesTest {
-
- static Function<HttpResponse, Set<String>> createParser() {
- return Guice.createInjector().getInstance(SplitNewlines.class);
- }
-
- public void test() {
- InputStream is = SplitNewlinesTest.class.getResourceAsStream("/uuids.txt");
- Set<String> list = createParser().apply(HttpResponse.builder().statusCode(200).message("ok").payload(is).build());
- assertEquals(list, ImmutableSortedSet.of("7e8ab721-81c9-4cb9-a651-4cafbfe1501c",
- "ea6a8fdb-dab3-4d06-86c2-41a5835e6ed9", "74744450-d338-4087-b3b8-59b505110a57"));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/handlers/CloudSigmaErrorHandlerTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/handlers/CloudSigmaErrorHandlerTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/handlers/CloudSigmaErrorHandlerTest.java
deleted file mode 100644
index 4b0791d..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/handlers/CloudSigmaErrorHandlerTest.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.handlers;
-
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.reportMatcher;
-import static org.easymock.EasyMock.verify;
-
-import java.net.URI;
-
-import org.easymock.IArgumentMatcher;
-import org.jclouds.http.HttpCommand;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.rest.AuthorizationException;
-import org.jclouds.rest.ResourceNotFoundException;
-import org.testng.annotations.Test;
-
-import com.google.inject.Guice;
-
-@Test(groups = { "unit" })
-public class CloudSigmaErrorHandlerTest {
-
- @Test
- public void test400MakesIllegalArgumentException() {
- assertCodeMakes("GET", URI.create("https://cloudsigma.com/foo"), 400, "", "Bad Request",
- IllegalArgumentException.class);
- }
-
- @Test
- public void test400MakesResourceNotFoundExceptionOnInfo() {
- assertCodeMakes("GET", URI.create("https://cloudsigma.com/foo/info"), 400, "", "",
- ResourceNotFoundException.class);
- }
-
- @Test
- public void test400MakesResourceNotFoundExceptionOnMessageNotFound() {
- assertCodeMakes(
- "GET",
- URI.create("https://cloudsigma.com/foo"),
- 400,
- "",
- "errors:system Drive 8f9b42b1-26de-49ad-a3fd-d4fa06524339 could not be found. Please re-validate your entry.",
- ResourceNotFoundException.class);
- }
-
- @Test
- public void test401MakesAuthorizationException() {
- assertCodeMakes("GET", URI.create("https://cloudsigma.com/foo"), 401, "", "Unauthorized",
- AuthorizationException.class);
- }
-
- @Test
- public void test404MakesResourceNotFoundException() {
- assertCodeMakes("GET", URI.create("https://cloudsigma.com/foo"), 404, "", "Not Found",
- ResourceNotFoundException.class);
- }
-
- @Test
- public void test405MakesIllegalArgumentException() {
- assertCodeMakes("GET", URI.create("https://cloudsigma.com/foo"), 405, "", "Method Not Allowed",
- IllegalArgumentException.class);
- }
-
- @Test
- public void test409MakesIllegalStateException() {
- assertCodeMakes("GET", URI.create("https://cloudsigma.com/foo"), 409, "", "Conflict",
- IllegalStateException.class);
- }
-
- private void assertCodeMakes(String method, URI uri, int statusCode, String message, String content,
- Class<? extends Exception> expected) {
- assertCodeMakes(method, uri, statusCode, message, "text/xml", content, expected);
- }
-
- private void assertCodeMakes(String method, URI uri, int statusCode, String message, String contentType,
- String content, Class<? extends Exception> expected) {
-
- CloudSigmaErrorHandler function = Guice.createInjector().getInstance(CloudSigmaErrorHandler.class);
-
- HttpCommand command = createMock(HttpCommand.class);
- HttpRequest request = HttpRequest.builder().method(method).endpoint(uri).build();
- HttpResponse response = HttpResponse.builder().statusCode(statusCode).message(message).payload(content).build();
- response.getPayload().getContentMetadata().setContentType(contentType);
-
- expect(command.getCurrentRequest()).andReturn(request).atLeastOnce();
- command.setException(classEq(expected));
-
- replay(command);
-
- function.handleError(command, response);
-
- verify(command);
- }
-
- public static Exception classEq(final Class<? extends Exception> in) {
- reportMatcher(new IArgumentMatcher() {
-
- @Override
- public void appendTo(StringBuffer buffer) {
- buffer.append("classEq(");
- buffer.append(in);
- buffer.append(")");
- }
-
- @Override
- public boolean matches(Object arg) {
- return arg.getClass() == in;
- }
-
- });
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/options/CloneDriveOptionsTest.java
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/options/CloneDriveOptionsTest.java b/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/options/CloneDriveOptionsTest.java
deleted file mode 100644
index bc09ca1..0000000
--- a/apis/cloudsigma/src/test/java/org/jclouds/cloudsigma/options/CloneDriveOptionsTest.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.options;
-
-import static org.jclouds.cloudsigma.options.CloneDriveOptions.Builder.affinity;
-import static org.jclouds.cloudsigma.options.CloneDriveOptions.Builder.size;
-import static org.jclouds.cloudsigma.options.CloneDriveOptions.Builder.tags;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNull;
-
-import org.jclouds.cloudsigma.domain.AffinityType;
-import org.testng.annotations.Test;
-
-/**
- * Tests possible uses of CloneDriveOptions and CloneDriveOptions.Builder.*
- */
-@Test(groups = "unit")
-public class CloneDriveOptionsTest {
-
- @Test
- public void testNullSize() {
- CloneDriveOptions options = new CloneDriveOptions();
- assertNull(options.getOptions().get("size"));
- }
-
- @Test
- public void testSize() {
- CloneDriveOptions options = new CloneDriveOptions().size(1024);
- assertEquals(options.getOptions().get("size"), "1024");
- }
-
- @Test
- public void testSizeStatic() {
- CloneDriveOptions options = size(1024);
- assertEquals(options.getOptions().get("size"), "1024");
- }
-
- @Test(expectedExceptions = IllegalArgumentException.class)
- public void testSizeNegative() {
- size(-1);
- }
-
- @Test
- public void testNullTags() {
- CloneDriveOptions options = new CloneDriveOptions();
- assertNull(options.getOptions().get("tags"));
- }
-
- @Test
- public void testTags() {
- CloneDriveOptions options = new CloneDriveOptions().tags("foo", "bar", "baz");
- assertEquals(options.getOptions().get("tags"), "foo bar baz");
- }
-
- @Test
- public void testTagsStatic() {
- CloneDriveOptions options = tags("foo", "bar", "baz");
- assertEquals(options.getOptions().get("tags"), "foo bar baz");
- }
-
- @Test
- public void testHddAffinity() {
- CloneDriveOptions options = new CloneDriveOptions().affinity(AffinityType.HDD);
- assertNull(options.getOptions().get("tags"));
- }
-
- @Test
- public void testHddAffinityStatic() {
- CloneDriveOptions options = affinity(AffinityType.HDD);
- assertNull(options.getOptions().get("tags"));
- }
-
- @Test
- public void testSsdAffinity() {
- CloneDriveOptions options = new CloneDriveOptions().affinity(AffinityType.SSD);
- assertEquals(options.getOptions().get("tags"), "affinity:ssd");
- }
-
- @Test
- public void testSsdAffinityStatic() {
- CloneDriveOptions options = affinity(AffinityType.SSD);
- assertEquals(options.getOptions().get("tags"), "affinity:ssd");
- }
-
- @Test
- public void testHddAffinityBeforeTags() {
- CloneDriveOptions options = new CloneDriveOptions().affinity(AffinityType.HDD);
- options.tags("foo", "bar", "baz");
- assertEquals(options.getOptions().get("tags"), "foo bar baz");
- }
-
- @Test
- public void testSsdAffinityBeforeTags() {
- CloneDriveOptions options = new CloneDriveOptions().affinity(AffinityType.SSD);
- options.tags("foo", "bar", "baz");
- assertEquals(options.getOptions().get("tags"), "foo bar baz affinity:ssd");
- }
-
- @Test
- public void testHddAffinityAfterTags() {
- CloneDriveOptions options = new CloneDriveOptions().tags("foo", "bar", "baz");
- options.affinity(AffinityType.HDD);
- assertEquals(options.getOptions().get("tags"), "foo bar baz");
- }
-
- @Test
- public void testSsdAffinityAfterTags() {
- CloneDriveOptions options = new CloneDriveOptions().tags("foo", "bar", "baz");
- options.affinity(AffinityType.SSD);
- assertEquals(options.getOptions().get("tags"), "foo bar baz affinity:ssd");
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/resources/create_drive.txt
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/resources/create_drive.txt b/apis/cloudsigma/src/test/resources/create_drive.txt
deleted file mode 100644
index 44ce187..0000000
--- a/apis/cloudsigma/src/test/resources/create_drive.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-name Ubuntu 10.10 Server Edition Linux 64bit Preinstalled System
-size 8589934592
-claim:type shared
-readers ffffffff-ffff-ffff-ffff-ffffffffffff
-use tag1 tag2
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/resources/create_server.txt
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/resources/create_server.txt b/apis/cloudsigma/src/test/resources/create_server.txt
deleted file mode 100644
index 474d4d7..0000000
--- a/apis/cloudsigma/src/test/resources/create_server.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-name TestServer
-cpu 2000
-smp auto
-mem 1024
-persistent false
-boot ide:0:0
-ide:0:0 08c92dd5-70a0-4f51-83d2-835919d254df
-ide:0:0:media disk
-nic:0:model e1000
-vnc:ip auto
-vnc:password XXXXXXXX
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/resources/drive.txt
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/resources/drive.txt b/apis/cloudsigma/src/test/resources/drive.txt
deleted file mode 100644
index 149c823..0000000
--- a/apis/cloudsigma/src/test/resources/drive.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-status active
-use networking security gateway
-name Ubuntu 10.10 Server Edition Linux 64bit Preinstalled System
-bits 64
-url http://www.ubuntu.com
-read:bytes 4096
-user 58ca3c1f-7629-4771-9b71-863f40153ba4
-encryption:cipher aes-xts-plain
-encryption:key ba6c2a4897072e9f25920ed73bd522e9c10d89f30a215158cccf8d0f654ac643
-description The Ubuntu Linux distribution brings the spirit of Ubuntu to the software world.
-drive b8171d28-755a-4271-b891-7998871a160e
-install_notes first line\n\n
-os linux
-write:bytes 8589938688
-claim:type shared
-claimed 00109617-2c6b-424b-9cfa-5b572c17bafe:guest:692cd1c7-a863-4a22-8170-fc6e6feb68af:ide:0:0 00031836-a624-4b22-bc7d-41ff8977087b:guest:a1414360-7c24-4730-8c97-180bf7775a71:ide:0:0 0002c6df-a1d2-4d1d-96f0-f95405a28183:guest:386f1cc7-affc-49c1-82a5-2f8e412170e4:ide:0:0 00031836-a624-4b22-bc7d-41ff8977087b:guest:17b076be-430d-4a76-9df3-b9896fec82a5:ide:0:0 000663ee-9fb6-4461-90f6-01327a4aff07:guest:f83b519f-feab-42cf-859c-f61495681ada:ide:0:1
-drive_type installcd,livecd
-autoexpanding false
-tags foo bar baz
-readers ffffffff-ffff-ffff-ffff-ffffffffffff
-read:requests 1
-free true
-type disk
-write:requests 2097153
-size 8589934592
-user:foo bar
-user:baz raz
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/resources/drive_data.txt
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/resources/drive_data.txt b/apis/cloudsigma/src/test/resources/drive_data.txt
deleted file mode 100644
index 74d7679..0000000
--- a/apis/cloudsigma/src/test/resources/drive_data.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-name Ubuntu 10.10 Server Edition Linux 64bit Preinstalled System
-size 8589934592
-claim:type shared
-tags foo bar baz
-readers ffffffff-ffff-ffff-ffff-ffffffffffff
-use tag1 tag2
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/resources/log4j.xml b/apis/cloudsigma/src/test/resources/log4j.xml
deleted file mode 100644
index 63810d3..0000000
--- a/apis/cloudsigma/src/test/resources/log4j.xml
+++ /dev/null
@@ -1,151 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
- <!--
- For more configuration infromation and examples see the Apache
- Log4j website: http://logging.apache.org/log4j/
- -->
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
- debug="false">
-
- <!-- A time/date based rolling appender -->
- <appender name="WIREFILE" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="File" value="target/test-data/jclouds-wire.log" />
- <param name="Append" value="true" />
-
- <!-- Rollover at midnight each day -->
- <param name="DatePattern" value="'.'yyyy-MM-dd" />
-
- <param name="Threshold" value="TRACE" />
-
- <layout class="org.apache.log4j.PatternLayout">
- <!-- The default pattern: Date Priority [Category] Message\n -->
- <param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n" />
-
- <!--
- The full pattern: Date MS Priority [Category]
- (Thread:NDC) Message\n <param name="ConversionPattern"
- value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
- -->
- </layout>
- </appender>
-
- <!-- A time/date based rolling appender -->
- <appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="File" value="target/test-data/jclouds.log" />
- <param name="Append" value="true" />
-
- <!-- Rollover at midnight each day -->
- <param name="DatePattern" value="'.'yyyy-MM-dd" />
-
- <param name="Threshold" value="TRACE" />
-
- <layout class="org.apache.log4j.PatternLayout">
- <!-- The default pattern: Date Priority [Category] Message\n -->
- <param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n" />
-
- <!--
- The full pattern: Date MS Priority [Category]
- (Thread:NDC) Message\n <param name="ConversionPattern"
- value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
- -->
- </layout>
- </appender>
-
- <!-- A time/date based rolling appender -->
- <appender name="COMPUTEFILE" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="File" value="target/test-data/jclouds-compute.log" />
- <param name="Append" value="true" />
-
- <!-- Rollover at midnight each day -->
- <param name="DatePattern" value="'.'yyyy-MM-dd" />
-
- <param name="Threshold" value="TRACE" />
-
- <layout class="org.apache.log4j.PatternLayout">
- <!-- The default pattern: Date Priority [Category] Message\n -->
- <param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n" />
-
- <!--
- The full pattern: Date MS Priority [Category]
- (Thread:NDC) Message\n <param name="ConversionPattern"
- value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
- -->
- </layout>
- </appender>
-
- <!-- A time/date based rolling appender -->
- <appender name="SSHFILE" class="org.apache.log4j.DailyRollingFileAppender">
- <param name="File" value="target/test-data/jclouds-ssh.log" />
- <param name="Append" value="true" />
-
- <!-- Rollover at midnight each day -->
- <param name="DatePattern" value="'.'yyyy-MM-dd" />
-
- <param name="Threshold" value="TRACE" />
-
- <layout class="org.apache.log4j.PatternLayout">
- <!-- The default pattern: Date Priority [Category] Message\n -->
- <param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n" />
-
- <!--
- The full pattern: Date MS Priority [Category]
- (Thread:NDC) Message\n <param name="ConversionPattern"
- value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
- -->
- </layout>
- </appender>
-
- <appender name="ASYNCCOMPUTE" class="org.apache.log4j.AsyncAppender">
- <appender-ref ref="COMPUTEFILE" />
- </appender>
-
- <appender name="ASYNCSSH" class="org.apache.log4j.AsyncAppender">
- <appender-ref ref="SSHFILE" />
- </appender>
-
- <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
- <appender-ref ref="FILE" />
- </appender>
-
- <appender name="ASYNCWIRE" class="org.apache.log4j.AsyncAppender">
- <appender-ref ref="WIREFILE" />
- </appender>
-
- <!-- ================ -->
- <!-- Limit categories -->
- <!-- ================ -->
-
- <category name="org.jclouds">
- <priority value="DEBUG" />
- <appender-ref ref="ASYNC" />
- </category>
-
- <category name="jclouds.headers">
- <priority value="DEBUG" />
- <appender-ref ref="ASYNCWIRE" />
- </category>
-
- <category name="jclouds.ssh">
- <priority value="DEBUG" />
- <appender-ref ref="ASYNCSSH" />
- </category>
-
- <category name="jclouds.wire">
- <priority value="DEBUG" />
- <appender-ref ref="ASYNCWIRE" />
- </category>
-
- <category name="jclouds.compute">
- <priority value="TRACE" />
- <appender-ref ref="ASYNCCOMPUTE" />
- </category>
- <!-- ======================= -->
- <!-- Setup the Root category -->
- <!-- ======================= -->
-
- <root>
- <priority value="WARN" />
- </root>
-
-</log4j:configuration>
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/resources/new_server.txt
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/resources/new_server.txt b/apis/cloudsigma/src/test/resources/new_server.txt
deleted file mode 100644
index 1dfbad9..0000000
--- a/apis/cloudsigma/src/test/resources/new_server.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-ide:0:0:write:requests 0
-boot ide:0:0
-vnc:password XXXXXXXX
-ide:0:0 403c9a86-0aab-4e47-aa95-e9768021c4c1
-ide:0:0:read:requests 0
-ide:0:0:read:bytes 0
-vnc:ip 83.222.249.221
-tx:packets 0
-tx 0
-rx 0
-smp 1
-mem 512
-nic:0:model e1000
-status active
-started 1292695612
-rx:packets 0
-user 2f6244eb-50bc-4403-847e-f03cc3706a1f
-ide:0:0:media disk
-name adriancole.test
-persistent true
-nic:0:block tcp/43594 tcp/5902 udp/5060 tcp/5900 tcp/5901 tcp/21 tcp/22 tcp/23 tcp/25 tcp/110 tcp/143 tcp/43595
-server bd98615a-6f74-4d63-ad1e-b13338b9356a
-ide:0:0:write:bytes 0
-cpu 1000
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/resources/osmatches.json
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/resources/osmatches.json b/apis/cloudsigma/src/test/resources/osmatches.json
deleted file mode 100644
index 7b0b1fa..0000000
--- a/apis/cloudsigma/src/test/resources/osmatches.json
+++ /dev/null
@@ -1,174 +0,0 @@
-{
- "Ubuntu-10.04-20110917 pub": {
- "family": "UBUNTU",
- "version": "10.04",
- "is64Bit": true
- },
-
- "Ubuntu-11.04-20110917 pub": {
- "family": "UBUNTU",
- "version": "11.04",
- "is64Bit": true
- },
-
- "Centos-6.0-20110917 pub": {
- "family": "CENTOS",
- "version": "6.0",
- "is64Bit": true
- },
-
- "Centos-5.6-20110917 pub": {
- "family": "CENTOS",
- "version": "5.6",
- "is64Bit": true
- },
-
- "Ubuntu 10.04.1 LTS Desktop Edition 32bit Preinstalled System": {
- "family": "UBUNTU",
- "version": "10.04",
- "is64Bit": false
- },
-
- "Ubuntu 10.04 Server Edition Linux 64bit with Plesk": {
- "family": "UBUNTU",
- "version": "10.04",
- "is64Bit": true
- },
-
- "CentOS 5.5 Linux 64bit Preinstalled System": {
- "family": "CENTOS",
- "version": "5.5",
- "is64Bit": true
- },
-
- "Windows Server Standard 2008 R2 64bit English": {
- "family": "WINDOWS",
- "version": "2008 R2",
- "is64Bit": true
- },
-
- "Ubuntu 10.04 Server Edition Linux 64bit": {
- "family": "UBUNTU",
- "version": "10.04",
- "is64Bit": true
- },
-
- "Windows Server 2008 Standard 32bit English": {
- "family": "WINDOWS",
- "version": "2008",
- "is64Bit": false
- },
-
- "Windows Server 2008 Standard 32bit English pub": {
- "family": "WINDOWS",
- "version": "2008",
- "is64Bit": false
- },
-
-
- "Fedora 14 Linux 64bit Preinstalled System": {
- "family": "FEDORA",
- "version": "",
- "is64Bit": true
- },
-
- "CentOS 5.5 Linux 64bit Preinstalled System with AppFirst Monitoring pub": {
- "family": "CENTOS",
- "version": "5.5",
- "is64Bit": true
- },
-
-
- "Ubuntu 10.10 Server Edition LAMP Linux 64bit Preinstalled System": {
- "family": "UBUNTU",
- "version": "10.10",
- "is64Bit": true
- },
-
- "Ubuntu 10.10 Server Edition Linux 64bit Preinstalled System": {
- "family": "UBUNTU",
- "version": "10.10",
- "is64Bit": true
- },
-
- "Windows Server Web 2008 R2 64bit English": {
- "family": "WINDOWS",
- "version": "2008 R2",
- "is64Bit": true
- },
-
-
- "SQL Server Standard 2008 R2 - Windows Server Standard 2008 R2 - 64bit English": {
- "family": "WINDOWS",
- "version": "2008 R2",
- "is64Bit": true
- },
-
-
- "Ubuntu 10.10 Desktop Edition 64bit Preinstalled System": {
- "family": "UBUNTU",
- "version": "10.10",
- "is64Bit": true
- },
-
- "Ubuntu 10.04 Desktop Edition Linux 64bit Preinstalled System": {
- "family": "UBUNTU",
- "version": "10.04",
- "is64Bit": true
- },
-
- "Debian 5.0 Preinstalled": {
- "family": "DEBIAN",
- "version": "5.0",
- "is64Bit": true
- },
-
- "pfSense 2.0 BETA4-20101127-031119 Preinstalled System": {
- "family": "UNRECOGNIZED",
- "version": null,
- "is64Bit": true
- },
-
- "FreeBSD 8.1 Preinstalled Base System": {
- "family": "FREEBSD",
- "version": "",
- "is64Bit": true
- },
-
- "CentOS 5.5 Linux 64bit Preinstalled System with AppFirst Monitoring": {
- "family": "CENTOS",
- "version": "5.5",
- "is64Bit": true
- },
-
- "Fedora 13 Linux 64bit Preinstalled System": {
- "family": "FEDORA",
- "version": "",
- "is64Bit": true
- },
-
- "Windows Server 2003 Standard 32bit English": {
- "family": "WINDOWS",
- "version": "2003",
- "is64Bit": false
- },
-
- "Windows Server 2003 Standard 64bit English": {
- "family": "WINDOWS",
- "version": "2003",
- "is64Bit": true
- },
-
- "Debian 5.0 Preinstalled without X": {
- "family": "DEBIAN",
- "version": "5.0",
- "is64Bit": true
- },
-
- "Debian 6.0 No X Minimal Linux 64bit Preinstalled System": {
- "family": "DEBIAN",
- "version": "6.0",
- "is64Bit": true
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/resources/profile.txt
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/resources/profile.txt b/apis/cloudsigma/src/test/resources/profile.txt
deleted file mode 100644
index dd71ea4..0000000
--- a/apis/cloudsigma/src/test/resources/profile.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-uuid 58ca3c1f-7629-4771-9b71-863f40153ba4
-email adrian@jclouds.org
-salutation
-first_name Adrian
-last_name Cole
-nick_name jclouds
-title Mr
-company Cloud Conscious, LLC.
-vat
-country US
-town 1200 Fulton St. #609
-language en
-currency USD
-address 1200 Fulton St. #609
-postcode 1200 Fulton St. #609
-phone 4153180253
-job_title
-location
-facebook
-twitter
-xing
-linkedin
-website
-signature
-ftp_disabled false
-api_disabled false
-api_https_only false
-type regular
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/resources/servers.txt
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/resources/servers.txt b/apis/cloudsigma/src/test/resources/servers.txt
deleted file mode 100644
index a3d1ff1..0000000
--- a/apis/cloudsigma/src/test/resources/servers.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-ide:0:0:write:requests 3698
-boot ide:0:0
-vnc:password HfHzVmLT
-ide:0:0 4af85ed3-0caa-4736-8a26-a33d7de0a122
-ide:0:0:read:requests 11154
-ide:0:0:read:bytes 45686784
-vnc:ip 46.20.114.124
-tx:packets 31
-tx 2550
-rx 455530
-smp 1
-mem 1024
-nic:0:model e1000
-status active
-started 1291493868
-rx:packets 7583
-user 2f6244eb-50bc-4403-847e-f03cc3706a1f
-name jo
-persistent true
-nic:0:block tcp/43594 tcp/5902 udp/5060 tcp/5900 tcp/5901 tcp/21 tcp/22 tcp/23 tcp/25 tcp/110 tcp/143 tcp/43595
-server f8bee9cd-8e4b-4a05-8593-1314e3bfe49b
-nic:0:dhcp 46.20.114.124
-ide:0:0:write:bytes 15147008
-cpu 2000
-
-status stopped
-name Demo
-mem 1024
-boot ide:0:0
-vnc:password HWbjvrg2
-persistent true
-server 0f962616-2071-4173-be79-7dd084271edf
-smp auto
-nic:0:dhcp auto
-user 2f6244eb-50bc-4403-847e-f03cc3706a1f
-nic:0:model e1000
-vnc:ip auto
-ide:0:0 853bb98a-4fff-4c2f-a265-97c363f19ea5
-cpu 2000
-ide:0:0:media cdrom
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/resources/uuids.txt
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/resources/uuids.txt b/apis/cloudsigma/src/test/resources/uuids.txt
deleted file mode 100644
index 092a4f8..0000000
--- a/apis/cloudsigma/src/test/resources/uuids.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-7e8ab721-81c9-4cb9-a651-4cafbfe1501c
-ea6a8fdb-dab3-4d06-86c2-41a5835e6ed9
-74744450-d338-4087-b3b8-59b505110a57
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/cloudsigma/src/test/resources/vlan.txt
----------------------------------------------------------------------
diff --git a/apis/cloudsigma/src/test/resources/vlan.txt b/apis/cloudsigma/src/test/resources/vlan.txt
deleted file mode 100644
index f98a134..0000000
--- a/apis/cloudsigma/src/test/resources/vlan.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-resource 6e2d1f6a-03c8-422b-bc8e-d744612cf46a
-type vlan
-user f2e19d5c-eaa1-44e5-94aa-dc194594bd7b
-name My VLAN1
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/apis/pom.xml
----------------------------------------------------------------------
diff --git a/apis/pom.xml b/apis/pom.xml
index 423d9e5..32722fe 100644
--- a/apis/pom.xml
+++ b/apis/pom.xml
@@ -31,7 +31,6 @@
<name>jclouds apis project</name>
<modules>
<module>cloudwatch</module>
- <module>cloudsigma</module>
<module>cloudstack</module>
<module>filesystem</module>
<module>byon</module>
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/providers/cloudsigma-lvs/pom.xml
----------------------------------------------------------------------
diff --git a/providers/cloudsigma-lvs/pom.xml b/providers/cloudsigma-lvs/pom.xml
deleted file mode 100644
index 7caa9de..0000000
--- a/providers/cloudsigma-lvs/pom.xml
+++ /dev/null
@@ -1,125 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-project</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- <relativePath>../../project/pom.xml</relativePath>
- </parent>
- <groupId>org.apache.jclouds.provider</groupId>
- <artifactId>cloudsigma-lvs</artifactId>
- <name>jclouds CloudSigma provider</name>
- <description>ComputeService binding to the CloudSigma datacenter in SuperNAP Las Vegas</description>
- <packaging>bundle</packaging>
-
- <properties>
- <test.cloudsigma-lvs.endpoint>https://api.lvs.cloudsigma.com</test.cloudsigma-lvs.endpoint>
- <test.cloudsigma-lvs.api-version>1.0</test.cloudsigma-lvs.api-version>
- <test.cloudsigma-lvs.build-version />
- <test.cloudsigma-lvs.identity>FIXME_IDENTITY</test.cloudsigma-lvs.identity>
- <test.cloudsigma-lvs.credential>FIXME_CREDENTIAL</test.cloudsigma-lvs.credential>
- <test.cloudsigma-lvs.template />
- <jclouds.osgi.export>org.jclouds.cloudsigma*;version="${project.version}"</jclouds.osgi.export>
- <jclouds.osgi.import>
- org.jclouds.compute.internal;version="${project.version}",
- org.jclouds.rest.internal;version="${project.version}",
- org.jclouds*;version="${project.version}",
- *
- </jclouds.osgi.import>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>cloudsigma</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.api</groupId>
- <artifactId>cloudsigma</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds</groupId>
- <artifactId>jclouds-compute</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.driver</groupId>
- <artifactId>jclouds-log4j</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.jclouds.driver</groupId>
- <artifactId>jclouds-sshj</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>live</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <executions>
- <execution>
- <id>integration</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <systemPropertyVariables>
- <test.cloudsigma-lvs.endpoint>${test.cloudsigma-lvs.endpoint}</test.cloudsigma-lvs.endpoint>
- <test.cloudsigma-lvs.api-version>${test.cloudsigma-lvs.api-version}</test.cloudsigma-lvs.api-version>
- <test.cloudsigma-lvs.build-version>${test.cloudsigma-lvs.build-version}</test.cloudsigma-lvs.build-version>
- <test.cloudsigma-lvs.identity>${test.cloudsigma-lvs.identity}</test.cloudsigma-lvs.identity>
- <test.cloudsigma-lvs.credential>${test.cloudsigma-lvs.credential}</test.cloudsigma-lvs.credential>
- <test.cloudsigma-lvs.template>${test.cloudsigma-lvs.template}</test.cloudsigma-lvs.template>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
-
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/providers/cloudsigma-lvs/src/main/java/org/jclouds/cloudsigma/CloudSigmaLasVegasProviderMetadata.java
----------------------------------------------------------------------
diff --git a/providers/cloudsigma-lvs/src/main/java/org/jclouds/cloudsigma/CloudSigmaLasVegasProviderMetadata.java b/providers/cloudsigma-lvs/src/main/java/org/jclouds/cloudsigma/CloudSigmaLasVegasProviderMetadata.java
deleted file mode 100644
index 06fb790..0000000
--- a/providers/cloudsigma-lvs/src/main/java/org/jclouds/cloudsigma/CloudSigmaLasVegasProviderMetadata.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma;
-
-import java.net.URI;
-import java.util.Properties;
-
-import org.jclouds.providers.ProviderMetadata;
-import org.jclouds.providers.internal.BaseProviderMetadata;
-
-/**
- * Implementation of {@link org.jclouds.types.ProviderMetadata} for CloudSigma Las Vegas.
-
- */
-public class CloudSigmaLasVegasProviderMetadata extends BaseProviderMetadata {
-
- public static Builder builder() {
- return new Builder();
- }
-
- @Override
- public Builder toBuilder() {
- return builder().fromProviderMetadata(this);
- }
-
- public CloudSigmaLasVegasProviderMetadata() {
- super(builder());
- }
-
- public CloudSigmaLasVegasProviderMetadata(Builder builder) {
- super(builder);
- }
-
- public static Properties defaultProperties() {
- Properties properties = new Properties();
- return properties;
- }
-
- public static class Builder
- extends
- BaseProviderMetadata.Builder {
-
- protected Builder() {
- id("cloudsigma-lvs")
- .name("CloudSigma Las Vegas")
- .apiMetadata(new CloudSigmaApiMetadata())
- .homepage(URI.create("http://www.cloudsigma.com/en/our-cloud/features"))
- .console(URI.create("https://gui.lvs.cloudsigma.com/"))
- .iso3166Codes("US-NV")
- .endpoint("https://api.lvs.cloudsigma.com")
- .defaultProperties(CloudSigmaLasVegasProviderMetadata.defaultProperties());
- }
-
- @Override
- public CloudSigmaLasVegasProviderMetadata build() {
- return new CloudSigmaLasVegasProviderMetadata(this);
- }
-
- @Override
- public Builder fromProviderMetadata(
- ProviderMetadata in) {
- super.fromProviderMetadata(in);
- return this;
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/providers/cloudsigma-lvs/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata
----------------------------------------------------------------------
diff --git a/providers/cloudsigma-lvs/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata b/providers/cloudsigma-lvs/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata
deleted file mode 100644
index 8f7f34d..0000000
--- a/providers/cloudsigma-lvs/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata
+++ /dev/null
@@ -1 +0,0 @@
-org.jclouds.cloudsigma.CloudSigmaLasVegasProviderMetadata
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/providers/cloudsigma-lvs/src/test/java/org/jclouds/cloudsigma/CloudSigmaLasVegasLondonClientLiveTest.java
----------------------------------------------------------------------
diff --git a/providers/cloudsigma-lvs/src/test/java/org/jclouds/cloudsigma/CloudSigmaLasVegasLondonClientLiveTest.java b/providers/cloudsigma-lvs/src/test/java/org/jclouds/cloudsigma/CloudSigmaLasVegasLondonClientLiveTest.java
deleted file mode 100644
index 766942a..0000000
--- a/providers/cloudsigma-lvs/src/test/java/org/jclouds/cloudsigma/CloudSigmaLasVegasLondonClientLiveTest.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma;
-
-import org.testng.annotations.Test;
-
-@Test(groups = "live", singleThreaded = true)
-public class CloudSigmaLasVegasLondonClientLiveTest extends CloudSigmaClientLiveTest {
- public CloudSigmaLasVegasLondonClientLiveTest() {
- provider = "cloudsigma-lvs";
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/providers/cloudsigma-lvs/src/test/java/org/jclouds/cloudsigma/CloudSigmaLasVegasProviderTest.java
----------------------------------------------------------------------
diff --git a/providers/cloudsigma-lvs/src/test/java/org/jclouds/cloudsigma/CloudSigmaLasVegasProviderTest.java b/providers/cloudsigma-lvs/src/test/java/org/jclouds/cloudsigma/CloudSigmaLasVegasProviderTest.java
deleted file mode 100644
index ecd8b2b..0000000
--- a/providers/cloudsigma-lvs/src/test/java/org/jclouds/cloudsigma/CloudSigmaLasVegasProviderTest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma;
-
-import org.jclouds.providers.internal.BaseProviderMetadataTest;
-import org.testng.annotations.Test;
-
-@Test(groups = "unit", testName = "CloudSigmaLasVegasProviderTest")
-public class CloudSigmaLasVegasProviderTest extends BaseProviderMetadataTest {
-
- public CloudSigmaLasVegasProviderTest() {
- super(new CloudSigmaLasVegasProviderMetadata(), new CloudSigmaApiMetadata());
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/f7aea987/providers/cloudsigma-lvs/src/test/java/org/jclouds/cloudsigma/compute/CloudSigmaLasVegasComputeServiceLiveTest.java
----------------------------------------------------------------------
diff --git a/providers/cloudsigma-lvs/src/test/java/org/jclouds/cloudsigma/compute/CloudSigmaLasVegasComputeServiceLiveTest.java b/providers/cloudsigma-lvs/src/test/java/org/jclouds/cloudsigma/compute/CloudSigmaLasVegasComputeServiceLiveTest.java
deleted file mode 100644
index 7a24e1d..0000000
--- a/providers/cloudsigma-lvs/src/test/java/org/jclouds/cloudsigma/compute/CloudSigmaLasVegasComputeServiceLiveTest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.cloudsigma.compute;
-
-import org.testng.annotations.Test;
-
-@Test(groups = "live", singleThreaded = true, testName = "CloudSigmaLasVegasComputeServiceLiveTest")
-public class CloudSigmaLasVegasComputeServiceLiveTest extends CloudSigmaComputeServiceLiveTest {
-
- public CloudSigmaLasVegasComputeServiceLiveTest() {
- provider = "cloudsigma-lvs";
- }
-
-}