blob: e29e8e1693b918dd1ec90ef2af85a5e266366e5c [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();
47
Pankaj Berde73ea7e52013-04-04 14:52:50 -070048 @JsonIgnore
Pankaj Berde5fb27632013-04-05 08:56:12 -070049 @GremlinGroovy("_().out('on').has('number',port_num)")
Pankaj Berdeda809572013-02-22 15:31:20 -080050 public IPortObject getPort(final short port_num);
51
52 @Adjacency(label="on")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080053 public void addPort(final IPortObject port);
54
55 @Adjacency(label="on")
56 public void removePort(final IPortObject port);
57
58 @JsonIgnore
59 @GremlinGroovy("_().out('on').out('host')")
60 public Iterable<IDeviceObject> getDevices();
Pankaj Berded0079742013-03-27 17:53:25 -070061
62 @JsonIgnore
63 @Incidence(label="switch",direction = Direction.IN)
64 public Iterable<IFlowEntry> getFlowEntries();
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080065 }
66
67 public interface IPortObject extends IBaseObject{
68
69 @JsonProperty("number")
70 @Property("number")
71 public Short getNumber();
72
Pankaj Berde15193092013-03-21 17:30:14 -070073 @Property("number")
74 public void setNumber(Short n);
75
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080076 @JsonProperty("desc")
77 @Property("desc")
78 public String getDesc();
79
Pankaj Berde15193092013-03-21 17:30:14 -070080 @Property("desc")
81 public void setDesc(String s);
82
83 @JsonIgnore
Pankaj Berdef1404a72013-04-03 11:50:07 -070084 @Property("port_state")
Pankaj Berde15193092013-03-21 17:30:14 -070085 public Integer getPortState();
86
87 @Property("port_state")
88 public void setPortState(Integer s);
89
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080090 @JsonIgnore
91 @Incidence(label="on",direction = Direction.IN)
92 public ISwitchObject getSwitch();
Pankaj Berdea6b80c32013-03-29 09:02:56 -070093
Pankaj Berdeac1a8c32013-02-26 17:45:57 -080094 @JsonProperty("devices")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080095 @Adjacency(label="host")
96 public Iterable<IDeviceObject> getDevices();
97
98 @Adjacency(label="host")
99 public void setDevice(final IDeviceObject device);
100
101 @Adjacency(label="host")
102 public void removeDevice(final IDeviceObject device);
103
Pankaj Berded0079742013-03-27 17:53:25 -0700104 @JsonIgnore
105 @Incidence(label="inport",direction = Direction.IN)
106 public Iterable<IFlowEntry> getInFlowEntries();
107
108 @JsonIgnore
109 @Incidence(label="outport",direction = Direction.IN)
110 public Iterable<IFlowEntry> getOutFlowEntries();
111
Pankaj Berde5fb27632013-04-05 08:56:12 -0700112 @JsonIgnore
113 @Adjacency(label="link")
114 public Iterable<IPortObject> getLinkedPorts();
115
Pankaj Berdea6b80c32013-03-29 09:02:56 -0700116 @Adjacency(label="link")
117 public void removeLink(final IPortObject dest_port);
118
Pankaj Berde5fb27632013-04-05 08:56:12 -0700119 @Adjacency(label="link")
120 public void setLinkPort(final IPortObject dest_port);
121
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800122// @JsonIgnore
123// @Adjacency(label="link")
124// public Iterable<ILinkObject> getLinks();
125 }
126
127 public interface IDeviceObject extends IBaseObject {
128
129 @JsonProperty("mac")
130 @Property("dl_addr")
131 public String getMACAddress();
132 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800133 public void setMACAddress(String macaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800134
135 @JsonProperty("ipv4")
136 @Property("nw_addr")
137 public String getIPAddress();
138 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800139 public void setIPAddress(String ipaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800140
141 @JsonIgnore
142 @Incidence(label="host",direction = Direction.IN)
Pankaj Berde2497e542013-02-19 18:51:24 -0800143 public Iterable<IPortObject> getAttachedPorts();
144
145 @JsonIgnore
146 @Incidence(label="host",direction=Direction.IN)
147 public void setHostPort(final IPortObject port);
148
149 @JsonIgnore
150 @Incidence(label="host",direction=Direction.IN)
151 public void removeHostPort(final IPortObject port);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800152
153 @JsonIgnore
154 @GremlinGroovy("_().in('host').in('on')")
Pankaj Berde2497e542013-02-19 18:51:24 -0800155 public Iterable<ISwitchObject> getSwitch();
156
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800157/* @JsonProperty("dpid")
158 @GremlinGroovy("_().in('host').in('on').next().getProperty('dpid')")
159 public Iterable<String> getSwitchDPID();
160
161 @JsonProperty("number")
162 @GremlinGroovy("_().in('host').transform{it.number}")
163 public Iterable<Short> getPortNumber();
164
Pankaj Berde2497e542013-02-19 18:51:24 -0800165 @JsonProperty("AttachmentPoint")
166 @GremlinGroovy("_().in('host').in('on').path(){it.number}{it.dpid}")
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800167 public Iterable<SwitchPort> getAttachmentPoints();*/
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800168 }
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800169
170public interface IFlowPath extends IBaseObject {
Jonathan Hart01f2d272013-04-04 20:03:46 -0700171 @JsonProperty("flowId")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800172 @Property("flow_id")
173 public String getFlowId();
174
175 @Property("flow_id")
176 public void setFlowId(String flowId);
177
Jonathan Hart01f2d272013-04-04 20:03:46 -0700178 @JsonProperty("installerId")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800179 @Property("installer_id")
180 public String getInstallerId();
181
182 @Property("installer_id")
183 public void setInstallerId(String installerId);
184
Jonathan Hart01f2d272013-04-04 20:03:46 -0700185 @JsonProperty("srcDpid")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800186 @Property("src_switch")
187 public String getSrcSwitch();
188
189 @Property("src_switch")
190 public void setSrcSwitch(String srcSwitch);
191
Jonathan Hart01f2d272013-04-04 20:03:46 -0700192 @JsonProperty("srcPort")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800193 @Property("src_port")
194 public Short getSrcPort();
195
196 @Property("src_port")
197 public void setSrcPort(Short srcPort);
198
Jonathan Hart01f2d272013-04-04 20:03:46 -0700199 @JsonProperty("dstDpid")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800200 @Property("dst_switch")
201 public String getDstSwitch();
202
203 @Property("dst_switch")
204 public void setDstSwitch(String dstSwitch);
205
Jonathan Hart01f2d272013-04-04 20:03:46 -0700206 @JsonProperty("dstPort")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800207 @Property("dst_port")
208 public Short getDstPort();
209
210 @Property("dst_port")
211 public void setDstPort(Short dstPort);
212
Jonathan Hart01f2d272013-04-04 20:03:46 -0700213 @JsonProperty("dataPath")
214 @JsonSerialize(using=DatapathSummarySerializer.class)
Pavlin Radoslavovdbaaf2e2013-03-29 04:25:55 -0700215 @Property("data_path_summary")
216 public String getDataPathSummary();
217
218 @Property("data_path_summary")
219 public void setDataPathSummary(String dataPathSummary);
220
Jonathan Hart01f2d272013-04-04 20:03:46 -0700221 @JsonIgnore
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800222 @Adjacency(label="flow", direction=Direction.IN)
223 public Iterable<IFlowEntry> getFlowEntries();
224
225 @Adjacency(label="flow", direction=Direction.IN)
226 public void addFlowEntry(final IFlowEntry flowEntry);
227
228 @Adjacency(label="flow", direction=Direction.IN)
229 public void removeFlowEntry(final IFlowEntry flowEntry);
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700230
Jonathan Hart01f2d272013-04-04 20:03:46 -0700231 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700232 @Property("matchEthernetFrameType")
233 public Short getMatchEthernetFrameType();
234
235 @Property("matchEthernetFrameType")
236 public void setMatchEthernetFrameType(Short matchEthernetFrameType);
237
Jonathan Hart01f2d272013-04-04 20:03:46 -0700238 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700239 @Property("matchSrcMac")
240 public String getMatchSrcMac();
241
242 @Property("matchSrcMac")
243 public void setMatchSrcMac(String matchSrcMac);
244
Jonathan Hart01f2d272013-04-04 20:03:46 -0700245 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700246 @Property("matchDstMac")
247 public String getMatchDstMac();
248
249 @Property("matchDstMac")
250 public void setMatchDstMac(String matchDstMac);
251
Jonathan Hart01f2d272013-04-04 20:03:46 -0700252 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700253 @Property("matchSrcIPv4Net")
254 public String getMatchSrcIPv4Net();
255
256 @Property("matchSrcIPv4Net")
257 public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
258
Jonathan Hart01f2d272013-04-04 20:03:46 -0700259 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700260 @Property("matchDstIPv4Net")
261 public String getMatchDstIPv4Net();
262
263 @Property("matchDstIPv4Net")
264 public void setMatchDstIPv4Net(String matchDstIPv4Net);
Pankaj Berded0079742013-03-27 17:53:25 -0700265
266 @JsonIgnore
267 @GremlinGroovy("_().in('flow').out('switch')")
Pankaj Berdef1404a72013-04-03 11:50:07 -0700268 public Iterable<ISwitchObject> getSwitches();
Jonathan Hart01f2d272013-04-04 20:03:46 -0700269
270 @JsonIgnore
271 @Property("state")
272 public String getState();
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800273 }
274
275public interface IFlowEntry extends IBaseObject {
276 @Property("flow_entry_id")
277 public String getFlowEntryId();
278
279 @Property("flow_entry_id")
280 public void setFlowEntryId(String flowEntryId);
281
282 @Property("switch_dpid")
283 public String getSwitchDpid();
284
285 @Property("switch_dpid")
286 public void setSwitchDpid(String switchDpid);
287
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800288 @Property("user_state")
289 public String getUserState();
290
291 @Property("user_state")
292 public void setUserState(String userState);
293
294 @Property("switch_state")
295 public String getSwitchState();
296
297 @Property("switch_state")
298 public void setSwitchState(String switchState);
299
300 @Property("error_state_type")
301 public String getErrorStateType();
302
303 @Property("error_state_type")
304 public void setErrorStateType(String errorStateType);
305
306 @Property("error_state_code")
307 public String getErrorStateCode();
308
309 @Property("error_state_code")
310 public void setErrorStateCode(String errorStateCode);
Pavlin Radoslavove2f0de82013-03-12 01:39:30 -0700311
312 @Property("matchInPort")
313 public Short getMatchInPort();
314
315 @Property("matchInPort")
316 public void setMatchInPort(Short matchInPort);
317
318 @Property("matchEthernetFrameType")
319 public Short getMatchEthernetFrameType();
320
321 @Property("matchEthernetFrameType")
322 public void setMatchEthernetFrameType(Short matchEthernetFrameType);
323
324 @Property("matchSrcMac")
325 public String getMatchSrcMac();
326
327 @Property("matchSrcMac")
328 public void setMatchSrcMac(String matchSrcMac);
329
330 @Property("matchDstMac")
331 public String getMatchDstMac();
332
333 @Property("matchDstMac")
334 public void setMatchDstMac(String matchDstMac);
335
336 @Property("matchSrcIPv4Net")
337 public String getMatchSrcIPv4Net();
338
339 @Property("matchSrcIPv4Net")
340 public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
341
342 @Property("matchDstIPv4Net")
343 public String getMatchDstIPv4Net();
344
345 @Property("matchDstIPv4Net")
346 public void setMatchDstIPv4Net(String matchDstIPv4Net);
347
348 @Property("actionOutput")
349 public Short getActionOutput();
350
351 @Property("actionOutput")
352 public void setActionOutput(Short actionOutput);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700353
354 @Adjacency(label="flow")
355 public IFlowPath getFlow();
356
357 @Adjacency(label="flow")
358 public void setFlow(IFlowPath flow);
359
Pankaj Berded0079742013-03-27 17:53:25 -0700360 @Adjacency(label="switch")
361 public ISwitchObject getSwitch();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700362
Pankaj Berded0079742013-03-27 17:53:25 -0700363 @Adjacency(label="switch")
364 public void setSwitch(ISwitchObject sw);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700365
Pankaj Berded0079742013-03-27 17:53:25 -0700366 @Adjacency(label="inport")
367 public IPortObject getInPort();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700368
Pankaj Berded0079742013-03-27 17:53:25 -0700369 @Adjacency(label="inport")
370 public void setInPort(IPortObject port);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700371
Pankaj Berded0079742013-03-27 17:53:25 -0700372 @Adjacency(label="outport")
373 public IPortObject getOutPort();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700374
Pavlin Radoslavov4fead9c2013-03-28 03:09:27 -0700375 @Adjacency(label="outport")
Pankaj Berded0079742013-03-27 17:53:25 -0700376 public void setOutPort(IPortObject port);
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800377 }
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800378}