From 9acfa880d493e009437c60666f04a439be8cafa3 Mon Sep 17 00:00:00 2001 From: Andrew Donald Kennedy Date: Sun, 12 Aug 2012 12:29:36 +0100 Subject: [PATCH] openstack-nova extensibility --- .../openstack/nova/v2_0/config/NovaRestClientModule.java | 6 +++--- .../jclouds/openstack/nova/v2_0/features/ExtensionApi.java | 2 +- .../openstack/nova/v2_0/features/ExtensionAsyncApi.java | 4 ++-- .../org/jclouds/openstack/nova/v2_0/features/FlavorApi.java | 2 +- .../openstack/nova/v2_0/features/FlavorAsyncApi.java | 2 +- .../org/jclouds/openstack/nova/v2_0/features/ImageApi.java | 2 +- .../jclouds/openstack/nova/v2_0/features/ImageAsyncApi.java | 2 +- .../org/jclouds/openstack/nova/v2_0/features/ServerApi.java | 2 +- .../openstack/nova/v2_0/features/ServerAsyncApi.java | 2 +- ...nnotationNamespaceEqualsAnyNamespaceInExtensionsSet.java | 4 ++-- .../openstack/nova/v2_0/features/ExtensionApiLiveTest.java | 2 +- .../openstack/nova/v2_0/features/FlavorApiLiveTest.java | 2 +- .../openstack/nova/v2_0/features/ImageApiLiveTest.java | 2 +- .../openstack/nova/v2_0/features/ServerApiLiveTest.java | 2 +- 14 files changed, 18 insertions(+), 18 deletions(-) diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaRestClientModule.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaRestClientModule.java index 579b62390f..a75b52dcb8 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaRestClientModule.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/config/NovaRestClientModule.java @@ -129,12 +129,12 @@ public class NovaRestClientModule ext @Provides @Singleton - public LoadingCache> provideExtensionsByZone(final Provider novaApi) { + public LoadingCache> provideExtensionsByZone(final Provider novaApi) { return CacheBuilder.newBuilder().expireAfterWrite(23, TimeUnit.HOURS) - .build(new CacheLoader>() { + .build(new CacheLoader>() { @Override - public Set load(String key) throws Exception { + public Set load(String key) throws Exception { return novaApi.get().getExtensionApiForZone(key).listExtensions(); } diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ExtensionApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ExtensionApi.java index 08647ca7e9..1b5c4d73cb 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ExtensionApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ExtensionApi.java @@ -42,7 +42,7 @@ public interface ExtensionApi { * * @return all extensions */ - Set listExtensions(); + Set listExtensions(); /** * Extensions may also be queried individually by their unique alias. diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ExtensionAsyncApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ExtensionAsyncApi.java index a2207e49b9..91b012db36 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ExtensionAsyncApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ExtensionAsyncApi.java @@ -59,7 +59,7 @@ public interface ExtensionAsyncApi { @Consumes(MediaType.APPLICATION_JSON) @Path("/extensions") @ExceptionParser(ReturnEmptySetOnNotFoundOr404.class) - ListenableFuture> listExtensions(); + ListenableFuture> listExtensions(); /** * @see ExtensionApi#getExtensionByAlias @@ -69,6 +69,6 @@ public interface ExtensionAsyncApi { @Consumes(MediaType.APPLICATION_JSON) @Path("/extensions/{alias}") @ExceptionParser(ReturnNullOnNotFoundOr404.class) - ListenableFuture getExtensionByAlias(@PathParam("alias") String id); + ListenableFuture getExtensionByAlias(@PathParam("alias") String id); } diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/FlavorApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/FlavorApi.java index 8bb523caad..5eb5cc69ed 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/FlavorApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/FlavorApi.java @@ -43,7 +43,7 @@ public interface FlavorApi { * * @return all flavors (IDs, names, links) */ - Set listFlavors(); + Set listFlavors(); /** * List all flavors (all details) diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/FlavorAsyncApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/FlavorAsyncApi.java index ac010c2eb7..632f888668 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/FlavorAsyncApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/FlavorAsyncApi.java @@ -61,7 +61,7 @@ public interface FlavorAsyncApi { @Consumes(MediaType.APPLICATION_JSON) @Path("/flavors") @ExceptionParser(ReturnEmptySetOnNotFoundOr404.class) - ListenableFuture> listFlavors(); + ListenableFuture> listFlavors(); /** * @see FlavorApi#listFlavorsInDetail diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ImageApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ImageApi.java index dc31674d38..89fe3e38d5 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ImageApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ImageApi.java @@ -43,7 +43,7 @@ public interface ImageApi { * * @return all images (IDs, names, links) */ - Set listImages(); + Set listImages(); /** * List all images (all details) diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ImageAsyncApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ImageAsyncApi.java index 0c623d3866..40fbc949b6 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ImageAsyncApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ImageAsyncApi.java @@ -59,7 +59,7 @@ public interface ImageAsyncApi { @Consumes(MediaType.APPLICATION_JSON) @Path("/images") @ExceptionParser(ReturnEmptySetOnNotFoundOr404.class) - ListenableFuture> listImages(); + ListenableFuture> listImages(); /** * @see ImageApi#listImagesInDetail diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ServerApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ServerApi.java index 8b476a669e..1378b18856 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ServerApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ServerApi.java @@ -47,7 +47,7 @@ public interface ServerApi { * * @return all servers (IDs, names, links) */ - Set listServers(); + Set listServers(); /** * List all servers (all details) diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ServerAsyncApi.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ServerAsyncApi.java index 28db18398b..c1d7a7b79b 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ServerAsyncApi.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ServerAsyncApi.java @@ -76,7 +76,7 @@ public interface ServerAsyncApi { @Consumes(MediaType.APPLICATION_JSON) @Path("/servers") @ExceptionParser(ReturnEmptySetOnNotFoundOr404.class) - ListenableFuture> listServers(); + ListenableFuture> listServers(); /** * @see ServerApi#listServersInDetail diff --git a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/functions/PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSet.java b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/functions/PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSet.java index 183d5c60b0..2656b978dc 100644 --- a/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/functions/PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSet.java +++ b/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/functions/PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSet.java @@ -51,7 +51,7 @@ import com.google.common.collect.Multimap; @Singleton public class PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSet implements ImplicitOptionalConverter { - private final LoadingCache> extensions; + private final LoadingCache> extensions; @com.google.inject.Inject(optional=true) @Named("openstack.nova.extensions") @@ -88,7 +88,7 @@ public class PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensio @Inject public PresentWhenExtensionAnnotationNamespaceEqualsAnyNamespaceInExtensionsSet( - LoadingCache> extensions) { + LoadingCache> extensions) { this.extensions = checkNotNull(extensions, "extensions"); } diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ExtensionApiLiveTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ExtensionApiLiveTest.java index 67217c5ae3..60d53b0a17 100644 --- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ExtensionApiLiveTest.java +++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ExtensionApiLiveTest.java @@ -44,7 +44,7 @@ public class ExtensionApiLiveTest extends BaseNovaApiLiveTest { public void testListExtensions() throws Exception { for (String zoneId : novaContext.getApi().getConfiguredZones()) { ExtensionApi api = novaContext.getApi().getExtensionApiForZone(zoneId); - Set response = api.listExtensions(); + Set response = api.listExtensions(); assert null != response; assertTrue(response.size() >= 0); for (Extension extension : response) { diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/FlavorApiLiveTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/FlavorApiLiveTest.java index 1374911027..87cc77c60e 100644 --- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/FlavorApiLiveTest.java +++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/FlavorApiLiveTest.java @@ -45,7 +45,7 @@ public class FlavorApiLiveTest extends BaseNovaApiLiveTest { public void testListFlavors() throws Exception { for (String zoneId : novaContext.getApi().getConfiguredZones()) { FlavorApi api = novaContext.getApi().getFlavorApiForZone(zoneId); - Set response = api.listFlavors(); + Set response = api.listFlavors(); assert null != response; assertTrue(response.size() >= 0); for (Resource flavor : response) { diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ImageApiLiveTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ImageApiLiveTest.java index 80237740c3..034666503b 100644 --- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ImageApiLiveTest.java +++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ImageApiLiveTest.java @@ -41,7 +41,7 @@ public class ImageApiLiveTest extends BaseNovaApiLiveTest { public void testListImages() throws Exception { for (String zoneId : novaContext.getApi().getConfiguredZones()) { ImageApi api = novaContext.getApi().getImageApiForZone(zoneId); - Set response = api.listImages(); + Set response = api.listImages(); assertNotNull(response); assertTrue(response.size() >= 0); for (Resource image : response) { diff --git a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ServerApiLiveTest.java b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ServerApiLiveTest.java index 1a02473c52..f15604d8ee 100644 --- a/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ServerApiLiveTest.java +++ b/apis/openstack-nova/src/test/java/org/jclouds/openstack/nova/v2_0/features/ServerApiLiveTest.java @@ -40,7 +40,7 @@ public class ServerApiLiveTest extends BaseNovaApiLiveTest { public void testListServersInDetail() throws Exception { for (String zoneId : novaContext.getApi().getConfiguredZones()) { ServerApi api = novaContext.getApi().getServerApiForZone(zoneId); - Set response = api.listServers(); + Set response = api.listServers(); assert null != response; assertTrue(response.size() >= 0); for (Resource server : response) {