1 package oic.simulator.serviceprovider.resource;
5 import org.oic.simulator.AutomationType;
6 import org.oic.simulator.ResourceAttribute;
7 import org.oic.simulator.ResourceAttribute.Range;
8 import org.oic.simulator.ResourceAttribute.Type;
10 public class LocalResourceAttribute {
12 // Native object reference
13 private ResourceAttribute resourceAttribute;
15 private Object attributeValue;
16 private List<String> attValues;
18 private int automationId;
20 private boolean automationInProgress;
22 private int automationUpdateInterval;
24 private AutomationType automationType;
26 public ResourceAttribute getResourceAttribute() {
27 return resourceAttribute;
30 public void setResourceAttribute(ResourceAttribute resourceAttribute) {
31 this.resourceAttribute = resourceAttribute;
34 public String getAttributeName() {
35 return resourceAttribute.getName();
38 public Object getAttributeValue() {
39 return attributeValue;
42 public void setAttributeValue(Object attributeValue) {
43 this.attributeValue = attributeValue;
46 public Object[] getAllowedValues() {
47 return resourceAttribute.getAllowedValues();
50 public Object getMinValue() {
51 return resourceAttribute.getRange().getMin();
54 public Object getMaxValue() {
55 return resourceAttribute.getRange().getMax();
58 public boolean isAutomationInProgress() {
59 return automationInProgress;
62 public void setAutomationInProgress(boolean automationInProgress) {
63 this.automationInProgress = automationInProgress;
66 public int getAutomationUpdateInterval() {
67 return automationUpdateInterval;
70 public void setAutomationUpdateInterval(int automationUpdateInterval) {
71 this.automationUpdateInterval = automationUpdateInterval;
74 public AutomationType getAutomationType() {
75 return automationType;
78 public void setAutomationType(AutomationType automationType) {
79 this.automationType = automationType;
82 public int getAutomationId() {
86 public void setAutomationId(int automationId) {
87 this.automationId = automationId;
90 public Type getAttValType() {
91 return resourceAttribute.getType();
94 public Type getAttValBaseType() {
95 return resourceAttribute.getBaseType();
98 public List<String> getAttValues() {
102 public void setAttValues(List<String> attValues) {
103 this.attValues = attValues;
106 public void printAttributeDetails() {
107 System.out.println("Attribute Name:" + resourceAttribute.getName());
108 System.out.println("Attribute Value:" + resourceAttribute.getValue());
109 System.out.println("Attribute Base Type:"
110 + resourceAttribute.getBaseType());
111 System.out.println("Attribute Type:" + resourceAttribute.getType());
112 System.out.print("Allowed Values:");
113 Object[] values = getAllowedValues();
114 for (Object obj : values) {
115 System.out.print(obj);
117 Range range = resourceAttribute.getRange();
119 System.out.println("Range:" + range.getMin() + " to "