blob: 4f11c6c8d537170a9a289b539d5f5cd17185f1cc [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
49 @GremlinGroovy("_().out('on').has('number',portnum)")
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 Berdea6b80c32013-03-29 09:02:56 -0700112 @Adjacency(label="link")
113 public void removeLink(final IPortObject dest_port);
114
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800115// @JsonIgnore
116// @Adjacency(label="link")
117// public Iterable<ILinkObject> getLinks();
118 }
119
120 public interface IDeviceObject extends IBaseObject {
121
122 @JsonProperty("mac")
123 @Property("dl_addr")
124 public String getMACAddress();
125 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800126 public void setMACAddress(String macaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800127
128 @JsonProperty("ipv4")
129 @Property("nw_addr")
130 public String getIPAddress();
131 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800132 public void setIPAddress(String ipaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800133
134 @JsonIgnore
135 @Incidence(label="host",direction = Direction.IN)
Pankaj Berde2497e542013-02-19 18:51:24 -0800136 public Iterable<IPortObject> getAttachedPorts();
137
138 @JsonIgnore
139 @Incidence(label="host",direction=Direction.IN)
140 public void setHostPort(final IPortObject port);
141
142 @JsonIgnore
143 @Incidence(label="host",direction=Direction.IN)
144 public void removeHostPort(final IPortObject port);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800145
146 @JsonIgnore
147 @GremlinGroovy("_().in('host').in('on')")
Pankaj Berde2497e542013-02-19 18:51:24 -0800148 public Iterable<ISwitchObject> getSwitch();
149
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800150/* @JsonProperty("dpid")
151 @GremlinGroovy("_().in('host').in('on').next().getProperty('dpid')")
152 public Iterable<String> getSwitchDPID();
153
154 @JsonProperty("number")
155 @GremlinGroovy("_().in('host').transform{it.number}")
156 public Iterable<Short> getPortNumber();
157
Pankaj Berde2497e542013-02-19 18:51:24 -0800158 @JsonProperty("AttachmentPoint")
159 @GremlinGroovy("_().in('host').in('on').path(){it.number}{it.dpid}")
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800160 public Iterable<SwitchPort> getAttachmentPoints();*/
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800161 }
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800162
163public interface IFlowPath extends IBaseObject {
Jonathan Hart01f2d272013-04-04 20:03:46 -0700164 @JsonProperty("flowId")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800165 @Property("flow_id")
166 public String getFlowId();
167
168 @Property("flow_id")
169 public void setFlowId(String flowId);
170
Jonathan Hart01f2d272013-04-04 20:03:46 -0700171 @JsonProperty("installerId")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800172 @Property("installer_id")
173 public String getInstallerId();
174
175 @Property("installer_id")
176 public void setInstallerId(String installerId);
177
Jonathan Hart01f2d272013-04-04 20:03:46 -0700178 @JsonProperty("srcDpid")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800179 @Property("src_switch")
180 public String getSrcSwitch();
181
182 @Property("src_switch")
183 public void setSrcSwitch(String srcSwitch);
184
Jonathan Hart01f2d272013-04-04 20:03:46 -0700185 @JsonProperty("srcPort")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800186 @Property("src_port")
187 public Short getSrcPort();
188
189 @Property("src_port")
190 public void setSrcPort(Short srcPort);
191
Jonathan Hart01f2d272013-04-04 20:03:46 -0700192 @JsonProperty("dstDpid")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800193 @Property("dst_switch")
194 public String getDstSwitch();
195
196 @Property("dst_switch")
197 public void setDstSwitch(String dstSwitch);
198
Jonathan Hart01f2d272013-04-04 20:03:46 -0700199 @JsonProperty("dstPort")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800200 @Property("dst_port")
201 public Short getDstPort();
202
203 @Property("dst_port")
204 public void setDstPort(Short dstPort);
205
Jonathan Hart01f2d272013-04-04 20:03:46 -0700206 @JsonProperty("dataPath")
207 @JsonSerialize(using=DatapathSummarySerializer.class)
Pavlin Radoslavovdbaaf2e2013-03-29 04:25:55 -0700208 @Property("data_path_summary")
209 public String getDataPathSummary();
210
211 @Property("data_path_summary")
212 public void setDataPathSummary(String dataPathSummary);
213
Jonathan Hart01f2d272013-04-04 20:03:46 -0700214 @JsonIgnore
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800215 @Adjacency(label="flow", direction=Direction.IN)
216 public Iterable<IFlowEntry> getFlowEntries();
217
218 @Adjacency(label="flow", direction=Direction.IN)
219 public void addFlowEntry(final IFlowEntry flowEntry);
220
221 @Adjacency(label="flow", direction=Direction.IN)
222 public void removeFlowEntry(final IFlowEntry flowEntry);
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700223
Jonathan Hart01f2d272013-04-04 20:03:46 -0700224 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700225 @Property("matchEthernetFrameType")
226 public Short getMatchEthernetFrameType();
227
228 @Property("matchEthernetFrameType")
229 public void setMatchEthernetFrameType(Short matchEthernetFrameType);
230
Jonathan Hart01f2d272013-04-04 20:03:46 -0700231 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700232 @Property("matchSrcMac")
233 public String getMatchSrcMac();
234
235 @Property("matchSrcMac")
236 public void setMatchSrcMac(String matchSrcMac);
237
Jonathan Hart01f2d272013-04-04 20:03:46 -0700238 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700239 @Property("matchDstMac")
240 public String getMatchDstMac();
241
242 @Property("matchDstMac")
243 public void setMatchDstMac(String matchDstMac);
244
Jonathan Hart01f2d272013-04-04 20:03:46 -0700245 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700246 @Property("matchSrcIPv4Net")
247 public String getMatchSrcIPv4Net();
248
249 @Property("matchSrcIPv4Net")
250 public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
251
Jonathan Hart01f2d272013-04-04 20:03:46 -0700252 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700253 @Property("matchDstIPv4Net")
254 public String getMatchDstIPv4Net();
255
256 @Property("matchDstIPv4Net")
257 public void setMatchDstIPv4Net(String matchDstIPv4Net);
Pankaj Berded0079742013-03-27 17:53:25 -0700258
259 @JsonIgnore
260 @GremlinGroovy("_().in('flow').out('switch')")
Pankaj Berdef1404a72013-04-03 11:50:07 -0700261 public Iterable<ISwitchObject> getSwitches();
Jonathan Hart01f2d272013-04-04 20:03:46 -0700262
263 @JsonIgnore
264 @Property("state")
265 public String getState();
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800266 }
267
268public interface IFlowEntry extends IBaseObject {
269 @Property("flow_entry_id")
270 public String getFlowEntryId();
271
272 @Property("flow_entry_id")
273 public void setFlowEntryId(String flowEntryId);
274
275 @Property("switch_dpid")
276 public String getSwitchDpid();
277
278 @Property("switch_dpid")
279 public void setSwitchDpid(String switchDpid);
280
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800281 @Property("user_state")
282 public String getUserState();
283
284 @Property("user_state")
285 public void setUserState(String userState);
286
287 @Property("switch_state")
288 public String getSwitchState();
289
290 @Property("switch_state")
291 public void setSwitchState(String switchState);
292
293 @Property("error_state_type")
294 public String getErrorStateType();
295
296 @Property("error_state_type")
297 public void setErrorStateType(String errorStateType);
298
299 @Property("error_state_code")
300 public String getErrorStateCode();
301
302 @Property("error_state_code")
303 public void setErrorStateCode(String errorStateCode);
Pavlin Radoslavove2f0de82013-03-12 01:39:30 -0700304
305 @Property("matchInPort")
306 public Short getMatchInPort();
307
308 @Property("matchInPort")
309 public void setMatchInPort(Short matchInPort);
310
311 @Property("matchEthernetFrameType")
312 public Short getMatchEthernetFrameType();
313
314 @Property("matchEthernetFrameType")
315 public void setMatchEthernetFrameType(Short matchEthernetFrameType);
316
317 @Property("matchSrcMac")
318 public String getMatchSrcMac();
319
320 @Property("matchSrcMac")
321 public void setMatchSrcMac(String matchSrcMac);
322
323 @Property("matchDstMac")
324 public String getMatchDstMac();
325
326 @Property("matchDstMac")
327 public void setMatchDstMac(String matchDstMac);
328
329 @Property("matchSrcIPv4Net")
330 public String getMatchSrcIPv4Net();
331
332 @Property("matchSrcIPv4Net")
333 public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
334
335 @Property("matchDstIPv4Net")
336 public String getMatchDstIPv4Net();
337
338 @Property("matchDstIPv4Net")
339 public void setMatchDstIPv4Net(String matchDstIPv4Net);
340
341 @Property("actionOutput")
342 public Short getActionOutput();
343
344 @Property("actionOutput")
345 public void setActionOutput(Short actionOutput);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700346
347 @Adjacency(label="flow")
348 public IFlowPath getFlow();
349
350 @Adjacency(label="flow")
351 public void setFlow(IFlowPath flow);
352
Pankaj Berded0079742013-03-27 17:53:25 -0700353 @Adjacency(label="switch")
354 public ISwitchObject getSwitch();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700355
Pankaj Berded0079742013-03-27 17:53:25 -0700356 @Adjacency(label="switch")
357 public void setSwitch(ISwitchObject sw);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700358
Pankaj Berded0079742013-03-27 17:53:25 -0700359 @Adjacency(label="inport")
360 public IPortObject getInPort();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700361
Pankaj Berded0079742013-03-27 17:53:25 -0700362 @Adjacency(label="inport")
363 public void setInPort(IPortObject port);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700364
Pankaj Berded0079742013-03-27 17:53:25 -0700365 @Adjacency(label="outport")
366 public IPortObject getOutPort();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700367
Pavlin Radoslavov4fead9c2013-03-28 03:09:27 -0700368 @Adjacency(label="outport")
Pankaj Berded0079742013-03-27 17:53:25 -0700369 public void setOutPort(IPortObject port);
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800370 }
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800371}