package schedframe.scheduling.plan.impl; import java.io.StringWriter; import org.exolab.castor.xml.MarshalException; import org.exolab.castor.xml.ValidationException; import schedframe.scheduling.plan.ComputingResourceTypeInterface; import schedframe.scheduling.plan.HostInterface; public class Host implements HostInterface { private static final long serialVersionUID = -5534266040248107980L; protected org.qcg.broker.schemas.schedulingplan.Host host; public Host(){ host = new org.qcg.broker.schemas.schedulingplan.Host(); } public Host(org.qcg.broker.schemas.schedulingplan.Host value){ host = value; } public org.qcg.broker.schemas.schedulingplan.Host getDescription() { return host; } public String getDocument() { StringWriter writer = new StringWriter(); try { host.marshal(writer); } catch (MarshalException e) { e.printStackTrace(); } catch (ValidationException e) { e.printStackTrace(); } return writer.toString(); } @SuppressWarnings("unchecked") public ComputingResourceTypeInterface getMachineParameters() { org.qcg.broker.schemas.schedulingplan.ComputingResourceType crt = host.getMachineParameters(); if(crt == null) return null; else return new ComputingResourceType(crt); } public String getHostname() { return host.getHostname(); } public String getQueue() { return host.getQueue(); } public void setMachineParameters( ComputingResourceTypeInterface machineParameters) { host.setMachineParameters((org.qcg.broker.schemas.schedulingplan.ComputingResourceType) machineParameters.getDescription()); } public void setHostname(String hostname) { host.setHostname(hostname); } public void setQueue(String queue) { host.setQueue(queue); } }