blob: 19addad8f0c0365f488e0cd0ef4431471fb82b5d [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
48 @Adjacency(label="on")
Pankaj Berdeda809572013-02-22 15:31:20 -080049 public IPortObject getPort(final short port_num);
50
51 @Adjacency(label="on")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080052 public void addPort(final IPortObject port);
53
54 @Adjacency(label="on")
55 public void removePort(final IPortObject port);
56
57 @JsonIgnore
58 @GremlinGroovy("_().out('on').out('host')")
59 public Iterable<IDeviceObject> getDevices();
Pankaj Berded0079742013-03-27 17:53:25 -070060
61 @JsonIgnore
62 @Incidence(label="switch",direction = Direction.IN)
63 public Iterable<IFlowEntry> getFlowEntries();
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080064 }
65
66 public interface IPortObject extends IBaseObject{
67
68 @JsonProperty("number")
69 @Property("number")
70 public Short getNumber();
71
Pankaj Berde15193092013-03-21 17:30:14 -070072 @Property("number")
73 public void setNumber(Short n);
74
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080075 @JsonProperty("desc")
76 @Property("desc")
77 public String getDesc();
78
Pankaj Berde15193092013-03-21 17:30:14 -070079 @Property("desc")
80 public void setDesc(String s);
81
82 @JsonIgnore
83 @Property("port_sate")
84 public Integer getPortState();
85
86 @Property("port_state")
87 public void setPortState(Integer s);
88
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080089 @JsonIgnore
90 @Incidence(label="on",direction = Direction.IN)
91 public ISwitchObject getSwitch();
92
Pankaj Berdeac1a8c32013-02-26 17:45:57 -080093
94 @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 Berde1b8a42f2013-02-15 08:25:03 -0800112// @JsonIgnore
113// @Adjacency(label="link")
114// public Iterable<ILinkObject> getLinks();
115 }
116
117 public interface IDeviceObject extends IBaseObject {
118
119 @JsonProperty("mac")
120 @Property("dl_addr")
121 public String getMACAddress();
122 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800123 public void setMACAddress(String macaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800124
125 @JsonProperty("ipv4")
126 @Property("nw_addr")
127 public String getIPAddress();
128 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800129 public void setIPAddress(String ipaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800130
131 @JsonIgnore
132 @Incidence(label="host",direction = Direction.IN)
Pankaj Berde2497e542013-02-19 18:51:24 -0800133 public Iterable<IPortObject> getAttachedPorts();
134
135 @JsonIgnore
136 @Incidence(label="host",direction=Direction.IN)
137 public void setHostPort(final IPortObject port);
138
139 @JsonIgnore
140 @Incidence(label="host",direction=Direction.IN)
141 public void removeHostPort(final IPortObject port);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800142
143 @JsonIgnore
144 @GremlinGroovy("_().in('host').in('on')")
Pankaj Berde2497e542013-02-19 18:51:24 -0800145 public Iterable<ISwitchObject> getSwitch();
146
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800147/* @JsonProperty("dpid")
148 @GremlinGroovy("_().in('host').in('on').next().getProperty('dpid')")
149 public Iterable<String> getSwitchDPID();
150
151 @JsonProperty("number")
152 @GremlinGroovy("_().in('host').transform{it.number}")
153 public Iterable<Short> getPortNumber();
154
Pankaj Berde2497e542013-02-19 18:51:24 -0800155 @JsonProperty("AttachmentPoint")
156 @GremlinGroovy("_().in('host').in('on').path(){it.number}{it.dpid}")
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800157 public Iterable<SwitchPort> getAttachmentPoints();*/
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800158 }
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800159
160public interface IFlowPath extends IBaseObject {
Jonathan Hart01f2d272013-04-04 20:03:46 -0700161 @JsonProperty("flowId")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800162 @Property("flow_id")
163 public String getFlowId();
164
165 @Property("flow_id")
166 public void setFlowId(String flowId);
167
Jonathan Hart01f2d272013-04-04 20:03:46 -0700168 @JsonProperty("installerId")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800169 @Property("installer_id")
170 public String getInstallerId();
171
172 @Property("installer_id")
173 public void setInstallerId(String installerId);
174
Jonathan Hart01f2d272013-04-04 20:03:46 -0700175 @JsonProperty("srcDpid")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800176 @Property("src_switch")
177 public String getSrcSwitch();
178
179 @Property("src_switch")
180 public void setSrcSwitch(String srcSwitch);
181
Jonathan Hart01f2d272013-04-04 20:03:46 -0700182 @JsonProperty("srcPort")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800183 @Property("src_port")
184 public Short getSrcPort();
185
186 @Property("src_port")
187 public void setSrcPort(Short srcPort);
188
Jonathan Hart01f2d272013-04-04 20:03:46 -0700189 @JsonProperty("dstDpid")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800190 @Property("dst_switch")
191 public String getDstSwitch();
192
193 @Property("dst_switch")
194 public void setDstSwitch(String dstSwitch);
195
Jonathan Hart01f2d272013-04-04 20:03:46 -0700196 @JsonProperty("dstPort")
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800197 @Property("dst_port")
198 public Short getDstPort();
199
200 @Property("dst_port")
201 public void setDstPort(Short dstPort);
202
Jonathan Hart01f2d272013-04-04 20:03:46 -0700203 @JsonProperty("dataPath")
204 @JsonSerialize(using=DatapathSummarySerializer.class)
Pavlin Radoslavovdbaaf2e2013-03-29 04:25:55 -0700205 @Property("data_path_summary")
206 public String getDataPathSummary();
207
208 @Property("data_path_summary")
209 public void setDataPathSummary(String dataPathSummary);
210
Jonathan Hart01f2d272013-04-04 20:03:46 -0700211 @JsonIgnore
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800212 @Adjacency(label="flow", direction=Direction.IN)
213 public Iterable<IFlowEntry> getFlowEntries();
214
215 @Adjacency(label="flow", direction=Direction.IN)
216 public void addFlowEntry(final IFlowEntry flowEntry);
217
218 @Adjacency(label="flow", direction=Direction.IN)
219 public void removeFlowEntry(final IFlowEntry flowEntry);
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700220
Jonathan Hart01f2d272013-04-04 20:03:46 -0700221 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700222 @Property("matchEthernetFrameType")
223 public Short getMatchEthernetFrameType();
224
225 @Property("matchEthernetFrameType")
226 public void setMatchEthernetFrameType(Short matchEthernetFrameType);
227
Jonathan Hart01f2d272013-04-04 20:03:46 -0700228 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700229 @Property("matchSrcMac")
230 public String getMatchSrcMac();
231
232 @Property("matchSrcMac")
233 public void setMatchSrcMac(String matchSrcMac);
234
Jonathan Hart01f2d272013-04-04 20:03:46 -0700235 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700236 @Property("matchDstMac")
237 public String getMatchDstMac();
238
239 @Property("matchDstMac")
240 public void setMatchDstMac(String matchDstMac);
241
Jonathan Hart01f2d272013-04-04 20:03:46 -0700242 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700243 @Property("matchSrcIPv4Net")
244 public String getMatchSrcIPv4Net();
245
246 @Property("matchSrcIPv4Net")
247 public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
248
Jonathan Hart01f2d272013-04-04 20:03:46 -0700249 @JsonIgnore
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700250 @Property("matchDstIPv4Net")
251 public String getMatchDstIPv4Net();
252
253 @Property("matchDstIPv4Net")
254 public void setMatchDstIPv4Net(String matchDstIPv4Net);
Pankaj Berded0079742013-03-27 17:53:25 -0700255
256 @JsonIgnore
257 @GremlinGroovy("_().in('flow').out('switch')")
258 public Iterable<IDeviceObject> getSwitches();
Jonathan Hart01f2d272013-04-04 20:03:46 -0700259
260 @JsonIgnore
261 @Property("state")
262 public String getState();
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800263 }
264
265public interface IFlowEntry extends IBaseObject {
266 @Property("flow_entry_id")
267 public String getFlowEntryId();
268
269 @Property("flow_entry_id")
270 public void setFlowEntryId(String flowEntryId);
271
272 @Property("switch_dpid")
273 public String getSwitchDpid();
274
275 @Property("switch_dpid")
276 public void setSwitchDpid(String switchDpid);
277
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800278 @Property("user_state")
279 public String getUserState();
280
281 @Property("user_state")
282 public void setUserState(String userState);
283
284 @Property("switch_state")
285 public String getSwitchState();
286
287 @Property("switch_state")
288 public void setSwitchState(String switchState);
289
290 @Property("error_state_type")
291 public String getErrorStateType();
292
293 @Property("error_state_type")
294 public void setErrorStateType(String errorStateType);
295
296 @Property("error_state_code")
297 public String getErrorStateCode();
298
299 @Property("error_state_code")
300 public void setErrorStateCode(String errorStateCode);
Pavlin Radoslavove2f0de82013-03-12 01:39:30 -0700301
302 @Property("matchInPort")
303 public Short getMatchInPort();
304
305 @Property("matchInPort")
306 public void setMatchInPort(Short matchInPort);
307
308 @Property("matchEthernetFrameType")
309 public Short getMatchEthernetFrameType();
310
311 @Property("matchEthernetFrameType")
312 public void setMatchEthernetFrameType(Short matchEthernetFrameType);
313
314 @Property("matchSrcMac")
315 public String getMatchSrcMac();
316
317 @Property("matchSrcMac")
318 public void setMatchSrcMac(String matchSrcMac);
319
320 @Property("matchDstMac")
321 public String getMatchDstMac();
322
323 @Property("matchDstMac")
324 public void setMatchDstMac(String matchDstMac);
325
326 @Property("matchSrcIPv4Net")
327 public String getMatchSrcIPv4Net();
328
329 @Property("matchSrcIPv4Net")
330 public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
331
332 @Property("matchDstIPv4Net")
333 public String getMatchDstIPv4Net();
334
335 @Property("matchDstIPv4Net")
336 public void setMatchDstIPv4Net(String matchDstIPv4Net);
337
338 @Property("actionOutput")
339 public Short getActionOutput();
340
341 @Property("actionOutput")
342 public void setActionOutput(Short actionOutput);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700343
344 @Adjacency(label="flow")
345 public IFlowPath getFlow();
346
347 @Adjacency(label="flow")
348 public void setFlow(IFlowPath flow);
349
Pankaj Berded0079742013-03-27 17:53:25 -0700350 @Adjacency(label="switch")
351 public ISwitchObject getSwitch();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700352
Pankaj Berded0079742013-03-27 17:53:25 -0700353 @Adjacency(label="switch")
354 public void setSwitch(ISwitchObject sw);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700355
Pankaj Berded0079742013-03-27 17:53:25 -0700356 @Adjacency(label="inport")
357 public IPortObject getInPort();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700358
Pankaj Berded0079742013-03-27 17:53:25 -0700359 @Adjacency(label="inport")
360 public void setInPort(IPortObject port);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700361
Pankaj Berded0079742013-03-27 17:53:25 -0700362 @Adjacency(label="outport")
363 public IPortObject getOutPort();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700364
Pavlin Radoslavov4fead9c2013-03-28 03:09:27 -0700365 @Adjacency(label="outport")
Pankaj Berded0079742013-03-27 17:53:25 -0700366 public void setOutPort(IPortObject port);
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800367 }
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800368}