blob: 5264648cb9c693ed09f2309cd1d67cd3d0e45362 [file] [log] [blame]
Pankaj Berde1b8a42f2013-02-15 08:25:03 -08001package net.floodlightcontroller.core;
2
3import org.codehaus.jackson.annotate.JsonIgnore;
4import org.codehaus.jackson.annotate.JsonProperty;
5
6import com.tinkerpop.blueprints.Direction;
7import com.tinkerpop.frames.Adjacency;
8import com.tinkerpop.frames.Incidence;
9import com.tinkerpop.frames.Property;
10import com.tinkerpop.frames.annotations.gremlin.GremlinGroovy;
11import com.tinkerpop.frames.VertexFrame;
12
13public interface INetMapTopologyObjects {
14
15public interface IBaseObject extends VertexFrame {
16
17 @JsonProperty("state")
18 @Property("state")
19 public String getState();
Pankaj Berde1cde50b2013-02-19 20:16:06 -080020
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080021 @Property("state")
22 public void setState(final String state);
23
24 @JsonIgnore
25 @Property("type")
26 public String getType();
27 @Property("type")
28 public void setType(final String type);
29
30}
31
32public interface ISwitchObject extends IBaseObject{
33
34 @JsonProperty("dpid")
35 @Property("dpid")
36 public String getDPID();
37
38 @Property("dpid")
39 public void setDPID(String dpid);
40
41 @JsonProperty("ports")
42 @Adjacency(label="on")
43 public Iterable<IPortObject> getPorts();
44
Pankaj Berde73ea7e52013-04-04 14:52:50 -070045 @JsonIgnore
46 @GremlinGroovy("_().out('on').has('number',portnum)")
Pankaj Berdeda809572013-02-22 15:31:20 -080047 public IPortObject getPort(final short port_num);
48
49 @Adjacency(label="on")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080050 public void addPort(final IPortObject port);
51
52 @Adjacency(label="on")
53 public void removePort(final IPortObject port);
54
55 @JsonIgnore
56 @GremlinGroovy("_().out('on').out('host')")
57 public Iterable<IDeviceObject> getDevices();
Pankaj Berded0079742013-03-27 17:53:25 -070058
59 @JsonIgnore
60 @Incidence(label="switch",direction = Direction.IN)
61 public Iterable<IFlowEntry> getFlowEntries();
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080062 }
63
64 public interface IPortObject extends IBaseObject{
65
66 @JsonProperty("number")
67 @Property("number")
68 public Short getNumber();
69
Pankaj Berde15193092013-03-21 17:30:14 -070070 @Property("number")
71 public void setNumber(Short n);
72
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080073 @JsonProperty("desc")
74 @Property("desc")
75 public String getDesc();
76
Pankaj Berde15193092013-03-21 17:30:14 -070077 @Property("desc")
78 public void setDesc(String s);
79
80 @JsonIgnore
Pankaj Berdef1404a72013-04-03 11:50:07 -070081 @Property("port_state")
Pankaj Berde15193092013-03-21 17:30:14 -070082 public Integer getPortState();
83
84 @Property("port_state")
85 public void setPortState(Integer s);
86
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080087 @JsonIgnore
88 @Incidence(label="on",direction = Direction.IN)
89 public ISwitchObject getSwitch();
Pankaj Berdea6b80c32013-03-29 09:02:56 -070090
Pankaj Berdeac1a8c32013-02-26 17:45:57 -080091 @JsonProperty("devices")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080092 @Adjacency(label="host")
93 public Iterable<IDeviceObject> getDevices();
94
95 @Adjacency(label="host")
96 public void setDevice(final IDeviceObject device);
97
98 @Adjacency(label="host")
99 public void removeDevice(final IDeviceObject device);
100
Pankaj Berded0079742013-03-27 17:53:25 -0700101 @JsonIgnore
102 @Incidence(label="inport",direction = Direction.IN)
103 public Iterable<IFlowEntry> getInFlowEntries();
104
105 @JsonIgnore
106 @Incidence(label="outport",direction = Direction.IN)
107 public Iterable<IFlowEntry> getOutFlowEntries();
108
Pankaj Berdea6b80c32013-03-29 09:02:56 -0700109 @Adjacency(label="link")
110 public void removeLink(final IPortObject dest_port);
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 {
161 @Property("flow_id")
162 public String getFlowId();
163
164 @Property("flow_id")
165 public void setFlowId(String flowId);
166
167 @Property("installer_id")
168 public String getInstallerId();
169
170 @Property("installer_id")
171 public void setInstallerId(String installerId);
172
173 @Property("src_switch")
174 public String getSrcSwitch();
175
176 @Property("src_switch")
177 public void setSrcSwitch(String srcSwitch);
178
179 @Property("src_port")
180 public Short getSrcPort();
181
182 @Property("src_port")
183 public void setSrcPort(Short srcPort);
184
185 @Property("dst_switch")
186 public String getDstSwitch();
187
188 @Property("dst_switch")
189 public void setDstSwitch(String dstSwitch);
190
191 @Property("dst_port")
192 public Short getDstPort();
193
194 @Property("dst_port")
195 public void setDstPort(Short dstPort);
196
Pavlin Radoslavovdbaaf2e2013-03-29 04:25:55 -0700197 @Property("data_path_summary")
198 public String getDataPathSummary();
199
200 @Property("data_path_summary")
201 public void setDataPathSummary(String dataPathSummary);
202
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800203 @Adjacency(label="flow", direction=Direction.IN)
204 public Iterable<IFlowEntry> getFlowEntries();
205
206 @Adjacency(label="flow", direction=Direction.IN)
207 public void addFlowEntry(final IFlowEntry flowEntry);
208
209 @Adjacency(label="flow", direction=Direction.IN)
210 public void removeFlowEntry(final IFlowEntry flowEntry);
Pavlin Radoslavov67b3ef32013-04-03 02:44:48 -0700211
212 @Property("matchEthernetFrameType")
213 public Short getMatchEthernetFrameType();
214
215 @Property("matchEthernetFrameType")
216 public void setMatchEthernetFrameType(Short matchEthernetFrameType);
217
218 @Property("matchSrcMac")
219 public String getMatchSrcMac();
220
221 @Property("matchSrcMac")
222 public void setMatchSrcMac(String matchSrcMac);
223
224 @Property("matchDstMac")
225 public String getMatchDstMac();
226
227 @Property("matchDstMac")
228 public void setMatchDstMac(String matchDstMac);
229
230 @Property("matchSrcIPv4Net")
231 public String getMatchSrcIPv4Net();
232
233 @Property("matchSrcIPv4Net")
234 public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
235
236 @Property("matchDstIPv4Net")
237 public String getMatchDstIPv4Net();
238
239 @Property("matchDstIPv4Net")
240 public void setMatchDstIPv4Net(String matchDstIPv4Net);
Pankaj Berded0079742013-03-27 17:53:25 -0700241
242 @JsonIgnore
243 @GremlinGroovy("_().in('flow').out('switch')")
Pankaj Berdef1404a72013-04-03 11:50:07 -0700244 public Iterable<ISwitchObject> getSwitches();
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800245 }
246
247public interface IFlowEntry extends IBaseObject {
248 @Property("flow_entry_id")
249 public String getFlowEntryId();
250
251 @Property("flow_entry_id")
252 public void setFlowEntryId(String flowEntryId);
253
254 @Property("switch_dpid")
255 public String getSwitchDpid();
256
257 @Property("switch_dpid")
258 public void setSwitchDpid(String switchDpid);
259
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800260 @Property("user_state")
261 public String getUserState();
262
263 @Property("user_state")
264 public void setUserState(String userState);
265
266 @Property("switch_state")
267 public String getSwitchState();
268
269 @Property("switch_state")
270 public void setSwitchState(String switchState);
271
272 @Property("error_state_type")
273 public String getErrorStateType();
274
275 @Property("error_state_type")
276 public void setErrorStateType(String errorStateType);
277
278 @Property("error_state_code")
279 public String getErrorStateCode();
280
281 @Property("error_state_code")
282 public void setErrorStateCode(String errorStateCode);
Pavlin Radoslavove2f0de82013-03-12 01:39:30 -0700283
284 @Property("matchInPort")
285 public Short getMatchInPort();
286
287 @Property("matchInPort")
288 public void setMatchInPort(Short matchInPort);
289
290 @Property("matchEthernetFrameType")
291 public Short getMatchEthernetFrameType();
292
293 @Property("matchEthernetFrameType")
294 public void setMatchEthernetFrameType(Short matchEthernetFrameType);
295
296 @Property("matchSrcMac")
297 public String getMatchSrcMac();
298
299 @Property("matchSrcMac")
300 public void setMatchSrcMac(String matchSrcMac);
301
302 @Property("matchDstMac")
303 public String getMatchDstMac();
304
305 @Property("matchDstMac")
306 public void setMatchDstMac(String matchDstMac);
307
308 @Property("matchSrcIPv4Net")
309 public String getMatchSrcIPv4Net();
310
311 @Property("matchSrcIPv4Net")
312 public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
313
314 @Property("matchDstIPv4Net")
315 public String getMatchDstIPv4Net();
316
317 @Property("matchDstIPv4Net")
318 public void setMatchDstIPv4Net(String matchDstIPv4Net);
319
320 @Property("actionOutput")
321 public Short getActionOutput();
322
323 @Property("actionOutput")
324 public void setActionOutput(Short actionOutput);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700325
326 @Adjacency(label="flow")
327 public IFlowPath getFlow();
328
329 @Adjacency(label="flow")
330 public void setFlow(IFlowPath flow);
331
Pankaj Berded0079742013-03-27 17:53:25 -0700332 @Adjacency(label="switch")
333 public ISwitchObject getSwitch();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700334
Pankaj Berded0079742013-03-27 17:53:25 -0700335 @Adjacency(label="switch")
336 public void setSwitch(ISwitchObject sw);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700337
Pankaj Berded0079742013-03-27 17:53:25 -0700338 @Adjacency(label="inport")
339 public IPortObject getInPort();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700340
Pankaj Berded0079742013-03-27 17:53:25 -0700341 @Adjacency(label="inport")
342 public void setInPort(IPortObject port);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700343
Pankaj Berded0079742013-03-27 17:53:25 -0700344 @Adjacency(label="outport")
345 public IPortObject getOutPort();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700346
Pavlin Radoslavov4fead9c2013-03-28 03:09:27 -0700347 @Adjacency(label="outport")
Pankaj Berded0079742013-03-27 17:53:25 -0700348 public void setOutPort(IPortObject port);
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800349 }
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800350}