From 313e56e8d613da5fe887be784dc2ecb142049d5a Mon Sep 17 00:00:00 2001 From: "adrian.f.cole" Date: Wed, 13 Jan 2010 07:55:27 +0000 Subject: [PATCH] Issue 130: tune output in compute service git-svn-id: http://jclouds.googlecode.com/svn/trunk@2646 3d8758e0-26b5-11de-8745-db77d3ebf521 --- .../compute/domain/internal/NodeIdentityImpl.java | 5 +++++ .../compute/domain/internal/NodeMetadataImpl.java | 7 +++++++ .../compute/TerremarkVCloudComputeService.java | 13 ++++++------- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/org/jclouds/compute/domain/internal/NodeIdentityImpl.java b/core/src/main/java/org/jclouds/compute/domain/internal/NodeIdentityImpl.java index 552b459371..6c8999f4a6 100644 --- a/core/src/main/java/org/jclouds/compute/domain/internal/NodeIdentityImpl.java +++ b/core/src/main/java/org/jclouds/compute/domain/internal/NodeIdentityImpl.java @@ -88,4 +88,9 @@ public class NodeIdentityImpl implements NodeIdentity { return true; } + @Override + public String toString() { + return "[id=" + id + ", name=" + name + "]"; + } + } diff --git a/core/src/main/java/org/jclouds/compute/domain/internal/NodeMetadataImpl.java b/core/src/main/java/org/jclouds/compute/domain/internal/NodeMetadataImpl.java index c7d3040e0f..a01b0690dc 100644 --- a/core/src/main/java/org/jclouds/compute/domain/internal/NodeMetadataImpl.java +++ b/core/src/main/java/org/jclouds/compute/domain/internal/NodeMetadataImpl.java @@ -51,6 +51,13 @@ public class NodeMetadataImpl extends NodeIdentityImpl implements NodeMetadata { private final int loginPort; private final LoginType loginType; + @Override + public String toString() { + return "[id=" + getId() + ", name=" + getName() + ", state=" + getState() + + ", privateAddresses=" + privateAddresses + ", publicAddresses=" + publicAddresses + + "]"; + } + public NodeMetadataImpl(String id, String name, NodeState state, Iterable publicAddresses, Iterable privateAddresses, int loginPort, LoginType loginType, Map extra) { diff --git a/vcloud/terremark/src/main/java/org/jclouds/vcloud/terremark/compute/TerremarkVCloudComputeService.java b/vcloud/terremark/src/main/java/org/jclouds/vcloud/terremark/compute/TerremarkVCloudComputeService.java index 8e18b8d070..2a7c54d380 100644 --- a/vcloud/terremark/src/main/java/org/jclouds/vcloud/terremark/compute/TerremarkVCloudComputeService.java +++ b/vcloud/terremark/src/main/java/org/jclouds/vcloud/terremark/compute/TerremarkVCloudComputeService.java @@ -66,9 +66,9 @@ public class TerremarkVCloudComputeService implements ComputeService { private static final Map vAppStatusToNodeState = ImmutableMap . builder().put(VAppStatus.OFF, NodeState.TERMINATED).put( - VAppStatus.ON, NodeState.RUNNING).put(VAppStatus.RESOLVED, - NodeState.PENDING).put(VAppStatus.SUSPENDED, NodeState.SUSPENDED).put( - VAppStatus.UNRESOLVED, NodeState.PENDING).build(); + VAppStatus.ON, NodeState.RUNNING).put(VAppStatus.RESOLVED, NodeState.PENDING) + .put(VAppStatus.SUSPENDED, NodeState.SUSPENDED).put(VAppStatus.UNRESOLVED, + NodeState.PENDING).build(); @Inject public TerremarkVCloudComputeService(TerremarkVCloudClient tmClient, @@ -86,17 +86,16 @@ public class TerremarkVCloudComputeService implements ComputeService { return new CreateNodeResponseImpl(vApp.getId(), vApp.getName(), vAppStatusToNodeState .get(vApp.getStatus()), ImmutableSet. of(publicIp), vApp .getNetworkToAddresses().values(), 22, LoginType.SSH, new Credentials("vcloud", - "p4ssw0rd"), ImmutableMap.of()); + "p4ssw0rd"), ImmutableMap. of()); } @Override public NodeMetadata getNodeMetadata(String id) { VApp vApp = tmClient.getVApp(id); - // TODO - Set publicAddresses = ImmutableSet. of(); + Set publicAddresses = computeClient.getPublicAddresses(id); return new NodeMetadataImpl(vApp.getId(), vApp.getName(), vAppStatusToNodeState.get(vApp .getStatus()), publicAddresses, vApp.getNetworkToAddresses().values(), 22, - LoginType.SSH, ImmutableMap.of()); + LoginType.SSH, ImmutableMap. of()); } @Override