blob: c49df8405aee61abb7418d6930012fb09bc5e3ab [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
45 @Adjacency(label="on")
Pankaj Berdeda809572013-02-22 15:31:20 -080046 public IPortObject getPort(final short port_num);
47
48 @Adjacency(label="on")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080049 public void addPort(final IPortObject port);
50
51 @Adjacency(label="on")
52 public void removePort(final IPortObject port);
53
54 @JsonIgnore
55 @GremlinGroovy("_().out('on').out('host')")
56 public Iterable<IDeviceObject> getDevices();
Pankaj Berded0079742013-03-27 17:53:25 -070057
58 @JsonIgnore
59 @Incidence(label="switch",direction = Direction.IN)
60 public Iterable<IFlowEntry> getFlowEntries();
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080061 }
62
63 public interface IPortObject extends IBaseObject{
64
65 @JsonProperty("number")
66 @Property("number")
67 public Short getNumber();
68
Pankaj Berde15193092013-03-21 17:30:14 -070069 @Property("number")
70 public void setNumber(Short n);
71
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080072 @JsonProperty("desc")
73 @Property("desc")
74 public String getDesc();
75
Pankaj Berde15193092013-03-21 17:30:14 -070076 @Property("desc")
77 public void setDesc(String s);
78
79 @JsonIgnore
Pankaj Berdef1404a72013-04-03 11:50:07 -070080 @Property("port_state")
Pankaj Berde15193092013-03-21 17:30:14 -070081 public Integer getPortState();
82
83 @Property("port_state")
84 public void setPortState(Integer s);
85
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080086 @JsonIgnore
87 @Incidence(label="on",direction = Direction.IN)
88 public ISwitchObject getSwitch();
Pankaj Berdea6b80c32013-03-29 09:02:56 -070089
Pankaj Berdeac1a8c32013-02-26 17:45:57 -080090 @JsonProperty("devices")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080091 @Adjacency(label="host")
92 public Iterable<IDeviceObject> getDevices();
93
94 @Adjacency(label="host")
95 public void setDevice(final IDeviceObject device);
96
97 @Adjacency(label="host")
98 public void removeDevice(final IDeviceObject device);
99
Pankaj Berded0079742013-03-27 17:53:25 -0700100 @JsonIgnore
101 @Incidence(label="inport",direction = Direction.IN)
102 public Iterable<IFlowEntry> getInFlowEntries();
103
104 @JsonIgnore
105 @Incidence(label="outport",direction = Direction.IN)
106 public Iterable<IFlowEntry> getOutFlowEntries();
107
Pankaj Berdea6b80c32013-03-29 09:02:56 -0700108 @Adjacency(label="link")
109 public void removeLink(final IPortObject dest_port);
110
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800111// @JsonIgnore
112// @Adjacency(label="link")
113// public Iterable<ILinkObject> getLinks();
114 }
115
116 public interface IDeviceObject extends IBaseObject {
117
118 @JsonProperty("mac")
119 @Property("dl_addr")
120 public String getMACAddress();
121 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800122 public void setMACAddress(String macaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800123
124 @JsonProperty("ipv4")
125 @Property("nw_addr")
126 public String getIPAddress();
127 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800128 public void setIPAddress(String ipaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800129
130 @JsonIgnore
131 @Incidence(label="host",direction = Direction.IN)
Pankaj Berde2497e542013-02-19 18:51:24 -0800132 public Iterable<IPortObject> getAttachedPorts();
133
134 @JsonIgnore
135 @Incidence(label="host",direction=Direction.IN)
136 public void setHostPort(final IPortObject port);
137
138 @JsonIgnore
139 @Incidence(label="host",direction=Direction.IN)
140 public void removeHostPort(final IPortObject port);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800141
142 @JsonIgnore
143 @GremlinGroovy("_().in('host').in('on')")
Pankaj Berde2497e542013-02-19 18:51:24 -0800144 public Iterable<ISwitchObject> getSwitch();
145
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800146/* @JsonProperty("dpid")
147 @GremlinGroovy("_().in('host').in('on').next().getProperty('dpid')")
148 public Iterable<String> getSwitchDPID();
149
150 @JsonProperty("number")
151 @GremlinGroovy("_().in('host').transform{it.number}")
152 public Iterable<Short> getPortNumber();
153
Pankaj Berde2497e542013-02-19 18:51:24 -0800154 @JsonProperty("AttachmentPoint")
155 @GremlinGroovy("_().in('host').in('on').path(){it.number}{it.dpid}")
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800156 public Iterable<SwitchPort> getAttachmentPoints();*/
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800157 }
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800158
159public interface IFlowPath extends IBaseObject {
160 @Property("flow_id")
161 public String getFlowId();
162
163 @Property("flow_id")
164 public void setFlowId(String flowId);
165
166 @Property("installer_id")
167 public String getInstallerId();
168
169 @Property("installer_id")
170 public void setInstallerId(String installerId);
171
172 @Property("src_switch")
173 public String getSrcSwitch();
174
175 @Property("src_switch")
176 public void setSrcSwitch(String srcSwitch);
177
178 @Property("src_port")
179 public Short getSrcPort();
180
181 @Property("src_port")
182 public void setSrcPort(Short srcPort);
183
184 @Property("dst_switch")
185 public String getDstSwitch();
186
187 @Property("dst_switch")
188 public void setDstSwitch(String dstSwitch);
189
190 @Property("dst_port")
191 public Short getDstPort();
192
193 @Property("dst_port")
194 public void setDstPort(Short dstPort);
195
Pavlin Radoslavovdbaaf2e2013-03-29 04:25:55 -0700196 @Property("data_path_summary")
197 public String getDataPathSummary();
198
199 @Property("data_path_summary")
200 public void setDataPathSummary(String dataPathSummary);
201
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800202 @Adjacency(label="flow", direction=Direction.IN)
203 public Iterable<IFlowEntry> getFlowEntries();
204
205 @Adjacency(label="flow", direction=Direction.IN)
206 public void addFlowEntry(final IFlowEntry flowEntry);
207
208 @Adjacency(label="flow", direction=Direction.IN)
209 public void removeFlowEntry(final IFlowEntry flowEntry);
Pankaj Berded0079742013-03-27 17:53:25 -0700210
211 @JsonIgnore
212 @GremlinGroovy("_().in('flow').out('switch')")
Pankaj Berdef1404a72013-04-03 11:50:07 -0700213 public Iterable<ISwitchObject> getSwitches();
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800214 }
215
216public interface IFlowEntry extends IBaseObject {
217 @Property("flow_entry_id")
218 public String getFlowEntryId();
219
220 @Property("flow_entry_id")
221 public void setFlowEntryId(String flowEntryId);
222
223 @Property("switch_dpid")
224 public String getSwitchDpid();
225
226 @Property("switch_dpid")
227 public void setSwitchDpid(String switchDpid);
228
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800229 @Property("user_state")
230 public String getUserState();
231
232 @Property("user_state")
233 public void setUserState(String userState);
234
235 @Property("switch_state")
236 public String getSwitchState();
237
238 @Property("switch_state")
239 public void setSwitchState(String switchState);
240
241 @Property("error_state_type")
242 public String getErrorStateType();
243
244 @Property("error_state_type")
245 public void setErrorStateType(String errorStateType);
246
247 @Property("error_state_code")
248 public String getErrorStateCode();
249
250 @Property("error_state_code")
251 public void setErrorStateCode(String errorStateCode);
Pavlin Radoslavove2f0de82013-03-12 01:39:30 -0700252
253 @Property("matchInPort")
254 public Short getMatchInPort();
255
256 @Property("matchInPort")
257 public void setMatchInPort(Short matchInPort);
258
259 @Property("matchEthernetFrameType")
260 public Short getMatchEthernetFrameType();
261
262 @Property("matchEthernetFrameType")
263 public void setMatchEthernetFrameType(Short matchEthernetFrameType);
264
265 @Property("matchSrcMac")
266 public String getMatchSrcMac();
267
268 @Property("matchSrcMac")
269 public void setMatchSrcMac(String matchSrcMac);
270
271 @Property("matchDstMac")
272 public String getMatchDstMac();
273
274 @Property("matchDstMac")
275 public void setMatchDstMac(String matchDstMac);
276
277 @Property("matchSrcIPv4Net")
278 public String getMatchSrcIPv4Net();
279
280 @Property("matchSrcIPv4Net")
281 public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
282
283 @Property("matchDstIPv4Net")
284 public String getMatchDstIPv4Net();
285
286 @Property("matchDstIPv4Net")
287 public void setMatchDstIPv4Net(String matchDstIPv4Net);
288
289 @Property("actionOutput")
290 public Short getActionOutput();
291
292 @Property("actionOutput")
293 public void setActionOutput(Short actionOutput);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700294
295 @Adjacency(label="flow")
296 public IFlowPath getFlow();
297
298 @Adjacency(label="flow")
299 public void setFlow(IFlowPath flow);
300
Pankaj Berded0079742013-03-27 17:53:25 -0700301 @Adjacency(label="switch")
302 public ISwitchObject getSwitch();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700303
Pankaj Berded0079742013-03-27 17:53:25 -0700304 @Adjacency(label="switch")
305 public void setSwitch(ISwitchObject sw);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700306
Pankaj Berded0079742013-03-27 17:53:25 -0700307 @Adjacency(label="inport")
308 public IPortObject getInPort();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700309
Pankaj Berded0079742013-03-27 17:53:25 -0700310 @Adjacency(label="inport")
311 public void setInPort(IPortObject port);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700312
Pankaj Berded0079742013-03-27 17:53:25 -0700313 @Adjacency(label="outport")
314 public IPortObject getOutPort();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700315
Pavlin Radoslavov4fead9c2013-03-28 03:09:27 -0700316 @Adjacency(label="outport")
Pankaj Berded0079742013-03-27 17:53:25 -0700317 public void setOutPort(IPortObject port);
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800318 }
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800319}