blob: 4a033270662fcf4b1421ad97573fce1a40828568 [file] [log] [blame]
Pankaj Berde1b8a42f2013-02-15 08:25:03 -08001package net.floodlightcontroller.core;
2
Jonathan Hart01f2d272013-04-04 20:03:46 -07003import net.floodlightcontroller.flowcache.web.DatapathSummarySerializer;
4
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;
14import com.tinkerpop.frames.VertexFrame;
15
16public interface INetMapTopologyObjects {
17
18public interface IBaseObject extends VertexFrame {
19
20 @JsonProperty("state")
21 @Property("state")
22 public String getState();
Pankaj Berde1cde50b2013-02-19 20:16:06 -080023
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080024 @Property("state")
25 public void setState(final String state);
26
27 @JsonIgnore
28 @Property("type")
29 public String getType();
30 @Property("type")
31 public void setType(final String type);
32
33}
34
35public interface ISwitchObject extends IBaseObject{
36
37 @JsonProperty("dpid")
38 @Property("dpid")
39 public String getDPID();
40
41 @Property("dpid")
42 public void setDPID(String dpid);
43
44 @JsonProperty("ports")
45 @Adjacency(label="on")
46 public Iterable<IPortObject> getPorts();
Pankaj Berde62016142013-04-09 15:35:50 -070047
48// Requires Frames 2.3.0
49// @JsonIgnore
50// @GremlinGroovy("_().out('on').has('number',port_num)")
51// public IPortObject getPort(@GremlinParam("port_num") final short port_num);
Pankaj Berdeda809572013-02-22 15:31:20 -080052
53 @Adjacency(label="on")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080054 public void addPort(final IPortObject port);
55
56 @Adjacency(label="on")
57 public void removePort(final IPortObject port);
58
59 @JsonIgnore
60 @GremlinGroovy("_().out('on').out('host')")
61 public Iterable<IDeviceObject> getDevices();
Pankaj Berded0079742013-03-27 17:53:25 -070062
63 @JsonIgnore
64 @Incidence(label="switch",direction = Direction.IN)
65 public Iterable<IFlowEntry> getFlowEntries();
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080066 }
67
68 public interface IPortObject extends IBaseObject{
69
70 @JsonProperty("number")
71 @Property("number")
72 public Short getNumber();
73
Pankaj Berde15193092013-03-21 17:30:14 -070074 @Property("number")
75 public void setNumber(Short n);
76
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080077 @JsonProperty("desc")
78 @Property("desc")
79 public String getDesc();
80
Pankaj Berde15193092013-03-21 17:30:14 -070081 @Property("desc")
82 public void setDesc(String s);
83
84 @JsonIgnore
Pankaj Berdef1404a72013-04-03 11:50:07 -070085 @Property("port_state")
Pankaj Berde15193092013-03-21 17:30:14 -070086 public Integer getPortState();
87
88 @Property("port_state")
89 public void setPortState(Integer s);
90
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080091 @JsonIgnore
92 @Incidence(label="on",direction = Direction.IN)
93 public ISwitchObject getSwitch();
Pankaj Berdea6b80c32013-03-29 09:02:56 -070094
Pankaj Berdeac1a8c32013-02-26 17:45:57 -080095 @JsonProperty("devices")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080096 @Adjacency(label="host")
97 public Iterable<IDeviceObject> getDevices();
98
99 @Adjacency(label="host")
100 public void setDevice(final IDeviceObject device);
101
102 @Adjacency(label="host")
103 public void removeDevice(final IDeviceObject device);
104
Pankaj Berded0079742013-03-27 17:53:25 -0700105 @JsonIgnore
106 @Incidence(label="inport",direction = Direction.IN)
107 public Iterable<IFlowEntry> getInFlowEntries();
108
109 @JsonIgnore
110 @Incidence(label="outport",direction = Direction.IN)
111 public Iterable<IFlowEntry> getOutFlowEntries();
112
Pankaj Berde5fb27632013-04-05 08:56:12 -0700113 @JsonIgnore
114 @Adjacency(label="link")
115 public Iterable<IPortObject> getLinkedPorts();
116
Pankaj Berdea6b80c32013-03-29 09:02:56 -0700117 @Adjacency(label="link")
118 public void removeLink(final IPortObject dest_port);
119
Pankaj Berde5fb27632013-04-05 08:56:12 -0700120 @Adjacency(label="link")
121 public void setLinkPort(final IPortObject dest_port);
122
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800123// @JsonIgnore
124// @Adjacency(label="link")
125// public Iterable<ILinkObject> getLinks();
126 }
127
128 public interface IDeviceObject extends IBaseObject {
129
130 @JsonProperty("mac")
131 @Property("dl_addr")
132 public String getMACAddress();
133 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800134 public void setMACAddress(String macaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800135
136 @JsonProperty("ipv4")
137 @Property("nw_addr")
138 public String getIPAddress();
139 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800140 public void setIPAddress(String ipaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800141
142 @JsonIgnore
143 @Incidence(label="host",direction = Direction.IN)
Pankaj Berde2497e542013-02-19 18:51:24 -0800144 public Iterable<IPortObject> getAttachedPorts();
145
146 @JsonIgnore
147 @Incidence(label="host",direction=Direction.IN)
148 public void setHostPort(final IPortObject port);
149
150 @JsonIgnore
151 @Incidence(label="host",direction=Direction.IN)
152 public void removeHostPort(final IPortObject port);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800153
154 @JsonIgnore
155 @GremlinGroovy("_().in('host').in('on')")
Pankaj Berde2497e542013-02-19 18:51:24 -0800156 public Iterable<ISwitchObject> getSwitch();
157
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800158/* @JsonProperty("dpid")
159 @GremlinGroovy("_().in('host').in('on').next().getProperty('dpid')")
160 public Iterable<String> getSwitchDPID();
161
162 @JsonProperty("number")
163 @GremlinGroovy("_().in('host').transform{it.number}")
164 public Iterable<Short> getPortNumber();
165
Pankaj Berde2497e542013-02-19 18:51:24 -0800166 @JsonProperty("AttachmentPoint")
167 @GremlinGroovy("_().in('host').in('on').path(){it.number}{it.dpid}")
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800168 public Iterable<SwitchPort> getAttachmentPoints();*/
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800169 }
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800170
171public interface IFlowPath extends IBaseObject {
Jonathan Hart01f2d272013-04-04 20:03:46 -0700172 @JsonProperty("flowId")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800173 @Property("flow_id")
174 public String getFlowId();
175
176 @Property("flow_id")
177 public void setFlowId(String flowId);
178
Jonathan Hart01f2d272013-04-04 20:03:46 -0700179 @JsonProperty("installerId")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800180 @Property("installer_id")
181 public String getInstallerId();
182
183 @Property("installer_id")
184 public void setInstallerId(String installerId);
185
Jonathan Hart01f2d272013-04-04 20:03:46 -0700186 @JsonProperty("srcDpid")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800187 @Property("src_switch")
188 public String getSrcSwitch();
189
190 @Property("src_switch")
191 public void setSrcSwitch(String srcSwitch);
192
Jonathan Hart01f2d272013-04-04 20:03:46 -0700193 @JsonProperty("srcPort")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800194 @Property("src_port")
195 public Short getSrcPort();
196
197 @Property("src_port")
198 public void setSrcPort(Short srcPort);
199
Jonathan Hart01f2d272013-04-04 20:03:46 -0700200 @JsonProperty("dstDpid")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800201 @Property("dst_switch")
202 public String getDstSwitch();
203
204 @Property("dst_switch")
205 public void setDstSwitch(String dstSwitch);
206
Jonathan Hart01f2d272013-04-04 20:03:46 -0700207 @JsonProperty("dstPort")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800208 @Property("dst_port")
209 public Short getDstPort();
210
211 @Property("dst_port")
212 public void setDstPort(Short dstPort);
213
Jonathan Hart01f2d272013-04-04 20:03:46 -0700214 @JsonProperty("dataPath")
215 @JsonSerialize(using=DatapathSummarySerializer.class)
Pavlin Radoslavovdbaaf2e2013-03-29 04:25:55 -0700216 @Property("data_path_summary")
217 public String getDataPathSummary();
218
219 @Property("data_path_summary")
220 public void setDataPathSummary(String dataPathSummary);
221
Jonathan Hart01f2d272013-04-04 20:03:46 -0700222 @JsonIgnore
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800223 @Adjacency(label="flow", direction=Direction.IN)
224 public Iterable<IFlowEntry> getFlowEntries();
225
226 @Adjacency(label="flow", direction=Direction.IN)
227 public void addFlowEntry(final IFlowEntry flowEntry);
228
229 @Adjacency(label="flow", direction=Direction.IN)
230 public void removeFlowEntry(final IFlowEntry flowEntry);
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700231
Jonathan Hart01f2d272013-04-04 20:03:46 -0700232 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700233 @Property("matchEthernetFrameType")
234 public Short getMatchEthernetFrameType();
235
236 @Property("matchEthernetFrameType")
237 public void setMatchEthernetFrameType(Short matchEthernetFrameType);
238
Jonathan Hart01f2d272013-04-04 20:03:46 -0700239 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700240 @Property("matchSrcMac")
241 public String getMatchSrcMac();
242
243 @Property("matchSrcMac")
244 public void setMatchSrcMac(String matchSrcMac);
245
Jonathan Hart01f2d272013-04-04 20:03:46 -0700246 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700247 @Property("matchDstMac")
248 public String getMatchDstMac();
249
250 @Property("matchDstMac")
251 public void setMatchDstMac(String matchDstMac);
252
Jonathan Hart01f2d272013-04-04 20:03:46 -0700253 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700254 @Property("matchSrcIPv4Net")
255 public String getMatchSrcIPv4Net();
256
257 @Property("matchSrcIPv4Net")
258 public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
259
Jonathan Hart01f2d272013-04-04 20:03:46 -0700260 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700261 @Property("matchDstIPv4Net")
262 public String getMatchDstIPv4Net();
263
264 @Property("matchDstIPv4Net")
265 public void setMatchDstIPv4Net(String matchDstIPv4Net);
Pankaj Berded0079742013-03-27 17:53:25 -0700266
267 @JsonIgnore
268 @GremlinGroovy("_().in('flow').out('switch')")
Pankaj Berdef1404a72013-04-03 11:50:07 -0700269 public Iterable<ISwitchObject> getSwitches();
Jonathan Hart01f2d272013-04-04 20:03:46 -0700270
271 @JsonIgnore
272 @Property("state")
273 public String getState();
Pavlin Radoslavov710e2a72013-04-08 02:31:05 +0000274
275 @JsonIgnore
276 @Property("user_state")
277 public String getUserState();
278
279 @Property("user_state")
280 public void setUserState(String userState);
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800281 }
282
283public interface IFlowEntry extends IBaseObject {
284 @Property("flow_entry_id")
285 public String getFlowEntryId();
286
287 @Property("flow_entry_id")
288 public void setFlowEntryId(String flowEntryId);
289
290 @Property("switch_dpid")
291 public String getSwitchDpid();
292
293 @Property("switch_dpid")
294 public void setSwitchDpid(String switchDpid);
295
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800296 @Property("user_state")
297 public String getUserState();
298
299 @Property("user_state")
300 public void setUserState(String userState);
301
302 @Property("switch_state")
303 public String getSwitchState();
304
305 @Property("switch_state")
306 public void setSwitchState(String switchState);
307
308 @Property("error_state_type")
309 public String getErrorStateType();
310
311 @Property("error_state_type")
312 public void setErrorStateType(String errorStateType);
313
314 @Property("error_state_code")
315 public String getErrorStateCode();
316
317 @Property("error_state_code")
318 public void setErrorStateCode(String errorStateCode);
Pavlin Radoslavove2f0de82013-03-12 01:39:30 -0700319
320 @Property("matchInPort")
321 public Short getMatchInPort();
322
323 @Property("matchInPort")
324 public void setMatchInPort(Short matchInPort);
325
326 @Property("matchEthernetFrameType")
327 public Short getMatchEthernetFrameType();
328
329 @Property("matchEthernetFrameType")
330 public void setMatchEthernetFrameType(Short matchEthernetFrameType);
331
332 @Property("matchSrcMac")
333 public String getMatchSrcMac();
334
335 @Property("matchSrcMac")
336 public void setMatchSrcMac(String matchSrcMac);
337
338 @Property("matchDstMac")
339 public String getMatchDstMac();
340
341 @Property("matchDstMac")
342 public void setMatchDstMac(String matchDstMac);
343
344 @Property("matchSrcIPv4Net")
345 public String getMatchSrcIPv4Net();
346
347 @Property("matchSrcIPv4Net")
348 public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
349
350 @Property("matchDstIPv4Net")
351 public String getMatchDstIPv4Net();
352
353 @Property("matchDstIPv4Net")
354 public void setMatchDstIPv4Net(String matchDstIPv4Net);
355
356 @Property("actionOutput")
357 public Short getActionOutput();
358
359 @Property("actionOutput")
360 public void setActionOutput(Short actionOutput);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700361
362 @Adjacency(label="flow")
363 public IFlowPath getFlow();
364
365 @Adjacency(label="flow")
366 public void setFlow(IFlowPath flow);
367
Pankaj Berded0079742013-03-27 17:53:25 -0700368 @Adjacency(label="switch")
369 public ISwitchObject getSwitch();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700370
Pankaj Berded0079742013-03-27 17:53:25 -0700371 @Adjacency(label="switch")
372 public void setSwitch(ISwitchObject sw);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700373
Pankaj Berded0079742013-03-27 17:53:25 -0700374 @Adjacency(label="inport")
375 public IPortObject getInPort();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700376
Pankaj Berded0079742013-03-27 17:53:25 -0700377 @Adjacency(label="inport")
378 public void setInPort(IPortObject port);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700379
Pankaj Berded0079742013-03-27 17:53:25 -0700380 @Adjacency(label="outport")
381 public IPortObject getOutPort();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700382
Pavlin Radoslavov4fead9c2013-03-28 03:09:27 -0700383 @Adjacency(label="outport")
Pankaj Berded0079742013-03-27 17:53:25 -0700384 public void setOutPort(IPortObject port);
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800385 }
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800386}