3e93190fc20735763437216ab6b7c5790610a5fa
[iot2.git] / benchmarks / SmartLightsController / LightBulbSmart_Stub.java
1 package SmartLightsController;
2
3 import java.io.IOException;
4 import java.util.List;
5 import java.util.ArrayList;
6 import java.util.Arrays;
7 import iotrmi.Java.IoTRMICall;
8 import iotrmi.Java.IoTRMIObject;
9
10 import iotcode.interfaces.LightBulbSmart;
11
12 public class LightBulbSmart_Stub implements LightBulbSmart {
13
14         private IoTRMICall rmiCall;
15         private String callbackAddress;
16         private int[] ports;
17
18         private final static int objectId = 0;
19         
20
21         public LightBulbSmart_Stub(int _port, String _skeletonAddress, String _callbackAddress, int _rev, int[] _ports) throws Exception {
22                 callbackAddress = _callbackAddress;
23                 ports = _ports;
24                 rmiCall = new IoTRMICall(_port, _skeletonAddress, _rev);
25         }
26
27         public void turnOn() {
28                 int methodId = 2;
29                 Class<?> retType = void.class;
30                 Class<?>[] paramCls = new Class<?>[] {  };
31                 Object[] paramObj = new Object[] {  };
32                 rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
33         }
34
35         public double getBrightnessRangeLowerBound() {
36                 int methodId = 10;
37                 Class<?> retType = double.class;
38                 Class<?>[] paramCls = new Class<?>[] {  };
39                 Object[] paramObj = new Object[] {  };
40                 Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
41                 return (double)retObj;
42         }
43
44         public void turnOff() {
45                 int methodId = 1;
46                 Class<?> retType = void.class;
47                 Class<?>[] paramCls = new Class<?>[] {  };
48                 Object[] paramObj = new Object[] {  };
49                 rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
50         }
51
52         public boolean getState() {
53                 int methodId = 3;
54                 Class<?> retType = boolean.class;
55                 Class<?>[] paramCls = new Class<?>[] {  };
56                 Object[] paramObj = new Object[] {  };
57                 Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
58                 return (boolean)retObj;
59         }
60
61         public double getBrightnessRangeUpperBound() {
62                 int methodId = 11;
63                 Class<?> retType = double.class;
64                 Class<?>[] paramCls = new Class<?>[] {  };
65                 Object[] paramObj = new Object[] {  };
66                 Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
67                 return (double)retObj;
68         }
69
70         public double getSaturation() {
71                 int methodId = 8;
72                 Class<?> retType = double.class;
73                 Class<?>[] paramCls = new Class<?>[] {  };
74                 Object[] paramObj = new Object[] {  };
75                 Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
76                 return (double)retObj;
77         }
78
79         public double getHueRangeLowerBound() {
80                 int methodId = 12;
81                 Class<?> retType = double.class;
82                 Class<?>[] paramCls = new Class<?>[] {  };
83                 Object[] paramObj = new Object[] {  };
84                 Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
85                 return (double)retObj;
86         }
87
88         public double getHue() {
89                 int methodId = 7;
90                 Class<?> retType = double.class;
91                 Class<?>[] paramCls = new Class<?>[] {  };
92                 Object[] paramObj = new Object[] {  };
93                 Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
94                 return (double)retObj;
95         }
96
97         public double getHueRangeUpperBound() {
98                 int methodId = 13;
99                 Class<?> retType = double.class;
100                 Class<?>[] paramCls = new Class<?>[] {  };
101                 Object[] paramObj = new Object[] {  };
102                 Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
103                 return (double)retObj;
104         }
105
106         public int getTemperature() {
107                 int methodId = 9;
108                 Class<?> retType = int.class;
109                 Class<?>[] paramCls = new Class<?>[] {  };
110                 Object[] paramObj = new Object[] {  };
111                 Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
112                 return (int)retObj;
113         }
114
115         public double getBrightness() {
116                 int methodId = 6;
117                 Class<?> retType = double.class;
118                 Class<?>[] paramCls = new Class<?>[] {  };
119                 Object[] paramObj = new Object[] {  };
120                 Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
121                 return (double)retObj;
122         }
123
124         public int getTemperatureRangeLowerBound() {
125                 int methodId = 16;
126                 Class<?> retType = int.class;
127                 Class<?>[] paramCls = new Class<?>[] {  };
128                 Object[] paramObj = new Object[] {  };
129                 Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
130                 return (int)retObj;
131         }
132
133         public int getTemperatureRangeUpperBound() {
134                 int methodId = 17;
135                 Class<?> retType = int.class;
136                 Class<?>[] paramCls = new Class<?>[] {  };
137                 Object[] paramObj = new Object[] {  };
138                 Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
139                 return (int)retObj;
140         }
141
142         public void setColor(double _hue, double _saturation, double _brightness) {
143                 int methodId = 4;
144                 Class<?> retType = void.class;
145                 Class<?>[] paramCls = new Class<?>[] { double.class, double.class, double.class };
146                 Object[] paramObj = new Object[] { _hue, _saturation, _brightness };
147                 rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
148         }
149
150         public void init() {
151                 int methodId = 0;
152                 Class<?> retType = void.class;
153                 Class<?>[] paramCls = new Class<?>[] {  };
154                 Object[] paramObj = new Object[] {  };
155                 rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
156         }
157
158         public double getSaturationRangeLowerBound() {
159                 int methodId = 14;
160                 Class<?> retType = double.class;
161                 Class<?>[] paramCls = new Class<?>[] {  };
162                 Object[] paramObj = new Object[] {  };
163                 Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
164                 return (double)retObj;
165         }
166
167         public double getSaturationRangeUpperBound() {
168                 int methodId = 15;
169                 Class<?> retType = double.class;
170                 Class<?>[] paramCls = new Class<?>[] {  };
171                 Object[] paramObj = new Object[] {  };
172                 Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
173                 return (double)retObj;
174         }
175
176         public void setTemperature(int _temperature) {
177                 int methodId = 5;
178                 Class<?> retType = void.class;
179                 Class<?>[] paramCls = new Class<?>[] { int.class };
180                 Object[] paramObj = new Object[] { _temperature };
181                 rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
182         }
183
184 }