blob: 77c42b132798df6d0f55d752a425af25889e1f7a [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 Yuta20514902013-06-12 11:24:16 -07003import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IPortObject;
HIGUCHI Yutaefa54882013-06-12 13:13:02 -07004import net.onrc.onos.ofcontroller.flowcache.web.DatapathSummarySerializer;
Jonathan Hart01f2d272013-04-04 20:03:46 -07005
Pankaj Berde1b8a42f2013-02-15 08:25:03 -08006import org.codehaus.jackson.annotate.JsonIgnore;
7import org.codehaus.jackson.annotate.JsonProperty;
Jonathan Hart01f2d272013-04-04 20:03:46 -07008import org.codehaus.jackson.map.annotate.JsonSerialize;
Pankaj Berde1b8a42f2013-02-15 08:25:03 -08009
10import com.tinkerpop.blueprints.Direction;
11import com.tinkerpop.frames.Adjacency;
12import com.tinkerpop.frames.Incidence;
13import com.tinkerpop.frames.Property;
14import com.tinkerpop.frames.annotations.gremlin.GremlinGroovy;
Pankaj Berdef2f2f032013-06-10 21:08:14 -070015import com.tinkerpop.frames.annotations.gremlin.GremlinParam;
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080016import com.tinkerpop.frames.VertexFrame;
17
18public interface INetMapTopologyObjects {
19
20public interface IBaseObject extends VertexFrame {
21
22 @JsonProperty("state")
23 @Property("state")
24 public String getState();
Pankaj Berde1cde50b2013-02-19 20:16:06 -080025
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080026 @Property("state")
27 public void setState(final String state);
28
29 @JsonIgnore
30 @Property("type")
31 public String getType();
32 @Property("type")
33 public void setType(final String type);
34
35}
36
37public interface ISwitchObject extends IBaseObject{
38
39 @JsonProperty("dpid")
40 @Property("dpid")
41 public String getDPID();
42
43 @Property("dpid")
44 public void setDPID(String dpid);
45
46 @JsonProperty("ports")
47 @Adjacency(label="on")
48 public Iterable<IPortObject> getPorts();
Pankaj Berde62016142013-04-09 15:35:50 -070049
50// Requires Frames 2.3.0
Pankaj Berdef2f2f032013-06-10 21:08:14 -070051 @JsonIgnore
52 @GremlinGroovy("_().out('on').has('number',port_num)")
53 public IPortObject getPort(@GremlinParam("port_num") final short port_num);
Pankaj Berdeda809572013-02-22 15:31:20 -080054
55 @Adjacency(label="on")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080056 public void addPort(final IPortObject port);
57
58 @Adjacency(label="on")
59 public void removePort(final IPortObject port);
60
61 @JsonIgnore
62 @GremlinGroovy("_().out('on').out('host')")
63 public Iterable<IDeviceObject> getDevices();
Pankaj Berded0079742013-03-27 17:53:25 -070064
65 @JsonIgnore
66 @Incidence(label="switch",direction = Direction.IN)
67 public Iterable<IFlowEntry> getFlowEntries();
Pankaj Berdef2f2f032013-06-10 21:08:14 -070068
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080069 }
70
71 public interface IPortObject extends IBaseObject{
72
73 @JsonProperty("number")
74 @Property("number")
75 public Short getNumber();
76
Pankaj Berde15193092013-03-21 17:30:14 -070077 @Property("number")
78 public void setNumber(Short n);
79
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080080 @JsonProperty("desc")
81 @Property("desc")
82 public String getDesc();
83
Pankaj Berde15193092013-03-21 17:30:14 -070084 @Property("desc")
85 public void setDesc(String s);
86
87 @JsonIgnore
Pankaj Berdef1404a72013-04-03 11:50:07 -070088 @Property("port_state")
Pankaj Berde15193092013-03-21 17:30:14 -070089 public Integer getPortState();
90
91 @Property("port_state")
92 public void setPortState(Integer s);
93
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080094 @JsonIgnore
95 @Incidence(label="on",direction = Direction.IN)
96 public ISwitchObject getSwitch();
Teru87cd2da2013-06-15 20:33:08 -070097
98 @JsonIgnore
99 @Adjacency(label="on",direction = Direction.IN)
100 public ISwitchObject getVertexSwitch();
Pankaj Berdea6b80c32013-03-29 09:02:56 -0700101
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800102 @JsonProperty("devices")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800103 @Adjacency(label="host")
104 public Iterable<IDeviceObject> getDevices();
105
106 @Adjacency(label="host")
107 public void setDevice(final IDeviceObject device);
108
109 @Adjacency(label="host")
110 public void removeDevice(final IDeviceObject device);
111
Pankaj Berded0079742013-03-27 17:53:25 -0700112 @JsonIgnore
113 @Incidence(label="inport",direction = Direction.IN)
114 public Iterable<IFlowEntry> getInFlowEntries();
115
116 @JsonIgnore
117 @Incidence(label="outport",direction = Direction.IN)
118 public Iterable<IFlowEntry> getOutFlowEntries();
119
Pankaj Berde5fb27632013-04-05 08:56:12 -0700120 @JsonIgnore
121 @Adjacency(label="link")
122 public Iterable<IPortObject> getLinkedPorts();
123
Pankaj Berdea6b80c32013-03-29 09:02:56 -0700124 @Adjacency(label="link")
125 public void removeLink(final IPortObject dest_port);
126
Pankaj Berde5fb27632013-04-05 08:56:12 -0700127 @Adjacency(label="link")
128 public void setLinkPort(final IPortObject dest_port);
129
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800130// @JsonIgnore
131// @Adjacency(label="link")
132// public Iterable<ILinkObject> getLinks();
133 }
134
135 public interface IDeviceObject extends IBaseObject {
136
137 @JsonProperty("mac")
138 @Property("dl_addr")
139 public String getMACAddress();
140 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800141 public void setMACAddress(String macaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800142
143 @JsonProperty("ipv4")
144 @Property("nw_addr")
145 public String getIPAddress();
Teru87cd2da2013-06-15 20:33:08 -0700146 @Property("nw_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800147 public void setIPAddress(String ipaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800148
149 @JsonIgnore
Teru87cd2da2013-06-15 20:33:08 -0700150 @Adjacency(label="host",direction = Direction.IN)
Pankaj Berde2497e542013-02-19 18:51:24 -0800151 public Iterable<IPortObject> getAttachedPorts();
152
153 @JsonIgnore
154 @Incidence(label="host",direction=Direction.IN)
155 public void setHostPort(final IPortObject port);
156
157 @JsonIgnore
158 @Incidence(label="host",direction=Direction.IN)
159 public void removeHostPort(final IPortObject port);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800160
161 @JsonIgnore
162 @GremlinGroovy("_().in('host').in('on')")
Pankaj Berde2497e542013-02-19 18:51:24 -0800163 public Iterable<ISwitchObject> getSwitch();
164
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800165/* @JsonProperty("dpid")
166 @GremlinGroovy("_().in('host').in('on').next().getProperty('dpid')")
167 public Iterable<String> getSwitchDPID();
168
169 @JsonProperty("number")
170 @GremlinGroovy("_().in('host').transform{it.number}")
171 public Iterable<Short> getPortNumber();
172
Pankaj Berde2497e542013-02-19 18:51:24 -0800173 @JsonProperty("AttachmentPoint")
174 @GremlinGroovy("_().in('host').in('on').path(){it.number}{it.dpid}")
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800175 public Iterable<SwitchPort> getAttachmentPoints();*/
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800176 }
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800177
178public interface IFlowPath extends IBaseObject {
Jonathan Hart01f2d272013-04-04 20:03:46 -0700179 @JsonProperty("flowId")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800180 @Property("flow_id")
181 public String getFlowId();
182
183 @Property("flow_id")
184 public void setFlowId(String flowId);
185
Jonathan Hart01f2d272013-04-04 20:03:46 -0700186 @JsonProperty("installerId")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800187 @Property("installer_id")
188 public String getInstallerId();
189
190 @Property("installer_id")
191 public void setInstallerId(String installerId);
192
Jonathan Hart01f2d272013-04-04 20:03:46 -0700193 @JsonProperty("srcDpid")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800194 @Property("src_switch")
195 public String getSrcSwitch();
196
197 @Property("src_switch")
198 public void setSrcSwitch(String srcSwitch);
199
Jonathan Hart01f2d272013-04-04 20:03:46 -0700200 @JsonProperty("srcPort")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800201 @Property("src_port")
202 public Short getSrcPort();
203
204 @Property("src_port")
205 public void setSrcPort(Short srcPort);
206
Jonathan Hart01f2d272013-04-04 20:03:46 -0700207 @JsonProperty("dstDpid")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800208 @Property("dst_switch")
209 public String getDstSwitch();
210
211 @Property("dst_switch")
212 public void setDstSwitch(String dstSwitch);
213
Jonathan Hart01f2d272013-04-04 20:03:46 -0700214 @JsonProperty("dstPort")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800215 @Property("dst_port")
216 public Short getDstPort();
217
218 @Property("dst_port")
219 public void setDstPort(Short dstPort);
220
Jonathan Hart01f2d272013-04-04 20:03:46 -0700221 @JsonProperty("dataPath")
222 @JsonSerialize(using=DatapathSummarySerializer.class)
Pavlin Radoslavovdbaaf2e2013-03-29 04:25:55 -0700223 @Property("data_path_summary")
224 public String getDataPathSummary();
225
226 @Property("data_path_summary")
227 public void setDataPathSummary(String dataPathSummary);
228
Jonathan Hart01f2d272013-04-04 20:03:46 -0700229 @JsonIgnore
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800230 @Adjacency(label="flow", direction=Direction.IN)
231 public Iterable<IFlowEntry> getFlowEntries();
232
233 @Adjacency(label="flow", direction=Direction.IN)
234 public void addFlowEntry(final IFlowEntry flowEntry);
235
236 @Adjacency(label="flow", direction=Direction.IN)
237 public void removeFlowEntry(final IFlowEntry flowEntry);
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700238
Jonathan Hart01f2d272013-04-04 20:03:46 -0700239 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700240 @Property("matchEthernetFrameType")
241 public Short getMatchEthernetFrameType();
242
243 @Property("matchEthernetFrameType")
244 public void setMatchEthernetFrameType(Short matchEthernetFrameType);
245
Jonathan Hart01f2d272013-04-04 20:03:46 -0700246 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700247 @Property("matchSrcMac")
248 public String getMatchSrcMac();
249
250 @Property("matchSrcMac")
251 public void setMatchSrcMac(String matchSrcMac);
252
Jonathan Hart01f2d272013-04-04 20:03:46 -0700253 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700254 @Property("matchDstMac")
255 public String getMatchDstMac();
256
257 @Property("matchDstMac")
258 public void setMatchDstMac(String matchDstMac);
259
Jonathan Hart01f2d272013-04-04 20:03:46 -0700260 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700261 @Property("matchSrcIPv4Net")
262 public String getMatchSrcIPv4Net();
263
264 @Property("matchSrcIPv4Net")
265 public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
266
Jonathan Hart01f2d272013-04-04 20:03:46 -0700267 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700268 @Property("matchDstIPv4Net")
269 public String getMatchDstIPv4Net();
270
271 @Property("matchDstIPv4Net")
272 public void setMatchDstIPv4Net(String matchDstIPv4Net);
Pankaj Berded0079742013-03-27 17:53:25 -0700273
274 @JsonIgnore
275 @GremlinGroovy("_().in('flow').out('switch')")
Pankaj Berdef1404a72013-04-03 11:50:07 -0700276 public Iterable<ISwitchObject> getSwitches();
Jonathan Hart01f2d272013-04-04 20:03:46 -0700277
278 @JsonIgnore
279 @Property("state")
280 public String getState();
Pavlin Radoslavov710e2a72013-04-08 02:31:05 +0000281
282 @JsonIgnore
283 @Property("user_state")
284 public String getUserState();
285
286 @Property("user_state")
287 public void setUserState(String userState);
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800288 }
289
290public interface IFlowEntry extends IBaseObject {
291 @Property("flow_entry_id")
292 public String getFlowEntryId();
293
294 @Property("flow_entry_id")
295 public void setFlowEntryId(String flowEntryId);
296
297 @Property("switch_dpid")
298 public String getSwitchDpid();
299
300 @Property("switch_dpid")
301 public void setSwitchDpid(String switchDpid);
302
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800303 @Property("user_state")
304 public String getUserState();
305
306 @Property("user_state")
307 public void setUserState(String userState);
308
309 @Property("switch_state")
310 public String getSwitchState();
311
312 @Property("switch_state")
313 public void setSwitchState(String switchState);
314
315 @Property("error_state_type")
316 public String getErrorStateType();
317
318 @Property("error_state_type")
319 public void setErrorStateType(String errorStateType);
320
321 @Property("error_state_code")
322 public String getErrorStateCode();
323
324 @Property("error_state_code")
325 public void setErrorStateCode(String errorStateCode);
Pavlin Radoslavove2f0de82013-03-12 01:39:30 -0700326
327 @Property("matchInPort")
328 public Short getMatchInPort();
329
330 @Property("matchInPort")
331 public void setMatchInPort(Short matchInPort);
332
333 @Property("matchEthernetFrameType")
334 public Short getMatchEthernetFrameType();
335
336 @Property("matchEthernetFrameType")
337 public void setMatchEthernetFrameType(Short matchEthernetFrameType);
338
339 @Property("matchSrcMac")
340 public String getMatchSrcMac();
341
342 @Property("matchSrcMac")
343 public void setMatchSrcMac(String matchSrcMac);
344
345 @Property("matchDstMac")
346 public String getMatchDstMac();
347
348 @Property("matchDstMac")
349 public void setMatchDstMac(String matchDstMac);
350
351 @Property("matchSrcIPv4Net")
352 public String getMatchSrcIPv4Net();
353
354 @Property("matchSrcIPv4Net")
355 public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
356
357 @Property("matchDstIPv4Net")
358 public String getMatchDstIPv4Net();
359
360 @Property("matchDstIPv4Net")
361 public void setMatchDstIPv4Net(String matchDstIPv4Net);
362
363 @Property("actionOutput")
364 public Short getActionOutput();
365
366 @Property("actionOutput")
367 public void setActionOutput(Short actionOutput);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700368
369 @Adjacency(label="flow")
370 public IFlowPath getFlow();
371
372 @Adjacency(label="flow")
373 public void setFlow(IFlowPath flow);
374
Pankaj Berded0079742013-03-27 17:53:25 -0700375 @Adjacency(label="switch")
376 public ISwitchObject getSwitch();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700377
Pankaj Berded0079742013-03-27 17:53:25 -0700378 @Adjacency(label="switch")
379 public void setSwitch(ISwitchObject sw);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700380
Pankaj Berded0079742013-03-27 17:53:25 -0700381 @Adjacency(label="inport")
382 public IPortObject getInPort();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700383
Pankaj Berded0079742013-03-27 17:53:25 -0700384 @Adjacency(label="inport")
385 public void setInPort(IPortObject port);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700386
Pankaj Berded0079742013-03-27 17:53:25 -0700387 @Adjacency(label="outport")
388 public IPortObject getOutPort();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700389
Pavlin Radoslavov4fead9c2013-03-28 03:09:27 -0700390 @Adjacency(label="outport")
Pankaj Berded0079742013-03-27 17:53:25 -0700391 public void setOutPort(IPortObject port);
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800392 }
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800393}