Issue 176: add default passwords

This commit is contained in:
Adrian Cole 2010-03-17 09:27:16 -07:00
parent e1903f9473
commit 785ce56d3f
2 changed files with 42 additions and 2 deletions

View File

@ -0,0 +1,37 @@
package org.jclouds.vcloud.bluelock.compute;
import java.util.Map;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import org.jclouds.compute.domain.NodeState;
import org.jclouds.vcloud.VCloudClient;
import org.jclouds.vcloud.compute.BaseVCloudComputeClient;
import org.jclouds.vcloud.domain.VApp;
import org.jclouds.vcloud.domain.VAppStatus;
import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableMap;
/**
* @author Adrian Cole
*/
@Singleton
public class BlueLockVCloudComputeClient extends BaseVCloudComputeClient {
@Inject
protected BlueLockVCloudComputeClient(VCloudClient client, Predicate<String> successTester,
@Named("NOT_FOUND") Predicate<VApp> notFoundTester,
Map<VAppStatus, NodeState> vAppStatusToNodeState) {
super(client, successTester, notFoundTester, vAppStatusToNodeState);
}
@Override
protected Map<String, String> parseResponse(VApp vAppResponse) {
// https://forums.bluelock.com/faq.php?faq=vcloudexpressfaq
return ImmutableMap.<String, String> of("id", vAppResponse.getId(), "username", (vAppResponse
.getOperatingSystemDescription().indexOf("buntu") != -1) ? "express" : "root",
"password", "ExpressPassword#1");
}
}

View File

@ -18,6 +18,8 @@
*/
package org.jclouds.vcloud.bluelock.compute.config;
import org.jclouds.vcloud.bluelock.compute.BlueLockVCloudComputeClient;
import org.jclouds.vcloud.compute.VCloudComputeClient;
import org.jclouds.vcloud.compute.config.VCloudComputeServiceContextModule;
/**
@ -26,12 +28,13 @@ import org.jclouds.vcloud.compute.config.VCloudComputeServiceContextModule;
*
* @author Adrian Cole
*/
public class BlueLockVCloudComputeServiceContextModule extends
VCloudComputeServiceContextModule {
public class BlueLockVCloudComputeServiceContextModule extends VCloudComputeServiceContextModule {
@Override
protected void configure() {
super.configure();
bind(VCloudComputeClient.class).to(BlueLockVCloudComputeClient.class);
}
}