Package org.jclouds.domain

Examples of org.jclouds.domain.Credentials


      for (NodeMetadata node : nodes) {
         assertNotNull(node.getProviderId());
         assertNotNull(node.getGroup());
         assertEquals(node.getGroup(), group);
         assertEquals(node.getStatus(), Status.RUNNING);
         Credentials fromStore = view.utils().credentialStore().get("node#" + node.getId());
         assertEquals(fromStore, node.getCredentials());
         assert node.getPublicAddresses().size() >= 1 || node.getPrivateAddresses().size() >= 1 : "no ips in" + node;
         assertNotNull(node.getCredentials());
         if (node.getCredentials().identity != null) {
            assertNotNull(node.getCredentials().identity);
View Full Code Here


      for (NodeMetadata node : nodes) {
         assertNotNull(node.getProviderId());
         assertNotNull(node.getGroup());
         assertEquals(node.getGroup(), group);
         assertEquals(node.getStatus(), Status.RUNNING);
         Credentials fromStore = view.utils().credentialStore().get("node#" + node.getId());
         assertEquals(fromStore, node.getCredentials());
         assert node.getPublicAddresses().size() >= 1 || node.getPrivateAddresses().size() >= 1 : "no ips in" + node;
         assertNotNull(node.getCredentials());
         if (node.getCredentials().identity != null) {
            assertNotNull(node.getCredentials().identity);
View Full Code Here

      String name = null; // user doesn't determine a node name;
      URI uri = null; // no uri to get rest access to host info

      String tag = getTagForInstace(instance);

      Credentials credentials = getCredentialsForInstanceWithTag(instance, tag);

      Map<String, String> userMetadata = ImmutableMap.<String, String> of();

      NodeState state = instanceToNodeState.get(instance.getInstanceState());
View Full Code Here

               location, uri, userMetadata, tag, image, state, publicAddresses, privateAddresses,
               extra, credentials);
   }

   private Credentials getCredentialsForInstanceWithTag(final RunningInstance instance, String tag) {
      Credentials credentials = null;// default if no keypair exists

      if (instance.getKeyName() != null) {
         credentials = new Credentials(getLoginAccountFor(instance), getPrivateKeyOrNull(instance,
                  tag));
      }
      return credentials;
   }
View Full Code Here

  public void setHandlerMapFactory(HandlerMapFactory handlerMapFactory) {
    this.handlerMapFactory = handlerMapFactory;
  }

  private Cluster.Instance toInstance(NodeMetadata metadata, Cluster cluster, ClusterSpec spec) {
    Credentials credentials = new Credentials(spec.getClusterUser(), spec.getPrivateKey());

    Set<String> roles = Sets.newHashSet();
    try {
      if (cluster != null) {
        roles = cluster.getInstanceMatching(withIds(metadata.getId())).getRoles();
View Full Code Here

   * @param content
   * @return
   * @throws UnknownHostException
   */
  protected Cluster unserialize(ClusterSpec spec, String content) throws UnknownHostException {
    Credentials credentials = new Credentials(spec.getClusterUser(), spec.getPrivateKey());
    Set<Cluster.Instance> instances = Sets.newLinkedHashSet();

    for(String line : Splitter.on("\n").split(content)) {
      if (line.trim().equals("")) continue; /* ignore empty lines */
      Iterator<String> fields = Splitter.on("\t").split(line).iterator();
View Full Code Here

import org.junit.Test;

public class CassandraClusterActionHandlerTest {

  private Instance getInstance(String id) throws UnknownHostException {
    return new Instance(new Credentials("", ""), Sets.newHashSet(""),
        "127.0.0.1", "127.0.0.1", id, null);
  }
View Full Code Here

  }

  private Cluster createTestCluster(String[] ids, String[] roles) {
    checkArgument(ids.length == roles.length, "each ID should have a role");

    Credentials credentials = new Credentials("dummy", "dummy");
    Set<Cluster.Instance> instances = Sets.newLinkedHashSet();

    for(int i = 0; i < ids.length; i++) {
      String ip = "127.0.0." + (i + 1);
      instances.add(new Cluster.Instance(credentials,
View Full Code Here

  private Cluster cluster;
  private static final int NUMBER_OF_INSTANCES = 5;

  @Before
  public void setUp() {
    Credentials credentials = new Credentials("dummy", "dummy");
    Set<Cluster.Instance> instances = Sets.newHashSet();

    for(int i = 0; i < NUMBER_OF_INSTANCES; i++) {
      String ip = "127.0.0." + (i + 1);
      instances.add(new Cluster.Instance(credentials,
View Full Code Here

        ImmutableMap.<String,String>of(), ImmutableSet.<String>of(), processors,
        1024, ImmutableList.<Volume>of(), null, "xen");
    when(node.getHardware()).thenReturn(hardware);
   
    Builder<Instance> instances = ImmutableSet.<Instance>builder();
    Instance master = new Instance(new Credentials("", ""),
        ImmutableSet.of(HadoopNameNodeClusterActionHandler.ROLE,
            HadoopJobTrackerClusterActionHandler.ROLE),
            "10.0.0.1", "10.0.0.1", "1", node, fakeDnsResolver);
    instances.add(master);
    for (int i = 0; i < numberOfWorkers; i++) {
      int id = i + 2;
      instances.add(new Instance(new Credentials("", ""),
        ImmutableSet.of(HadoopDataNodeClusterActionHandler.ROLE,
              HadoopTaskTrackerClusterActionHandler.ROLE),
              "10.0.0." + id, "10.0.0." + id, id + "", node, fakeDnsResolver));
    }
    return new Cluster(instances.build());
View Full Code Here

TOP

Related Classes of org.jclouds.domain.Credentials

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.