blob: 558e0cde4ea1bd6d504deda8a487d27f511c9321 [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 Yutaefa54882013-06-12 13:13:02 -07003import net.onrc.onos.ofcontroller.flowcache.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 Koide13260102013-06-17 13:44:27 -070051 @GremlinGroovy("in.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 Koide13260102013-06-17 13:44:27 -070061 @GremlinGroovy("in.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 Koide13260102013-06-17 13:44:27 -070094 @GremlinGroovy("it.in('on')")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080095 public ISwitchObject getSwitch();
Pankaj Berdea6b80c32013-03-29 09:02:56 -070096
Pankaj Berdeac1a8c32013-02-26 17:45:57 -080097 @JsonProperty("devices")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080098 @Adjacency(label="host")
99 public Iterable<IDeviceObject> getDevices();
100
101 @Adjacency(label="host")
102 public void setDevice(final IDeviceObject device);
103
104 @Adjacency(label="host")
105 public void removeDevice(final IDeviceObject device);
106
Pankaj Berded0079742013-03-27 17:53:25 -0700107 @JsonIgnore
108 @Incidence(label="inport",direction = Direction.IN)
109 public Iterable<IFlowEntry> getInFlowEntries();
110
111 @JsonIgnore
112 @Incidence(label="outport",direction = Direction.IN)
113 public Iterable<IFlowEntry> getOutFlowEntries();
114
Pankaj Berde5fb27632013-04-05 08:56:12 -0700115 @JsonIgnore
116 @Adjacency(label="link")
117 public Iterable<IPortObject> getLinkedPorts();
118
Pankaj Berdea6b80c32013-03-29 09:02:56 -0700119 @Adjacency(label="link")
120 public void removeLink(final IPortObject dest_port);
121
Pankaj Berde5fb27632013-04-05 08:56:12 -0700122 @Adjacency(label="link")
123 public void setLinkPort(final IPortObject dest_port);
124
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800125// @JsonIgnore
126// @Adjacency(label="link")
127// public Iterable<ILinkObject> getLinks();
128 }
129
130 public interface IDeviceObject extends IBaseObject {
131
132 @JsonProperty("mac")
133 @Property("dl_addr")
134 public String getMACAddress();
135 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800136 public void setMACAddress(String macaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800137
138 @JsonProperty("ipv4")
139 @Property("nw_addr")
140 public String getIPAddress();
Toshio Koide13260102013-06-17 13:44:27 -0700141 @Property("nw_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800142 public void setIPAddress(String ipaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800143
144 @JsonIgnore
145 @Incidence(label="host",direction = Direction.IN)
Pankaj Berde2497e542013-02-19 18:51:24 -0800146 public Iterable<IPortObject> getAttachedPorts();
147
148 @JsonIgnore
149 @Incidence(label="host",direction=Direction.IN)
150 public void setHostPort(final IPortObject port);
151
152 @JsonIgnore
153 @Incidence(label="host",direction=Direction.IN)
154 public void removeHostPort(final IPortObject port);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800155
156 @JsonIgnore
Toshio Koide13260102013-06-17 13:44:27 -0700157 @GremlinGroovy("it.in('host').in('on')")
Pankaj Berde2497e542013-02-19 18:51:24 -0800158 public Iterable<ISwitchObject> getSwitch();
159
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800160/* @JsonProperty("dpid")
161 @GremlinGroovy("_().in('host').in('on').next().getProperty('dpid')")
162 public Iterable<String> getSwitchDPID();
163
164 @JsonProperty("number")
165 @GremlinGroovy("_().in('host').transform{it.number}")
166 public Iterable<Short> getPortNumber();
167
Pankaj Berde2497e542013-02-19 18:51:24 -0800168 @JsonProperty("AttachmentPoint")
169 @GremlinGroovy("_().in('host').in('on').path(){it.number}{it.dpid}")
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800170 public Iterable<SwitchPort> getAttachmentPoints();*/
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800171 }
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800172
173public interface IFlowPath extends IBaseObject {
Jonathan Hart01f2d272013-04-04 20:03:46 -0700174 @JsonProperty("flowId")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800175 @Property("flow_id")
176 public String getFlowId();
177
178 @Property("flow_id")
179 public void setFlowId(String flowId);
180
Jonathan Hart01f2d272013-04-04 20:03:46 -0700181 @JsonProperty("installerId")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800182 @Property("installer_id")
183 public String getInstallerId();
184
185 @Property("installer_id")
186 public void setInstallerId(String installerId);
187
Jonathan Hart01f2d272013-04-04 20:03:46 -0700188 @JsonProperty("srcDpid")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800189 @Property("src_switch")
190 public String getSrcSwitch();
191
192 @Property("src_switch")
193 public void setSrcSwitch(String srcSwitch);
194
Jonathan Hart01f2d272013-04-04 20:03:46 -0700195 @JsonProperty("srcPort")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800196 @Property("src_port")
197 public Short getSrcPort();
198
199 @Property("src_port")
200 public void setSrcPort(Short srcPort);
201
Jonathan Hart01f2d272013-04-04 20:03:46 -0700202 @JsonProperty("dstDpid")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800203 @Property("dst_switch")
204 public String getDstSwitch();
205
206 @Property("dst_switch")
207 public void setDstSwitch(String dstSwitch);
208
Jonathan Hart01f2d272013-04-04 20:03:46 -0700209 @JsonProperty("dstPort")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800210 @Property("dst_port")
211 public Short getDstPort();
212
213 @Property("dst_port")
214 public void setDstPort(Short dstPort);
215
Jonathan Hart01f2d272013-04-04 20:03:46 -0700216 @JsonProperty("dataPath")
217 @JsonSerialize(using=DatapathSummarySerializer.class)
Pavlin Radoslavovdbaaf2e2013-03-29 04:25:55 -0700218 @Property("data_path_summary")
219 public String getDataPathSummary();
220
221 @Property("data_path_summary")
222 public void setDataPathSummary(String dataPathSummary);
223
Jonathan Hart01f2d272013-04-04 20:03:46 -0700224 @JsonIgnore
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800225 @Adjacency(label="flow", direction=Direction.IN)
226 public Iterable<IFlowEntry> getFlowEntries();
227
228 @Adjacency(label="flow", direction=Direction.IN)
229 public void addFlowEntry(final IFlowEntry flowEntry);
230
231 @Adjacency(label="flow", direction=Direction.IN)
232 public void removeFlowEntry(final IFlowEntry flowEntry);
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700233
Jonathan Hart01f2d272013-04-04 20:03:46 -0700234 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700235 @Property("matchEthernetFrameType")
236 public Short getMatchEthernetFrameType();
237
238 @Property("matchEthernetFrameType")
239 public void setMatchEthernetFrameType(Short matchEthernetFrameType);
240
Jonathan Hart01f2d272013-04-04 20:03:46 -0700241 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700242 @Property("matchSrcMac")
243 public String getMatchSrcMac();
244
245 @Property("matchSrcMac")
246 public void setMatchSrcMac(String matchSrcMac);
247
Jonathan Hart01f2d272013-04-04 20:03:46 -0700248 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700249 @Property("matchDstMac")
250 public String getMatchDstMac();
251
252 @Property("matchDstMac")
253 public void setMatchDstMac(String matchDstMac);
254
Jonathan Hart01f2d272013-04-04 20:03:46 -0700255 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700256 @Property("matchSrcIPv4Net")
257 public String getMatchSrcIPv4Net();
258
259 @Property("matchSrcIPv4Net")
260 public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
261
Jonathan Hart01f2d272013-04-04 20:03:46 -0700262 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700263 @Property("matchDstIPv4Net")
264 public String getMatchDstIPv4Net();
265
266 @Property("matchDstIPv4Net")
267 public void setMatchDstIPv4Net(String matchDstIPv4Net);
Pankaj Berded0079742013-03-27 17:53:25 -0700268
269 @JsonIgnore
Toshio Koide13260102013-06-17 13:44:27 -0700270 @GremlinGroovy("it.in('flow').out('switch')")
Pankaj Berdef1404a72013-04-03 11:50:07 -0700271 public Iterable<ISwitchObject> getSwitches();
Jonathan Hart01f2d272013-04-04 20:03:46 -0700272
273 @JsonIgnore
274 @Property("state")
275 public String getState();
Pavlin Radoslavov710e2a72013-04-08 02:31:05 +0000276
277 @JsonIgnore
278 @Property("user_state")
279 public String getUserState();
280
281 @Property("user_state")
282 public void setUserState(String userState);
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800283 }
284
285public interface IFlowEntry extends IBaseObject {
286 @Property("flow_entry_id")
287 public String getFlowEntryId();
288
289 @Property("flow_entry_id")
290 public void setFlowEntryId(String flowEntryId);
291
292 @Property("switch_dpid")
293 public String getSwitchDpid();
294
295 @Property("switch_dpid")
296 public void setSwitchDpid(String switchDpid);
297
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800298 @Property("user_state")
299 public String getUserState();
300
301 @Property("user_state")
302 public void setUserState(String userState);
303
304 @Property("switch_state")
305 public String getSwitchState();
306
307 @Property("switch_state")
308 public void setSwitchState(String switchState);
309
310 @Property("error_state_type")
311 public String getErrorStateType();
312
313 @Property("error_state_type")
314 public void setErrorStateType(String errorStateType);
315
316 @Property("error_state_code")
317 public String getErrorStateCode();
318
319 @Property("error_state_code")
320 public void setErrorStateCode(String errorStateCode);
Pavlin Radoslavove2f0de82013-03-12 01:39:30 -0700321
322 @Property("matchInPort")
323 public Short getMatchInPort();
324
325 @Property("matchInPort")
326 public void setMatchInPort(Short matchInPort);
327
328 @Property("matchEthernetFrameType")
329 public Short getMatchEthernetFrameType();
330
331 @Property("matchEthernetFrameType")
332 public void setMatchEthernetFrameType(Short matchEthernetFrameType);
333
334 @Property("matchSrcMac")
335 public String getMatchSrcMac();
336
337 @Property("matchSrcMac")
338 public void setMatchSrcMac(String matchSrcMac);
339
340 @Property("matchDstMac")
341 public String getMatchDstMac();
342
343 @Property("matchDstMac")
344 public void setMatchDstMac(String matchDstMac);
345
346 @Property("matchSrcIPv4Net")
347 public String getMatchSrcIPv4Net();
348
349 @Property("matchSrcIPv4Net")
350 public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
351
352 @Property("matchDstIPv4Net")
353 public String getMatchDstIPv4Net();
354
355 @Property("matchDstIPv4Net")
356 public void setMatchDstIPv4Net(String matchDstIPv4Net);
357
358 @Property("actionOutput")
359 public Short getActionOutput();
360
361 @Property("actionOutput")
362 public void setActionOutput(Short actionOutput);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700363
364 @Adjacency(label="flow")
365 public IFlowPath getFlow();
366
367 @Adjacency(label="flow")
368 public void setFlow(IFlowPath flow);
369
Pankaj Berded0079742013-03-27 17:53:25 -0700370 @Adjacency(label="switch")
371 public ISwitchObject getSwitch();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700372
Pankaj Berded0079742013-03-27 17:53:25 -0700373 @Adjacency(label="switch")
374 public void setSwitch(ISwitchObject sw);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700375
Pankaj Berded0079742013-03-27 17:53:25 -0700376 @Adjacency(label="inport")
377 public IPortObject getInPort();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700378
Pankaj Berded0079742013-03-27 17:53:25 -0700379 @Adjacency(label="inport")
380 public void setInPort(IPortObject port);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700381
Pankaj Berded0079742013-03-27 17:53:25 -0700382 @Adjacency(label="outport")
383 public IPortObject getOutPort();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700384
Pavlin Radoslavov4fead9c2013-03-28 03:09:27 -0700385 @Adjacency(label="outport")
Pankaj Berded0079742013-03-27 17:53:25 -0700386 public void setOutPort(IPortObject port);
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800387 }
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800388}