[477] | 1 | package simulator.reader; |
---|
| 2 | |
---|
| 3 | import org.qcg.broker.schemas.exception.UnknownParameter; |
---|
| 4 | |
---|
| 5 | import schemas.ComputingResource; |
---|
| 6 | import schemas.ComputingResourceTypeChoiceSequence; |
---|
| 7 | import schemas.ComputingResourceTypeChoiceSequence2; |
---|
| 8 | |
---|
| 9 | public class ComputingResourceWrapper { |
---|
| 10 | |
---|
| 11 | ComputingResource computingResource; |
---|
| 12 | |
---|
| 13 | public void wrap(ComputingResource computingResource) { |
---|
| 14 | this.computingResource = computingResource; |
---|
| 15 | } |
---|
| 16 | |
---|
| 17 | public long getChildCount(){ |
---|
| 18 | long compResCount = computingResource.getCount() > 1 ? computingResource.getCount() : 1; |
---|
| 19 | return compResCount; |
---|
| 20 | } |
---|
| 21 | |
---|
| 22 | public ComputingResourceTypeChoiceSequence getCharacteristics() throws UnknownParameter { |
---|
| 23 | if(computingResource.getComputingResourceTypeChoiceSequence() == null) |
---|
| 24 | throw new UnknownParameter("Characeristics are not defined."); |
---|
| 25 | return computingResource.getComputingResourceTypeChoiceSequence(); |
---|
| 26 | } |
---|
| 27 | |
---|
| 28 | public ComputingResourceTypeChoiceSequence2 getTemplate() throws UnknownParameter { |
---|
| 29 | if(computingResource.getComputingResourceTypeChoiceSequence2() == null) |
---|
| 30 | throw new UnknownParameter("Templates are not defined."); |
---|
| 31 | return computingResource.getComputingResourceTypeChoiceSequence2(); |
---|
| 32 | } |
---|
| 33 | |
---|
| 34 | public String getResourceClass(){ |
---|
| 35 | return this.computingResource.getClazz(); |
---|
| 36 | } |
---|
| 37 | |
---|
| 38 | public String getName(){ |
---|
| 39 | return this.computingResource.getName(); |
---|
| 40 | } |
---|
| 41 | |
---|
| 42 | public long getGroupId(){ |
---|
| 43 | return this.computingResource.getGroupId(); |
---|
| 44 | } |
---|
| 45 | } |
---|