@Test public void testGetVM() { System.out.println("getVM"); String application = "threeTierWebApp"; String deployment = "100"; String vmID = "1686"; VM result = new ActionRequester().getVM(application, deployment, vmID); assert (result != null); printVM(result); }
@Override public VM getVM(String application, String deployment, String vmID) { RestVMClient client = new RestVMClient(application, deployment); String response = client.getVM(String.class, vmID); try { JAXBContext jaxbContext = JAXBContext.newInstance(VM.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); return (VM) jaxbUnmarshaller.unmarshal(new StringReader(response)); } catch (JAXBException ex) { Logger.getLogger(ActionRequester.class.getName()).log(Level.SEVERE, null, ex); } finally { client.close(); } return null; }
ActionRequester implements Runnable, ActuatorInvoker { @Override public VM getVM(String application, String deployment, String vmID) { RestVMClient client = new RestVMClient(application, deployment); String response = client.getVM(String.class, vmID); try { JAXBContext jaxbContext = JAXBContext.newInstance(VM.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); return (VM) jaxbUnmarshaller.unmarshal(new StringReader(response)); } catch (JAXBException ex) { Logger.getLogger(ActionRequester.class.getName()).log(Level.SEVERE, null, ex); } finally { client.close(); } return null; } }
ActionRequester implements Runnable, ActuatorInvoker { @Override public VM getVM(String application, String deployment, String vmID) { RestVMClient client = new RestVMClient(application, deployment); String response = client.getVM(String.class, vmID); try { JAXBContext jaxbContext = JAXBContext.newInstance(VM.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); return (VM) jaxbUnmarshaller.unmarshal(new StringReader(response)); } catch (JAXBException ex) { Logger.getLogger(ActionRequester.class.getName()).log(Level.SEVERE, null, ex); } finally { client.close(); } return null; }  }
ActionRequester implements Runnable, ActuatorInvoker { @Override public VM getVM(String application, String deployment, String vmID) { RestVMClient client = new RestVMClient(application, deployment); String response = client.getVM(String.class, vmID); try { JAXBContext jaxbContext = JAXBContext.newInstance(VM.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); return (VM) jaxbUnmarshaller.unmarshal(new StringReader(response)); } 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 { @Override public VM getVM(String application, String deployment, String vmID) { RestVMClient client = new RestVMClient(application, deployment); String response = client.getVM(String.class, vmID); try { JAXBContext jaxbContext = JAXBContext.newInstance(VM.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); return (VM) jaxbUnmarshaller.unmarshal(new StringReader(response)); } 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);  }