blob: 7b38fef0cbad734d74a8e3158b045d6bc1129507 [file] [log] [blame]
HIGUCHI Yuta20514902013-06-12 11:24:16 -07001package net.onrc.onos.ofcontroller.core;
Pankaj Berde1b8a42f2013-02-15 08:25:03 -08002
HIGUCHI Yuta60a10142013-06-14 15:50:10 -07003import net.onrc.onos.ofcontroller.flowmanager.web.DatapathSummarySerializer;
Jonathan Hart01f2d272013-04-04 20:03:46 -07004
Pankaj Berde1b8a42f2013-02-15 08:25:03 -08005import org.codehaus.jackson.annotate.JsonIgnore;
6import org.codehaus.jackson.annotate.JsonProperty;
Jonathan Hart01f2d272013-04-04 20:03:46 -07007import org.codehaus.jackson.map.annotate.JsonSerialize;
Pankaj Berde1b8a42f2013-02-15 08:25:03 -08008
9import com.tinkerpop.blueprints.Direction;
10import com.tinkerpop.frames.Adjacency;
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080011import com.tinkerpop.frames.Property;
12import com.tinkerpop.frames.annotations.gremlin.GremlinGroovy;
Pankaj Berdef2f2f032013-06-10 21:08:14 -070013import com.tinkerpop.frames.annotations.gremlin.GremlinParam;
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080014import com.tinkerpop.frames.VertexFrame;
15
Teru68076a42013-06-27 14:57:49 -070016/*
17 * This is the interfaces to make the objects for Cassandra DB.
18 * They are interfaces, but it is also implementation,
19 * so this handles various control to the objects.
20 * Please take a look at tinkerpop/frames annotation doc to understand more.
21 */
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080022public interface INetMapTopologyObjects {
23
24public interface IBaseObject extends VertexFrame {
25
26 @JsonProperty("state")
27 @Property("state")
28 public String getState();
Pankaj Berde1cde50b2013-02-19 20:16:06 -080029
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080030 @Property("state")
31 public void setState(final String state);
32
33 @JsonIgnore
34 @Property("type")
35 public String getType();
36 @Property("type")
37 public void setType(final String type);
38
39}
40
41public interface ISwitchObject extends IBaseObject{
42
43 @JsonProperty("dpid")
44 @Property("dpid")
45 public String getDPID();
46
47 @Property("dpid")
48 public void setDPID(String dpid);
49
50 @JsonProperty("ports")
51 @Adjacency(label="on")
52 public Iterable<IPortObject> getPorts();
Pankaj Berde62016142013-04-09 15:35:50 -070053
54// Requires Frames 2.3.0
Pankaj Berdef2f2f032013-06-10 21:08:14 -070055 @JsonIgnore
Toshio Koide46dec822013-06-17 14:21:16 -070056 @GremlinGroovy("it.out('on').has('number',port_num)")
Pankaj Berdef2f2f032013-06-10 21:08:14 -070057 public IPortObject getPort(@GremlinParam("port_num") final short port_num);
Pankaj Berdeda809572013-02-22 15:31:20 -080058
59 @Adjacency(label="on")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080060 public void addPort(final IPortObject port);
61
62 @Adjacency(label="on")
63 public void removePort(final IPortObject port);
64
65 @JsonIgnore
Toshio Koide46dec822013-06-17 14:21:16 -070066 @GremlinGroovy("it.out('on').out('host')")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080067 public Iterable<IDeviceObject> getDevices();
Pankaj Berded0079742013-03-27 17:53:25 -070068
69 @JsonIgnore
Teru68076a42013-06-27 14:57:49 -070070 @Adjacency(label="switch",direction = Direction.IN)
Pankaj Berded0079742013-03-27 17:53:25 -070071 public Iterable<IFlowEntry> getFlowEntries();
Pankaj Berdef2f2f032013-06-10 21:08:14 -070072
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080073 }
74
75 public interface IPortObject extends IBaseObject{
76
77 @JsonProperty("number")
78 @Property("number")
79 public Short getNumber();
80
Pankaj Berdebbd38612013-06-22 05:59:12 -070081 @JsonIgnore
82 @Property("port_id")
83 public void setPortId(String id);
84
85 @JsonIgnore
86 @Property("port_id")
87 public String getPortId();
88
Pankaj Berde15193092013-03-21 17:30:14 -070089 @Property("number")
90 public void setNumber(Short n);
91
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080092 @JsonProperty("desc")
93 @Property("desc")
94 public String getDesc();
95
Pankaj Berde15193092013-03-21 17:30:14 -070096 @Property("desc")
97 public void setDesc(String s);
98
99 @JsonIgnore
Pankaj Berdef1404a72013-04-03 11:50:07 -0700100 @Property("port_state")
Pankaj Berde15193092013-03-21 17:30:14 -0700101 public Integer getPortState();
102
103 @Property("port_state")
104 public void setPortState(Integer s);
105
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800106 @JsonIgnore
Toshio Koide2bab79f2013-06-17 14:29:15 -0700107// @GremlinGroovy("it.in('on')")
Teru87cd2da2013-06-15 20:33:08 -0700108 @Adjacency(label="on",direction = Direction.IN)
Teru80f75132013-06-16 05:16:32 -0700109 public ISwitchObject getSwitch();
Pankaj Berdea6b80c32013-03-29 09:02:56 -0700110
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800111 @JsonProperty("devices")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800112 @Adjacency(label="host")
113 public Iterable<IDeviceObject> getDevices();
114
115 @Adjacency(label="host")
116 public void setDevice(final IDeviceObject device);
117
118 @Adjacency(label="host")
119 public void removeDevice(final IDeviceObject device);
120
Pankaj Berded0079742013-03-27 17:53:25 -0700121 @JsonIgnore
Teru68076a42013-06-27 14:57:49 -0700122 @Adjacency(label="inport",direction = Direction.IN)
Pankaj Berded0079742013-03-27 17:53:25 -0700123 public Iterable<IFlowEntry> getInFlowEntries();
124
125 @JsonIgnore
Teru68076a42013-06-27 14:57:49 -0700126 @Adjacency(label="outport",direction = Direction.IN)
Pankaj Berded0079742013-03-27 17:53:25 -0700127 public Iterable<IFlowEntry> getOutFlowEntries();
128
Pankaj Berde5fb27632013-04-05 08:56:12 -0700129 @JsonIgnore
130 @Adjacency(label="link")
131 public Iterable<IPortObject> getLinkedPorts();
132
Pankaj Berdea6b80c32013-03-29 09:02:56 -0700133 @Adjacency(label="link")
134 public void removeLink(final IPortObject dest_port);
135
Pankaj Berde5fb27632013-04-05 08:56:12 -0700136 @Adjacency(label="link")
137 public void setLinkPort(final IPortObject dest_port);
138
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800139// @JsonIgnore
140// @Adjacency(label="link")
141// public Iterable<ILinkObject> getLinks();
142 }
143
144 public interface IDeviceObject extends IBaseObject {
145
146 @JsonProperty("mac")
147 @Property("dl_addr")
148 public String getMACAddress();
149 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800150 public void setMACAddress(String macaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800151
152 @JsonProperty("ipv4")
153 @Property("nw_addr")
154 public String getIPAddress();
Teru87cd2da2013-06-15 20:33:08 -0700155 @Property("nw_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800156 public void setIPAddress(String ipaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800157
158 @JsonIgnore
Teru87cd2da2013-06-15 20:33:08 -0700159 @Adjacency(label="host",direction = Direction.IN)
Pankaj Berde2497e542013-02-19 18:51:24 -0800160 public Iterable<IPortObject> getAttachedPorts();
161
162 @JsonIgnore
Teru68076a42013-06-27 14:57:49 -0700163 @Adjacency(label="host",direction=Direction.IN)
Pankaj Berde2497e542013-02-19 18:51:24 -0800164 public void setHostPort(final IPortObject port);
165
166 @JsonIgnore
Teru68076a42013-06-27 14:57:49 -0700167 @Adjacency(label="host",direction=Direction.IN)
Pankaj Berde2497e542013-02-19 18:51:24 -0800168 public void removeHostPort(final IPortObject port);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800169
170 @JsonIgnore
Toshio Koide13260102013-06-17 13:44:27 -0700171 @GremlinGroovy("it.in('host').in('on')")
Pankaj Berde2497e542013-02-19 18:51:24 -0800172 public Iterable<ISwitchObject> getSwitch();
173
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800174/* @JsonProperty("dpid")
175 @GremlinGroovy("_().in('host').in('on').next().getProperty('dpid')")
176 public Iterable<String> getSwitchDPID();
177
178 @JsonProperty("number")
179 @GremlinGroovy("_().in('host').transform{it.number}")
180 public Iterable<Short> getPortNumber();
181
Pankaj Berde2497e542013-02-19 18:51:24 -0800182 @JsonProperty("AttachmentPoint")
183 @GremlinGroovy("_().in('host').in('on').path(){it.number}{it.dpid}")
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800184 public Iterable<SwitchPort> getAttachmentPoints();*/
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800185 }
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800186
187public interface IFlowPath extends IBaseObject {
Jonathan Hart01f2d272013-04-04 20:03:46 -0700188 @JsonProperty("flowId")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800189 @Property("flow_id")
190 public String getFlowId();
191
192 @Property("flow_id")
193 public void setFlowId(String flowId);
194
Jonathan Hart01f2d272013-04-04 20:03:46 -0700195 @JsonProperty("installerId")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800196 @Property("installer_id")
197 public String getInstallerId();
198
199 @Property("installer_id")
200 public void setInstallerId(String installerId);
201
Pavlin Radoslavov204b2862013-07-12 14:15:36 -0700202 @JsonProperty("flowPathFlags")
203 @Property("flow_path_flags")
204 public Long getFlowPathFlags();
205
206 @Property("flow_path_flags")
207 public void setFlowPathFlags(Long flowPathFlags);
208
Jonathan Hart01f2d272013-04-04 20:03:46 -0700209 @JsonProperty("srcDpid")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800210 @Property("src_switch")
211 public String getSrcSwitch();
212
213 @Property("src_switch")
214 public void setSrcSwitch(String srcSwitch);
215
Jonathan Hart01f2d272013-04-04 20:03:46 -0700216 @JsonProperty("srcPort")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800217 @Property("src_port")
218 public Short getSrcPort();
219
220 @Property("src_port")
221 public void setSrcPort(Short srcPort);
222
Jonathan Hart01f2d272013-04-04 20:03:46 -0700223 @JsonProperty("dstDpid")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800224 @Property("dst_switch")
225 public String getDstSwitch();
226
227 @Property("dst_switch")
228 public void setDstSwitch(String dstSwitch);
229
Jonathan Hart01f2d272013-04-04 20:03:46 -0700230 @JsonProperty("dstPort")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800231 @Property("dst_port")
232 public Short getDstPort();
233
234 @Property("dst_port")
235 public void setDstPort(Short dstPort);
236
Jonathan Hart01f2d272013-04-04 20:03:46 -0700237 @JsonProperty("dataPath")
238 @JsonSerialize(using=DatapathSummarySerializer.class)
Pavlin Radoslavovdbaaf2e2013-03-29 04:25:55 -0700239 @Property("data_path_summary")
240 public String getDataPathSummary();
241
242 @Property("data_path_summary")
243 public void setDataPathSummary(String dataPathSummary);
244
Jonathan Hart01f2d272013-04-04 20:03:46 -0700245 @JsonIgnore
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800246 @Adjacency(label="flow", direction=Direction.IN)
247 public Iterable<IFlowEntry> getFlowEntries();
248
249 @Adjacency(label="flow", direction=Direction.IN)
250 public void addFlowEntry(final IFlowEntry flowEntry);
251
252 @Adjacency(label="flow", direction=Direction.IN)
253 public void removeFlowEntry(final IFlowEntry flowEntry);
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700254
Pavlin Radoslavov1bc2c472013-07-17 18:11:37 -0700255 //
256 // Matching fields
257 //
Jonathan Hart01f2d272013-04-04 20:03:46 -0700258 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700259 @Property("matchSrcMac")
260 public String getMatchSrcMac();
261
262 @Property("matchSrcMac")
263 public void setMatchSrcMac(String matchSrcMac);
264
Jonathan Hart01f2d272013-04-04 20:03:46 -0700265 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700266 @Property("matchDstMac")
267 public String getMatchDstMac();
268
269 @Property("matchDstMac")
270 public void setMatchDstMac(String matchDstMac);
271
Jonathan Hart01f2d272013-04-04 20:03:46 -0700272 @JsonIgnore
Pavlin Radoslavovad3a1e62013-07-09 13:30:16 -0700273 @Property("matchEthernetFrameType")
274 public Short getMatchEthernetFrameType();
275
276 @Property("matchEthernetFrameType")
277 public void setMatchEthernetFrameType(Short matchEthernetFrameType);
278
279 @JsonIgnore
280 @Property("matchVlanId")
281 public Short getMatchVlanId();
282
283 @Property("matchVlanId")
284 public void setMatchVlanId(Short matchVlanId);
285
286 @JsonIgnore
287 @Property("matchVlanPriority")
288 public Byte getMatchVlanPriority();
289
290 @Property("matchVlanPriority")
291 public void setMatchVlanPriority(Byte matchVlanPriority);
292
293 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700294 @Property("matchSrcIPv4Net")
295 public String getMatchSrcIPv4Net();
296
297 @Property("matchSrcIPv4Net")
298 public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
299
Jonathan Hart01f2d272013-04-04 20:03:46 -0700300 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700301 @Property("matchDstIPv4Net")
302 public String getMatchDstIPv4Net();
303
304 @Property("matchDstIPv4Net")
305 public void setMatchDstIPv4Net(String matchDstIPv4Net);
Pavlin Radoslavovad3a1e62013-07-09 13:30:16 -0700306
307 @JsonIgnore
308 @Property("matchIpProto")
309 public Byte getMatchIpProto();
310
311 @Property("matchIpProto")
312 public void setMatchIpProto(Byte matchIpProto);
313
314 @JsonIgnore
315 @Property("matchIpToS")
316 public Byte getMatchIpToS();
317
318 @Property("matchIpToS")
319 public void setMatchIpToS(Byte matchIpToS);
320
321 @JsonIgnore
322 @Property("matchSrcTcpUdpPort")
323 public Short getMatchSrcTcpUdpPort();
324
325 @Property("matchSrcTcpUdpPort")
326 public void setMatchSrcTcpUdpPort(Short matchSrcTcpUdpPort);
327
328 @JsonIgnore
329 @Property("matchDstTcpUdpPort")
330 public Short getMatchDstTcpUdpPort();
331
332 @Property("matchDstTcpUdpPort")
333 public void setMatchDstTcpUdpPort(Short matchDstTcpUdpPort);
334
Pavlin Radoslavov1bc2c472013-07-17 18:11:37 -0700335 //
336 // Action-related fields
337 //
338 @Property("actions")
339 public String getActions();
340
341 @Property("actions")
342 public void setActions(String actionsStr);
343
344 //
345 // Other fields
346 //
Pankaj Berded0079742013-03-27 17:53:25 -0700347 @JsonIgnore
Toshio Koide13260102013-06-17 13:44:27 -0700348 @GremlinGroovy("it.in('flow').out('switch')")
Pankaj Berdef1404a72013-04-03 11:50:07 -0700349 public Iterable<ISwitchObject> getSwitches();
Jonathan Hart01f2d272013-04-04 20:03:46 -0700350
351 @JsonIgnore
352 @Property("state")
353 public String getState();
Pavlin Radoslavov710e2a72013-04-08 02:31:05 +0000354
355 @JsonIgnore
356 @Property("user_state")
357 public String getUserState();
358
359 @Property("user_state")
360 public void setUserState(String userState);
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800361 }
362
363public interface IFlowEntry extends IBaseObject {
364 @Property("flow_entry_id")
365 public String getFlowEntryId();
366
367 @Property("flow_entry_id")
368 public void setFlowEntryId(String flowEntryId);
369
370 @Property("switch_dpid")
371 public String getSwitchDpid();
372
373 @Property("switch_dpid")
374 public void setSwitchDpid(String switchDpid);
375
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800376 @Property("user_state")
377 public String getUserState();
378
379 @Property("user_state")
380 public void setUserState(String userState);
381
382 @Property("switch_state")
383 public String getSwitchState();
384
385 @Property("switch_state")
386 public void setSwitchState(String switchState);
387
388 @Property("error_state_type")
389 public String getErrorStateType();
390
391 @Property("error_state_type")
392 public void setErrorStateType(String errorStateType);
393
394 @Property("error_state_code")
395 public String getErrorStateCode();
396
397 @Property("error_state_code")
398 public void setErrorStateCode(String errorStateCode);
Pavlin Radoslavove2f0de82013-03-12 01:39:30 -0700399
Pavlin Radoslavov1bc2c472013-07-17 18:11:37 -0700400 //
401 // Matching fields
402 //
Pavlin Radoslavove2f0de82013-03-12 01:39:30 -0700403 @Property("matchInPort")
404 public Short getMatchInPort();
405
406 @Property("matchInPort")
407 public void setMatchInPort(Short matchInPort);
408
Pavlin Radoslavove2f0de82013-03-12 01:39:30 -0700409 @Property("matchSrcMac")
410 public String getMatchSrcMac();
411
412 @Property("matchSrcMac")
413 public void setMatchSrcMac(String matchSrcMac);
414
415 @Property("matchDstMac")
416 public String getMatchDstMac();
417
418 @Property("matchDstMac")
419 public void setMatchDstMac(String matchDstMac);
420
Pavlin Radoslavovad3a1e62013-07-09 13:30:16 -0700421 @Property("matchEthernetFrameType")
422 public Short getMatchEthernetFrameType();
423
424 @Property("matchEthernetFrameType")
425 public void setMatchEthernetFrameType(Short matchEthernetFrameType);
426
427 @Property("matchVlanId")
428 public Short getMatchVlanId();
429
430 @Property("matchVlanId")
431 public void setMatchVlanId(Short matchVlanId);
432
433 @Property("matchVlanPriority")
434 public Byte getMatchVlanPriority();
435
436 @Property("matchVlanPriority")
437 public void setMatchVlanPriority(Byte matchVlanPriority);
438
Pavlin Radoslavove2f0de82013-03-12 01:39:30 -0700439 @Property("matchSrcIPv4Net")
440 public String getMatchSrcIPv4Net();
441
442 @Property("matchSrcIPv4Net")
443 public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
444
445 @Property("matchDstIPv4Net")
446 public String getMatchDstIPv4Net();
447
448 @Property("matchDstIPv4Net")
449 public void setMatchDstIPv4Net(String matchDstIPv4Net);
450
Pavlin Radoslavovad3a1e62013-07-09 13:30:16 -0700451 @Property("matchIpProto")
452 public Byte getMatchIpProto();
453
454 @Property("matchIpProto")
455 public void setMatchIpProto(Byte matchIpProto);
456
457 @Property("matchIpToS")
458 public Byte getMatchIpToS();
459
460 @Property("matchIpToS")
461 public void setMatchIpToS(Byte matchIpToS);
462
463 @Property("matchSrcTcpUdpPort")
464 public Short getMatchSrcTcpUdpPort();
465
466 @Property("matchSrcTcpUdpPort")
467 public void setMatchSrcTcpUdpPort(Short matchSrcTcpUdpPort);
468
469 @Property("matchDstTcpUdpPort")
470 public Short getMatchDstTcpUdpPort();
471
472 @Property("matchDstTcpUdpPort")
473 public void setMatchDstTcpUdpPort(Short matchDstTcpUdpPort);
474
Pavlin Radoslavov1bc2c472013-07-17 18:11:37 -0700475 //
476 // Action-related fields
477 //
Pavlin Radoslavovc1bafd12013-07-12 17:00:35 -0700478 @Property("actionOutputPort")
479 public Short getActionOutputPort();
Pavlin Radoslavove2f0de82013-03-12 01:39:30 -0700480
Pavlin Radoslavovc1bafd12013-07-12 17:00:35 -0700481 @Property("actionOutputPort")
482 public void setActionOutputPort(Short actionOutputPort);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700483
Pavlin Radoslavov1bc2c472013-07-17 18:11:37 -0700484 @Property("actions")
485 public String getActions();
486
487 @Property("actions")
488 public void setActions(String actionsStr);
489
490 //
491 // Other fields
492 //
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700493 @Adjacency(label="flow")
494 public IFlowPath getFlow();
495
496 @Adjacency(label="flow")
497 public void setFlow(IFlowPath flow);
498
Pankaj Berded0079742013-03-27 17:53:25 -0700499 @Adjacency(label="switch")
500 public ISwitchObject getSwitch();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700501
Pankaj Berded0079742013-03-27 17:53:25 -0700502 @Adjacency(label="switch")
503 public void setSwitch(ISwitchObject sw);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700504
Pankaj Berded0079742013-03-27 17:53:25 -0700505 @Adjacency(label="inport")
506 public IPortObject getInPort();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700507
Pankaj Berded0079742013-03-27 17:53:25 -0700508 @Adjacency(label="inport")
509 public void setInPort(IPortObject port);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700510
Pankaj Berded0079742013-03-27 17:53:25 -0700511 @Adjacency(label="outport")
512 public IPortObject getOutPort();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700513
Pavlin Radoslavov4fead9c2013-03-28 03:09:27 -0700514 @Adjacency(label="outport")
Pankaj Berded0079742013-03-27 17:53:25 -0700515 public void setOutPort(IPortObject port);
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800516 }
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800517}