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