blob: fc1c32fb50957d32fea1b6f356eb25ed133e7ae6 [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
17public interface INetMapTopologyObjects {
18
19public interface IBaseObject extends VertexFrame {
20
21 @JsonProperty("state")
22 @Property("state")
23 public String getState();
Pankaj Berde1cde50b2013-02-19 20:16:06 -080024
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080025 @Property("state")
26 public void setState(final String state);
27
28 @JsonIgnore
29 @Property("type")
30 public String getType();
31 @Property("type")
32 public void setType(final String type);
33
34}
35
36public interface ISwitchObject extends IBaseObject{
37
38 @JsonProperty("dpid")
39 @Property("dpid")
40 public String getDPID();
41
42 @Property("dpid")
43 public void setDPID(String dpid);
44
45 @JsonProperty("ports")
46 @Adjacency(label="on")
47 public Iterable<IPortObject> getPorts();
Pankaj Berde62016142013-04-09 15:35:50 -070048
49// Requires Frames 2.3.0
Pankaj Berdef2f2f032013-06-10 21:08:14 -070050 @JsonIgnore
Toshio Koide46dec822013-06-17 14:21:16 -070051 @GremlinGroovy("it.out('on').has('number',port_num)")
Pankaj Berdef2f2f032013-06-10 21:08:14 -070052 public IPortObject getPort(@GremlinParam("port_num") final short port_num);
Pankaj Berdeda809572013-02-22 15:31:20 -080053
54 @Adjacency(label="on")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080055 public void addPort(final IPortObject port);
56
57 @Adjacency(label="on")
58 public void removePort(final IPortObject port);
59
60 @JsonIgnore
Toshio Koide46dec822013-06-17 14:21:16 -070061 @GremlinGroovy("it.out('on').out('host')")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080062 public Iterable<IDeviceObject> getDevices();
Pankaj Berded0079742013-03-27 17:53:25 -070063
64 @JsonIgnore
65 @Incidence(label="switch",direction = Direction.IN)
66 public Iterable<IFlowEntry> getFlowEntries();
Pankaj Berdef2f2f032013-06-10 21:08:14 -070067
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080068 }
69
70 public interface IPortObject extends IBaseObject{
71
72 @JsonProperty("number")
73 @Property("number")
74 public Short getNumber();
75
Pankaj Berde15193092013-03-21 17:30:14 -070076 @Property("number")
77 public void setNumber(Short n);
78
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080079 @JsonProperty("desc")
80 @Property("desc")
81 public String getDesc();
82
Pankaj Berde15193092013-03-21 17:30:14 -070083 @Property("desc")
84 public void setDesc(String s);
85
86 @JsonIgnore
Pankaj Berdef1404a72013-04-03 11:50:07 -070087 @Property("port_state")
Pankaj Berde15193092013-03-21 17:30:14 -070088 public Integer getPortState();
89
90 @Property("port_state")
91 public void setPortState(Integer s);
92
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080093 @JsonIgnore
Toshio Koide2bab79f2013-06-17 14:29:15 -070094// @GremlinGroovy("it.in('on')")
Teru87cd2da2013-06-15 20:33:08 -070095 @Adjacency(label="on",direction = Direction.IN)
Teru80f75132013-06-16 05:16:32 -070096 public ISwitchObject getSwitch();
Pankaj Berdea6b80c32013-03-29 09:02:56 -070097
Pankaj Berdeac1a8c32013-02-26 17:45:57 -080098 @JsonProperty("devices")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080099 @Adjacency(label="host")
100 public Iterable<IDeviceObject> getDevices();
101
102 @Adjacency(label="host")
103 public void setDevice(final IDeviceObject device);
104
105 @Adjacency(label="host")
106 public void removeDevice(final IDeviceObject device);
107
Pankaj Berded0079742013-03-27 17:53:25 -0700108 @JsonIgnore
109 @Incidence(label="inport",direction = Direction.IN)
110 public Iterable<IFlowEntry> getInFlowEntries();
111
112 @JsonIgnore
113 @Incidence(label="outport",direction = Direction.IN)
114 public Iterable<IFlowEntry> getOutFlowEntries();
115
Pankaj Berde5fb27632013-04-05 08:56:12 -0700116 @JsonIgnore
117 @Adjacency(label="link")
118 public Iterable<IPortObject> getLinkedPorts();
119
Pankaj Berdea6b80c32013-03-29 09:02:56 -0700120 @Adjacency(label="link")
121 public void removeLink(final IPortObject dest_port);
122
Pankaj Berde5fb27632013-04-05 08:56:12 -0700123 @Adjacency(label="link")
124 public void setLinkPort(final IPortObject dest_port);
125
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800126// @JsonIgnore
127// @Adjacency(label="link")
128// public Iterable<ILinkObject> getLinks();
129 }
130
131 public interface IDeviceObject extends IBaseObject {
132
133 @JsonProperty("mac")
134 @Property("dl_addr")
135 public String getMACAddress();
136 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800137 public void setMACAddress(String macaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800138
139 @JsonProperty("ipv4")
140 @Property("nw_addr")
141 public String getIPAddress();
Teru87cd2da2013-06-15 20:33:08 -0700142 @Property("nw_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800143 public void setIPAddress(String ipaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800144
145 @JsonIgnore
Teru87cd2da2013-06-15 20:33:08 -0700146 @Adjacency(label="host",direction = Direction.IN)
Pankaj Berde2497e542013-02-19 18:51:24 -0800147 public Iterable<IPortObject> getAttachedPorts();
148
149 @JsonIgnore
150 @Incidence(label="host",direction=Direction.IN)
151 public void setHostPort(final IPortObject port);
152
153 @JsonIgnore
154 @Incidence(label="host",direction=Direction.IN)
155 public void removeHostPort(final IPortObject port);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800156
157 @JsonIgnore
Toshio Koide13260102013-06-17 13:44:27 -0700158 @GremlinGroovy("it.in('host').in('on')")
Pankaj Berde2497e542013-02-19 18:51:24 -0800159 public Iterable<ISwitchObject> getSwitch();
160
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800161/* @JsonProperty("dpid")
162 @GremlinGroovy("_().in('host').in('on').next().getProperty('dpid')")
163 public Iterable<String> getSwitchDPID();
164
165 @JsonProperty("number")
166 @GremlinGroovy("_().in('host').transform{it.number}")
167 public Iterable<Short> getPortNumber();
168
Pankaj Berde2497e542013-02-19 18:51:24 -0800169 @JsonProperty("AttachmentPoint")
170 @GremlinGroovy("_().in('host').in('on').path(){it.number}{it.dpid}")
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800171 public Iterable<SwitchPort> getAttachmentPoints();*/
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800172 }
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800173
174public interface IFlowPath extends IBaseObject {
Jonathan Hart01f2d272013-04-04 20:03:46 -0700175 @JsonProperty("flowId")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800176 @Property("flow_id")
177 public String getFlowId();
178
179 @Property("flow_id")
180 public void setFlowId(String flowId);
181
Jonathan Hart01f2d272013-04-04 20:03:46 -0700182 @JsonProperty("installerId")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800183 @Property("installer_id")
184 public String getInstallerId();
185
186 @Property("installer_id")
187 public void setInstallerId(String installerId);
188
Jonathan Hart01f2d272013-04-04 20:03:46 -0700189 @JsonProperty("srcDpid")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800190 @Property("src_switch")
191 public String getSrcSwitch();
192
193 @Property("src_switch")
194 public void setSrcSwitch(String srcSwitch);
195
Jonathan Hart01f2d272013-04-04 20:03:46 -0700196 @JsonProperty("srcPort")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800197 @Property("src_port")
198 public Short getSrcPort();
199
200 @Property("src_port")
201 public void setSrcPort(Short srcPort);
202
Jonathan Hart01f2d272013-04-04 20:03:46 -0700203 @JsonProperty("dstDpid")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800204 @Property("dst_switch")
205 public String getDstSwitch();
206
207 @Property("dst_switch")
208 public void setDstSwitch(String dstSwitch);
209
Jonathan Hart01f2d272013-04-04 20:03:46 -0700210 @JsonProperty("dstPort")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800211 @Property("dst_port")
212 public Short getDstPort();
213
214 @Property("dst_port")
215 public void setDstPort(Short dstPort);
216
Jonathan Hart01f2d272013-04-04 20:03:46 -0700217 @JsonProperty("dataPath")
218 @JsonSerialize(using=DatapathSummarySerializer.class)
Pavlin Radoslavovdbaaf2e2013-03-29 04:25:55 -0700219 @Property("data_path_summary")
220 public String getDataPathSummary();
221
222 @Property("data_path_summary")
223 public void setDataPathSummary(String dataPathSummary);
224
Jonathan Hart01f2d272013-04-04 20:03:46 -0700225 @JsonIgnore
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800226 @Adjacency(label="flow", direction=Direction.IN)
227 public Iterable<IFlowEntry> getFlowEntries();
228
229 @Adjacency(label="flow", direction=Direction.IN)
230 public void addFlowEntry(final IFlowEntry flowEntry);
231
232 @Adjacency(label="flow", direction=Direction.IN)
233 public void removeFlowEntry(final IFlowEntry flowEntry);
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700234
Jonathan Hart01f2d272013-04-04 20:03:46 -0700235 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700236 @Property("matchEthernetFrameType")
237 public Short getMatchEthernetFrameType();
238
239 @Property("matchEthernetFrameType")
240 public void setMatchEthernetFrameType(Short matchEthernetFrameType);
241
Jonathan Hart01f2d272013-04-04 20:03:46 -0700242 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700243 @Property("matchSrcMac")
244 public String getMatchSrcMac();
245
246 @Property("matchSrcMac")
247 public void setMatchSrcMac(String matchSrcMac);
248
Jonathan Hart01f2d272013-04-04 20:03:46 -0700249 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700250 @Property("matchDstMac")
251 public String getMatchDstMac();
252
253 @Property("matchDstMac")
254 public void setMatchDstMac(String matchDstMac);
255
Jonathan Hart01f2d272013-04-04 20:03:46 -0700256 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700257 @Property("matchSrcIPv4Net")
258 public String getMatchSrcIPv4Net();
259
260 @Property("matchSrcIPv4Net")
261 public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
262
Jonathan Hart01f2d272013-04-04 20:03:46 -0700263 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700264 @Property("matchDstIPv4Net")
265 public String getMatchDstIPv4Net();
266
267 @Property("matchDstIPv4Net")
268 public void setMatchDstIPv4Net(String matchDstIPv4Net);
Pankaj Berded0079742013-03-27 17:53:25 -0700269
270 @JsonIgnore
Toshio Koide13260102013-06-17 13:44:27 -0700271 @GremlinGroovy("it.in('flow').out('switch')")
Pankaj Berdef1404a72013-04-03 11:50:07 -0700272 public Iterable<ISwitchObject> getSwitches();
Jonathan Hart01f2d272013-04-04 20:03:46 -0700273
274 @JsonIgnore
275 @Property("state")
276 public String getState();
Pavlin Radoslavov710e2a72013-04-08 02:31:05 +0000277
278 @JsonIgnore
279 @Property("user_state")
280 public String getUserState();
281
282 @Property("user_state")
283 public void setUserState(String userState);
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800284 }
285
286public interface IFlowEntry extends IBaseObject {
287 @Property("flow_entry_id")
288 public String getFlowEntryId();
289
290 @Property("flow_entry_id")
291 public void setFlowEntryId(String flowEntryId);
292
293 @Property("switch_dpid")
294 public String getSwitchDpid();
295
296 @Property("switch_dpid")
297 public void setSwitchDpid(String switchDpid);
298
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800299 @Property("user_state")
300 public String getUserState();
301
302 @Property("user_state")
303 public void setUserState(String userState);
304
305 @Property("switch_state")
306 public String getSwitchState();
307
308 @Property("switch_state")
309 public void setSwitchState(String switchState);
310
311 @Property("error_state_type")
312 public String getErrorStateType();
313
314 @Property("error_state_type")
315 public void setErrorStateType(String errorStateType);
316
317 @Property("error_state_code")
318 public String getErrorStateCode();
319
320 @Property("error_state_code")
321 public void setErrorStateCode(String errorStateCode);
Pavlin Radoslavove2f0de82013-03-12 01:39:30 -0700322
323 @Property("matchInPort")
324 public Short getMatchInPort();
325
326 @Property("matchInPort")
327 public void setMatchInPort(Short matchInPort);
328
329 @Property("matchEthernetFrameType")
330 public Short getMatchEthernetFrameType();
331
332 @Property("matchEthernetFrameType")
333 public void setMatchEthernetFrameType(Short matchEthernetFrameType);
334
335 @Property("matchSrcMac")
336 public String getMatchSrcMac();
337
338 @Property("matchSrcMac")
339 public void setMatchSrcMac(String matchSrcMac);
340
341 @Property("matchDstMac")
342 public String getMatchDstMac();
343
344 @Property("matchDstMac")
345 public void setMatchDstMac(String matchDstMac);
346
347 @Property("matchSrcIPv4Net")
348 public String getMatchSrcIPv4Net();
349
350 @Property("matchSrcIPv4Net")
351 public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
352
353 @Property("matchDstIPv4Net")
354 public String getMatchDstIPv4Net();
355
356 @Property("matchDstIPv4Net")
357 public void setMatchDstIPv4Net(String matchDstIPv4Net);
358
359 @Property("actionOutput")
360 public Short getActionOutput();
361
362 @Property("actionOutput")
363 public void setActionOutput(Short actionOutput);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700364
365 @Adjacency(label="flow")
366 public IFlowPath getFlow();
367
368 @Adjacency(label="flow")
369 public void setFlow(IFlowPath flow);
370
Pankaj Berded0079742013-03-27 17:53:25 -0700371 @Adjacency(label="switch")
372 public ISwitchObject getSwitch();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700373
Pankaj Berded0079742013-03-27 17:53:25 -0700374 @Adjacency(label="switch")
375 public void setSwitch(ISwitchObject sw);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700376
Pankaj Berded0079742013-03-27 17:53:25 -0700377 @Adjacency(label="inport")
378 public IPortObject getInPort();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700379
Pankaj Berded0079742013-03-27 17:53:25 -0700380 @Adjacency(label="inport")
381 public void setInPort(IPortObject port);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700382
Pankaj Berded0079742013-03-27 17:53:25 -0700383 @Adjacency(label="outport")
384 public IPortObject getOutPort();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700385
Pavlin Radoslavov4fead9c2013-03-28 03:09:27 -0700386 @Adjacency(label="outport")
Pankaj Berded0079742013-03-27 17:53:25 -0700387 public void setOutPort(IPortObject port);
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800388 }
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800389}