Package org.jclouds.fujitsu.fgcp.compute.strategy.VServerMetadata

Examples of org.jclouds.fujitsu.fgcp.compute.strategy.VServerMetadata.Builder


   /**
    * {@inheritDoc}
    */
   @Override
   public VServerMetadata getNode(String id) {
      Builder builder = VServerMetadata.builder();
      builder.id(id);

      try {
         VServerWithDetails server = api.getVirtualServerApi().getDetails(id);
         // skip FWs and SLBs
         if (isFWorSLB(server)) {
            return null;
         }
         VServerStatus status = api.getVirtualServerApi().getStatus(id);
         logger.trace("Node %s [%s] - %s", id, status, server);
         builder.serverWithDetails(server);
         builder.status(status);
         builder.initialPassword(api.getVirtualServerApi().getInitialPassword(id));

         // mapped public ips?
//       String fwId = toFirewallId.apply(id);
       // futures.add(asyncApi.getBuiltinServerApi().getConfiguration(fwId,
       // BuiltinServerConfiguration.FW_RULE));
      } catch (ResourceNotFoundException e) {
         return null;
      }

      return builder.build();
   }
View Full Code Here


   /**
    * {@inheritDoc}
    */
   @Override
   public VServerMetadata getNode(String id) {
      Builder builder = VServerMetadata.builder();
      builder.id(id);

      try {
         VServerWithDetails server = api.getVirtualServerApi().getDetails(id);
         // skip FWs and SLBs
         if (isFWorSLB(server)) {
            return null;
         }
         VServerStatus status = api.getVirtualServerApi().getStatus(id);
         logger.trace("Node %s [%s] - %s", id, status, server);
         builder.serverWithDetails(server);
         builder.status(status);
         builder.initialPassword(api.getVirtualServerApi().getInitialPassword(id));

         // mapped public ips?
//       String fwId = toFirewallId.apply(id);
       // futures.add(asyncApi.getBuiltinServerApi().getConfiguration(fwId,
       // BuiltinServerConfiguration.FW_RULE));
      } catch (ResourceNotFoundException e) {
         return null;
      }

      return builder.build();
   }
View Full Code Here

   /**
    * {@inheritDoc}
    */
   @Override
   public VServerMetadata getNode(String id) {
      Builder builder = VServerMetadata.builder();
      builder.id(id);

      List<ListenableFuture<?>> futures = Lists.newArrayList();

      futures.add(asyncApi.getVirtualServerApi().getDetails(id));
      futures.add(asyncApi.getVirtualServerApi().getStatus(id));
      futures.add(asyncApi.getVirtualServerApi().getInitialPassword(id));
      // mapped public ips?
      String fwId = toFirewallId.apply(id);
//      futures.add(asyncApi.getBuiltinServerApi().getConfiguration(fwId,
//            BuiltinServerConfiguration.SLB_RULE));
      try {
         List<Object> results = Futures.successfulAsList(futures).get();
         VServerWithDetails server = (VServerWithDetails) results.get(0);
         VServerStatus status = (VServerStatus) results.get(1);
         System.out.println("getNode(" + id + ")'s getDetails: " + status +" - " + server);
         if (server == null) {
            server = api.getVirtualServerApi().getDetails(id);
            System.out.println("getNode(" + id + ")'s getDetails(2) returns: " + server);
         }
         builder.serverWithDetails(server);
         builder.status(status == null ? VServerStatus.UNRECOGNIZED : status);
//         System.out.println("status in adapter#getNode: "
//         + (VServerStatus) results.get(1)
//         +" for "
//         + server.getId());
         builder.initialPassword((String) results.get(2));
//         SLB slb = ((BuiltinServer) results.get(4)).;
//         slb.
      } catch (InterruptedException e) {
         throw Throwables.propagate(e);
      } catch (ExecutionException e) {
         throw Throwables.propagate(e);
      }
      return builder.build();
   }
View Full Code Here

TOP

Related Classes of org.jclouds.fujitsu.fgcp.compute.strategy.VServerMetadata.Builder

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.