blob: 0d5217172efb0e088e248a576a5d4c79a91efd96 [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;
11import com.tinkerpop.frames.Incidence;
12import com.tinkerpop.frames.Property;
13import com.tinkerpop.frames.annotations.gremlin.GremlinGroovy;
Pankaj Berdef2f2f032013-06-10 21:08:14 -070014import com.tinkerpop.frames.annotations.gremlin.GremlinParam;
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080015import com.tinkerpop.frames.VertexFrame;
16
Teru68076a42013-06-27 14:57:49 -070017/*
18 * This is the interfaces to make the objects for Cassandra DB.
19 * They are interfaces, but it is also implementation,
20 * so this handles various control to the objects.
21 * Please take a look at tinkerpop/frames annotation doc to understand more.
22 */
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080023public interface INetMapTopologyObjects {
24
25public interface IBaseObject extends VertexFrame {
26
27 @JsonProperty("state")
28 @Property("state")
29 public String getState();
Pankaj Berde1cde50b2013-02-19 20:16:06 -080030
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080031 @Property("state")
32 public void setState(final String state);
33
34 @JsonIgnore
35 @Property("type")
36 public String getType();
37 @Property("type")
38 public void setType(final String type);
39
40}
41
42public interface ISwitchObject extends IBaseObject{
43
44 @JsonProperty("dpid")
45 @Property("dpid")
46 public String getDPID();
47
48 @Property("dpid")
49 public void setDPID(String dpid);
50
51 @JsonProperty("ports")
52 @Adjacency(label="on")
53 public Iterable<IPortObject> getPorts();
Pankaj Berde62016142013-04-09 15:35:50 -070054
55// Requires Frames 2.3.0
Pankaj Berdef2f2f032013-06-10 21:08:14 -070056 @JsonIgnore
Toshio Koide46dec822013-06-17 14:21:16 -070057 @GremlinGroovy("it.out('on').has('number',port_num)")
Pankaj Berdef2f2f032013-06-10 21:08:14 -070058 public IPortObject getPort(@GremlinParam("port_num") final short port_num);
Pankaj Berdeda809572013-02-22 15:31:20 -080059
60 @Adjacency(label="on")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080061 public void addPort(final IPortObject port);
62
63 @Adjacency(label="on")
64 public void removePort(final IPortObject port);
65
66 @JsonIgnore
Toshio Koide46dec822013-06-17 14:21:16 -070067 @GremlinGroovy("it.out('on').out('host')")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080068 public Iterable<IDeviceObject> getDevices();
Pankaj Berded0079742013-03-27 17:53:25 -070069
70 @JsonIgnore
Teru68076a42013-06-27 14:57:49 -070071 @Adjacency(label="switch",direction = Direction.IN)
Pankaj Berded0079742013-03-27 17:53:25 -070072 public Iterable<IFlowEntry> getFlowEntries();
Pankaj Berdef2f2f032013-06-10 21:08:14 -070073
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080074 }
75
76 public interface IPortObject extends IBaseObject{
77
78 @JsonProperty("number")
79 @Property("number")
80 public Short getNumber();
81
Pankaj Berdebbd38612013-06-22 05:59:12 -070082 @JsonIgnore
83 @Property("port_id")
84 public void setPortId(String id);
85
86 @JsonIgnore
87 @Property("port_id")
88 public String getPortId();
89
Pankaj Berde15193092013-03-21 17:30:14 -070090 @Property("number")
91 public void setNumber(Short n);
92
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080093 @JsonProperty("desc")
94 @Property("desc")
95 public String getDesc();
96
Pankaj Berde15193092013-03-21 17:30:14 -070097 @Property("desc")
98 public void setDesc(String s);
99
100 @JsonIgnore
Pankaj Berdef1404a72013-04-03 11:50:07 -0700101 @Property("port_state")
Pankaj Berde15193092013-03-21 17:30:14 -0700102 public Integer getPortState();
103
104 @Property("port_state")
105 public void setPortState(Integer s);
106
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800107 @JsonIgnore
Toshio Koide2bab79f2013-06-17 14:29:15 -0700108// @GremlinGroovy("it.in('on')")
Teru87cd2da2013-06-15 20:33:08 -0700109 @Adjacency(label="on",direction = Direction.IN)
Teru80f75132013-06-16 05:16:32 -0700110 public ISwitchObject getSwitch();
Pankaj Berdea6b80c32013-03-29 09:02:56 -0700111
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800112 @JsonProperty("devices")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800113 @Adjacency(label="host")
114 public Iterable<IDeviceObject> getDevices();
115
116 @Adjacency(label="host")
117 public void setDevice(final IDeviceObject device);
118
119 @Adjacency(label="host")
120 public void removeDevice(final IDeviceObject device);
121
Pankaj Berded0079742013-03-27 17:53:25 -0700122 @JsonIgnore
Teru68076a42013-06-27 14:57:49 -0700123 @Adjacency(label="inport",direction = Direction.IN)
Pankaj Berded0079742013-03-27 17:53:25 -0700124 public Iterable<IFlowEntry> getInFlowEntries();
125
126 @JsonIgnore
Teru68076a42013-06-27 14:57:49 -0700127 @Adjacency(label="outport",direction = Direction.IN)
Pankaj Berded0079742013-03-27 17:53:25 -0700128 public Iterable<IFlowEntry> getOutFlowEntries();
129
Pankaj Berde5fb27632013-04-05 08:56:12 -0700130 @JsonIgnore
131 @Adjacency(label="link")
132 public Iterable<IPortObject> getLinkedPorts();
133
Pankaj Berdea6b80c32013-03-29 09:02:56 -0700134 @Adjacency(label="link")
135 public void removeLink(final IPortObject dest_port);
136
Pankaj Berde5fb27632013-04-05 08:56:12 -0700137 @Adjacency(label="link")
138 public void setLinkPort(final IPortObject dest_port);
139
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800140// @JsonIgnore
141// @Adjacency(label="link")
142// public Iterable<ILinkObject> getLinks();
143 }
144
145 public interface IDeviceObject extends IBaseObject {
146
147 @JsonProperty("mac")
148 @Property("dl_addr")
149 public String getMACAddress();
150 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800151 public void setMACAddress(String macaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800152
153 @JsonProperty("ipv4")
154 @Property("nw_addr")
155 public String getIPAddress();
Teru87cd2da2013-06-15 20:33:08 -0700156 @Property("nw_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800157 public void setIPAddress(String ipaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800158
159 @JsonIgnore
Teru87cd2da2013-06-15 20:33:08 -0700160 @Adjacency(label="host",direction = Direction.IN)
Pankaj Berde2497e542013-02-19 18:51:24 -0800161 public Iterable<IPortObject> getAttachedPorts();
162
163 @JsonIgnore
Teru68076a42013-06-27 14:57:49 -0700164 @Adjacency(label="host",direction=Direction.IN)
Pankaj Berde2497e542013-02-19 18:51:24 -0800165 public void setHostPort(final IPortObject port);
166
167 @JsonIgnore
Teru68076a42013-06-27 14:57:49 -0700168 @Adjacency(label="host",direction=Direction.IN)
Pankaj Berde2497e542013-02-19 18:51:24 -0800169 public void removeHostPort(final IPortObject port);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800170
171 @JsonIgnore
Toshio Koide13260102013-06-17 13:44:27 -0700172 @GremlinGroovy("it.in('host').in('on')")
Pankaj Berde2497e542013-02-19 18:51:24 -0800173 public Iterable<ISwitchObject> getSwitch();
174
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800175/* @JsonProperty("dpid")
176 @GremlinGroovy("_().in('host').in('on').next().getProperty('dpid')")
177 public Iterable<String> getSwitchDPID();
178
179 @JsonProperty("number")
180 @GremlinGroovy("_().in('host').transform{it.number}")
181 public Iterable<Short> getPortNumber();
182
Pankaj Berde2497e542013-02-19 18:51:24 -0800183 @JsonProperty("AttachmentPoint")
184 @GremlinGroovy("_().in('host').in('on').path(){it.number}{it.dpid}")
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800185 public Iterable<SwitchPort> getAttachmentPoints();*/
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800186 }
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800187
188public interface IFlowPath extends IBaseObject {
Jonathan Hart01f2d272013-04-04 20:03:46 -0700189 @JsonProperty("flowId")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800190 @Property("flow_id")
191 public String getFlowId();
192
193 @Property("flow_id")
194 public void setFlowId(String flowId);
195
Jonathan Hart01f2d272013-04-04 20:03:46 -0700196 @JsonProperty("installerId")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800197 @Property("installer_id")
198 public String getInstallerId();
199
200 @Property("installer_id")
201 public void setInstallerId(String installerId);
202
Pavlin Radoslavov204b2862013-07-12 14:15:36 -0700203 @JsonProperty("flowPathFlags")
204 @Property("flow_path_flags")
205 public Long getFlowPathFlags();
206
207 @Property("flow_path_flags")
208 public void setFlowPathFlags(Long flowPathFlags);
209
Jonathan Hart01f2d272013-04-04 20:03:46 -0700210 @JsonProperty("srcDpid")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800211 @Property("src_switch")
212 public String getSrcSwitch();
213
214 @Property("src_switch")
215 public void setSrcSwitch(String srcSwitch);
216
Jonathan Hart01f2d272013-04-04 20:03:46 -0700217 @JsonProperty("srcPort")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800218 @Property("src_port")
219 public Short getSrcPort();
220
221 @Property("src_port")
222 public void setSrcPort(Short srcPort);
223
Jonathan Hart01f2d272013-04-04 20:03:46 -0700224 @JsonProperty("dstDpid")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800225 @Property("dst_switch")
226 public String getDstSwitch();
227
228 @Property("dst_switch")
229 public void setDstSwitch(String dstSwitch);
230
Jonathan Hart01f2d272013-04-04 20:03:46 -0700231 @JsonProperty("dstPort")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800232 @Property("dst_port")
233 public Short getDstPort();
234
235 @Property("dst_port")
236 public void setDstPort(Short dstPort);
237
Jonathan Hart01f2d272013-04-04 20:03:46 -0700238 @JsonProperty("dataPath")
239 @JsonSerialize(using=DatapathSummarySerializer.class)
Pavlin Radoslavovdbaaf2e2013-03-29 04:25:55 -0700240 @Property("data_path_summary")
241 public String getDataPathSummary();
242
243 @Property("data_path_summary")
244 public void setDataPathSummary(String dataPathSummary);
245
Jonathan Hart01f2d272013-04-04 20:03:46 -0700246 @JsonIgnore
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800247 @Adjacency(label="flow", direction=Direction.IN)
248 public Iterable<IFlowEntry> getFlowEntries();
249
250 @Adjacency(label="flow", direction=Direction.IN)
251 public void addFlowEntry(final IFlowEntry flowEntry);
252
253 @Adjacency(label="flow", direction=Direction.IN)
254 public void removeFlowEntry(final IFlowEntry flowEntry);
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700255
Jonathan Hart01f2d272013-04-04 20:03:46 -0700256 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700257 @Property("matchSrcMac")
258 public String getMatchSrcMac();
259
260 @Property("matchSrcMac")
261 public void setMatchSrcMac(String matchSrcMac);
262
Jonathan Hart01f2d272013-04-04 20:03:46 -0700263 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700264 @Property("matchDstMac")
265 public String getMatchDstMac();
266
267 @Property("matchDstMac")
268 public void setMatchDstMac(String matchDstMac);
269
Jonathan Hart01f2d272013-04-04 20:03:46 -0700270 @JsonIgnore
Pavlin Radoslavovad3a1e62013-07-09 13:30:16 -0700271 @Property("matchEthernetFrameType")
272 public Short getMatchEthernetFrameType();
273
274 @Property("matchEthernetFrameType")
275 public void setMatchEthernetFrameType(Short matchEthernetFrameType);
276
277 @JsonIgnore
278 @Property("matchVlanId")
279 public Short getMatchVlanId();
280
281 @Property("matchVlanId")
282 public void setMatchVlanId(Short matchVlanId);
283
284 @JsonIgnore
285 @Property("matchVlanPriority")
286 public Byte getMatchVlanPriority();
287
288 @Property("matchVlanPriority")
289 public void setMatchVlanPriority(Byte matchVlanPriority);
290
291 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700292 @Property("matchSrcIPv4Net")
293 public String getMatchSrcIPv4Net();
294
295 @Property("matchSrcIPv4Net")
296 public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
297
Jonathan Hart01f2d272013-04-04 20:03:46 -0700298 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700299 @Property("matchDstIPv4Net")
300 public String getMatchDstIPv4Net();
301
302 @Property("matchDstIPv4Net")
303 public void setMatchDstIPv4Net(String matchDstIPv4Net);
Pavlin Radoslavovad3a1e62013-07-09 13:30:16 -0700304
305 @JsonIgnore
306 @Property("matchIpProto")
307 public Byte getMatchIpProto();
308
309 @Property("matchIpProto")
310 public void setMatchIpProto(Byte matchIpProto);
311
312 @JsonIgnore
313 @Property("matchIpToS")
314 public Byte getMatchIpToS();
315
316 @Property("matchIpToS")
317 public void setMatchIpToS(Byte matchIpToS);
318
319 @JsonIgnore
320 @Property("matchSrcTcpUdpPort")
321 public Short getMatchSrcTcpUdpPort();
322
323 @Property("matchSrcTcpUdpPort")
324 public void setMatchSrcTcpUdpPort(Short matchSrcTcpUdpPort);
325
326 @JsonIgnore
327 @Property("matchDstTcpUdpPort")
328 public Short getMatchDstTcpUdpPort();
329
330 @Property("matchDstTcpUdpPort")
331 public void setMatchDstTcpUdpPort(Short matchDstTcpUdpPort);
332
Pankaj Berded0079742013-03-27 17:53:25 -0700333 @JsonIgnore
Toshio Koide13260102013-06-17 13:44:27 -0700334 @GremlinGroovy("it.in('flow').out('switch')")
Pankaj Berdef1404a72013-04-03 11:50:07 -0700335 public Iterable<ISwitchObject> getSwitches();
Jonathan Hart01f2d272013-04-04 20:03:46 -0700336
337 @JsonIgnore
338 @Property("state")
339 public String getState();
Pavlin Radoslavov710e2a72013-04-08 02:31:05 +0000340
341 @JsonIgnore
342 @Property("user_state")
343 public String getUserState();
344
345 @Property("user_state")
346 public void setUserState(String userState);
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800347 }
348
349public interface IFlowEntry extends IBaseObject {
350 @Property("flow_entry_id")
351 public String getFlowEntryId();
352
353 @Property("flow_entry_id")
354 public void setFlowEntryId(String flowEntryId);
355
356 @Property("switch_dpid")
357 public String getSwitchDpid();
358
359 @Property("switch_dpid")
360 public void setSwitchDpid(String switchDpid);
361
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800362 @Property("user_state")
363 public String getUserState();
364
365 @Property("user_state")
366 public void setUserState(String userState);
367
368 @Property("switch_state")
369 public String getSwitchState();
370
371 @Property("switch_state")
372 public void setSwitchState(String switchState);
373
374 @Property("error_state_type")
375 public String getErrorStateType();
376
377 @Property("error_state_type")
378 public void setErrorStateType(String errorStateType);
379
380 @Property("error_state_code")
381 public String getErrorStateCode();
382
383 @Property("error_state_code")
384 public void setErrorStateCode(String errorStateCode);
Pavlin Radoslavove2f0de82013-03-12 01:39:30 -0700385
386 @Property("matchInPort")
387 public Short getMatchInPort();
388
389 @Property("matchInPort")
390 public void setMatchInPort(Short matchInPort);
391
Pavlin Radoslavove2f0de82013-03-12 01:39:30 -0700392 @Property("matchSrcMac")
393 public String getMatchSrcMac();
394
395 @Property("matchSrcMac")
396 public void setMatchSrcMac(String matchSrcMac);
397
398 @Property("matchDstMac")
399 public String getMatchDstMac();
400
401 @Property("matchDstMac")
402 public void setMatchDstMac(String matchDstMac);
403
Pavlin Radoslavovad3a1e62013-07-09 13:30:16 -0700404 @Property("matchEthernetFrameType")
405 public Short getMatchEthernetFrameType();
406
407 @Property("matchEthernetFrameType")
408 public void setMatchEthernetFrameType(Short matchEthernetFrameType);
409
410 @Property("matchVlanId")
411 public Short getMatchVlanId();
412
413 @Property("matchVlanId")
414 public void setMatchVlanId(Short matchVlanId);
415
416 @Property("matchVlanPriority")
417 public Byte getMatchVlanPriority();
418
419 @Property("matchVlanPriority")
420 public void setMatchVlanPriority(Byte matchVlanPriority);
421
Pavlin Radoslavove2f0de82013-03-12 01:39:30 -0700422 @Property("matchSrcIPv4Net")
423 public String getMatchSrcIPv4Net();
424
425 @Property("matchSrcIPv4Net")
426 public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
427
428 @Property("matchDstIPv4Net")
429 public String getMatchDstIPv4Net();
430
431 @Property("matchDstIPv4Net")
432 public void setMatchDstIPv4Net(String matchDstIPv4Net);
433
Pavlin Radoslavovad3a1e62013-07-09 13:30:16 -0700434 @Property("matchIpProto")
435 public Byte getMatchIpProto();
436
437 @Property("matchIpProto")
438 public void setMatchIpProto(Byte matchIpProto);
439
440 @Property("matchIpToS")
441 public Byte getMatchIpToS();
442
443 @Property("matchIpToS")
444 public void setMatchIpToS(Byte matchIpToS);
445
446 @Property("matchSrcTcpUdpPort")
447 public Short getMatchSrcTcpUdpPort();
448
449 @Property("matchSrcTcpUdpPort")
450 public void setMatchSrcTcpUdpPort(Short matchSrcTcpUdpPort);
451
452 @Property("matchDstTcpUdpPort")
453 public Short getMatchDstTcpUdpPort();
454
455 @Property("matchDstTcpUdpPort")
456 public void setMatchDstTcpUdpPort(Short matchDstTcpUdpPort);
457
Pavlin Radoslavovc1bafd12013-07-12 17:00:35 -0700458 @Property("actionOutputPort")
459 public Short getActionOutputPort();
Pavlin Radoslavove2f0de82013-03-12 01:39:30 -0700460
Pavlin Radoslavovc1bafd12013-07-12 17:00:35 -0700461 @Property("actionOutputPort")
462 public void setActionOutputPort(Short actionOutputPort);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700463
464 @Adjacency(label="flow")
465 public IFlowPath getFlow();
466
467 @Adjacency(label="flow")
468 public void setFlow(IFlowPath flow);
469
Pankaj Berded0079742013-03-27 17:53:25 -0700470 @Adjacency(label="switch")
471 public ISwitchObject getSwitch();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700472
Pankaj Berded0079742013-03-27 17:53:25 -0700473 @Adjacency(label="switch")
474 public void setSwitch(ISwitchObject sw);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700475
Pankaj Berded0079742013-03-27 17:53:25 -0700476 @Adjacency(label="inport")
477 public IPortObject getInPort();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700478
Pankaj Berded0079742013-03-27 17:53:25 -0700479 @Adjacency(label="inport")
480 public void setInPort(IPortObject port);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700481
Pankaj Berded0079742013-03-27 17:53:25 -0700482 @Adjacency(label="outport")
483 public IPortObject getOutPort();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700484
Pavlin Radoslavov4fead9c2013-03-28 03:09:27 -0700485 @Adjacency(label="outport")
Pankaj Berded0079742013-03-27 17:53:25 -0700486 public void setOutPort(IPortObject port);
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800487 }
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800488}