[104] | 1 | package schedframe.scheduling.plan.impl; |
---|
| 2 | |
---|
| 3 | import org.qcg.broker.schemas.schedulingplan.types.InterfaceType; |
---|
| 4 | |
---|
| 5 | import java.io.StringWriter; |
---|
| 6 | |
---|
| 7 | import org.exolab.castor.xml.MarshalException; |
---|
| 8 | import org.exolab.castor.xml.ValidationException; |
---|
| 9 | |
---|
| 10 | import schedframe.scheduling.plan.PropertiesTypeInterface; |
---|
| 11 | import schedframe.scheduling.plan.ProviderInfoInterface; |
---|
| 12 | |
---|
| 13 | |
---|
| 14 | public class ProviderInfo implements ProviderInfoInterface<org.qcg.broker.schemas.schedulingplan.ProviderInfo> { |
---|
| 15 | |
---|
| 16 | private static final long serialVersionUID = -1629036434099074699L; |
---|
| 17 | private org.qcg.broker.schemas.schedulingplan.ProviderInfo pi; |
---|
| 18 | |
---|
| 19 | public ProviderInfo(){ |
---|
| 20 | pi = new org.qcg.broker.schemas.schedulingplan.ProviderInfo(); |
---|
| 21 | } |
---|
| 22 | |
---|
| 23 | public ProviderInfo(org.qcg.broker.schemas.schedulingplan.ProviderInfo info){ |
---|
| 24 | this.pi = info; |
---|
| 25 | } |
---|
| 26 | |
---|
| 27 | public org.qcg.broker.schemas.schedulingplan.ProviderInfo getDescription() { |
---|
| 28 | pi.getAdditionalProperties(); |
---|
| 29 | return pi; |
---|
| 30 | } |
---|
| 31 | |
---|
| 32 | public String getDocument() { |
---|
| 33 | StringWriter writer = new StringWriter(); |
---|
| 34 | try { |
---|
| 35 | pi.marshal(writer); |
---|
| 36 | } catch (MarshalException e) { |
---|
| 37 | e.printStackTrace(); |
---|
| 38 | } catch (ValidationException e) { |
---|
| 39 | e.printStackTrace(); |
---|
| 40 | } |
---|
| 41 | return writer.toString(); |
---|
| 42 | } |
---|
| 43 | |
---|
| 44 | public String getLocation() { |
---|
| 45 | return pi.getLocation(); |
---|
| 46 | } |
---|
| 47 | |
---|
| 48 | public String getProxyName() { |
---|
| 49 | return pi.getProxyName(); |
---|
| 50 | } |
---|
| 51 | |
---|
| 52 | public InterfaceType getType() { |
---|
| 53 | return pi.getType(); |
---|
| 54 | } |
---|
| 55 | |
---|
| 56 | public void setLocation(String location) { |
---|
| 57 | pi.setLocation(location); |
---|
| 58 | } |
---|
| 59 | |
---|
| 60 | public void setProxyName(String proxyName) { |
---|
| 61 | pi.setProxyName(proxyName); |
---|
| 62 | } |
---|
| 63 | |
---|
| 64 | public void setType(InterfaceType type) { |
---|
| 65 | pi.setType(type); |
---|
| 66 | } |
---|
| 67 | |
---|
| 68 | @SuppressWarnings("unchecked") |
---|
| 69 | public PropertiesTypeInterface<org.qcg.broker.schemas.schedulingplan.PropertiesType> getAdditionalProperties() { |
---|
| 70 | org.qcg.broker.schemas.schedulingplan.PropertiesType properties = this.pi.getAdditionalProperties(); |
---|
| 71 | PropertiesType ret = new PropertiesType(properties); |
---|
| 72 | return ret; |
---|
| 73 | } |
---|
| 74 | |
---|
| 75 | public <Properties_> void setAdditionalProperties( |
---|
| 76 | PropertiesTypeInterface<Properties_> additionalProperties) { |
---|
| 77 | this.pi.setAdditionalProperties( |
---|
| 78 | (org.qcg.broker.schemas.schedulingplan.PropertiesType) additionalProperties.getDescription()); |
---|
| 79 | } |
---|
| 80 | |
---|
| 81 | } |
---|