Remove default endpoint from ApiMetadata

This commit is contained in:
Andrew Donald Kennedy 2012-04-12 12:12:50 +01:00
parent 5a3d2a11d6
commit 30cee89d53
5 changed files with 8 additions and 17 deletions

View File

@ -17,6 +17,7 @@
* under the License. * under the License.
*/ */
package org.jclouds.vcloud.director.v1_5; package org.jclouds.vcloud.director.v1_5;
import static org.jclouds.Constants.PROPERTY_SESSION_INTERVAL; import static org.jclouds.Constants.PROPERTY_SESSION_INTERVAL;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.PROPERTY_VCLOUD_DIRECTOR_TIMEOUT_TASK_COMPLETED; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.PROPERTY_VCLOUD_DIRECTOR_TIMEOUT_TASK_COMPLETED;
import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.PROPERTY_VCLOUD_DIRECTOR_VERSION_SCHEMA; import static org.jclouds.vcloud.director.v1_5.VCloudDirectorConstants.PROPERTY_VCLOUD_DIRECTOR_VERSION_SCHEMA;
@ -36,7 +37,7 @@ import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
import com.google.common.reflect.TypeToken; import com.google.common.reflect.TypeToken;
/** /**
* Implementation of {@link ApiMetadata} for VCloudDirector 1.0 API * Implementation of {@link ApiMetadata} for VCloudDirector 1.5 API
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@ -82,14 +83,13 @@ public class VCloudDirectorApiMetadata
protected Builder() { protected Builder() {
super(VCloudDirectorClient.class, VCloudDirectorAsyncClient.class); super(VCloudDirectorClient.class, VCloudDirectorAsyncClient.class);
id("vcloud") id("vcloud-director")
.name("VCloud Director 1.5 API") .name("vCloud Director 1.5 API")
.type(ApiType.COMPUTE) .type(ApiType.COMPUTE)
.identityName("User at Organization (user@org)") .identityName("User at Organization (user@org)")
.credentialName("Password") .credentialName("Password")
.documentation(URI.create("http://www.vmware.com/support/pubs/vcd_pubs.html")) .documentation(URI.create("http://www.vmware.com/support/pubs/vcd_pubs.html"))
.version("1.5") .version("1.5")
.defaultEndpoint("https://vcloudbeta.bluelock.com/api")
.defaultProperties(VCloudDirectorApiMetadata.defaultProperties()) .defaultProperties(VCloudDirectorApiMetadata.defaultProperties())
.context(TypeToken.of(VCloudDirectorContext.class)) .context(TypeToken.of(VCloudDirectorContext.class))
.contextBuilder(TypeToken.of(VCloudDirectorContextBuilder.class)); .contextBuilder(TypeToken.of(VCloudDirectorContextBuilder.class));

View File

@ -54,6 +54,7 @@ public class VCloudDirectorContextBuilder
// modules.add(new VCloudDirectorComputeServiceContextModule()); // modules.add(new VCloudDirectorComputeServiceContextModule());
// } // }
@Override
protected void addClientModule(List<Module> modules) { protected void addClientModule(List<Module> modules) {
modules.add(new VCloudDirectorRestClientModule()); modules.add(new VCloudDirectorRestClientModule());
} }

View File

@ -25,12 +25,10 @@ import java.net.URI;
import java.util.Properties; import java.util.Properties;
import org.jclouds.Constants; import org.jclouds.Constants;
import org.jclouds.apis.ApiMetadata;
import org.jclouds.date.DateService; import org.jclouds.date.DateService;
import org.jclouds.http.HttpRequest; import org.jclouds.http.HttpRequest;
import org.jclouds.http.HttpResponse; import org.jclouds.http.HttpResponse;
import org.jclouds.rest.internal.BaseRestClientExpectTest; import org.jclouds.rest.internal.BaseRestClientExpectTest;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorApiMetadata;
import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType; import org.jclouds.vcloud.director.v1_5.VCloudDirectorMediaType;
import org.jclouds.vcloud.director.v1_5.domain.Reference; import org.jclouds.vcloud.director.v1_5.domain.Reference;
import org.testng.annotations.BeforeGroups; import org.testng.annotations.BeforeGroups;
@ -41,7 +39,7 @@ import com.google.common.collect.Multimap;
import com.google.inject.Guice; import com.google.inject.Guice;
/** /**
* Base class for writing KeyStone Rest Client Expect tests * Base class for writing vCloud Director REST client expect tests.
* *
* @author Adrian Cole * @author Adrian Cole
*/ */
@ -71,6 +69,7 @@ public abstract class BaseVCloudDirectorExpectTest<T> extends BaseRestClientExpe
public Properties setupProperties() { public Properties setupProperties() {
Properties props = new Properties(); Properties props = new Properties();
props.put(Constants.PROPERTY_MAX_RETRIES, 1); props.put(Constants.PROPERTY_MAX_RETRIES, 1);
props.put(Constants.PROPERTY_ENDPOINT, endpoint);
return props; return props;
} }
@ -252,10 +251,4 @@ public abstract class BaseVCloudDirectorExpectTest<T> extends BaseRestClientExpe
public URI toAdminUri(URI uri) { public URI toAdminUri(URI uri) {
return Reference.builder().href(uri).build().toAdminReference(endpoint).getHref(); return Reference.builder().href(uri).build().toAdminReference(endpoint).getHref();
} }
@Override
protected ApiMetadata<?, ?, ?, ?> createApiMetadata() {
return new VCloudDirectorApiMetadata();
}
} }

View File

@ -21,8 +21,6 @@ package org.jclouds.vcloud.director.v1_5.internal;
import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient; import org.jclouds.vcloud.director.v1_5.user.VCloudDirectorClient;
/** /**
* Base class for writing KeyStone Rest Client Expect tests
*
* @author Adrian Cole * @author Adrian Cole
*/ */
public abstract class BaseVCloudDirectorRestClientExpectTest extends BaseVCloudDirectorExpectTest<VCloudDirectorClient> { public abstract class BaseVCloudDirectorRestClientExpectTest extends BaseVCloudDirectorExpectTest<VCloudDirectorClient> {

View File

@ -29,7 +29,6 @@ import com.google.common.base.Function;
import com.google.inject.Module; import com.google.inject.Module;
/** /**
*
* @author Adrian Cole * @author Adrian Cole
*/ */
public abstract class VCloudDirectorAdminClientExpectTest extends public abstract class VCloudDirectorAdminClientExpectTest extends