Package org.jclouds.compute.domain.internal

Examples of org.jclouds.compute.domain.internal.NodeMetadataImpl


  public void testAllOptions() throws Exception {
   
    ServiceFactory factory = mock(ServiceFactory.class);
    Service service = mock(Service.class);
    when(factory.create((String) any())).thenReturn(service);
    NodeMetadata node1 = new NodeMetadataImpl(null, "name1", "id1",
        new LocationImpl(LocationScope.PROVIDER, "location-id1",
            "location-desc1", null),
        null, Collections.<String,String>emptyMap(), null, null, "image-id",
        null, NodeState.RUNNING,
        Lists.newArrayList("100.0.0.1"),
        Lists.newArrayList("10.0.0.1"), null);
    NodeMetadata node2 = new NodeMetadataImpl(null, "name2", "id2",
        new LocationImpl(LocationScope.PROVIDER, "location-id2",
            "location-desc2", null),
        null, Collections.<String,String>emptyMap(), null, null, "image-id",
        null, NodeState.RUNNING,
        Lists.newArrayList("100.0.0.2"),
View Full Code Here


import org.junit.Test;

public class CassandraServiceTest {

  private NodeMetadata getNodeMetadata(String id) {
    return new NodeMetadataImpl("1", null, "1", null, null,
        new HashMap<String, String>(), null, null, null, null,
        NodeState.RUNNING, new ArrayList<String>(),
        new ArrayList<String>(), null);
  }
View Full Code Here

      Location location = getLocationForAvailabilityZone(instance);

      Image image = resolveImageForInstanceInLocation(instance, location);

      return new NodeMetadataImpl(id, name, instance.getRegion() + "/" + instance.getId(),
               location, uri, userMetadata, tag, image, state, publicAddresses, privateAddresses,
               extra, credentials);
   }
View Full Code Here

import org.junit.Test;

public class CassandraServiceTest {

  private NodeMetadata getNodeMetadata(String id) {
    return new NodeMetadataImpl("1", null, "1", null, null,
        new HashMap<String, String>(), null, null,
        NodeState.RUNNING, new ArrayList<String>(),
        new ArrayList<String>(), new HashMap<String, String>(), null);
  }
View Full Code Here

        Iterator<? extends ComputeMetadata> iterator = set.iterator();

        // traverse through all nodes of this ComputeService object
        while (iterator.hasNext()) {
          NodeMetadataImpl nodeMetadata = (NodeMetadataImpl) iterator
              .next();

          // if this node belongs to the requested domain
          if (nodeIds.contains(nodeMetadata.getId())) {

            // get the status of the node
            Status nodeStatus = nodeMetadata.getStatus();

            // count nodes that are in pending state
            if (nodeStatus.equals(Status.PENDING)) {
              pendingInstanceCount++;
            }
View Full Code Here

  public void testAllOptions() throws Exception {
   
    ServiceFactory factory = mock(ServiceFactory.class);
    Service service = mock(Service.class);
    when(factory.create((String) any())).thenReturn(service);
    NodeMetadata node1 = new NodeMetadataImpl(null, "name1", "id1",
        new LocationImpl(LocationScope.PROVIDER, "location-id1",
            "location-desc1", null),
        null, Collections.<String,String>emptyMap(), null, null, "image-id",
        null, NodeState.RUNNING,
        Lists.newArrayList("100.0.0.1"),
        Lists.newArrayList("10.0.0.1"), null);
    NodeMetadata node2 = new NodeMetadataImpl(null, "name2", "id2",
        new LocationImpl(LocationScope.PROVIDER, "location-id2",
            "location-desc2", null),
        null, Collections.<String,String>emptyMap(), null, null, "image-id",
        null, NodeState.RUNNING,
        Lists.newArrayList("100.0.0.2"),
View Full Code Here

      Set<NodeMetadata> nodes = Sets.newHashSet();
      Map<?, Exception> executionExceptions = Maps.newHashMap();
      Map<NodeMetadata, Throwable> failedNodes = Maps.newHashMap();
      for (int i = 0; i < num; i++) {
        NodeMetadata nodeMeta = new NodeMetadataImpl(
            "ec2", "" + roles + id, "nodeId" + id + i,
            location, new URI("http://node" + i),
            userMetadata, null, null, null, null, NodeState.RUNNING, 22,
            addresses, addresses, null, loginCredentials);
        if (i < only) {
          nodes.add(nodeMeta);
          LOG.info("{} - Node successfully started: {}", roles, nodeMeta.getId());
        } else {
          failedNodes.put(nodeMeta, new Exception("Simulated failing node"));
          LOG.info("{} - Node failing to start: {}", roles, nodeMeta.getId());
        }
      }
      if (failedNodes.size() > 0) {
        Image image = new ImageImpl("ec2", "test", "testId", location, new URI("http://node"),
            userMetadata, new OperatingSystem(null, null, null, null, "op", true), "description",
View Full Code Here

      Set<NodeMetadata> nodes = Sets.newHashSet();
      Map<?, Exception> executionExceptions = Maps.newHashMap();
      Map<NodeMetadata, Throwable> failedNodes = Maps.newHashMap();
      for (int i = 0; i < num; i++) {
        NodeMetadata nodeMeta = new NodeMetadataImpl(
            "ec2", "" + roles + id, "nodeId" + id + i,
            location, new URI("http://node" + i),
            userMetadata, ImmutableSet.<String>of(), null, null, null, null, NodeState.RUNNING, 22,
            addresses, addresses, null, loginCredentials, "hostname");
        if (i < only) {
          nodes.add(nodeMeta);
          LOG.info("{} - Node successfully started: {}", roles, nodeMeta.getId());
        } else {
          failedNodes.put(nodeMeta, new Exception("Simulated failing node"));
          LOG.info("{} - Node failing to start: {}", roles, nodeMeta.getId());
        }
      }
      if (failedNodes.size() > 0) {
        Image image = new ImageImpl("ec2", "test", "testId", location, new URI("http://node"),
            userMetadata, ImmutableSet.<String>of(), new OperatingSystem(null, null, null, null, "op", true),
View Full Code Here

      Set<NodeMetadata> nodes = Sets.newHashSet();
      Map<?, Exception> executionExceptions = Maps.newHashMap();
      Map<NodeMetadata, Throwable> failedNodes = Maps.newHashMap();
      for (int i = 0; i < num; i++) {
        NodeMetadata nodeMeta = new NodeMetadataImpl(
            "ec2", "" + roles + id, "nodeId" + id + i,
            location, new URI("http://node" + i),
            userMetadata, ImmutableSet.<String>of(), null, null, null, null, NodeState.RUNNING, 22,
            addresses, addresses, null, loginCredentials, "hostname");
        if (i < only) {
          nodes.add(nodeMeta);
          LOG.info("{} - Node successfully started: {}", roles, nodeMeta.getId());
        } else {
          failedNodes.put(nodeMeta, new Exception("Simulated failing node"));
          LOG.info("{} - Node failing to start: {}", roles, nodeMeta.getId());
        }
      }
      if (failedNodes.size() > 0) {
        Image image = new ImageImpl("ec2", "test", "testId", location, new URI("http://node"),
            userMetadata, ImmutableSet.<String>of(), new OperatingSystem(null, null, null, null, "op", true),
View Full Code Here

      return NodeMetadataBuilder.class.cast(super.userMetadata(userMetadata));
   }

   @Override
   public NodeMetadata build() {
      return new NodeMetadataImpl(providerId, name, id, location, uri, userMetadata, tags, group, hardware, imageId,
               os, status, backendStatus, loginPort, publicAddresses, privateAddresses, credentials, hostname);
   }
View Full Code Here

TOP

Related Classes of org.jclouds.compute.domain.internal.NodeMetadataImpl

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.