2a697ce8c0610be9069ff1eda8c91f84656051ad
[iot2.git] / benchmarks / Java / Lifxtest / LightBulbTest_Stub.java
1 package Lifxtest;
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.LightBulbTest;
11
12 public class LightBulbTest_Stub implements LightBulbTest {
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 LightBulbTest_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 getBrightness() {
36                 int methodId = 6;
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 void setColor(double _hue, double _saturation, double _brightness) {
62                 int methodId = 4;
63                 Class<?> retType = void.class;
64                 Class<?>[] paramCls = new Class<?>[] { double.class, double.class, double.class };
65                 Object[] paramObj = new Object[] { _hue, _saturation, _brightness };
66                 rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
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 void init() {
79                 int methodId = 0;
80                 Class<?> retType = void.class;
81                 Class<?>[] paramCls = new Class<?>[] {  };
82                 Object[] paramObj = new Object[] {  };
83                 rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
84         }
85
86         public void setTemperature(int _temperature) {
87                 int methodId = 5;
88                 Class<?> retType = void.class;
89                 Class<?>[] paramCls = new Class<?>[] { int.class };
90                 Object[] paramObj = new Object[] { _temperature };
91                 rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
92         }
93
94         public double getHue() {
95                 int methodId = 7;
96                 Class<?> retType = double.class;
97                 Class<?>[] paramCls = new Class<?>[] {  };
98                 Object[] paramObj = new Object[] {  };
99                 Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
100                 return (double)retObj;
101         }
102
103         public int getTemperature() {
104                 int methodId = 9;
105                 Class<?> retType = int.class;
106                 Class<?>[] paramCls = new Class<?>[] {  };
107                 Object[] paramObj = new Object[] {  };
108                 Object retObj = rmiCall.remoteCall(objectId, methodId, retType, null, paramCls, paramObj);
109                 return (int)retObj;
110         }
111
112 }