diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudClient.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudApi.java
similarity index 67%
rename from apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudClient.java
rename to apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudApi.java
index b37e1b1b5b..5ecef9c14b 100644
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudClient.java
+++ b/apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudApi.java
@@ -19,14 +19,16 @@ package org.jclouds.vcloud;
import java.io.Closeable;
import org.jclouds.rest.annotations.Delegate;
-import org.jclouds.vcloud.features.CatalogClient;
-import org.jclouds.vcloud.features.NetworkClient;
-import org.jclouds.vcloud.features.OrgClient;
-import org.jclouds.vcloud.features.TaskClient;
-import org.jclouds.vcloud.features.VAppClient;
-import org.jclouds.vcloud.features.VAppTemplateClient;
-import org.jclouds.vcloud.features.VDCClient;
-import org.jclouds.vcloud.features.VmClient;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.vcloud.features.CatalogApi;
+import org.jclouds.vcloud.features.NetworkApi;
+import org.jclouds.vcloud.features.OrgApi;
+import org.jclouds.vcloud.features.TaskApi;
+import org.jclouds.vcloud.features.VAppApi;
+import org.jclouds.vcloud.features.VAppTemplateApi;
+import org.jclouds.vcloud.features.VDCApi;
+import org.jclouds.vcloud.features.VmApi;
+import org.jclouds.vcloud.filters.AddVCloudAuthorizationAndCookieToRequest;
/**
* Provides access to VCloud resources via their REST API.
@@ -35,54 +37,55 @@ import org.jclouds.vcloud.features.VmClient;
* @see
* @author Adrian Cole
*/
-public interface VCloudClient extends Closeable {
+@RequestFilters(AddVCloudAuthorizationAndCookieToRequest.class)
+public interface VCloudApi extends Closeable {
/**
* Provides asynchronous access to VApp Template features.
*
*/
@Delegate
- VAppTemplateClient getVAppTemplateClient();
+ VAppTemplateApi getVAppTemplateClient();
/**
* Provides synchronous access to VApp features.
*/
@Delegate
- VAppClient getVAppClient();
+ VAppApi getVAppClient();
/**
* Provides synchronous access to Vm features.
*/
@Delegate
- VmClient getVmClient();
+ VmApi getVmClient();
/**
* Provides synchronous access to Catalog features.
*/
@Delegate
- CatalogClient getCatalogClient();
+ CatalogApi getCatalogClient();
/**
* Provides synchronous access to Task features.
*/
@Delegate
- TaskClient getTaskClient();
+ TaskApi getTaskClient();
/**
* Provides synchronous access to VDC features.
*/
@Delegate
- VDCClient getVDCClient();
+ VDCApi getVDCClient();
/**
* Provides synchronous access to Network features.
*/
@Delegate
- NetworkClient getNetworkClient();
+ NetworkApi getNetworkClient();
/**
* Provides synchronous access to Org features.
*/
@Delegate
- OrgClient getOrgClient();
+ OrgApi getOrgClient();
}
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudApiMetadata.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudApiMetadata.java
index 3991316067..bd60ef9ff7 100644
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudApiMetadata.java
+++ b/apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudApiMetadata.java
@@ -29,13 +29,12 @@ import java.util.Properties;
import org.jclouds.apis.ApiMetadata;
import org.jclouds.compute.ComputeServiceContext;
-import org.jclouds.rest.internal.BaseRestApiMetadata;
+import org.jclouds.rest.internal.BaseHttpApiMetadata;
import org.jclouds.vcloud.compute.config.VCloudComputeServiceContextModule;
-import org.jclouds.vcloud.config.VCloudRestClientModule;
+import org.jclouds.vcloud.config.VCloudHttpApiModule;
import org.jclouds.vcloud.domain.network.FenceMode;
import com.google.common.collect.ImmutableSet;
-import com.google.common.reflect.TypeToken;
import com.google.inject.Module;
/**
@@ -43,17 +42,9 @@ import com.google.inject.Module;
*
* @author Adrian Cole
*/
-public class VCloudApiMetadata extends BaseRestApiMetadata {
+public class VCloudApiMetadata extends BaseHttpApiMetadata {
+
- /**
- * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(VCloudClient.class)} as
- * {@link VCloudAsyncClient} interface will be removed in jclouds 1.7.
- */
- @Deprecated
- public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() {
- private static final long serialVersionUID = 1L;
- };
-
@Override
public Builder toBuilder() {
return new Builder().fromApiMetadata(this);
@@ -68,7 +59,7 @@ public class VCloudApiMetadata extends BaseRestApiMetadata {
}
public static Properties defaultProperties() {
- Properties properties = BaseRestApiMetadata.defaultProperties();
+ Properties properties = BaseHttpApiMetadata.defaultProperties();
properties.setProperty(PROPERTY_VCLOUD_VERSION_SCHEMA, "1");
properties.setProperty(PROPERTY_VCLOUD_XML_NAMESPACE,
String.format("http://www.vmware.com/vcloud/v${%s}", PROPERTY_VCLOUD_VERSION_SCHEMA));
@@ -87,11 +78,8 @@ public class VCloudApiMetadata extends BaseRestApiMetadata {
return properties;
}
- public static class Builder extends BaseRestApiMetadata.Builder {
-
- @SuppressWarnings("deprecation")
+ public static class Builder extends BaseHttpApiMetadata.Builder {
protected Builder() {
- super(VCloudClient.class, VCloudAsyncClient.class);
id("vcloud")
.name("VCloud 1.0 API")
.identityName("User at Organization (user@org)")
@@ -100,7 +88,7 @@ public class VCloudApiMetadata extends BaseRestApiMetadata {
.version("1.0")
.defaultProperties(VCloudApiMetadata.defaultProperties())
.view(typeToken(ComputeServiceContext.class))
- .defaultModules(ImmutableSet.>of(VCloudRestClientModule.class, VCloudComputeServiceContextModule.class));
+ .defaultModules(ImmutableSet.>of(VCloudHttpApiModule.class, VCloudComputeServiceContextModule.class));
}
@Override
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudAsyncClient.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudAsyncClient.java
deleted file mode 100644
index 4820d8e680..0000000000
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudAsyncClient.java
+++ /dev/null
@@ -1,119 +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.vcloud;
-
-import java.io.Closeable;
-
-import org.jclouds.rest.annotations.Delegate;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.vcloud.features.CatalogAsyncClient;
-import org.jclouds.vcloud.features.NetworkAsyncClient;
-import org.jclouds.vcloud.features.OrgAsyncClient;
-import org.jclouds.vcloud.features.TaskAsyncClient;
-import org.jclouds.vcloud.features.VAppAsyncClient;
-import org.jclouds.vcloud.features.VAppTemplateAsyncClient;
-import org.jclouds.vcloud.features.VDCAsyncClient;
-import org.jclouds.vcloud.features.VmAsyncClient;
-import org.jclouds.vcloud.filters.AddVCloudAuthorizationAndCookieToRequest;
-
-/**
- * Provides access to VCloud resources via their REST API.
- *
- *
- * @see
- * @author Adrian Cole
- * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(VCloudClient.class)} as
- * {@link VCloudAsyncClient} interface will be removed in jclouds 1.7.
- */
-@Deprecated
-@RequestFilters(AddVCloudAuthorizationAndCookieToRequest.class)
-public interface VCloudAsyncClient extends Closeable {
-
- /**
- * Provides asynchronous access to VApp Template features.
- *
- * @see VCloudClient#getVAppTemplateClient
- *
- */
- @Delegate
- VAppTemplateAsyncClient getVAppTemplateClient();
-
- /**
- * Provides asynchronous access to VApp features.
- *
- * @see VCloudClient#getVAppClient
- *
- */
- @Delegate
- VAppAsyncClient getVAppClient();
-
- /**
- * Provides asynchronous access to Vm features.
- *
- * @see VCloudClient#getVmClient
- *
- */
- @Delegate
- VmAsyncClient getVmClient();
-
- /**
- * Provides asynchronous access to Catalog features.
- *
- * @see VCloudClient#getCatalogClient
- *
- */
- @Delegate
- CatalogAsyncClient getCatalogClient();
-
- /**
- * Provides asynchronous access to Task features.
- *
- * @see VCloudClient#getTaskClient
- *
- */
- @Delegate
- TaskAsyncClient getTaskClient();
-
- /**
- * Provides asynchronous access to VDC features.
- *
- * @see VCloudClient#getVDCClient
- *
- */
- @Delegate
- VDCAsyncClient getVDCClient();
-
- /**
- * Provides asynchronous access to Network features.
- *
- * @see VCloudClient#getNetworkClient
- *
- */
- @Delegate
- NetworkAsyncClient getNetworkClient();
-
- /**
- * Provides asynchronous access to Org features.
- *
- * @see VCloudClient#getOrgClient
- *
- */
- @Delegate
- OrgAsyncClient getOrgClient();
-
-}
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudVersionsClient.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudVersionsApi.java
similarity index 76%
rename from apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudVersionsClient.java
rename to apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudVersionsApi.java
index 17a210c138..01ec0459cf 100644
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudVersionsClient.java
+++ b/apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudVersionsApi.java
@@ -19,7 +19,17 @@ package org.jclouds.vcloud;
import java.io.Closeable;
import java.net.URI;
import java.util.SortedMap;
-public interface VCloudVersionsClient extends Closeable {
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+import org.jclouds.rest.annotations.XMLResponseParser;
+import org.jclouds.vcloud.xml.SupportedVersionsHandler;
+
+public interface VCloudVersionsApi extends Closeable {
+
+ @GET
+ @XMLResponseParser(SupportedVersionsHandler.class)
+ @Path("/versions")
SortedMap getSupportedVersions();
}
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudVersionsAsyncClient.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudVersionsAsyncClient.java
deleted file mode 100644
index 53212c9cea..0000000000
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/VCloudVersionsAsyncClient.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.vcloud;
-
-import java.io.Closeable;
-import java.net.URI;
-import java.util.SortedMap;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-
-import org.jclouds.rest.annotations.XMLResponseParser;
-import org.jclouds.vcloud.xml.SupportedVersionsHandler;
-
-import com.google.common.util.concurrent.ListenableFuture;
-
-/**
- * Establishes a context with a VCloud endpoint.
- *
- *
- * @see
- * @author Adrian Cole
- */
-public interface VCloudVersionsAsyncClient extends Closeable {
-
- /**
- * Retrieve information for supported versions
- */
- @GET
- @XMLResponseParser(SupportedVersionsHandler.class)
- @Path("/versions")
- ListenableFuture> getSupportedVersions();
-}
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/compute/strategy/InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/compute/strategy/InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn.java
index 64da5738f1..e9da2e0a1a 100644
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/compute/strategy/InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn.java
+++ b/apis/vcloud/src/main/java/org/jclouds/vcloud/compute/strategy/InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn.java
@@ -42,7 +42,7 @@ import org.jclouds.ovf.Network;
import org.jclouds.predicates.validators.DnsNameValidator;
import org.jclouds.rest.annotations.BuildVersion;
import org.jclouds.vcloud.TaskStillRunningException;
-import org.jclouds.vcloud.VCloudClient;
+import org.jclouds.vcloud.VCloudApi;
import org.jclouds.vcloud.compute.options.VCloudTemplateOptions;
import org.jclouds.vcloud.domain.GuestCustomizationSection;
import org.jclouds.vcloud.domain.NetworkConnection;
@@ -71,7 +71,7 @@ public class InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployA
@Named(ComputeServiceConstants.COMPUTE_LOGGER)
protected Logger logger = Logger.NULL;
- protected final VCloudClient client;
+ protected final VCloudApi client;
protected final Predicate successTester;
protected final LoadingCache vAppTemplates;
protected final NetworkConfigurationForNetworkAndOptions networkConfigurationForNetworkAndOptions;
@@ -79,7 +79,7 @@ public class InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployA
@Inject
- protected InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn(VCloudClient client,
+ protected InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn(VCloudApi client,
Predicate successTester, LoadingCache vAppTemplates, NetworkConfigurationForNetworkAndOptions networkConfigurationForNetworkAndOptions,
@BuildVersion String buildVersion) {
this.client = client;
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/compute/strategy/VCloudComputeServiceAdapter.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/compute/strategy/VCloudComputeServiceAdapter.java
index 6627c47893..efa8e3ae0a 100644
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/compute/strategy/VCloudComputeServiceAdapter.java
+++ b/apis/vcloud/src/main/java/org/jclouds/vcloud/compute/strategy/VCloudComputeServiceAdapter.java
@@ -38,7 +38,7 @@ import org.jclouds.ovf.Envelope;
import org.jclouds.util.Throwables2;
import org.jclouds.vcloud.TaskInErrorStateException;
import org.jclouds.vcloud.TaskStillRunningException;
-import org.jclouds.vcloud.VCloudClient;
+import org.jclouds.vcloud.VCloudApi;
import org.jclouds.vcloud.VCloudMediaType;
import org.jclouds.vcloud.domain.Org;
import org.jclouds.vcloud.domain.ReferenceType;
@@ -54,10 +54,9 @@ import com.google.common.base.Predicate;
import com.google.common.base.Supplier;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSet.Builder;
-import com.google.common.collect.Iterables;
/**
- * defines the connection between the {@link VCloudClient} implementation and the jclouds
+ * defines the connection between the {@link org.jclouds.vcloud.VCloudApi} implementation and the jclouds
* {@link ComputeService}
*
*/
@@ -68,7 +67,7 @@ public class VCloudComputeServiceAdapter implements ComputeServiceAdapter successTester;
protected final InstantiateVAppTemplateWithGroupEncodedIntoNameThenCustomizeDeployAndPowerOn booter;
protected final Supplier