renamed elastichosts to elasticstack

This commit is contained in:
Adrian Cole 2010-12-03 18:44:39 +00:00
parent 934bf68b21
commit 51f40c84bf
83 changed files with 318 additions and 318 deletions

View File

@ -89,8 +89,8 @@ bluelock-vcdirector.propertiesbuilder=org.jclouds.vcloud.bluelock.BlueLockVCloud
gogrid.propertiesbuilder=org.jclouds.gogrid.GoGridPropertiesBuilder
gogrid.contextbuilder=org.jclouds.gogrid.GoGridContextBuilder
elastichosts.propertiesbuilder=org.jclouds.elastichosts.ElasticHostsPropertiesBuilder
elastichosts.contextbuilder=org.jclouds.elastichosts.ElasticHostsContextBuilder
elasticstack.propertiesbuilder=org.jclouds.elasticstack.ElasticStackPropertiesBuilder
elasticstack.contextbuilder=org.jclouds.elasticstack.ElasticStackContextBuilder
cloudsigma.propertiesbuilder=org.jclouds.cloudsigma.CloudSigmaPropertiesBuilder
cloudsigma.contextbuilder=org.jclouds.cloudsigma.CloudSigmaContextBuilder

View File

@ -31,14 +31,14 @@
<relativePath>../../project/pom.xml</relativePath>
</parent>
<groupId>org.jclouds</groupId>
<artifactId>jclouds-elastichosts</artifactId>
<name>jclouds ElasticHosts core</name>
<description>jclouds components to access ElasticHosts</description>
<artifactId>jclouds-elasticstack</artifactId>
<name>jclouds elasticstack core</name>
<description>jclouds components to access elasticstack</description>
<scm>
<connection>scm:svn:http://jclouds.googlecode.com/svn/trunk/elastichosts</connection>
<developerConnection>scm:svn:https://jclouds.googlecode.com/svn/trunk/elastichosts</developerConnection>
<url>http://jclouds.googlecode.com/svn/trunk/elastichosts</url>
<connection>scm:svn:http://jclouds.googlecode.com/svn/trunk/elasticstack</connection>
<developerConnection>scm:svn:https://jclouds.googlecode.com/svn/trunk/elasticstack</developerConnection>
<url>http://jclouds.googlecode.com/svn/trunk/elasticstack</url>
</scm>
<!-- bootstrapping: need to fetch the project POM -->
@ -59,10 +59,10 @@
<properties>
<!-- when instances are hung, open a ticket and add here -->
<jclouds.compute.blacklist-nodes>trmkrun-ccc,test.trmk-924</jclouds.compute.blacklist-nodes>
<test.elastichosts.endpoint>https://api.cloudsigma.com</test.elastichosts.endpoint>
<test.elastichosts.apiversion>1.0</test.elastichosts.apiversion>
<test.elastichosts.identity>FIXME</test.elastichosts.identity>
<test.elastichosts.credential>FIXME</test.elastichosts.credential>
<test.elasticstack.endpoint>https://api.cloudsigma.com</test.elasticstack.endpoint>
<test.elasticstack.apiversion>1.0</test.elasticstack.apiversion>
<test.elasticstack.identity>FIXME</test.elasticstack.identity>
<test.elasticstack.credential>FIXME</test.elasticstack.credential>
</properties>
<dependencies>
<dependency>
@ -108,20 +108,20 @@
<configuration>
<systemProperties>
<property>
<name>test.elastichosts.endpoint</name>
<value>${test.elastichosts.endpoint}</value>
<name>test.elasticstack.endpoint</name>
<value>${test.elasticstack.endpoint}</value>
</property>
<property>
<name>test.elastichosts.apiversion</name>
<value>${test.elastichosts.apiversion}</value>
<name>test.elasticstack.apiversion</name>
<value>${test.elasticstack.apiversion}</value>
</property>
<property>
<name>test.elastichosts.identity</name>
<value>${test.elastichosts.identity}</value>
<name>test.elasticstack.identity</name>
<value>${test.elasticstack.identity}</value>
</property>
<property>
<name>test.elastichosts.credential</name>
<value>${test.elastichosts.credential}</value>
<name>test.elasticstack.credential</name>
<value>${test.elasticstack.credential}</value>
</property>
<property>
<name>jclouds.compute.blacklist-nodes</name>

View File

@ -31,13 +31,13 @@ import javax.ws.rs.core.MediaType;
import org.jclouds.cloudsigma.domain.DriveInfo;
import org.jclouds.cloudsigma.functions.KeyValuesDelimitedByBlankLinesToDriveInfo;
import org.jclouds.cloudsigma.functions.ListOfKeyValuesDelimitedByBlankLinesToDriveInfoSet;
import org.jclouds.elastichosts.CommonElasticHostsAsyncClient;
import org.jclouds.elastichosts.ElasticHostsClient;
import org.jclouds.elastichosts.binders.BindCreateDriveRequestToPlainTextString;
import org.jclouds.elastichosts.binders.BindDriveDataToPlainTextString;
import org.jclouds.elastichosts.domain.CreateDriveRequest;
import org.jclouds.elastichosts.domain.DriveData;
import org.jclouds.elastichosts.functions.SplitNewlines;
import org.jclouds.elasticstack.CommonElasticStackAsyncClient;
import org.jclouds.elasticstack.ElasticStackClient;
import org.jclouds.elasticstack.binders.BindCreateDriveRequestToPlainTextString;
import org.jclouds.elasticstack.binders.BindDriveDataToPlainTextString;
import org.jclouds.elasticstack.domain.CreateDriveRequest;
import org.jclouds.elasticstack.domain.DriveData;
import org.jclouds.elasticstack.functions.SplitNewlines;
import org.jclouds.http.filters.BasicAuthentication;
import org.jclouds.rest.annotations.BinderParam;
import org.jclouds.rest.annotations.ExceptionParser;
@ -51,16 +51,16 @@ import com.google.common.util.concurrent.ListenableFuture;
* Provides asynchronous access to CloudSigma via their REST API.
* <p/>
*
* @see ElasticHostsClient
* @see ElasticStackClient
* @see <a href="TODO: insert URL of provider documentation" />
* @author Adrian Cole
*/
@RequestFilters(BasicAuthentication.class)
@Consumes(MediaType.TEXT_PLAIN)
public interface CloudSigmaAsyncClient extends CommonElasticHostsAsyncClient {
public interface CloudSigmaAsyncClient extends CommonElasticStackAsyncClient {
/**
* @see ElasticHostsClient#listStandardDrives()
* @see ElasticStackClient#listStandardDrives()
*/
@GET
@Path("/drives/standard/list")
@ -68,7 +68,7 @@ public interface CloudSigmaAsyncClient extends CommonElasticHostsAsyncClient {
ListenableFuture<Set<String>> listStandardDrives();
/**
* @see ElasticHostsClient#listStandardCds()
* @see ElasticStackClient#listStandardCds()
*/
@GET
@Path("/drives/standard/cd/list")
@ -76,7 +76,7 @@ public interface CloudSigmaAsyncClient extends CommonElasticHostsAsyncClient {
ListenableFuture<Set<String>> listStandardCds();
/**
* @see ElasticHostsClient#listStandardImages()
* @see ElasticStackClient#listStandardImages()
*/
@GET
@Path("/drives/standard/img/list")
@ -84,16 +84,16 @@ public interface CloudSigmaAsyncClient extends CommonElasticHostsAsyncClient {
ListenableFuture<Set<String>> listStandardImages();
/**
* @see ElasticHostsClient#listDriveInfo()
* @see ElasticStackClient#listDriveInfo()
*/
@Override
@GET
@Path("/drives/info")
@ResponseParser(ListOfKeyValuesDelimitedByBlankLinesToDriveInfoSet.class)
ListenableFuture<Set<? extends org.jclouds.elastichosts.domain.DriveInfo>> listDriveInfo();
ListenableFuture<Set<? extends org.jclouds.elasticstack.domain.DriveInfo>> listDriveInfo();
/**
* @see ElasticHostsClient#getDriveInfo
* @see ElasticStackClient#getDriveInfo
*/
@Override
@GET
@ -103,7 +103,7 @@ public interface CloudSigmaAsyncClient extends CommonElasticHostsAsyncClient {
ListenableFuture<? extends DriveInfo> getDriveInfo(@PathParam("uuid") String uuid);
/**
* @see ElasticHostsClient#createDrive
* @see ElasticStackClient#createDrive
*/
@Override
@POST
@ -114,7 +114,7 @@ public interface CloudSigmaAsyncClient extends CommonElasticHostsAsyncClient {
@BinderParam(BindCreateDriveRequestToPlainTextString.class) CreateDriveRequest createDrive);
/**
* @see ElasticHostsClient#setDriveData
* @see ElasticStackClient#setDriveData
*/
@POST
@ExceptionParser(ReturnNullOnNotFoundOr404.class)

View File

@ -24,20 +24,20 @@ import java.util.concurrent.TimeUnit;
import org.jclouds.cloudsigma.domain.DriveInfo;
import org.jclouds.concurrent.Timeout;
import org.jclouds.elastichosts.CommonElasticHostsClient;
import org.jclouds.elastichosts.domain.CreateDriveRequest;
import org.jclouds.elastichosts.domain.DriveData;
import org.jclouds.elasticstack.CommonElasticStackClient;
import org.jclouds.elasticstack.domain.CreateDriveRequest;
import org.jclouds.elasticstack.domain.DriveData;
/**
* Provides synchronous access to CloudSigma.
* <p/>
*
* @see CloudSigmaAsyncClient
* @see <a href="TODO: insert URL of ElasticHosts documentation" />
* @see <a href="TODO: insert URL of elasticstack documentation" />
* @author Adrian Cole
*/
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
public interface CloudSigmaClient extends CommonElasticHostsClient {
public interface CloudSigmaClient extends CommonElasticStackClient {
/**
* list of drive uuids that are in the library

View File

@ -25,9 +25,9 @@ import org.jclouds.cloudsigma.CloudSigmaAsyncClient;
import org.jclouds.cloudsigma.CloudSigmaClient;
import org.jclouds.cloudsigma.functions.CreateDriveRequestToMap;
import org.jclouds.cloudsigma.functions.DriveDataToMap;
import org.jclouds.elastichosts.domain.CreateDriveRequest;
import org.jclouds.elastichosts.domain.DriveData;
import org.jclouds.elastichosts.handlers.ElasticHostsErrorHandler;
import org.jclouds.elasticstack.domain.CreateDriveRequest;
import org.jclouds.elasticstack.domain.DriveData;
import org.jclouds.elasticstack.handlers.ElasticStackErrorHandler;
import org.jclouds.http.HttpErrorHandler;
import org.jclouds.http.RequiresHttp;
import org.jclouds.http.annotation.ClientError;
@ -54,9 +54,9 @@ public class CloudSigmaRestClientModule extends RestClientModule<CloudSigmaClien
@Override
protected void bindErrorHandlers() {
bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(ElasticHostsErrorHandler.class);
bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(ElasticHostsErrorHandler.class);
bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(ElasticHostsErrorHandler.class);
bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(ElasticStackErrorHandler.class);
bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(ElasticStackErrorHandler.class);
bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(ElasticStackErrorHandler.class);
}
@Override

View File

@ -25,8 +25,8 @@ import java.net.URI;
import java.util.Map;
import java.util.Set;
import org.jclouds.elastichosts.domain.ClaimType;
import org.jclouds.elastichosts.domain.DriveStatus;
import org.jclouds.elasticstack.domain.ClaimType;
import org.jclouds.elasticstack.domain.DriveStatus;
import com.google.common.collect.ImmutableSet;
@ -34,8 +34,8 @@ import com.google.common.collect.ImmutableSet;
*
* @author Adrian Cole
*/
public class DriveInfo extends org.jclouds.elastichosts.domain.DriveInfo {
public static class Builder extends org.jclouds.elastichosts.domain.DriveInfo.Builder {
public class DriveInfo extends org.jclouds.elasticstack.domain.DriveInfo {
public static class Builder extends org.jclouds.elasticstack.domain.DriveInfo.Builder {
private Boolean autoexpanding;
private Integer bits;
private String description;
@ -225,7 +225,7 @@ public class DriveInfo extends org.jclouds.elastichosts.domain.DriveInfo {
return Builder.class.cast(super.userMetadata(userMetadata));
}
public static Builder fromDriveInfo(org.jclouds.elastichosts.domain.DriveInfo driveInfo) {
public static Builder fromDriveInfo(org.jclouds.elasticstack.domain.DriveInfo driveInfo) {
return new Builder().uuid(driveInfo.getUuid()).name(driveInfo.getName()).size(driveInfo.getSize())
.claimType(driveInfo.getClaimType()).readers(driveInfo.getReaders()).tags(driveInfo.getTags())
.userMetadata(driveInfo.getUserMetadata()).status(driveInfo.getStatus()).user(driveInfo.getUser())

View File

@ -26,7 +26,7 @@ import java.util.Map;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.jclouds.elastichosts.domain.CreateDriveRequest;
import org.jclouds.elasticstack.domain.CreateDriveRequest;
import com.google.common.base.Function;
import com.google.common.collect.Maps;
@ -37,10 +37,10 @@ import com.google.common.collect.Maps;
*/
@Singleton
public class CreateDriveRequestToMap implements Function<CreateDriveRequest, Map<String, String>> {
private final org.jclouds.elastichosts.functions.CreateDriveRequestToMap baseDriveToMap;
private final org.jclouds.elasticstack.functions.CreateDriveRequestToMap baseDriveToMap;
@Inject
public CreateDriveRequestToMap(org.jclouds.elastichosts.functions.CreateDriveRequestToMap baseDriveToMap) {
public CreateDriveRequestToMap(org.jclouds.elasticstack.functions.CreateDriveRequestToMap baseDriveToMap) {
this.baseDriveToMap = baseDriveToMap;
}

View File

@ -26,7 +26,7 @@ import java.util.Map;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.jclouds.elastichosts.domain.DriveData;
import org.jclouds.elasticstack.domain.DriveData;
import com.google.common.base.Function;
import com.google.common.collect.Maps;
@ -37,10 +37,10 @@ import com.google.common.collect.Maps;
*/
@Singleton
public class DriveDataToMap implements Function<DriveData, Map<String, String>> {
private final org.jclouds.elastichosts.functions.DriveDataToMap baseDriveToMap;
private final org.jclouds.elasticstack.functions.DriveDataToMap baseDriveToMap;
@Inject
public DriveDataToMap(org.jclouds.elastichosts.functions.DriveDataToMap baseDriveToMap) {
public DriveDataToMap(org.jclouds.elasticstack.functions.DriveDataToMap baseDriveToMap) {
this.baseDriveToMap = baseDriveToMap;
}

View File

@ -25,7 +25,7 @@ import javax.inject.Inject;
import javax.inject.Singleton;
import org.jclouds.cloudsigma.domain.DriveInfo;
import org.jclouds.elastichosts.functions.ListOfKeyValuesDelimitedByBlankLinesToListOfMaps;
import org.jclouds.elasticstack.functions.ListOfKeyValuesDelimitedByBlankLinesToListOfMaps;
import org.jclouds.http.HttpResponse;
import org.jclouds.http.functions.ReturnStringIf2xx;

View File

@ -37,10 +37,10 @@ import com.google.common.base.Splitter;
*/
@Singleton
public class MapToDriveInfo implements Function<Map<String, String>, DriveInfo> {
private final org.jclouds.elastichosts.functions.MapToDriveInfo mapToDriveInfo;
private final org.jclouds.elasticstack.functions.MapToDriveInfo mapToDriveInfo;
@Inject
public MapToDriveInfo(org.jclouds.elastichosts.functions.MapToDriveInfo mapToDriveInfo) {
public MapToDriveInfo(org.jclouds.elasticstack.functions.MapToDriveInfo mapToDriveInfo) {
this.mapToDriveInfo = mapToDriveInfo;
}

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts;
package org.jclouds.elasticstack;
import java.util.Set;
@ -28,14 +28,14 @@ import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.core.MediaType;
import org.jclouds.elastichosts.binders.BindCreateDriveRequestToPlainTextString;
import org.jclouds.elastichosts.binders.BindDriveDataToPlainTextString;
import org.jclouds.elastichosts.domain.CreateDriveRequest;
import org.jclouds.elastichosts.domain.DriveData;
import org.jclouds.elastichosts.domain.DriveInfo;
import org.jclouds.elastichosts.functions.KeyValuesDelimitedByBlankLinesToDriveInfo;
import org.jclouds.elastichosts.functions.ListOfKeyValuesDelimitedByBlankLinesToDriveInfoSet;
import org.jclouds.elastichosts.functions.SplitNewlines;
import org.jclouds.elasticstack.binders.BindCreateDriveRequestToPlainTextString;
import org.jclouds.elasticstack.binders.BindDriveDataToPlainTextString;
import org.jclouds.elasticstack.domain.CreateDriveRequest;
import org.jclouds.elasticstack.domain.DriveData;
import org.jclouds.elasticstack.domain.DriveInfo;
import org.jclouds.elasticstack.functions.KeyValuesDelimitedByBlankLinesToDriveInfo;
import org.jclouds.elasticstack.functions.ListOfKeyValuesDelimitedByBlankLinesToDriveInfoSet;
import org.jclouds.elasticstack.functions.SplitNewlines;
import org.jclouds.http.filters.BasicAuthentication;
import org.jclouds.rest.annotations.BinderParam;
import org.jclouds.rest.annotations.ExceptionParser;
@ -47,19 +47,19 @@ import org.jclouds.rest.functions.ReturnVoidOnNotFoundOr404;
import com.google.common.util.concurrent.ListenableFuture;
/**
* Provides asynchronous access to ElasticHosts via their REST API.
* Provides asynchronous access to elasticstack via their REST API.
* <p/>
*
* @see ElasticHostsClient
* @see ElasticStackClient
* @see <a href="TODO: insert URL of provider documentation" />
* @author Adrian Cole
*/
@RequestFilters(BasicAuthentication.class)
@Consumes(MediaType.TEXT_PLAIN)
public interface CommonElasticHostsAsyncClient {
public interface CommonElasticStackAsyncClient {
/**
* @see ElasticHostsClient#listDrives()
* @see ElasticStackClient#listDrives()
*/
@GET
@Path("/drives/list")
@ -67,7 +67,7 @@ public interface CommonElasticHostsAsyncClient {
ListenableFuture<Set<String>> listDrives();
/**
* @see ElasticHostsClient#listDriveInfo()
* @see ElasticStackClient#listDriveInfo()
*/
@GET
@Path("/drives/info")
@ -75,7 +75,7 @@ public interface CommonElasticHostsAsyncClient {
ListenableFuture<Set<? extends DriveInfo>> listDriveInfo();
/**
* @see ElasticHostsClient#getDriveInfo
* @see ElasticStackClient#getDriveInfo
*/
@GET
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
@ -84,7 +84,7 @@ public interface CommonElasticHostsAsyncClient {
ListenableFuture<? extends DriveInfo> getDriveInfo(@PathParam("uuid") String uuid);
/**
* @see ElasticHostsClient#createDrive
* @see ElasticStackClient#createDrive
*/
@POST
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
@ -94,7 +94,7 @@ public interface CommonElasticHostsAsyncClient {
@BinderParam(BindCreateDriveRequestToPlainTextString.class) CreateDriveRequest createDrive);
/**
* @see ElasticHostsClient#setDriveData
* @see ElasticStackClient#setDriveData
*/
@POST
@ExceptionParser(ReturnNullOnNotFoundOr404.class)
@ -104,7 +104,7 @@ public interface CommonElasticHostsAsyncClient {
@BinderParam(BindDriveDataToPlainTextString.class) DriveData createDrive);
/**
* @see ElasticHostsClient#destroyDrive
* @see ElasticStackClient#destroyDrive
*/
@POST
@Path("/drives/{uuid}/destroy")

View File

@ -17,26 +17,26 @@
* ====================================================================
*/
package org.jclouds.elastichosts;
package org.jclouds.elasticstack;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.jclouds.concurrent.Timeout;
import org.jclouds.elastichosts.domain.CreateDriveRequest;
import org.jclouds.elastichosts.domain.DriveData;
import org.jclouds.elastichosts.domain.DriveInfo;
import org.jclouds.elasticstack.domain.CreateDriveRequest;
import org.jclouds.elasticstack.domain.DriveData;
import org.jclouds.elasticstack.domain.DriveInfo;
/**
* Provides synchronous access to ElasticHosts.
* Provides synchronous access to elasticstack.
* <p/>
*
* @see ElasticHostsAsyncClient
* @see <a href="TODO: insert URL of ElasticHosts documentation" />
* @see ElasticStackAsyncClient
* @see <a href="TODO: insert URL of elasticstack documentation" />
* @author Adrian Cole
*/
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
public interface CommonElasticHostsClient {
public interface CommonElasticStackClient {
/**
* list of drive uuids in your account
*

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts;
package org.jclouds.elasticstack;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
@ -27,10 +27,10 @@ import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import org.jclouds.elastichosts.binders.BindReadDriveOptionsToPath;
import org.jclouds.elastichosts.domain.ImageConversionType;
import org.jclouds.elastichosts.functions.ReturnPayload;
import org.jclouds.elastichosts.options.ReadDriveOptions;
import org.jclouds.elasticstack.binders.BindReadDriveOptionsToPath;
import org.jclouds.elasticstack.domain.ImageConversionType;
import org.jclouds.elasticstack.functions.ReturnPayload;
import org.jclouds.elasticstack.options.ReadDriveOptions;
import org.jclouds.http.filters.BasicAuthentication;
import org.jclouds.io.Payload;
import org.jclouds.rest.annotations.BinderParam;
@ -43,19 +43,19 @@ import org.jclouds.rest.functions.ReturnVoidOnNotFoundOr404;
import com.google.common.util.concurrent.ListenableFuture;
/**
* Provides asynchronous access to ElasticHosts via their REST API.
* Provides asynchronous access to elasticstack via their REST API.
* <p/>
*
* @see ElasticHostsClient
* @see ElasticStackClient
* @see <a href="TODO: insert URL of provider documentation" />
* @author Adrian Cole
*/
@RequestFilters(BasicAuthentication.class)
@Consumes(MediaType.TEXT_PLAIN)
public interface ElasticHostsAsyncClient extends CommonElasticHostsAsyncClient {
public interface ElasticStackAsyncClient extends CommonElasticStackAsyncClient {
/**
* @see ElasticHostsClient#imageDrive(String,String)
* @see ElasticStackClient#imageDrive(String,String)
*/
@POST
@Path("/drives/{destination}/image/{source}")
@ -63,7 +63,7 @@ public interface ElasticHostsAsyncClient extends CommonElasticHostsAsyncClient {
ListenableFuture<Void> imageDrive(@PathParam("source") String source, @PathParam("destination") String destination);
/**
* @see ElasticHostsClient#imageDrive(String,String,ImageConversionType)
* @see ElasticStackClient#imageDrive(String,String,ImageConversionType)
*/
@POST
@Path("/drives/{destination}/image/{source}/{conversion}")
@ -72,7 +72,7 @@ public interface ElasticHostsAsyncClient extends CommonElasticHostsAsyncClient {
@PathParam("conversion") ImageConversionType conversionType);
/**
* @see ElasticHostsClient#readDrive(String)
* @see ElasticStackClient#readDrive(String)
*/
@GET
@Consumes(MediaType.APPLICATION_OCTET_STREAM)
@ -82,7 +82,7 @@ public interface ElasticHostsAsyncClient extends CommonElasticHostsAsyncClient {
ListenableFuture<Payload> readDrive(@PathParam("uuid") String uuid);
/**
* @see ElasticHostsClient#readDrive(String,ReadDriveOptions)
* @see ElasticStackClient#readDrive(String,ReadDriveOptions)
*/
@POST
@Consumes(MediaType.APPLICATION_OCTET_STREAM)
@ -93,7 +93,7 @@ public interface ElasticHostsAsyncClient extends CommonElasticHostsAsyncClient {
@BinderParam(BindReadDriveOptionsToPath.class) ReadDriveOptions options);
/**
* @see ElasticHostsClient#writeDrive(String, Payload)
* @see ElasticStackClient#writeDrive(String, Payload)
*/
@POST
@Produces(MediaType.APPLICATION_OCTET_STREAM)
@ -102,7 +102,7 @@ public interface ElasticHostsAsyncClient extends CommonElasticHostsAsyncClient {
ListenableFuture<Void> writeDrive(@PathParam("uuid") String uuid, Payload content);
/**
* @see ElasticHostsClient#writeDrive(String, Payload, long)
* @see ElasticStackClient#writeDrive(String, Payload, long)
*/
@POST
@Produces(MediaType.APPLICATION_OCTET_STREAM)

View File

@ -17,25 +17,25 @@
* ====================================================================
*/
package org.jclouds.elastichosts;
package org.jclouds.elasticstack;
import java.util.concurrent.TimeUnit;
import org.jclouds.concurrent.Timeout;
import org.jclouds.elastichosts.domain.ImageConversionType;
import org.jclouds.elastichosts.options.ReadDriveOptions;
import org.jclouds.elasticstack.domain.ImageConversionType;
import org.jclouds.elasticstack.options.ReadDriveOptions;
import org.jclouds.io.Payload;
/**
* Provides synchronous access to ElasticHosts.
* Provides synchronous access to elasticstack.
* <p/>
*
* @see ElasticHostsAsyncClient
* @see <a href="TODO: insert URL of ElasticHosts documentation" />
* @see ElasticStackAsyncClient
* @see <a href="TODO: insert URL of elasticstack documentation" />
* @author Adrian Cole
*/
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
public interface ElasticHostsClient extends CommonElasticHostsClient {
public interface ElasticStackClient extends CommonElasticStackClient {
/**
* Image a drive from another drive. The actual imaging process is asynchronous, with progress
@ -87,7 +87,7 @@ public interface ElasticHostsClient extends CommonElasticHostsClient {
void writeDrive(String uuid, Payload content);
/**
* @see ElasticHostsClient#writeDrive(String, Payload)
* @see ElasticStackClient#writeDrive(String, Payload)
* @param offset
* the byte offset in the target drive at which to start writing, not an offset in the
* input stream.

View File

@ -17,12 +17,12 @@
* ====================================================================
*/
package org.jclouds.elastichosts;
package org.jclouds.elasticstack;
import java.util.List;
import java.util.Properties;
import org.jclouds.elastichosts.config.ElasticHostsRestClientModule;
import org.jclouds.elasticstack.config.ElasticStackRestClientModule;
import org.jclouds.rest.RestContextBuilder;
import com.google.inject.Module;
@ -31,15 +31,15 @@ import com.google.inject.Module;
*
* @author Adrian Cole
*/
public class ElasticHostsContextBuilder extends
RestContextBuilder<ElasticHostsClient, ElasticHostsAsyncClient> {
public class ElasticStackContextBuilder extends
RestContextBuilder<ElasticStackClient, ElasticStackAsyncClient> {
public ElasticHostsContextBuilder(Properties props) {
super(ElasticHostsClient.class, ElasticHostsAsyncClient.class, props);
public ElasticStackContextBuilder(Properties props) {
super(ElasticStackClient.class, ElasticStackAsyncClient.class, props);
}
protected void addClientModule(List<Module> modules) {
modules.add(new ElasticHostsRestClientModule());
modules.add(new ElasticStackRestClientModule());
}
}

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts;
package org.jclouds.elasticstack;
import static org.jclouds.Constants.PROPERTY_API_VERSION;
@ -26,11 +26,11 @@ import java.util.Properties;
import org.jclouds.PropertiesBuilder;
/**
* Builds properties used in ElasticHosts Clients
* Builds properties used in elasticstack Clients
*
* @author Adrian Cole
*/
public class ElasticHostsPropertiesBuilder extends PropertiesBuilder {
public class ElasticStackPropertiesBuilder extends PropertiesBuilder {
@Override
protected Properties defaultProperties() {
Properties properties = super.defaultProperties();
@ -38,7 +38,7 @@ public class ElasticHostsPropertiesBuilder extends PropertiesBuilder {
return properties;
}
public ElasticHostsPropertiesBuilder(Properties properties) {
public ElasticStackPropertiesBuilder(Properties properties) {
super(properties);
}

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.binders;
package org.jclouds.elasticstack.binders;
import static com.google.common.base.Preconditions.checkArgument;
@ -27,8 +27,8 @@ import javax.inject.Inject;
import javax.inject.Singleton;
import javax.ws.rs.core.MediaType;
import org.jclouds.elastichosts.domain.CreateDriveRequest;
import org.jclouds.elastichosts.functions.ListOfMapsToListOfKeyValuesDelimitedByBlankLines;
import org.jclouds.elasticstack.domain.CreateDriveRequest;
import org.jclouds.elasticstack.functions.ListOfMapsToListOfKeyValuesDelimitedByBlankLines;
import org.jclouds.http.HttpRequest;
import org.jclouds.rest.Binder;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.binders;
package org.jclouds.elasticstack.binders;
import static com.google.common.base.Preconditions.checkArgument;
@ -27,8 +27,8 @@ import javax.inject.Inject;
import javax.inject.Singleton;
import javax.ws.rs.core.MediaType;
import org.jclouds.elastichosts.domain.DriveData;
import org.jclouds.elastichosts.functions.ListOfMapsToListOfKeyValuesDelimitedByBlankLines;
import org.jclouds.elasticstack.domain.DriveData;
import org.jclouds.elasticstack.functions.ListOfMapsToListOfKeyValuesDelimitedByBlankLines;
import org.jclouds.http.HttpRequest;
import org.jclouds.rest.Binder;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.binders;
package org.jclouds.elasticstack.binders;
import static com.google.common.base.Preconditions.checkArgument;
@ -26,7 +26,7 @@ import javax.inject.Provider;
import javax.inject.Singleton;
import javax.ws.rs.core.UriBuilder;
import org.jclouds.elastichosts.options.ReadDriveOptions;
import org.jclouds.elasticstack.options.ReadDriveOptions;
import org.jclouds.http.HttpRequest;
import org.jclouds.rest.Binder;

View File

@ -17,17 +17,17 @@
* ====================================================================
*/
package org.jclouds.elastichosts.config;
package org.jclouds.elasticstack.config;
import java.util.Map;
import org.jclouds.elastichosts.ElasticHostsAsyncClient;
import org.jclouds.elastichosts.ElasticHostsClient;
import org.jclouds.elastichosts.domain.CreateDriveRequest;
import org.jclouds.elastichosts.domain.DriveData;
import org.jclouds.elastichosts.functions.CreateDriveRequestToMap;
import org.jclouds.elastichosts.functions.DriveDataToMap;
import org.jclouds.elastichosts.handlers.ElasticHostsErrorHandler;
import org.jclouds.elasticstack.ElasticStackAsyncClient;
import org.jclouds.elasticstack.ElasticStackClient;
import org.jclouds.elasticstack.domain.CreateDriveRequest;
import org.jclouds.elasticstack.domain.DriveData;
import org.jclouds.elasticstack.functions.CreateDriveRequestToMap;
import org.jclouds.elasticstack.functions.DriveDataToMap;
import org.jclouds.elasticstack.handlers.ElasticStackErrorHandler;
import org.jclouds.http.HttpErrorHandler;
import org.jclouds.http.RequiresHttp;
import org.jclouds.http.annotation.ClientError;
@ -40,16 +40,16 @@ import com.google.common.base.Function;
import com.google.inject.TypeLiteral;
/**
* Configures the ElasticHosts connection.
* Configures the elasticstack connection.
*
* @author Adrian Cole
*/
@RequiresHttp
@ConfiguresRestClient
public class ElasticHostsRestClientModule extends RestClientModule<ElasticHostsClient, ElasticHostsAsyncClient> {
public class ElasticStackRestClientModule extends RestClientModule<ElasticStackClient, ElasticStackAsyncClient> {
public ElasticHostsRestClientModule() {
super(ElasticHostsClient.class, ElasticHostsAsyncClient.class);
public ElasticStackRestClientModule() {
super(ElasticStackClient.class, ElasticStackAsyncClient.class);
}
@Override
@ -63,9 +63,9 @@ public class ElasticHostsRestClientModule extends RestClientModule<ElasticHostsC
@Override
protected void bindErrorHandlers() {
bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(ElasticHostsErrorHandler.class);
bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(ElasticHostsErrorHandler.class);
bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(ElasticHostsErrorHandler.class);
bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(ElasticStackErrorHandler.class);
bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(ElasticStackErrorHandler.class);
bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(ElasticStackErrorHandler.class);
}
@Override

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.domain;
package org.jclouds.elasticstack.domain;
import static com.google.common.base.Preconditions.checkArgument;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.domain;
package org.jclouds.elasticstack.domain;
import static com.google.common.base.Preconditions.checkNotNull;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.domain;
package org.jclouds.elasticstack.domain;
import static com.google.common.base.Preconditions.checkNotNull;
@ -26,7 +26,7 @@ import java.util.Set;
import javax.annotation.Nullable;
import org.jclouds.elastichosts.domain.internal.BaseDrive;
import org.jclouds.elasticstack.domain.internal.BaseDrive;
import com.google.common.collect.ImmutableSet;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.domain;
package org.jclouds.elasticstack.domain;
import static com.google.common.base.Preconditions.checkNotNull;

View File

@ -17,13 +17,13 @@
* ====================================================================
*/
package org.jclouds.elastichosts.domain;
package org.jclouds.elasticstack.domain;
import java.util.Map;
import javax.annotation.Nullable;
import org.jclouds.elastichosts.domain.internal.BaseDrive;
import org.jclouds.elasticstack.domain.internal.BaseDrive;
/**
*

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.domain;
package org.jclouds.elasticstack.domain;
import static com.google.common.base.Preconditions.checkNotNull;
@ -26,7 +26,7 @@ import java.util.Set;
import javax.annotation.Nullable;
import org.jclouds.elastichosts.domain.internal.BaseDrive;
import org.jclouds.elasticstack.domain.internal.BaseDrive;
import com.google.common.collect.ImmutableSet;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.domain;
package org.jclouds.elasticstack.domain;
import static com.google.common.base.Preconditions.checkNotNull;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.domain;
package org.jclouds.elasticstack.domain;
import static com.google.common.base.Preconditions.checkArgument;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.domain;
package org.jclouds.elasticstack.domain;
import static com.google.common.base.Preconditions.checkNotNull;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.domain;
package org.jclouds.elasticstack.domain;
import static com.google.common.base.Preconditions.checkNotNull;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.domain;
package org.jclouds.elasticstack.domain;
import static com.google.common.base.Preconditions.checkNotNull;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.domain;
package org.jclouds.elasticstack.domain;
import static com.google.common.base.Preconditions.checkNotNull;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.domain;
package org.jclouds.elasticstack.domain;
import static com.google.common.base.Preconditions.checkNotNull;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.domain;
package org.jclouds.elasticstack.domain;
import static com.google.common.base.Preconditions.checkArgument;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.domain;
package org.jclouds.elasticstack.domain;
import static com.google.common.base.Preconditions.checkNotNull;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.domain;
package org.jclouds.elasticstack.domain;
import javax.annotation.Nullable;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.domain.internal;
package org.jclouds.elasticstack.domain.internal;
import static com.google.common.base.Preconditions.checkNotNull;
@ -26,8 +26,8 @@ import java.util.Set;
import javax.annotation.Nullable;
import org.jclouds.elastichosts.domain.ClaimType;
import org.jclouds.elastichosts.domain.Item;
import org.jclouds.elasticstack.domain.ClaimType;
import org.jclouds.elasticstack.domain.Item;
import com.google.common.collect.ImmutableSet;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.functions;
package org.jclouds.elasticstack.functions;
import static com.google.common.base.Preconditions.checkNotNull;
@ -26,8 +26,8 @@ import java.util.Map.Entry;
import javax.inject.Singleton;
import org.jclouds.elastichosts.domain.ClaimType;
import org.jclouds.elastichosts.domain.internal.BaseDrive;
import org.jclouds.elasticstack.domain.ClaimType;
import org.jclouds.elasticstack.domain.internal.BaseDrive;
import com.google.common.base.Function;
import com.google.common.base.Joiner;

View File

@ -17,14 +17,14 @@
* ====================================================================
*/
package org.jclouds.elastichosts.functions;
package org.jclouds.elasticstack.functions;
import java.util.Map;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.jclouds.elastichosts.domain.CreateDriveRequest;
import org.jclouds.elasticstack.domain.CreateDriveRequest;
import com.google.common.base.Function;
import com.google.common.base.Joiner;

View File

@ -17,14 +17,14 @@
* ====================================================================
*/
package org.jclouds.elastichosts.functions;
package org.jclouds.elasticstack.functions;
import java.util.Map;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.jclouds.elastichosts.domain.DriveData;
import org.jclouds.elasticstack.domain.DriveData;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableMap;

View File

@ -17,14 +17,14 @@
* ====================================================================
*/
package org.jclouds.elastichosts.functions;
package org.jclouds.elasticstack.functions;
import java.util.Set;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.jclouds.elastichosts.domain.DriveInfo;
import org.jclouds.elasticstack.domain.DriveInfo;
import org.jclouds.http.HttpResponse;
import com.google.common.base.Function;

View File

@ -17,14 +17,14 @@
* ====================================================================
*/
package org.jclouds.elastichosts.functions;
package org.jclouds.elasticstack.functions;
import java.util.Set;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.jclouds.elastichosts.domain.DriveInfo;
import org.jclouds.elasticstack.domain.DriveInfo;
import org.jclouds.http.HttpResponse;
import org.jclouds.http.functions.ReturnStringIf2xx;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.functions;
package org.jclouds.elasticstack.functions;
import java.util.List;
import java.util.Map;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.functions;
package org.jclouds.elasticstack.functions;
import java.util.Map;

View File

@ -17,16 +17,16 @@
* ====================================================================
*/
package org.jclouds.elastichosts.functions;
package org.jclouds.elasticstack.functions;
import java.util.Map;
import java.util.Map.Entry;
import javax.inject.Singleton;
import org.jclouds.elastichosts.domain.ClaimType;
import org.jclouds.elastichosts.domain.DriveInfo;
import org.jclouds.elastichosts.domain.DriveStatus;
import org.jclouds.elasticstack.domain.ClaimType;
import org.jclouds.elasticstack.domain.DriveInfo;
import org.jclouds.elasticstack.domain.DriveStatus;
import com.google.common.base.Function;
import com.google.common.base.Splitter;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.functions;
package org.jclouds.elasticstack.functions;
import javax.inject.Singleton;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.functions;
package org.jclouds.elasticstack.functions;
import static com.google.common.base.Predicates.equalTo;
import static com.google.common.base.Predicates.not;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.handlers;
package org.jclouds.elasticstack.handlers;
import java.io.IOException;
@ -47,7 +47,7 @@ import com.google.common.io.Closeables;
*
*/
@Singleton
public class ElasticHostsErrorHandler implements HttpErrorHandler {
public class ElasticStackErrorHandler implements HttpErrorHandler {
@Resource
protected Logger logger = Logger.NULL;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.options;
package org.jclouds.elasticstack.options;
import static com.google.common.base.Preconditions.checkArgument;
@ -28,7 +28,7 @@ import static com.google.common.base.Preconditions.checkArgument;
* (if needed):
* <p/>
* <code>
* import static org.jclouds.elastichosts.options.ReadDriveOptions.Builder.*;
* import static org.jclouds.elasticstack.options.ReadDriveOptions.Builder.*;
*
*
* // this will get the first 1024 bytes starting at offset 2048

View File

@ -27,9 +27,9 @@ import java.util.Properties;
import org.jclouds.cloudsigma.functions.KeyValuesDelimitedByBlankLinesToDriveInfo;
import org.jclouds.cloudsigma.functions.ListOfKeyValuesDelimitedByBlankLinesToDriveInfoSet;
import org.jclouds.elastichosts.domain.CreateDriveRequest;
import org.jclouds.elastichosts.domain.DriveData;
import org.jclouds.elastichosts.functions.SplitNewlines;
import org.jclouds.elasticstack.domain.CreateDriveRequest;
import org.jclouds.elasticstack.domain.DriveData;
import org.jclouds.elasticstack.functions.SplitNewlines;
import org.jclouds.http.HttpRequest;
import org.jclouds.http.filters.BasicAuthentication;
import org.jclouds.rest.RestClientTest;

View File

@ -26,7 +26,7 @@ import java.util.Set;
import org.jclouds.cloudsigma.domain.DriveInfo;
import org.jclouds.cloudsigma.domain.DriveType;
import org.jclouds.elastichosts.CommonElasticHostsClientLiveTest;
import org.jclouds.elasticstack.CommonElasticStackClientLiveTest;
import org.testng.annotations.Test;
/**
@ -35,7 +35,7 @@ import org.testng.annotations.Test;
* @author Adrian Cole
*/
@Test(groups = "live", testName = "cloudsigma.CloudSigmaClientLiveTest")
public class CloudSigmaClientLiveTest extends CommonElasticHostsClientLiveTest<CloudSigmaClient, CloudSigmaAsyncClient> {
public class CloudSigmaClientLiveTest extends CommonElasticStackClientLiveTest<CloudSigmaClient, CloudSigmaAsyncClient> {
public CloudSigmaClientLiveTest() {
provider = "cloudsigma";
@ -59,7 +59,7 @@ public class CloudSigmaClientLiveTest extends CommonElasticHostsClientLiveTest<C
assertNotNull(drives);
}
@Override
protected void checkDriveMatchesGet(org.jclouds.elastichosts.domain.DriveInfo newInfo) {
protected void checkDriveMatchesGet(org.jclouds.elasticstack.domain.DriveInfo newInfo) {
super.checkDriveMatchesGet(newInfo);
assertEquals(DriveInfo.class.cast(newInfo).getType(), DriveType.DISK);
}

View File

@ -27,9 +27,9 @@ import java.util.Map;
import org.jclouds.cloudsigma.domain.DriveInfo;
import org.jclouds.cloudsigma.domain.DriveType;
import org.jclouds.elastichosts.domain.ClaimType;
import org.jclouds.elastichosts.domain.DriveStatus;
import org.jclouds.elastichosts.functions.ListOfKeyValuesDelimitedByBlankLinesToListOfMaps;
import org.jclouds.elasticstack.domain.ClaimType;
import org.jclouds.elasticstack.domain.DriveStatus;
import org.jclouds.elasticstack.functions.ListOfKeyValuesDelimitedByBlankLinesToListOfMaps;
import org.jclouds.util.Utils;
import org.testng.annotations.Test;
@ -75,7 +75,7 @@ public class MapToDriveInfoTest {
.userMetadata(ImmutableMap.of("foo", "bar", "baz", "raz")).build();
private static final MapToDriveInfo MAP_TO_DRIVE = new MapToDriveInfo(
new org.jclouds.elastichosts.functions.MapToDriveInfo());
new org.jclouds.elasticstack.functions.MapToDriveInfo());
public void testEmptyMapReturnsNull() {
assertEquals(MAP_TO_DRIVE.apply(ImmutableMap.<String, String> of()), null);

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts;
package org.jclouds.elasticstack;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.testng.Assert.assertEquals;
@ -27,11 +27,11 @@ import java.util.Properties;
import java.util.Set;
import org.jclouds.Constants;
import org.jclouds.elastichosts.domain.ClaimType;
import org.jclouds.elastichosts.domain.CreateDriveRequest;
import org.jclouds.elastichosts.domain.DriveData;
import org.jclouds.elastichosts.domain.DriveInfo;
import org.jclouds.elastichosts.domain.DriveStatus;
import org.jclouds.elasticstack.domain.ClaimType;
import org.jclouds.elasticstack.domain.CreateDriveRequest;
import org.jclouds.elasticstack.domain.DriveData;
import org.jclouds.elasticstack.domain.DriveInfo;
import org.jclouds.elasticstack.domain.DriveStatus;
import org.jclouds.logging.log4j.config.Log4JLoggingModule;
import org.jclouds.rest.RestContext;
import org.jclouds.rest.RestContextFactory;
@ -44,17 +44,17 @@ import com.google.common.collect.ImmutableSet;
import com.google.inject.Module;
/**
* Tests behavior of {@code CommonElasticHostsClient}
* Tests behavior of {@code CommonElasticStackClient}
*
* @author Adrian Cole
*/
@Test(groups = "live", sequential = true)
public abstract class CommonElasticHostsClientLiveTest<S extends CommonElasticHostsClient, A extends CommonElasticHostsAsyncClient> {
public abstract class CommonElasticStackClientLiveTest<S extends CommonElasticStackClient, A extends CommonElasticStackAsyncClient> {
protected S client;
protected RestContext<S, A> context;
protected String provider = "elastichosts";
protected String provider = "elasticstack";
protected String identity;
protected String credential;
protected String endpoint;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts;
package org.jclouds.elasticstack;
import static org.testng.Assert.assertEquals;
@ -27,14 +27,14 @@ import java.util.Properties;
import javax.ws.rs.core.MediaType;
import org.jclouds.elastichosts.domain.CreateDriveRequest;
import org.jclouds.elastichosts.domain.DriveData;
import org.jclouds.elastichosts.domain.ImageConversionType;
import org.jclouds.elastichosts.functions.KeyValuesDelimitedByBlankLinesToDriveInfo;
import org.jclouds.elastichosts.functions.ListOfKeyValuesDelimitedByBlankLinesToDriveInfoSet;
import org.jclouds.elastichosts.functions.ReturnPayload;
import org.jclouds.elastichosts.functions.SplitNewlines;
import org.jclouds.elastichosts.options.ReadDriveOptions;
import org.jclouds.elasticstack.domain.CreateDriveRequest;
import org.jclouds.elasticstack.domain.DriveData;
import org.jclouds.elasticstack.domain.ImageConversionType;
import org.jclouds.elasticstack.functions.KeyValuesDelimitedByBlankLinesToDriveInfo;
import org.jclouds.elasticstack.functions.ListOfKeyValuesDelimitedByBlankLinesToDriveInfoSet;
import org.jclouds.elasticstack.functions.ReturnPayload;
import org.jclouds.elasticstack.functions.SplitNewlines;
import org.jclouds.elasticstack.options.ReadDriveOptions;
import org.jclouds.http.HttpRequest;
import org.jclouds.http.filters.BasicAuthentication;
import org.jclouds.http.functions.ReleasePayloadAndReturn;
@ -54,18 +54,18 @@ import com.google.common.collect.Iterables;
import com.google.inject.TypeLiteral;
/**
* Tests annotation parsing of {@code ElasticHostsAsyncClient}
* Tests annotation parsing of {@code ElasticStackAsyncClient}
*
* @author Adrian Cole
*/
@Test(groups = "unit", testName = "elastichosts.ElasticHostsAsyncClientTest")
public class ElasticHostsAsyncClientTest extends RestClientTest<ElasticHostsAsyncClient> {
@Test(groups = "unit", testName = "elasticstack.ElasticStackAsyncClientTest")
public class ElasticStackAsyncClientTest extends RestClientTest<ElasticStackAsyncClient> {
public void testListDrives() throws SecurityException, NoSuchMethodException, IOException {
Method method = ElasticHostsAsyncClient.class.getMethod("listDrives");
GeneratedHttpRequest<ElasticHostsAsyncClient> httpRequest = processor.createRequest(method);
Method method = ElasticStackAsyncClient.class.getMethod("listDrives");
GeneratedHttpRequest<ElasticStackAsyncClient> httpRequest = processor.createRequest(method);
assertRequestLineEquals(httpRequest, "GET https://api.elastichosts.com/drives/list HTTP/1.1");
assertRequestLineEquals(httpRequest, "GET https://api.elasticstack.com/drives/list HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
assertPayloadEquals(httpRequest, null, null, false);
@ -73,7 +73,7 @@ public class ElasticHostsAsyncClientTest extends RestClientTest<ElasticHostsAsyn
Iterables.getOnlyElement(httpRequest.getFilters()).filter(httpRequest);
Iterables.getOnlyElement(httpRequest.getFilters()).filter(httpRequest);
assertRequestLineEquals(httpRequest, "GET https://api.elastichosts.com/drives/list HTTP/1.1");
assertRequestLineEquals(httpRequest, "GET https://api.elasticstack.com/drives/list HTTP/1.1");
// for example, using basic authentication, we should get "only one"
// header
assertNonPayloadHeadersEqual(httpRequest,
@ -90,10 +90,10 @@ public class ElasticHostsAsyncClientTest extends RestClientTest<ElasticHostsAsyn
}
public void testListDriveInfo() throws SecurityException, NoSuchMethodException, IOException {
Method method = ElasticHostsAsyncClient.class.getMethod("listDriveInfo");
GeneratedHttpRequest<ElasticHostsAsyncClient> httpRequest = processor.createRequest(method);
Method method = ElasticStackAsyncClient.class.getMethod("listDriveInfo");
GeneratedHttpRequest<ElasticStackAsyncClient> httpRequest = processor.createRequest(method);
assertRequestLineEquals(httpRequest, "GET https://api.elastichosts.com/drives/info HTTP/1.1");
assertRequestLineEquals(httpRequest, "GET https://api.elasticstack.com/drives/info HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
assertPayloadEquals(httpRequest, null, null, false);
@ -105,10 +105,10 @@ public class ElasticHostsAsyncClientTest extends RestClientTest<ElasticHostsAsyn
}
public void testGetDriveInfo() throws SecurityException, NoSuchMethodException, IOException {
Method method = ElasticHostsAsyncClient.class.getMethod("getDriveInfo", String.class);
GeneratedHttpRequest<ElasticHostsAsyncClient> httpRequest = processor.createRequest(method, "uuid");
Method method = ElasticStackAsyncClient.class.getMethod("getDriveInfo", String.class);
GeneratedHttpRequest<ElasticStackAsyncClient> httpRequest = processor.createRequest(method, "uuid");
assertRequestLineEquals(httpRequest, "GET https://api.elastichosts.com/drives/uuid/info HTTP/1.1");
assertRequestLineEquals(httpRequest, "GET https://api.elasticstack.com/drives/uuid/info HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
assertPayloadEquals(httpRequest, null, null, false);
@ -121,11 +121,11 @@ public class ElasticHostsAsyncClientTest extends RestClientTest<ElasticHostsAsyn
}
public void testCreateDrive() throws SecurityException, NoSuchMethodException, IOException {
Method method = ElasticHostsAsyncClient.class.getMethod("createDrive", CreateDriveRequest.class);
GeneratedHttpRequest<ElasticHostsAsyncClient> httpRequest = processor.createRequest(method,
Method method = ElasticStackAsyncClient.class.getMethod("createDrive", CreateDriveRequest.class);
GeneratedHttpRequest<ElasticStackAsyncClient> httpRequest = processor.createRequest(method,
new CreateDriveRequest.Builder().name("foo").size(10000l).build());
assertRequestLineEquals(httpRequest, "POST https://api.elastichosts.com/drives/create HTTP/1.1");
assertRequestLineEquals(httpRequest, "POST https://api.elasticstack.com/drives/create HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
assertPayloadEquals(httpRequest, "name foo\nsize 10000", "text/plain", false);
@ -138,11 +138,11 @@ public class ElasticHostsAsyncClientTest extends RestClientTest<ElasticHostsAsyn
}
public void testSetDriveData() throws SecurityException, NoSuchMethodException, IOException {
Method method = ElasticHostsAsyncClient.class.getMethod("setDriveData", String.class, DriveData.class);
GeneratedHttpRequest<ElasticHostsAsyncClient> httpRequest = processor.createRequest(method, "100",
Method method = ElasticStackAsyncClient.class.getMethod("setDriveData", String.class, DriveData.class);
GeneratedHttpRequest<ElasticStackAsyncClient> httpRequest = processor.createRequest(method, "100",
new DriveData.Builder().name("foo").size(10000l).tags(ImmutableList.of("production", "candy")).build());
assertRequestLineEquals(httpRequest, "POST https://api.elastichosts.com/drives/100/set HTTP/1.1");
assertRequestLineEquals(httpRequest, "POST https://api.elasticstack.com/drives/100/set HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
assertPayloadEquals(httpRequest, "name foo\nsize 10000\ntags production candy", "text/plain", false);
@ -155,10 +155,10 @@ public class ElasticHostsAsyncClientTest extends RestClientTest<ElasticHostsAsyn
}
public void testImageDrive() throws SecurityException, NoSuchMethodException, IOException {
Method method = ElasticHostsAsyncClient.class.getMethod("imageDrive", String.class, String.class);
GeneratedHttpRequest<ElasticHostsAsyncClient> httpRequest = processor.createRequest(method, "100", "200");
Method method = ElasticStackAsyncClient.class.getMethod("imageDrive", String.class, String.class);
GeneratedHttpRequest<ElasticStackAsyncClient> httpRequest = processor.createRequest(method, "100", "200");
assertRequestLineEquals(httpRequest, "POST https://api.elastichosts.com/drives/200/image/100 HTTP/1.1");
assertRequestLineEquals(httpRequest, "POST https://api.elasticstack.com/drives/200/image/100 HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
assertPayloadEquals(httpRequest, null, null, false);
@ -171,12 +171,12 @@ public class ElasticHostsAsyncClientTest extends RestClientTest<ElasticHostsAsyn
}
public void testImageDriveWithConversion() throws SecurityException, NoSuchMethodException, IOException {
Method method = ElasticHostsAsyncClient.class.getMethod("imageDrive", String.class, String.class,
Method method = ElasticStackAsyncClient.class.getMethod("imageDrive", String.class, String.class,
ImageConversionType.class);
GeneratedHttpRequest<ElasticHostsAsyncClient> httpRequest = processor.createRequest(method, "100", "200",
GeneratedHttpRequest<ElasticStackAsyncClient> httpRequest = processor.createRequest(method, "100", "200",
ImageConversionType.GUNZIP);
assertRequestLineEquals(httpRequest, "POST https://api.elastichosts.com/drives/200/image/100/gunzip HTTP/1.1");
assertRequestLineEquals(httpRequest, "POST https://api.elasticstack.com/drives/200/image/100/gunzip HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
assertPayloadEquals(httpRequest, null, null, false);
@ -189,10 +189,10 @@ public class ElasticHostsAsyncClientTest extends RestClientTest<ElasticHostsAsyn
}
public void testDestroyDrive() throws SecurityException, NoSuchMethodException, IOException {
Method method = ElasticHostsAsyncClient.class.getMethod("destroyDrive", String.class);
GeneratedHttpRequest<ElasticHostsAsyncClient> httpRequest = processor.createRequest(method, "uuid");
Method method = ElasticStackAsyncClient.class.getMethod("destroyDrive", String.class);
GeneratedHttpRequest<ElasticStackAsyncClient> httpRequest = processor.createRequest(method, "uuid");
assertRequestLineEquals(httpRequest, "POST https://api.elastichosts.com/drives/uuid/destroy HTTP/1.1");
assertRequestLineEquals(httpRequest, "POST https://api.elasticstack.com/drives/uuid/destroy HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
assertPayloadEquals(httpRequest, null, null, false);
@ -205,10 +205,10 @@ public class ElasticHostsAsyncClientTest extends RestClientTest<ElasticHostsAsyn
}
public void testReadDrive() throws SecurityException, NoSuchMethodException, IOException {
Method method = ElasticHostsAsyncClient.class.getMethod("readDrive", String.class);
GeneratedHttpRequest<ElasticHostsAsyncClient> httpRequest = processor.createRequest(method, "100");
Method method = ElasticStackAsyncClient.class.getMethod("readDrive", String.class);
GeneratedHttpRequest<ElasticStackAsyncClient> httpRequest = processor.createRequest(method, "100");
assertRequestLineEquals(httpRequest, "GET https://api.elastichosts.com/drives/100/read HTTP/1.1");
assertRequestLineEquals(httpRequest, "GET https://api.elasticstack.com/drives/100/read HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/octet-stream\n");
assertPayloadEquals(httpRequest, null, null, false);
@ -220,11 +220,11 @@ public class ElasticHostsAsyncClientTest extends RestClientTest<ElasticHostsAsyn
}
public void testReadDriveOptions() throws SecurityException, NoSuchMethodException, IOException {
Method method = ElasticHostsAsyncClient.class.getMethod("readDrive", String.class, ReadDriveOptions.class);
GeneratedHttpRequest<ElasticHostsAsyncClient> httpRequest = processor.createRequest(method, "100",
Method method = ElasticStackAsyncClient.class.getMethod("readDrive", String.class, ReadDriveOptions.class);
GeneratedHttpRequest<ElasticStackAsyncClient> httpRequest = processor.createRequest(method, "100",
new ReadDriveOptions().offset(1024).size(2048));
assertRequestLineEquals(httpRequest, "POST https://api.elastichosts.com/drives/100/read/1024/2048 HTTP/1.1");
assertRequestLineEquals(httpRequest, "POST https://api.elasticstack.com/drives/100/read/1024/2048 HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: application/octet-stream\n");
assertPayloadEquals(httpRequest, null, null, false);
@ -236,11 +236,11 @@ public class ElasticHostsAsyncClientTest extends RestClientTest<ElasticHostsAsyn
}
public void testWriteDrive() throws SecurityException, NoSuchMethodException, IOException {
Method method = ElasticHostsAsyncClient.class.getMethod("writeDrive", String.class, Payload.class);
GeneratedHttpRequest<ElasticHostsAsyncClient> httpRequest = processor.createRequest(method, "100",
Method method = ElasticStackAsyncClient.class.getMethod("writeDrive", String.class, Payload.class);
GeneratedHttpRequest<ElasticStackAsyncClient> httpRequest = processor.createRequest(method, "100",
Payloads.newStringPayload("foo"));
assertRequestLineEquals(httpRequest, "POST https://api.elastichosts.com/drives/100/write HTTP/1.1");
assertRequestLineEquals(httpRequest, "POST https://api.elasticstack.com/drives/100/write HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
assertPayloadEquals(httpRequest, "", MediaType.APPLICATION_OCTET_STREAM, false);
@ -252,11 +252,11 @@ public class ElasticHostsAsyncClientTest extends RestClientTest<ElasticHostsAsyn
}
public void testWriteDriveOffset() throws SecurityException, NoSuchMethodException, IOException {
Method method = ElasticHostsAsyncClient.class.getMethod("writeDrive", String.class, Payload.class, long.class);
GeneratedHttpRequest<ElasticHostsAsyncClient> httpRequest = processor.createRequest(method, "100",
Method method = ElasticStackAsyncClient.class.getMethod("writeDrive", String.class, Payload.class, long.class);
GeneratedHttpRequest<ElasticStackAsyncClient> httpRequest = processor.createRequest(method, "100",
Payloads.newStringPayload("foo"), 2048);
assertRequestLineEquals(httpRequest, "POST https://api.elastichosts.com/drives/100/write/2048 HTTP/1.1");
assertRequestLineEquals(httpRequest, "POST https://api.elasticstack.com/drives/100/write/2048 HTTP/1.1");
assertNonPayloadHeadersEqual(httpRequest, "Accept: text/plain\n");
assertPayloadEquals(httpRequest, "", MediaType.APPLICATION_OCTET_STREAM, false);
@ -274,15 +274,15 @@ public class ElasticHostsAsyncClientTest extends RestClientTest<ElasticHostsAsyn
}
@Override
protected TypeLiteral<RestAnnotationProcessor<ElasticHostsAsyncClient>> createTypeLiteral() {
return new TypeLiteral<RestAnnotationProcessor<ElasticHostsAsyncClient>>() {
protected TypeLiteral<RestAnnotationProcessor<ElasticStackAsyncClient>> createTypeLiteral() {
return new TypeLiteral<RestAnnotationProcessor<ElasticStackAsyncClient>>() {
};
}
@Override
public RestContextSpec<ElasticHostsClient, ElasticHostsAsyncClient> createContextSpec() {
public RestContextSpec<ElasticStackClient, ElasticStackAsyncClient> createContextSpec() {
Properties props = new Properties();
props.setProperty("elastichosts.endpoint", "https://api.elastichosts.com");
return new RestContextFactory().createContextSpec("elastichosts", "foo", "bar", props);
props.setProperty("elasticstack.endpoint", "https://api.elasticstack.com");
return new RestContextFactory().createContextSpec("elasticstack", "foo", "bar", props);
}
}

View File

@ -17,27 +17,27 @@
* ====================================================================
*/
package org.jclouds.elastichosts;
package org.jclouds.elasticstack;
import static org.testng.Assert.assertEquals;
import java.io.IOException;
import org.jclouds.elastichosts.domain.CreateDriveRequest;
import org.jclouds.elastichosts.domain.DriveInfo;
import org.jclouds.elastichosts.options.ReadDriveOptions;
import org.jclouds.elasticstack.domain.CreateDriveRequest;
import org.jclouds.elasticstack.domain.DriveInfo;
import org.jclouds.elasticstack.options.ReadDriveOptions;
import org.jclouds.io.Payloads;
import org.jclouds.util.Utils;
import org.testng.annotations.Test;
/**
* Tests behavior of {@code ElasticHostsClient}
* Tests behavior of {@code ElasticStackClient}
*
* @author Adrian Cole
*/
@Test(groups = "live", testName = "elastichosts.ElasticHostsClientLiveTest")
public class ElasticHostsClientLiveTest extends
CommonElasticHostsClientLiveTest<ElasticHostsClient, ElasticHostsAsyncClient> {
@Test(groups = "live", testName = "elasticstack.ElasticStackClientLiveTest")
public class ElasticStackClientLiveTest extends
CommonElasticStackClientLiveTest<ElasticStackClient, ElasticStackAsyncClient> {
private DriveInfo info2;
@Override

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts;
package org.jclouds.elasticstack;
import org.jclouds.util.Utils;
import org.testng.annotations.Test;
@ -35,7 +35,7 @@ public class ProvidersInPropertiesTest {
@Test
public void testSupportedProviders() {
Iterable<String> providers = Utils.getSupportedProviders();
assert Iterables.contains(providers, "elastichosts") : providers;
assert Iterables.contains(providers, "elasticstack") : providers;
}
//
// @Test

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.binders;
package org.jclouds.elasticstack.binders;
import static org.testng.Assert.assertEquals;
@ -27,11 +27,11 @@ import java.util.Map;
import javax.ws.rs.core.MediaType;
import org.jclouds.elastichosts.domain.ClaimType;
import org.jclouds.elastichosts.domain.CreateDriveRequest;
import org.jclouds.elastichosts.domain.DriveData;
import org.jclouds.elastichosts.functions.CreateDriveRequestToMap;
import org.jclouds.elastichosts.functions.DriveDataToMap;
import org.jclouds.elasticstack.domain.ClaimType;
import org.jclouds.elasticstack.domain.CreateDriveRequest;
import org.jclouds.elasticstack.domain.DriveData;
import org.jclouds.elasticstack.functions.CreateDriveRequestToMap;
import org.jclouds.elasticstack.functions.DriveDataToMap;
import org.jclouds.http.HttpRequest;
import org.jclouds.util.Utils;
import org.testng.annotations.Test;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.binders;
package org.jclouds.elasticstack.binders;
import static org.testng.Assert.assertEquals;
@ -27,11 +27,11 @@ import java.util.Map;
import javax.ws.rs.core.MediaType;
import org.jclouds.elastichosts.domain.ClaimType;
import org.jclouds.elastichosts.domain.CreateDriveRequest;
import org.jclouds.elastichosts.domain.DriveData;
import org.jclouds.elastichosts.functions.CreateDriveRequestToMap;
import org.jclouds.elastichosts.functions.DriveDataToMap;
import org.jclouds.elasticstack.domain.ClaimType;
import org.jclouds.elasticstack.domain.CreateDriveRequest;
import org.jclouds.elasticstack.domain.DriveData;
import org.jclouds.elasticstack.functions.CreateDriveRequestToMap;
import org.jclouds.elasticstack.functions.DriveDataToMap;
import org.jclouds.http.HttpRequest;
import org.jclouds.util.Utils;
import org.testng.annotations.Test;

View File

@ -17,13 +17,13 @@
* ====================================================================
*/
package org.jclouds.elastichosts.binders;
package org.jclouds.elasticstack.binders;
import static org.testng.Assert.assertEquals;
import java.net.URI;
import org.jclouds.elastichosts.options.ReadDriveOptions;
import org.jclouds.elasticstack.options.ReadDriveOptions;
import org.jclouds.http.HttpRequest;
import org.jclouds.logging.config.NullLoggingModule;
import org.jclouds.rest.BaseRestClientTest.MockModule;

View File

@ -17,14 +17,14 @@
* ====================================================================
*/
package org.jclouds.elastichosts.functions;
package org.jclouds.elasticstack.functions;
import static org.testng.Assert.assertEquals;
import java.io.IOException;
import org.jclouds.elastichosts.domain.ClaimType;
import org.jclouds.elastichosts.domain.internal.BaseDrive;
import org.jclouds.elasticstack.domain.ClaimType;
import org.jclouds.elasticstack.domain.internal.BaseDrive;
import org.testng.annotations.Test;
import com.google.common.collect.ImmutableMap;

View File

@ -17,14 +17,14 @@
* ====================================================================
*/
package org.jclouds.elastichosts.functions;
package org.jclouds.elasticstack.functions;
import static org.testng.Assert.assertEquals;
import java.io.IOException;
import org.jclouds.elastichosts.domain.ClaimType;
import org.jclouds.elastichosts.domain.CreateDriveRequest;
import org.jclouds.elasticstack.domain.ClaimType;
import org.jclouds.elasticstack.domain.CreateDriveRequest;
import org.testng.annotations.Test;
import com.google.common.collect.ImmutableMap;

View File

@ -17,14 +17,14 @@
* ====================================================================
*/
package org.jclouds.elastichosts.functions;
package org.jclouds.elasticstack.functions;
import static org.testng.Assert.assertEquals;
import java.io.IOException;
import org.jclouds.elastichosts.domain.ClaimType;
import org.jclouds.elastichosts.domain.DriveData;
import org.jclouds.elasticstack.domain.ClaimType;
import org.jclouds.elasticstack.domain.DriveData;
import org.testng.annotations.Test;
import com.google.common.collect.ImmutableMap;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.functions;
package org.jclouds.elasticstack.functions;
import static org.testng.Assert.assertEquals;

View File

@ -17,11 +17,11 @@
* ====================================================================
*/
package org.jclouds.elastichosts.functions;
package org.jclouds.elasticstack.functions;
import static org.testng.Assert.assertEquals;
import org.jclouds.elastichosts.domain.DriveInfo;
import org.jclouds.elasticstack.domain.DriveInfo;
import org.jclouds.http.HttpResponse;
import org.jclouds.io.Payloads;
import org.testng.annotations.Test;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.functions;
package org.jclouds.elasticstack.functions;
import static org.testng.Assert.assertEquals;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.functions;
package org.jclouds.elasticstack.functions;
import static org.testng.Assert.assertEquals;

View File

@ -17,16 +17,16 @@
* ====================================================================
*/
package org.jclouds.elastichosts.functions;
package org.jclouds.elasticstack.functions;
import static org.testng.Assert.assertEquals;
import java.io.IOException;
import java.util.Map;
import org.jclouds.elastichosts.domain.ClaimType;
import org.jclouds.elastichosts.domain.DriveInfo;
import org.jclouds.elastichosts.domain.DriveStatus;
import org.jclouds.elasticstack.domain.ClaimType;
import org.jclouds.elasticstack.domain.DriveInfo;
import org.jclouds.elasticstack.domain.DriveStatus;
import org.jclouds.util.Utils;
import org.testng.annotations.Test;

View File

@ -17,14 +17,14 @@
* ====================================================================
*/
package org.jclouds.elastichosts.functions;
package org.jclouds.elasticstack.functions;
import static org.testng.Assert.assertEquals;
import java.io.InputStream;
import java.util.Set;
import org.jclouds.elastichosts.functions.SplitNewlines;
import org.jclouds.elasticstack.functions.SplitNewlines;
import org.jclouds.http.HttpResponse;
import org.jclouds.io.Payloads;
import org.testng.annotations.Test;

View File

@ -17,7 +17,7 @@
* ====================================================================
*/
package org.jclouds.elastichosts.handlers;
package org.jclouds.elasticstack.handlers;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.reportMatcher;
@ -44,41 +44,41 @@ import com.google.inject.Guice;
* @author Adrian Cole
*/
@Test(groups = { "unit" })
public class ElasticHostsErrorHandlerTest {
public class ElasticStackErrorHandlerTest {
@Test
public void test400MakesIllegalArgumentException() {
assertCodeMakes("GET", URI.create("https://elastichosts.com/foo"), 400, "", "Bad Request",
assertCodeMakes("GET", URI.create("https://elasticstack.com/foo"), 400, "", "Bad Request",
IllegalArgumentException.class);
}
@Test
public void test400MakesResourceNotFoundExceptionOnMessageNotFound() {
assertCodeMakes("GET", URI.create("https://elastichosts.com/foo"), 400, "", "errors:system Drive 8f9b42b1-26de-49ad-a3fd-d4fa06524339 could not be found. Please re-validate your entry.",
assertCodeMakes("GET", URI.create("https://elasticstack.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://elastichosts.com/foo"), 401, "", "Unauthorized",
assertCodeMakes("GET", URI.create("https://elasticstack.com/foo"), 401, "", "Unauthorized",
AuthorizationException.class);
}
@Test
public void test404MakesResourceNotFoundException() {
assertCodeMakes("GET", URI.create("https://elastichosts.com/foo"), 404, "", "Not Found",
assertCodeMakes("GET", URI.create("https://elasticstack.com/foo"), 404, "", "Not Found",
ResourceNotFoundException.class);
}
@Test
public void test405MakesIllegalArgumentException() {
assertCodeMakes("GET", URI.create("https://elastichosts.com/foo"), 405, "", "Method Not Allowed",
assertCodeMakes("GET", URI.create("https://elasticstack.com/foo"), 405, "", "Method Not Allowed",
IllegalArgumentException.class);
}
@Test
public void test409MakesIllegalStateException() {
assertCodeMakes("GET", URI.create("https://elastichosts.com/foo"), 409, "", "Conflict",
assertCodeMakes("GET", URI.create("https://elasticstack.com/foo"), 409, "", "Conflict",
IllegalStateException.class);
}
@ -90,7 +90,7 @@ public class ElasticHostsErrorHandlerTest {
private void assertCodeMakes(String method, URI uri, int statusCode, String message, String contentType,
String content, Class<? extends Exception> expected) {
ElasticHostsErrorHandler function = Guice.createInjector().getInstance(ElasticHostsErrorHandler.class);
ElasticStackErrorHandler function = Guice.createInjector().getInstance(ElasticStackErrorHandler.class);
HttpCommand command = createMock(HttpCommand.class);
HttpRequest request = new HttpRequest(method, uri);

View File

@ -17,10 +17,10 @@
* ====================================================================
*/
package org.jclouds.elastichosts.options;
package org.jclouds.elasticstack.options;
import static org.jclouds.elastichosts.options.ReadDriveOptions.Builder.offset;
import static org.jclouds.elastichosts.options.ReadDriveOptions.Builder.size;
import static org.jclouds.elasticstack.options.ReadDriveOptions.Builder.offset;
import static org.jclouds.elasticstack.options.ReadDriveOptions.Builder.size;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNull;