@Test public void testGetVMs() { System.out.println("getVMs"); String applicationId = "davidgpTestApp"; String deploymentId = "453"; ActionRequester instance = new ActionRequester(); List<VM> result = instance.getVMs(applicationId, deploymentId); for (VM vm : result) { assert (vm != null); printVM(vm); } }
public List<VM> getVMs(String applicationId, String deploymentId) { RestDeploymentClient client = new RestDeploymentClient(applicationId); String response = client.getDeployment(String.class, deploymentId); try { JAXBContext jaxbContext = JAXBContext.newInstance(Deployment.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); Deployment deployment = (Deployment) jaxbUnmarshaller.unmarshal(new StringReader(response)); return deployment.getVms(); } catch (JAXBException ex) { Logger.getLogger(ActionRequester.class.getName()).log(Level.SEVERE, null, ex); } finally { client.close(); } return null; }
ActionRequester implements Runnable, ActuatorInvoker { public List<VM> getVMs(String applicationId, String deploymentId) { RestDeploymentClient client = new RestDeploymentClient(applicationId); String response = client.getDeployment(String.class, deploymentId); try { JAXBContext jaxbContext = JAXBContext.newInstance(Deployment.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); Deployment deployment = (Deployment) jaxbUnmarshaller.unmarshal(new StringReader(response)); return deployment.getVms(); } catch (JAXBException ex) { Logger.getLogger(ActionRequester.class.getName()).log(Level.SEVERE, null, ex); } finally { client.close(); } return null; } }
ActionRequester implements Runnable, ActuatorInvoker { public List<VM> getVMs(String applicationId, String deploymentId) { RestDeploymentClient client = new RestDeploymentClient(applicationId); String response = client.getDeployment(String.class, deploymentId); try { JAXBContext jaxbContext = JAXBContext.newInstance(Deployment.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); Deployment deployment = (Deployment) jaxbUnmarshaller.unmarshal(new StringReader(response)); return deployment.getVms(); } catch (JAXBException ex) { Logger.getLogger(ActionRequester.class.getName()).log(Level.SEVERE, null, ex); } finally { client.close(); } return null; }  }
ActionRequester implements Runnable, ActuatorInvoker { public List<VM> getVMs(String applicationId, String deploymentId) { RestDeploymentClient client = new RestDeploymentClient(applicationId); String response = client.getDeployment(String.class, deploymentId); try { JAXBContext jaxbContext = JAXBContext.newInstance(Deployment.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); Deployment deployment = (Deployment) jaxbUnmarshaller.unmarshal(new StringReader(response)); return deployment.getVms(); } catch (JAXBException ex) { Logger.getLogger(ActionRequester.class.getName()).log(Level.SEVERE, null, ex); } finally { client.close(); } return null; }  @Override String getOvf(String applicationId, String deploymentId); @Override VM getVM(String application, String deployment, String vmID); @Override List<String> getVmTypesAvailableToAdd(String applicationId, String deploymentId); @Override List<String> getVmTypesAvailableToRemove(String applicationId, String deploymentId); @Override List<Integer> getVmIdsAvailableToRemove(String applicationId, String deploymentId
    ); @Override int getVmCountOfGivenType(String applicationId, String deploymentId, String type); int getVmCountOfGivenType(List<VM> vms, String type); List<VM> getVMs(String applicationId, String deploymentId); @Override void addVM(String applicationId, String deploymentId, String ovfId); void addVM(String applicationId, String deploymentId, String ovfId, int cpuSize, String location); VM cloneVm(VM vm); @Override void deleteVM(String application, String deployment, String vmID); @Override void scaleUpVM(String application, String deployment, String vmID); @Override void scaleDownVM(String application, String deployment, String vmID); @Override double getPowerUsageVM(String applicationId, String deploymentId, String vmID); @Override double getAveragePowerUsage(String applicationId, String deploymentId, String vmType); @Override double getTotalPowerUsage(String applicationId, String deploymentId); @Override SLALimits getSlaLimits(String applicationId, String deploymentId); @Override List<Slot> getSlots(VmRequirements requirements); @Override List<Node> getProviderHostInfo(); @Override List<Slot> getSlots(); @Override void horizontallyScaleToNVms(String applicationId, String deploymentId, Response response); @Override void renegotiate(String applicationId, String deploymentId); @Override void hardShutdown(String applicationId, String deploymentId); @Override void run(); void stop(); @Override void actuate(Response response); }
ActionRequester implements Runnable, ActuatorInvoker { public List<VM> getVMs(String applicationId, String deploymentId) { RestDeploymentClient client = new RestDeploymentClient(applicationId); String response = client.getDeployment(String.class, deploymentId); try { JAXBContext jaxbContext = JAXBContext.newInstance(Deployment.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); Deployment deployment = (Deployment) jaxbUnmarshaller.unmarshal(new StringReader(response)); return deployment.getVms(); } catch (JAXBException ex) { Logger.getLogger(ActionRequester.class.getName()).log(Level.SEVERE, null, ex); } finally { client.close(); } return null; }  @Override String getOvf(String applicationId, String deploymentId); @Override VM getVM(String application, String deployment, String vmID); @Override List<String> getVmTypesAvailableToAdd(String applicationId, String deploymentId); @Override List<String> getVmTypesAvailableToRemove(String applicationId, String deploymentId); @Override List<Integer> getVmIdsAvailableToRemove(String applicationId, String deploymentId
    ); @Override int getVmCountOfGivenType(String applicationId, String deploymentId, String type); int getVmCountOfGivenType(List<VM> vms, String type); List<VM> getVMs(String applicationId, String deploymentId); @Override void addVM(String applicationId, String deploymentId, String ovfId); void addVM(String applicationId, String deploymentId, String ovfId, int cpuSize, String location); VM cloneVm(VM vm); @Override void deleteVM(String application, String deployment, String vmID); @Override void scaleUpVM(String application, String deployment, String vmID); @Override void scaleDownVM(String application, String deployment, String vmID); @Override double getPowerUsageVM(String applicationId, String deploymentId, String vmID); @Override double getAveragePowerUsage(String applicationId, String deploymentId, String vmType); @Override double getTotalPowerUsage(String applicationId, String deploymentId); @Override SLALimits getSlaLimits(String applicationId, String deploymentId); @Override List<Slot> getSlots(VmRequirements requirements); @Override List<Node> getProviderHostInfo(); @Override List<Slot> getSlots(); @Override void horizontallyScaleToNVms(String applicationId, String deploymentId, Response response); @Override void renegotiate(String applicationId, String deploymentId); @Override void hardShutdown(String applicationId, String deploymentId); @Override void run(); void stop(); @Override void actuate(Response response);  }