diff --git a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/NovaAsyncClient.java b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/NovaAsyncClient.java
index 0eb81ac7ab..f9f51ccc62 100644
--- a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/NovaAsyncClient.java
+++ b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/NovaAsyncClient.java
@@ -41,7 +41,8 @@ import com.google.inject.Provides;
*
*
* @see NovaClient
- * @see
+ * @see
* @author Adrian Cole
*/
public interface NovaAsyncClient {
@@ -53,53 +54,53 @@ public interface NovaAsyncClient {
@Provides
@Region
Set getConfiguredRegions();
-
+
/**
* Provides asynchronous access to Server features.
*/
@Delegate
ServerAsyncClient getServerClientForRegion(
- @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
-
+ @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
+
/**
* Provides asynchronous access to Flavor features.
*/
@Delegate
FlavorAsyncClient getFlavorClientForRegion(
- @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
-
+ @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
+
/**
* Provides asynchronous access to Extension features.
*/
@Delegate
ExtensionAsyncClient getExtensionClientForRegion(
- @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
+ @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
/**
* Provides asynchronous access to Image features.
*/
@Delegate
ImageAsyncClient getImageClientForRegion(
- @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
+ @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
/**
* Provides asynchronous access to Floating IP features.
*/
@Delegate
Optional getFloatingIPExtensionForRegion(
- @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
+ @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
/**
* Provides asynchronous access to Security Group features.
*/
@Delegate
Optional getSecurityGroupClientForRegion(
- @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
+ @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
/**
* Provides asynchronous access to Key Pair features.
*/
@Delegate
Optional getKeyPairClientForRegion(
- @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
+ @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
}
diff --git a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/NovaClient.java b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/NovaClient.java
index e2e899e48b..35f65c6d8b 100644
--- a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/NovaClient.java
+++ b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/NovaClient.java
@@ -43,7 +43,8 @@ import com.google.inject.Provides;
*
*
* @see NovaAsyncClient
- * @see
+ * @see
* @author Adrian Cole
*/
@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
@@ -55,54 +56,54 @@ public interface NovaClient {
@Provides
@Region
Set getConfiguredRegions();
-
+
/**
* Provides synchronous access to Server features.
*/
@Delegate
ServerClient getServerClientForRegion(
- @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
+ @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
/**
* Provides synchronous access to Flavor features.
*/
@Delegate
FlavorClient getFlavorClientForRegion(
- @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
+ @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
/**
* Provides synchronous access to Extension features.
*/
@Delegate
ExtensionClient getExtensionClientForRegion(
- @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
-
+ @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
+
/**
* Provides synchronous access to Image features.
*/
@Delegate
ImageClient getImageClientForRegion(
- @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
+ @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
/**
* Provides synchronous access to Floating IP features.
*/
@Delegate
Optional getFloatingIPExtensionForRegion(
- @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
+ @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
/**
* Provides synchronous access to Security Group features.
*/
@Delegate
SecurityGroupClient getSecurityGroupClientForRegion(
- @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
+ @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
/**
* Provides synchronous access to Key Pair features.
*/
@Delegate
KeyPairClient getKeyPairClientForRegion(
- @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
+ @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region);
}
diff --git a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/NovaContextBuilder.java b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/NovaContextBuilder.java
index 89983f6f88..08eb18e0a4 100644
--- a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/NovaContextBuilder.java
+++ b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/NovaContextBuilder.java
@@ -29,11 +29,10 @@ import com.google.inject.Module;
/**
* A context builder for getting nova clients.
- *
+ *
* @author Adrian Cole
*/
-public class NovaContextBuilder extends ComputeServiceContextBuilder
-{
+public class NovaContextBuilder extends ComputeServiceContextBuilder {
public NovaContextBuilder(Properties props) {
super(NovaClient.class, NovaAsyncClient.class, props);
diff --git a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/compute/NovaComputeServiceAdapter.java b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/compute/NovaComputeServiceAdapter.java
index 890d807d4c..5cb9b7a535 100644
--- a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/compute/NovaComputeServiceAdapter.java
+++ b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/compute/NovaComputeServiceAdapter.java
@@ -42,12 +42,12 @@ import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
/**
- * The adapter used by the NovaComputeServiceContextModule to interface the nova-specific domain model to the computeService generic domain model.
- *
+ * The adapter used by the NovaComputeServiceContextModule to interface the
+ * nova-specific domain model to the computeService generic domain model.
+ *
* @author Matt Stephenson
*/
-public class NovaComputeServiceAdapter implements ComputeServiceAdapter
-{
+public class NovaComputeServiceAdapter implements ComputeServiceAdapter {
private final NovaClient novaClient;
private final ServerClient defaultLocationServerClient;
@@ -55,15 +55,13 @@ public class NovaComputeServiceAdapter implements ComputeServiceAdapter regions;
-
@Inject
- public NovaComputeServiceAdapter(NovaClient novaClient)
- {
+ public NovaComputeServiceAdapter(NovaClient novaClient) {
this.novaClient = novaClient;
regions = novaClient.getConfiguredRegions();
- if (regions.isEmpty())
- {
- throw new IllegalStateException("No regions exist for this compute service. The Nova compute service requires at least 1 region.");
+ if (regions.isEmpty()) {
+ throw new IllegalStateException(
+ "No regions exist for this compute service. The Nova compute service requires at least 1 region.");
}
String region = regions.iterator().next();
this.defaultLocationServerClient = novaClient.getServerClientForRegion(region);
@@ -72,78 +70,68 @@ public class NovaComputeServiceAdapter implements ComputeServiceAdapter createNodeWithGroupEncodedIntoName(String tag, String name, Template template)
- {
- ServerClient serverClient = template.getLocation() != null ? novaClient.getServerClientForRegion(template.getLocation().getId()) : defaultLocationServerClient;
+ public NodeAndInitialCredentials createNodeWithGroupEncodedIntoName(String tag, String name,
+ Template template) {
+ ServerClient serverClient = template.getLocation() != null ? novaClient.getServerClientForRegion(template
+ .getLocation().getId()) : defaultLocationServerClient;
// TODO: make NovaTemplateOptions with the following:
// security group, key pair, floating ip (attach post server-create?)
Server server = serverClient.createServer(name, template.getImage().getId(), template.getHardware().getId());
- return new NodeAndInitialCredentials(server, server.getId() + "", LoginCredentials.builder().password(server.getAdminPass()).build());
+ return new NodeAndInitialCredentials(server, server.getId() + "", LoginCredentials.builder()
+ .password(server.getAdminPass()).build());
}
@Override
- public Iterable listHardwareProfiles()
- {
+ public Iterable listHardwareProfiles() {
return defaultFlavorClient.listFlavorsInDetail();
}
@Override
- public Iterable listImages()
- {
+ public Iterable listImages() {
return defaultImageClient.listImagesInDetail();
}
@Override
- public Iterable listLocations()
- {
- return Iterables.transform(novaClient.getConfiguredRegions(), new Function()
- {
+ public Iterable listLocations() {
+ return Iterables.transform(novaClient.getConfiguredRegions(), new Function() {
@Override
- public Location apply(@Nullable String region)
- {
+ public Location apply(@Nullable String region) {
return new LocationBuilder().id(region).description(region).build();
}
});
}
@Override
- public Server getNode(String id)
- {
+ public Server getNode(String id) {
return defaultLocationServerClient.getServer(id);
}
@Override
- public void destroyNode(String id)
- {
+ public void destroyNode(String id) {
defaultLocationServerClient.deleteServer(id);
}
@Override
- public void rebootNode(String id)
- {
+ public void rebootNode(String id) {
defaultLocationServerClient.rebootServer(id, RebootType.SOFT);
}
@Override
- public void resumeNode(String id)
- {
+ public void resumeNode(String id) {
throw new UnsupportedOperationException("suspend not supported");
}
@Override
- public void suspendNode(String id)
- {
+ public void suspendNode(String id) {
throw new UnsupportedOperationException("suspend not supported");
}
@Override
- public Iterable listNodes()
- {
+ public Iterable listNodes() {
ImmutableSet.Builder servers = new ImmutableSet.Builder();
- for (String region : regions)
- {
+ for (String region : regions) {
servers.addAll(novaClient.getServerClientForRegion(region).listServersInDetail());
}
diff --git a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/compute/config/NovaComputeServiceContextModule.java b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/compute/config/NovaComputeServiceContextModule.java
index 7304183ebb..39bce289a3 100644
--- a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/compute/config/NovaComputeServiceContextModule.java
+++ b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/compute/config/NovaComputeServiceContextModule.java
@@ -41,32 +41,37 @@ import com.google.inject.TypeLiteral;
/**
* Module for building a compute service context for Nova
- *
+ *
* @author Matt Stephenson
*/
-public class NovaComputeServiceContextModule extends
- ComputeServiceAdapterContextModule
-{
- public NovaComputeServiceContextModule()
- {
+public class NovaComputeServiceContextModule
+ extends
+ ComputeServiceAdapterContextModule {
+ public NovaComputeServiceContextModule() {
super(NovaClient.class, NovaAsyncClient.class);
}
@SuppressWarnings("unchecked")
@Override
- protected void configure()
- {
+ protected void configure() {
super.configure();
- bind(new TypeLiteral>(){}).to(NovaComputeServiceAdapter.class);
+ bind(
+ new TypeLiteral>() {
+ }).to(NovaComputeServiceAdapter.class);
- bind(new TypeLiteral>(){}).to(ServerToNodeMetadata.class);
+ bind(new TypeLiteral>() {
+ }).to(ServerToNodeMetadata.class);
- bind(new TypeLiteral>(){}).to(NovaImageToImage.class);
- bind(new TypeLiteral>(){}).to(NovaImageToOperatingSystem.class);
+ bind(new TypeLiteral>() {
+ }).to(NovaImageToImage.class);
+ bind(new TypeLiteral>() {
+ }).to(NovaImageToOperatingSystem.class);
- bind(new TypeLiteral>(){}).to(FlavorToHardware.class);
+ bind(new TypeLiteral>() {
+ }).to(FlavorToHardware.class);
// we aren't converting location from a provider-specific type
- bind(new TypeLiteral>(){}).to((Class)IdentityFunction.class);
+ bind(new TypeLiteral>() {
+ }).to((Class) IdentityFunction.class);
}
}
\ No newline at end of file
diff --git a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/compute/functions/FlavorToHardware.java b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/compute/functions/FlavorToHardware.java
index 858b899130..c112ace145 100644
--- a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/compute/functions/FlavorToHardware.java
+++ b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/compute/functions/FlavorToHardware.java
@@ -31,33 +31,27 @@ import com.google.common.base.Function;
import com.google.common.base.Supplier;
/**
- * A function for transforming the nova specific Flavor object to the generic Hardware object.
- *
+ * A function for transforming the nova specific Flavor object to the generic
+ * Hardware object.
+ *
* @author Matt Stephenson
*/
-public class FlavorToHardware implements Function
-{
-
+public class FlavorToHardware implements Function {
+
private final Supplier defaultLocation;
@Inject
- public FlavorToHardware(Supplier defaultLocation)
- {
+ public FlavorToHardware(Supplier defaultLocation) {
this.defaultLocation = defaultLocation;
}
@Override
- public Hardware apply(Flavor flavor)
- {
+ public Hardware apply(Flavor flavor) {
return new HardwareBuilder()
- // TODO: scope id to region, if there's a chance for conflict
- .id(flavor.getId())
- .providerId(flavor.getId())
- .name(flavor.getName())
- .ram(flavor.getRam())
- .processor(new Processor(flavor.getVcpus(), 1.0))
- .volume(new VolumeImpl(Float.valueOf(flavor.getDisk()), true, true))
- .location(defaultLocation.get())
- .build();
+ // TODO: scope id to region, if there's a chance for conflict
+ .id(flavor.getId()).providerId(flavor.getId()).name(flavor.getName()).ram(flavor.getRam())
+ .processor(new Processor(flavor.getVcpus(), 1.0))
+ .volume(new VolumeImpl(Float.valueOf(flavor.getDisk()), true, true)).location(defaultLocation.get())
+ .build();
}
}
diff --git a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/compute/functions/NovaImageToImage.java b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/compute/functions/NovaImageToImage.java
index e2fd03802c..df91f0d7c2 100644
--- a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/compute/functions/NovaImageToImage.java
+++ b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/compute/functions/NovaImageToImage.java
@@ -29,33 +29,27 @@ import com.google.common.base.Function;
import com.google.common.base.Supplier;
/**
- * A function for transforming a nova-specific Image into a generic Image object.
- *
+ * A function for transforming a nova-specific Image into a generic Image
+ * object.
+ *
* @author Matt Stephenson
*/
-public class NovaImageToImage implements Function
-{
+public class NovaImageToImage implements Function {
private final Function imageToOs;
private final Supplier defaultLocation;
@Inject
- public NovaImageToImage(Function imageToOs, Supplier defaultLocation)
- {
+ public NovaImageToImage(Function imageToOs,
+ Supplier defaultLocation) {
this.imageToOs = imageToOs;
this.defaultLocation = defaultLocation;
}
@Override
- public Image apply(org.jclouds.openstack.nova.v1_1.domain.Image image)
- {
+ public Image apply(org.jclouds.openstack.nova.v1_1.domain.Image image) {
return new ImageBuilder()
- // TODO: scope id to region, if there's a chance for conflict
- .id(image.getId())
- .providerId(image.getId())
- .name(image.getName())
- .operatingSystem(imageToOs.apply(image))
- .description(image.getName())
- .location(defaultLocation.get())
- .build();
+ // TODO: scope id to region, if there's a chance for conflict
+ .id(image.getId()).providerId(image.getId()).name(image.getName()).operatingSystem(imageToOs.apply(image))
+ .description(image.getName()).location(defaultLocation.get()).build();
}
}
diff --git a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/compute/functions/NovaImageToOperatingSystem.java b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/compute/functions/NovaImageToOperatingSystem.java
index 4ae42910d5..6e79b1f8ba 100644
--- a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/compute/functions/NovaImageToOperatingSystem.java
+++ b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/compute/functions/NovaImageToOperatingSystem.java
@@ -43,12 +43,12 @@ import com.google.common.base.Splitter;
import com.google.common.collect.Iterables;
/**
- * A function for transforming a nova specific Image into a generic OperatingSystem object.
- *
+ * A function for transforming a nova specific Image into a generic
+ * OperatingSystem object.
+ *
* @author Matt Stephenson
*/
-public class NovaImageToOperatingSystem implements Function
-{
+public class NovaImageToOperatingSystem implements Function {
public static final Pattern DEFAULT_PATTERN = Pattern.compile("(([^ ]*) ([0-9.]+) ?.*)");
// Windows Server 2008 R2 x64
public static final Pattern WINDOWS_PATTERN = Pattern.compile("Windows (.*) (x[86][64])");
@@ -60,13 +60,11 @@ public class NovaImageToOperatingSystem implements Function> osVersionMap;
@Inject
- public NovaImageToOperatingSystem(Map> osVersionMap)
- {
+ public NovaImageToOperatingSystem(Map> osVersionMap) {
this.osVersionMap = osVersionMap;
}
- public OperatingSystem apply(final Image from)
- {
+ public OperatingSystem apply(final Image from) {
OsFamily osFamily = null;
String osVersion = null;
@@ -74,42 +72,31 @@ public class NovaImageToOperatingSystem implements Function imageNameParts = Splitter.on(CharMatcher.WHITESPACE).trimResults().split(imageName.toLowerCase());
+ } else {
+ final Iterable imageNameParts = Splitter.on(CharMatcher.WHITESPACE).trimResults()
+ .split(imageName.toLowerCase());
- osFamily = Iterables.find(Arrays.asList(OsFamily.values()), new Predicate()
- {
+ osFamily = Iterables.find(Arrays.asList(OsFamily.values()), new Predicate() {
@Override
- public boolean apply(@Nullable OsFamily osFamily)
- {
+ public boolean apply(@Nullable OsFamily osFamily) {
return Iterables.any(imageNameParts, Predicates.equalTo(osFamily.name().toLowerCase()));
}
});
}
Matcher matcher = DEFAULT_PATTERN.matcher(imageName);
- if (matcher.find() && matcher.groupCount() >= 3)
- {
+ if (matcher.find() && matcher.groupCount() >= 3) {
osVersion = ComputeServiceUtils.parseVersionOrReturnEmptyString(osFamily, matcher.group(3), osVersionMap);
}
}
diff --git a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/compute/functions/ServerToNodeMetadata.java b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/compute/functions/ServerToNodeMetadata.java
index a1fb477dd0..cc75099af7 100644
--- a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/compute/functions/ServerToNodeMetadata.java
+++ b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/compute/functions/ServerToNodeMetadata.java
@@ -18,8 +18,6 @@
*/
package org.jclouds.openstack.nova.v1_1.compute.functions;
-import java.util.Map;
-
import org.jclouds.compute.domain.NodeMetadata;
import org.jclouds.compute.domain.NodeMetadataBuilder;
import org.jclouds.openstack.nova.v1_1.domain.Address;
@@ -30,33 +28,30 @@ import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables;
/**
- * A function for transforming a nova-specific Server into a generic NodeMetadata object.
- *
+ * A function for transforming a nova-specific Server into a generic
+ * NodeMetadata object.
+ *
* @author Matt Stephenson
*/
-public class ServerToNodeMetadata implements Function
-{
+public class ServerToNodeMetadata implements Function {
@Override
- public NodeMetadata apply(Server server)
- {
+ public NodeMetadata apply(Server server) {
return new NodeMetadataBuilder()
- // TODO: scope id to region, if there's a chance for conflict
- .id(server.getId())
- .providerId(server.getId())
- .name(server.getName())
- .publicAddresses(Iterables.transform(server.getPublicAddresses(), new AddressToStringTransformationFunction()))
- .privateAddresses(Iterables.transform(server.getPrivateAddresses(), new AddressToStringTransformationFunction()))
- .state(server.getStatus().getNodeState())
- .userMetadata(ImmutableMap.copyOf(server.getMetadata()))
- .build();
+ // TODO: scope id to region, if there's a chance for conflict
+ .id(server.getId())
+ .providerId(server.getId())
+ .name(server.getName())
+ .publicAddresses(
+ Iterables.transform(server.getPublicAddresses(), new AddressToStringTransformationFunction()))
+ .privateAddresses(
+ Iterables.transform(server.getPrivateAddresses(), new AddressToStringTransformationFunction()))
+ .state(server.getStatus().getNodeState()).userMetadata(ImmutableMap.copyOf(server.getMetadata())).build();
}
- private class AddressToStringTransformationFunction implements Function
- {
+ private class AddressToStringTransformationFunction implements Function {
@Override
- public String apply(Address address)
- {
+ public String apply(Address address) {
return address.getAddr();
}
}
diff --git a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/config/NovaParserModule.java b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/config/NovaParserModule.java
index 3978500918..63209fb4f0 100644
--- a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/config/NovaParserModule.java
+++ b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/config/NovaParserModule.java
@@ -38,8 +38,7 @@ public class NovaParserModule extends AbstractModule {
@Provides
@Singleton
public Map provideCustomAdapterBindings() {
- return ImmutableMap.of(
- );
+ return ImmutableMap. of();
}
@Override
diff --git a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/config/NovaRestClientModule.java b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/config/NovaRestClientModule.java
index 2f57e346c6..0dea102f98 100644
--- a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/config/NovaRestClientModule.java
+++ b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/config/NovaRestClientModule.java
@@ -57,15 +57,16 @@ import com.google.common.collect.ImmutableMap;
@ConfiguresRestClient
public class NovaRestClientModule extends RestClientModule {
- public static final Map, Class>> DELEGATE_MAP = ImmutableMap., Class>> builder()//
- .put(ServerClient.class, ServerAsyncClient.class)//
- .put(FlavorClient.class, FlavorAsyncClient.class)
- .put(ImageClient.class, ImageAsyncClient.class)
- .put(ExtensionClient.class, ExtensionAsyncClient.class)
- .put(FloatingIPClient.class, FloatingIPAsyncClient.class)
- .put(SecurityGroupClient.class, SecurityGroupAsyncClient.class)
- .put(KeyPairClient.class, KeyPairAsyncClient.class)
- .build();
+ public static final Map, Class>> DELEGATE_MAP = ImmutableMap
+ ., Class>> builder()
+ //
+ .put(ServerClient.class, ServerAsyncClient.class)
+ //
+ .put(FlavorClient.class, FlavorAsyncClient.class).put(ImageClient.class, ImageAsyncClient.class)
+ .put(ExtensionClient.class, ExtensionAsyncClient.class)
+ .put(FloatingIPClient.class, FloatingIPAsyncClient.class)
+ .put(SecurityGroupClient.class, SecurityGroupAsyncClient.class)
+ .put(KeyPairClient.class, KeyPairAsyncClient.class).build();
public NovaRestClientModule() {
super(NovaClient.class, NovaAsyncClient.class, DELEGATE_MAP);
@@ -80,8 +81,10 @@ public class NovaRestClientModule extends RestClientModule
*/
public class Extension extends Resource {
@@ -78,7 +80,7 @@ public class Extension extends Resource {
public Builder fromExtension(Extension in) {
return fromResource(in).namespace(in.getNamespace()).alias(in.getAlias()).updated(in.getUpdated())
- .description(in.getDescription());
+ .description(in.getDescription());
}
/**
@@ -119,8 +121,7 @@ public class Extension extends Resource {
private Date updated;
private String description;
- protected Extension(String name, Set links, URI namespace, String alias, Date updated,
- String description) {
+ protected Extension(String name, Set links, URI namespace, String alias, Date updated, String description) {
super(alias, name, links);
this.namespace = namespace;
this.alias = alias;
@@ -131,7 +132,7 @@ public class Extension extends Resource {
public URI getNamespace() {
return this.namespace;
}
-
+
@Override
public String getId() {
return this.alias;
@@ -151,8 +152,8 @@ public class Extension extends Resource {
@Override
public String toString() {
- return toStringHelper("").add("id", getId()).add("name", name).add("links", links).add("namespace", namespace).add(
- "alias", alias).add("updated", updated).add("description", description).toString();
+ return toStringHelper("").add("id", getId()).add("name", name).add("links", links).add("namespace", namespace)
+ .add("alias", alias).add("updated", updated).add("description", description).toString();
}
}
diff --git a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/Flavor.java b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/Flavor.java
index a9d97767aa..1c372ddeee 100644
--- a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/Flavor.java
+++ b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/Flavor.java
@@ -58,12 +58,12 @@ public class Flavor extends Resource {
this.disk = disk;
return this;
}
-
+
public Builder vcpus(int vcpus) {
this.vcpus = vcpus;
return this;
}
-
+
public Flavor build() {
return new Flavor(id, name, links, ram, disk, vcpus);
}
@@ -109,8 +109,7 @@ public class Flavor extends Resource {
private int disk;
private int vcpus;
- protected Flavor(String id, String name, Set links, int ram, int disk,
- int vcpus) {
+ protected Flavor(String id, String name, Set links, int ram, int disk, int vcpus) {
super(id, name, links);
this.ram = ram;
this.disk = disk;
@@ -131,8 +130,7 @@ public class Flavor extends Resource {
@Override
public String toString() {
- return toStringHelper("").add("id", id).add("name", name)
- .add("links", links).add("ram", ram).add("disk", disk)
+ return toStringHelper("").add("id", id).add("name", name).add("links", links).add("ram", ram).add("disk", disk)
.add("vcpus", vcpus).toString();
}
diff --git a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/FloatingIP.java b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/FloatingIP.java
index ebbbe6eb82..4bef33f85e 100644
--- a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/FloatingIP.java
+++ b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/FloatingIP.java
@@ -25,8 +25,9 @@ import org.jclouds.javax.annotation.Nullable;
import com.google.gson.annotations.SerializedName;
/**
- * A Floating IP is an IP address that can be created and associated with a Server instance.
- * Floating IPs can also be disassociated and deleted from a Server instance.
+ * A Floating IP is an IP address that can be created and associated with a
+ * Server instance. Floating IPs can also be disassociated and deleted from a
+ * Server instance.
*
* @author Jeremy Daggett
* @author chamerling
@@ -71,8 +72,7 @@ public class FloatingIP implements Comparable {
}
public Builder fromFloatingIp(FloatingIP in) {
- return id(in.getId()).ip(in.getIp()).fixedIp(in.getFixedIp())
- .instanceId(in.getInstanceId());
+ return id(in.getId()).ip(in.getIp()).fixedIp(in.getFixedIp()).instanceId(in.getInstanceId());
}
}
@@ -84,8 +84,7 @@ public class FloatingIP implements Comparable {
@SerializedName("instance_id")
private String instanceId;
- protected FloatingIP(String id, String ip, @Nullable String fixedIp,
- @Nullable String instanceId) {
+ protected FloatingIP(String id, String ip, @Nullable String fixedIp, @Nullable String instanceId) {
this.id = id;
this.ip = ip;
this.fixedIp = fixedIp;
@@ -119,8 +118,7 @@ public class FloatingIP implements Comparable {
int result = 1;
result = prime * result + ((fixedIp == null) ? 0 : fixedIp.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
- result = prime * result
- + ((instanceId == null) ? 0 : instanceId.hashCode());
+ result = prime * result + ((instanceId == null) ? 0 : instanceId.hashCode());
result = prime * result + ((ip == null) ? 0 : ip.hashCode());
return result;
}
@@ -159,8 +157,8 @@ public class FloatingIP implements Comparable {
@Override
public String toString() {
- return toStringHelper("").add("id", id).add("ip", ip)
- .add("fixedIp", fixedIp).add("instanceId", instanceId).toString();
+ return toStringHelper("").add("id", id).add("ip", ip).add("fixedIp", fixedIp).add("instanceId", instanceId)
+ .toString();
}
-
+
}
diff --git a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/Image.java b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/Image.java
index 328844d91c..e9e025bd8a 100644
--- a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/Image.java
+++ b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/Image.java
@@ -113,15 +113,13 @@ public class Image extends Resource {
}
public Image build() {
- return new Image(id, name, links, updated, created, tenantId, userId,
- status, progress, minDisk, minRam, server, metadata);
+ return new Image(id, name, links, updated, created, tenantId, userId, status, progress, minDisk, minRam,
+ server, metadata);
}
public Builder fromImage(Image in) {
- return fromResource(in).status(in.getStatus())
- .updated(in.getUpdated()).created(in.getCreated())
- .progress(in.getProgress()).server(in.getServer())
- .metadata(in.getMetadata());
+ return fromResource(in).status(in.getStatus()).updated(in.getUpdated()).created(in.getCreated())
+ .progress(in.getProgress()).server(in.getServer()).metadata(in.getMetadata());
}
/**
@@ -170,10 +168,8 @@ public class Image extends Resource {
private Resource server;
private Map metadata = Maps.newHashMap();
- protected Image(String id, String name, Set links, Date updated,
- Date created, String tenantId, String userId, ImageStatus status,
- int progress, int minDisk, int minRam, Resource server,
- Map metadata) {
+ protected Image(String id, String name, Set links, Date updated, Date created, String tenantId, String userId,
+ ImageStatus status, int progress, int minDisk, int minRam, Resource server, Map metadata) {
super(id, name, links);
this.updated = updated;
this.created = created;
@@ -229,12 +225,9 @@ public class Image extends Resource {
@Override
public String toString() {
- return toStringHelper("").add("id", id).add("name", name)
- .add("links", links).add("updated", updated)
- .add("created", created).add("tenantId", tenantId)
- .add("userId", userId).add("status", status)
- .add("progress", progress).add("minDisk", minDisk)
- .add("minRam", minRam).add("server", server)
+ return toStringHelper("").add("id", id).add("name", name).add("links", links).add("updated", updated)
+ .add("created", created).add("tenantId", tenantId).add("userId", userId).add("status", status)
+ .add("progress", progress).add("minDisk", minDisk).add("minRam", minRam).add("server", server)
.add("metadata", metadata).toString();
}
diff --git a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/KeyPair.java b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/KeyPair.java
index 35a7a5ade1..e48111a27c 100644
--- a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/KeyPair.java
+++ b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/KeyPair.java
@@ -24,7 +24,7 @@ import org.jclouds.javax.annotation.Nullable;
import com.google.gson.annotations.SerializedName;
-public class KeyPair implements Comparable{
+public class KeyPair implements Comparable {
public static Builder builder() {
return new Builder();
}
@@ -71,8 +71,7 @@ public class KeyPair implements Comparable{
}
public Builder fromKeyPair(KeyPair in) {
- return publicKey(in.getPublicKey()).privateKey(in.getPrivateKey())
- .userId(in.getUserId()).name(in.getName())
+ return publicKey(in.getPublicKey()).privateKey(in.getPrivateKey()).userId(in.getUserId()).name(in.getName())
.fingerprint(in.getFingerprint());
}
@@ -87,8 +86,7 @@ public class KeyPair implements Comparable{
String name;
String fingerprint;
- protected KeyPair(String publicKey, String privateKey,
- @Nullable String userId, String name, String fingerprint) {
+ protected KeyPair(String publicKey, String privateKey, @Nullable String userId, String name, String fingerprint) {
this.publicKey = publicKey;
this.privateKey = privateKey;
this.userId = userId;
@@ -116,59 +114,57 @@ public class KeyPair implements Comparable{
return this.fingerprint;
}
- @Override
- public int compareTo(KeyPair o) {
- return this.fingerprint.compareTo(o.getFingerprint());
- }
+ @Override
+ public int compareTo(KeyPair o) {
+ return this.fingerprint.compareTo(o.getFingerprint());
+ }
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((publicKey == null) ? 0 : publicKey.hashCode());
- result = prime * result + ((privateKey == null) ? 0 : privateKey.hashCode());
- result = prime * result
- + ((name == null) ? 0 : name.hashCode());
- result = prime * result + ((fingerprint == null) ? 0 : fingerprint.hashCode());
- return result;
- }
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((publicKey == null) ? 0 : publicKey.hashCode());
+ result = prime * result + ((privateKey == null) ? 0 : privateKey.hashCode());
+ result = prime * result + ((name == null) ? 0 : name.hashCode());
+ result = prime * result + ((fingerprint == null) ? 0 : fingerprint.hashCode());
+ return result;
+ }
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ KeyPair other = (KeyPair) obj;
+ if (publicKey == null) {
+ if (other.publicKey != null)
return false;
- if (getClass() != obj.getClass())
+ } else if (!publicKey.equals(other.publicKey))
+ return false;
+ if (privateKey == null) {
+ if (other.privateKey != null)
return false;
- KeyPair other = (KeyPair) obj;
- if (publicKey == null) {
- if (other.publicKey != null)
- return false;
- } else if (!publicKey.equals(other.publicKey))
+ } else if (!privateKey.equals(other.privateKey))
+ return false;
+ if (name == null) {
+ if (other.name != null)
return false;
- if (privateKey == null) {
- if (other.privateKey != null)
- return false;
- } else if (!privateKey.equals(other.privateKey))
+ } else if (!name.equals(other.name))
+ return false;
+ if (fingerprint == null) {
+ if (other.fingerprint != null)
return false;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name))
- return false;
- if (fingerprint == null) {
- if (other.fingerprint != null)
- return false;
- } else if (!fingerprint.equals(other.fingerprint))
- return false;
- return true;
- }
+ } else if (!fingerprint.equals(other.fingerprint))
+ return false;
+ return true;
+ }
@Override
public String toString() {
- return toStringHelper("").add("publicKey", publicKey)
- .add("privateKey", privateKey).add("userId", userId)
+ return toStringHelper("").add("publicKey", publicKey).add("privateKey", privateKey).add("userId", userId)
.add("name", name).add("fingerprint", fingerprint).toString();
}
}
\ No newline at end of file
diff --git a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/SecurityGroup.java b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/SecurityGroup.java
index a2fc8894e8..09dedb722d 100644
--- a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/SecurityGroup.java
+++ b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/SecurityGroup.java
@@ -23,15 +23,14 @@ import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Set;
-import com.google.common.collect.ImmutableSet;
import org.jclouds.javax.annotation.Nullable;
+import com.google.common.collect.ImmutableSet;
import com.google.gson.annotations.SerializedName;
-
/**
* Defines a security group
- *
+ *
*/
public class SecurityGroup {
public static Builder builder() {
@@ -43,7 +42,7 @@ public class SecurityGroup {
}
public static class Builder {
-
+
private String id;
private String tenantId;
private String name;
@@ -69,7 +68,7 @@ public class SecurityGroup {
this.description = description;
return this;
}
-
+
public Builder rules(Set rules) {
this.rules = rules;
return this;
@@ -79,23 +78,22 @@ public class SecurityGroup {
return new SecurityGroup(id, tenantId, name, description, rules);
}
-
public Builder fromSecurityGroup(SecurityGroup in) {
- return id(in.getId()).tenantId(in.getTenantId()).name(in.getName())
- .description(in.getDescription()).rules(in.getRules());
+ return id(in.getId()).tenantId(in.getTenantId()).name(in.getName()).description(in.getDescription())
+ .rules(in.getRules());
}
-
+
}
-
+
protected String id;
@SerializedName("tenant_id")
protected String tenantId;
protected String name;
protected String description;
protected Set rules;
-
- protected SecurityGroup(String id, String tenantId, @Nullable String name,
- @Nullable String description, Set rules) {
+
+ protected SecurityGroup(String id, String tenantId, @Nullable String name, @Nullable String description,
+ Set rules) {
this.id = id;
this.tenantId = tenantId;
this.name = name;
@@ -118,18 +116,16 @@ public class SecurityGroup {
public String getDescription() {
return this.description;
}
-
+
public Set getRules() {
return this.rules;
}
-
-
+
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
- result = prime * result
- + ((description == null) ? 0 : description.hashCode());
+ result = prime * result + ((description == null) ? 0 : description.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((rules == null) ? 0 : rules.hashCode());
@@ -176,9 +172,8 @@ public class SecurityGroup {
@Override
public String toString() {
- return toStringHelper("").add("id", id).add("name", name)
- .add("tenantId", tenantId).add("description", description).add("rules", rules)
- .toString();
+ return toStringHelper("").add("id", id).add("name", name).add("tenantId", tenantId)
+ .add("description", description).add("rules", rules).toString();
}
}
\ No newline at end of file
diff --git a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/SecurityGroupRule.java b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/SecurityGroupRule.java
index c976611e67..7618f3133e 100644
--- a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/SecurityGroupRule.java
+++ b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/SecurityGroupRule.java
@@ -30,7 +30,7 @@ import com.google.gson.annotations.SerializedName;
*
*/
public class SecurityGroupRule implements Comparable {
-
+
public static enum IpProtocol {
TCP, UDP, ICMP, UNRECOGNIZED;
public String value() {
@@ -50,8 +50,7 @@ public class SecurityGroupRule implements Comparable {
}
}
}
-
-
+
public static Builder builder() {
return new Builder();
}
@@ -108,18 +107,15 @@ public class SecurityGroupRule implements Comparable {
}
public SecurityGroupRule build() {
- return new SecurityGroupRule(id, fromPort, group, ipProtocol, toPort,
- parentGroupId, ipRange);
+ return new SecurityGroupRule(id, fromPort, group, ipProtocol, toPort, parentGroupId, ipRange);
}
public Builder fromSecurityGroupRule(SecurityGroupRule in) {
- return id(in.getId()).fromPort(in.getFromPort()).group(in.getGroup())
- .ipProtocol(in.getIpProtocol()).toPort(in.getToPort()).parentGroupId(in.getParentGroupId())
- .ipRange(in.getIpRange());
+ return id(in.getId()).fromPort(in.getFromPort()).group(in.getGroup()).ipProtocol(in.getIpProtocol())
+ .toPort(in.getToPort()).parentGroupId(in.getParentGroupId()).ipRange(in.getIpRange());
}
}
-
protected String id;
@SerializedName(value = "from_port")
@@ -139,10 +135,9 @@ public class SecurityGroupRule implements Comparable {
@SerializedName(value = "ip_range")
protected Map ipRange;
-
-
- protected SecurityGroupRule(String id, int fromPort, Map group,
- IpProtocol ipProtocol, int toPort, String parentGroupId, Map ipRange) {
+
+ protected SecurityGroupRule(String id, int fromPort, Map group, IpProtocol ipProtocol, int toPort,
+ String parentGroupId, Map ipRange) {
this.id = id;
this.fromPort = fromPort;
this.group = group;
@@ -171,20 +166,20 @@ public class SecurityGroupRule implements Comparable {
public int getToPort() {
return this.toPort;
}
-
+
public String getParentGroupId() {
return this.parentGroupId;
}
-
+
public Map getIpRange() {
return this.ipRange;
}
@Override
public int compareTo(SecurityGroupRule o) {
- return this.id.compareTo(o.getId());
+ return this.id.compareTo(o.getId());
}
-
+
@Override
public int hashCode() {
final int prime = 31;
@@ -192,11 +187,9 @@ public class SecurityGroupRule implements Comparable {
result = prime * result + fromPort;
result = prime * result + ((group == null) ? 0 : group.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
- result = prime * result
- + ((ipProtocol == null) ? 0 : ipProtocol.hashCode());
+ result = prime * result + ((ipProtocol == null) ? 0 : ipProtocol.hashCode());
result = prime * result + ((ipRange == null) ? 0 : ipRange.hashCode());
- result = prime * result
- + ((parentGroupId == null) ? 0 : parentGroupId.hashCode());
+ result = prime * result + ((parentGroupId == null) ? 0 : parentGroupId.hashCode());
result = prime * result + toPort;
return result;
}
@@ -241,11 +234,9 @@ public class SecurityGroupRule implements Comparable {
@Override
public String toString() {
- return toStringHelper("").add("id", id).add("fromPort", fromPort)
- .add("group", group).add("ipProtocol", ipProtocol)
- .add("toPort", toPort).add("parentGroupId", parentGroupId)
+ return toStringHelper("").add("id", id).add("fromPort", fromPort).add("group", group)
+ .add("ipProtocol", ipProtocol).add("toPort", toPort).add("parentGroupId", parentGroupId)
.add("ipRange", ipRange).toString();
}
-
}
\ No newline at end of file
diff --git a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/Server.java b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/Server.java
index 2e6e2c770b..a34cc2df98 100644
--- a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/Server.java
+++ b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/Server.java
@@ -45,8 +45,8 @@ import com.google.common.collect.Multimap;
import com.google.gson.annotations.SerializedName;
/**
- * A server is a virtual machine instance in the compute system. Flavor and image are requisite
- * elements when creating a server.
+ * A server is a virtual machine instance in the compute system. Flavor and
+ * image are requisite elements when creating a server.
*
* @author Adrian Cole
* @see privateAddresses) {
- this.addresses.replaceValues(Address.Type.PRIVATE, ImmutableSet.copyOf(checkNotNull(privateAddresses,
- "privateAddresses")));
+ this.addresses.replaceValues(Address.Type.PRIVATE,
+ ImmutableSet.copyOf(checkNotNull(privateAddresses, "privateAddresses")));
return this;
}
@@ -210,8 +210,8 @@ public class Server extends Resource {
* @see Server#getPublicAddresses()
*/
public Builder publicAddresses(Set publicAddresses) {
- this.addresses.replaceValues(Address.Type.PUBLIC, ImmutableSet.copyOf(checkNotNull(publicAddresses,
- "publicAddresses")));
+ this.addresses.replaceValues(Address.Type.PUBLIC,
+ ImmutableSet.copyOf(checkNotNull(publicAddresses, "publicAddresses")));
return this;
}
@@ -226,7 +226,7 @@ public class Server extends Resource {
public Server build() {
// return new Server(id, name, links, addresses);
return new Server(id, name, links, tenantId, userId, updated, created, hostId, accessIPv4, accessIPv6, status,
- progress, image, flavor, adminPass, addresses, metadata);
+ progress, image, flavor, adminPass, addresses, metadata);
}
public Builder fromServer(Server in) {
@@ -285,9 +285,9 @@ public class Server extends Resource {
protected Map metadata;
protected Server(String id, String name, Set links, String tenantId, String userId, Date updated,
- Date created, String hostId, String accessIPv4, String accessIPv6, ServerStatus status, int progress,
- Resource image, Resource flavor, String adminPass, Multimap addresses,
- Map metadata) {
+ Date created, String hostId, String accessIPv4, String accessIPv6, ServerStatus status, int progress,
+ Resource image, Resource flavor, String adminPass, Multimap addresses,
+ Map metadata) {
super(id, name, links);
this.tenantId = tenantId;
this.userId = userId;
@@ -386,13 +386,13 @@ public class Server extends Resource {
Set publicAddresses = addresses.get(Address.Type.PUBLIC);
Set privateAddresses = addresses.get(Address.Type.PRIVATE);
if (publicAddresses != null) {
- returnMapBuilder.putAll(Address.Type.PUBLIC, Iterables.filter(publicAddresses, Predicates
- .not(IsPrivateAddress.INSTANCE)));
+ returnMapBuilder.putAll(Address.Type.PUBLIC,
+ Iterables.filter(publicAddresses, Predicates.not(IsPrivateAddress.INSTANCE)));
}
if (privateAddresses != null) {
returnMapBuilder.putAll(Address.Type.PRIVATE, Iterables.filter(privateAddresses, IsPrivateAddress.INSTANCE));
- returnMapBuilder.putAll(Address.Type.PUBLIC, Iterables.filter(privateAddresses, Predicates
- .not(IsPrivateAddress.INSTANCE)));
+ returnMapBuilder.putAll(Address.Type.PUBLIC,
+ Iterables.filter(privateAddresses, Predicates.not(IsPrivateAddress.INSTANCE)));
}
ImmutableSetMultimap returnMap = returnMapBuilder.build();
@@ -415,10 +415,10 @@ public class Server extends Resource {
@Override
public String toString() {
- return toStringHelper("").add("id", id).add("name", name).add("tenantId", tenantId).add("userId", userId).add(
- "hostId", hostId).add("updated", updated).add("created", created).add("accessIPv4", accessIPv4).add(
- "accessIPv6", accessIPv6).add("status", status).add("progress", progress).add("image", image).add(
- "flavor", flavor).add("metadata", metadata).add("links", links).add("addresses", addresses).add(
- "adminPass", adminPass).toString();
+ return toStringHelper("").add("id", id).add("name", name).add("tenantId", tenantId).add("userId", userId)
+ .add("hostId", hostId).add("updated", updated).add("created", created).add("accessIPv4", accessIPv4)
+ .add("accessIPv6", accessIPv6).add("status", status).add("progress", progress).add("image", image)
+ .add("flavor", flavor).add("metadata", metadata).add("links", links).add("addresses", addresses)
+ .add("adminPass", adminPass).toString();
}
}
diff --git a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/ServerStatus.java b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/ServerStatus.java
index 799b614f41..722a7a1714 100644
--- a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/ServerStatus.java
+++ b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/domain/ServerStatus.java
@@ -32,25 +32,15 @@ import org.jclouds.compute.domain.NodeState;
*/
public enum ServerStatus {
- ACTIVE (NodeState.RUNNING),
- BUILD (NodeState.PENDING),
- REBUILD (NodeState.PENDING),
- SUSPENDED (NodeState.SUSPENDED),
- RESIZE (NodeState.PENDING),
- VERIFY_RESIZE(NodeState.PENDING),
- REVERT_RESIZE(NodeState.PENDING),
- PASSWORD (NodeState.PENDING),
- REBOOT (NodeState.PENDING),
- HARD_REBOOT (NodeState.PENDING),
- DELETED (NodeState.TERMINATED),
- UNKNOWN (NodeState.UNRECOGNIZED),
- ERROR (NodeState.ERROR),
- UNRECOGNIZED (NodeState.UNRECOGNIZED);
+ ACTIVE(NodeState.RUNNING), BUILD(NodeState.PENDING), REBUILD(NodeState.PENDING), SUSPENDED(NodeState.SUSPENDED), RESIZE(
+ NodeState.PENDING), VERIFY_RESIZE(NodeState.PENDING), REVERT_RESIZE(NodeState.PENDING), PASSWORD(
+ NodeState.PENDING), REBOOT(NodeState.PENDING), HARD_REBOOT(NodeState.PENDING), DELETED(NodeState.TERMINATED), UNKNOWN(
+ NodeState.UNRECOGNIZED), ERROR(NodeState.ERROR), UNRECOGNIZED(NodeState.UNRECOGNIZED);
private final NodeState nodeState;
ServerStatus(NodeState nodeState) {
- this.nodeState = nodeState;
+ this.nodeState = nodeState;
}
public String value() {
@@ -65,8 +55,7 @@ public enum ServerStatus {
}
}
- public NodeState getNodeState()
- {
- return nodeState;
- }
+ public NodeState getNodeState() {
+ return nodeState;
+ }
}
diff --git a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/extensions/ExtensionNamespaces.java b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/extensions/ExtensionNamespaces.java
index 725622493a..df97dda590 100644
--- a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/extensions/ExtensionNamespaces.java
+++ b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/extensions/ExtensionNamespaces.java
@@ -18,7 +18,6 @@
*/
package org.jclouds.openstack.nova.v1_1.extensions;
-
/**
* Extension namespaces
*
diff --git a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/extensions/FloatingIPClient.java b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/extensions/FloatingIPClient.java
index 6c53a719e9..4429053883 100644
--- a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/extensions/FloatingIPClient.java
+++ b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/extensions/FloatingIPClient.java
@@ -74,7 +74,7 @@ public interface FloatingIPClient {
* @param address
* the IP address to add
*
- * NOTE: Possibly move this to ServerClient?
+ * NOTE: Possibly move this to ServerClient?
*/
void addFloatingIP(String serverId, String address);
@@ -86,7 +86,7 @@ public interface FloatingIPClient {
* @param address
* the IP address to remove
*
- * NOTE: Possibly move this to ServerClient?
+ * NOTE: Possibly move this to ServerClient?
*/
void removeFloatingIP(String serverId, String address);
}
diff --git a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/extensions/KeyPairAsyncClient.java b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/extensions/KeyPairAsyncClient.java
index 1635f50ad6..415a1490e9 100644
--- a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/extensions/KeyPairAsyncClient.java
+++ b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/extensions/KeyPairAsyncClient.java
@@ -53,7 +53,9 @@ import com.google.common.util.concurrent.ListenableFuture;
* @see KeyPairClient
* @author Jeremy Daggett
* @see ExtensionAsyncClient
- * @see
+ * @see
* @see
* @see
*/
@@ -68,7 +70,6 @@ public interface KeyPairAsyncClient {
@Consumes(MediaType.APPLICATION_JSON)
@ExceptionParser(ReturnEmptySetOnNotFoundOr404.class)
ListenableFuture>> listKeyPairs();
-
@POST
@Path("/os-keypairs")
@@ -85,12 +86,12 @@ public interface KeyPairAsyncClient {
@Produces(MediaType.APPLICATION_JSON)
@Payload("%7B\"keypair\":%7B\"name\":\"{name}\",\"public_key\":\"{publicKey}\"%7D%7D")
ListenableFuture createKeyPairWithPublicKey(@PayloadParam("name") String name,
- @PayloadParam("publicKey") String publicKey);
+ @PayloadParam("publicKey") String publicKey);
@DELETE
@Path("/os-keypairs/{name}")
@ExceptionParser(ReturnFalseOnNotFoundOr404.class)
@Consumes
ListenableFuture deleteKeyPair(@PathParam("name") String name);
-
+
}
diff --git a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/extensions/KeyPairClient.java b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/extensions/KeyPairClient.java
index cca7c89bbd..ae58a7bdd6 100644
--- a/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/extensions/KeyPairClient.java
+++ b/labs/openstack-nova/src/main/java/org/jclouds/openstack/nova/v1_1/extensions/KeyPairClient.java
@@ -43,7 +43,7 @@ public interface KeyPairClient {
*
* @return all Key Pairs
*/
- Set