9b899a67c09b445f017d5e919281d83e204f0f55
[onosfw.git] /
1 /*
2  * Copyright 2015 Open Networking Laboratory
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package org.onosproject.openflow;
17
18 import java.util.List;
19
20 import org.jboss.netty.channel.Channel;
21 import org.onosproject.net.Device;
22 import org.onosproject.net.driver.DriverData;
23 import org.onosproject.net.driver.DriverHandler;
24 import org.onosproject.openflow.controller.Dpid;
25 import org.onosproject.openflow.controller.RoleState;
26 import org.onosproject.openflow.controller.driver.OpenFlowAgent;
27 import org.onosproject.openflow.controller.driver.OpenFlowSwitchDriver;
28 import org.onosproject.openflow.controller.driver.RoleHandler;
29 import org.onosproject.openflow.controller.driver.SwitchStateException;
30 import org.projectfloodlight.openflow.protocol.OFDescStatsReply;
31 import org.projectfloodlight.openflow.protocol.OFErrorMsg;
32 import org.projectfloodlight.openflow.protocol.OFFactories;
33 import org.projectfloodlight.openflow.protocol.OFFactory;
34 import org.projectfloodlight.openflow.protocol.OFFeaturesReply;
35 import org.projectfloodlight.openflow.protocol.OFMessage;
36 import org.projectfloodlight.openflow.protocol.OFPortDesc;
37 import org.projectfloodlight.openflow.protocol.OFPortDescStatsReply;
38 import org.projectfloodlight.openflow.protocol.OFVersion;
39
40 /**
41  * Testing adapter for the OpenFlow switch driver class.
42  */
43 public class OpenflowSwitchDriverAdapter implements OpenFlowSwitchDriver {
44
45     RoleState role = RoleState.MASTER;
46
47     @Override
48     public void setAgent(OpenFlowAgent agent) {
49
50     }
51
52     @Override
53     public void setRoleHandler(RoleHandler roleHandler) {
54
55     }
56
57     @Override
58     public void reassertRole() {
59
60     }
61
62     @Override
63     public boolean handleRoleError(OFErrorMsg error) {
64         return false;
65     }
66
67     @Override
68     public void handleNiciraRole(OFMessage m) throws SwitchStateException {
69
70     }
71
72     @Override
73     public void handleRole(OFMessage m) throws SwitchStateException {
74
75     }
76
77     @Override
78     public boolean connectSwitch() {
79         return false;
80     }
81
82     @Override
83     public boolean activateMasterSwitch() {
84         return false;
85     }
86
87     @Override
88     public boolean activateEqualSwitch() {
89         return false;
90     }
91
92     @Override
93     public void transitionToEqualSwitch() {
94
95     }
96
97     @Override
98     public void transitionToMasterSwitch() {
99
100     }
101
102     @Override
103     public void removeConnectedSwitch() {
104
105     }
106
107     @Override
108     public void setPortDescReply(OFPortDescStatsReply portDescReply) {
109
110     }
111
112     @Override
113     public void setPortDescReplies(List<OFPortDescStatsReply> portDescReplies) {
114
115     }
116
117     @Override
118     public void setFeaturesReply(OFFeaturesReply featuresReply) {
119
120     }
121
122     @Override
123     public void setSwitchDescription(OFDescStatsReply desc) {
124
125     }
126
127     @Override
128     public int getNextTransactionId() {
129         return 0;
130     }
131
132     @Override
133     public void setOFVersion(OFVersion ofV) {
134
135     }
136
137     @Override
138     public void setTableFull(boolean full) {
139
140     }
141
142     @Override
143     public void setChannel(Channel channel) {
144
145     }
146
147     @Override
148     public void setConnected(boolean connected) {
149
150     }
151
152     @Override
153     public void init(Dpid dpid, OFDescStatsReply desc, OFVersion ofv) {
154
155     }
156
157     @Override
158     public Boolean supportNxRole() {
159         return true;
160     }
161
162     @Override
163     public void startDriverHandshake() {
164
165     }
166
167     @Override
168     public boolean isDriverHandshakeComplete() {
169         return false;
170     }
171
172     @Override
173     public void processDriverHandshakeMessage(OFMessage m) {
174
175     }
176
177     @Override
178     public void sendRoleRequest(OFMessage message) {
179
180     }
181
182     @Override
183     public void sendHandshakeMessage(OFMessage message) {
184
185     }
186
187     @Override
188     public DriverHandler handler() {
189         return null;
190     }
191
192     @Override
193     public void setHandler(DriverHandler handler) {
194
195     }
196
197     @Override
198     public DriverData data() {
199         return null;
200     }
201
202     @Override
203     public void setData(DriverData data) {
204
205     }
206
207     @Override
208     public void sendMsg(OFMessage msg) {
209
210     }
211
212     @Override
213     public void sendMsg(List<OFMessage> msgs) {
214
215     }
216
217     @Override
218     public void handleMessage(OFMessage fromSwitch) {
219
220     }
221
222     @Override
223     public void setRole(RoleState role) {
224         this.role = role;
225     }
226
227     @Override
228     public RoleState getRole() {
229         return role;
230     }
231
232     @Override
233     public List<OFPortDesc> getPorts() {
234         return null;
235     }
236
237     @Override
238     public OFFactory factory() {
239         // return what-ever triggers requestPending = true
240         return OFFactories.getFactory(OFVersion.OF_10);
241     }
242
243     @Override
244     public String getStringId() {
245         return "100";
246     }
247
248     @Override
249     public long getId() {
250         return 0;
251     }
252
253     @Override
254     public String manufacturerDescription() {
255         return null;
256     }
257
258     @Override
259     public String datapathDescription() {
260         return null;
261     }
262
263     @Override
264     public String hardwareDescription() {
265         return null;
266     }
267
268     @Override
269     public String softwareDescription() {
270         return null;
271     }
272
273     @Override
274     public String serialNumber() {
275         return null;
276     }
277
278     @Override
279     public boolean isConnected() {
280         return false;
281     }
282
283     @Override
284     public void disconnectSwitch() {
285
286     }
287
288     @Override
289     public void returnRoleReply(RoleState requested, RoleState response) {
290
291     }
292
293     @Override
294     public Device.Type deviceType() {
295         return Device.Type.SWITCH;
296     }
297
298     @Override
299     public String channelId() {
300         return null;
301     }
302 }