Issue 130: tune output in compute service

git-svn-id: http://jclouds.googlecode.com/svn/trunk@2646 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
adrian.f.cole 2010-01-13 07:55:27 +00:00
parent 2d19e33828
commit 313e56e8d6
3 changed files with 18 additions and 7 deletions

View File

@ -88,4 +88,9 @@ public class NodeIdentityImpl implements NodeIdentity {
return true;
}
@Override
public String toString() {
return "[id=" + id + ", name=" + name + "]";
}
}

View File

@ -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<InetAddress> publicAddresses, Iterable<InetAddress> privateAddresses,
int loginPort, LoginType loginType, Map<String, String> extra) {

View File

@ -66,9 +66,9 @@ public class TerremarkVCloudComputeService implements ComputeService {
private static final Map<VAppStatus, NodeState> vAppStatusToNodeState = ImmutableMap
.<VAppStatus, NodeState> 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.<InetAddress> of(publicIp), vApp
.getNetworkToAddresses().values(), 22, LoginType.SSH, new Credentials("vcloud",
"p4ssw0rd"), ImmutableMap.<String,String>of());
"p4ssw0rd"), ImmutableMap.<String, String> of());
}
@Override
public NodeMetadata getNodeMetadata(String id) {
VApp vApp = tmClient.getVApp(id);
// TODO
Set<InetAddress> publicAddresses = ImmutableSet.<InetAddress> of();
Set<InetAddress> publicAddresses = computeClient.getPublicAddresses(id);
return new NodeMetadataImpl(vApp.getId(), vApp.getName(), vAppStatusToNodeState.get(vApp
.getStatus()), publicAddresses, vApp.getNetworkToAddresses().values(), 22,
LoginType.SSH, ImmutableMap.<String,String>of());
LoginType.SSH, ImmutableMap.<String, String> of());
}
@Override