blob: 9dea4c554d821d68531d1cd0c3540233e42c0853 [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
80 @Property("port_sate")
81 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
196 @Adjacency(label="flow", direction=Direction.IN)
197 public Iterable<IFlowEntry> getFlowEntries();
198
199 @Adjacency(label="flow", direction=Direction.IN)
200 public void addFlowEntry(final IFlowEntry flowEntry);
201
202 @Adjacency(label="flow", direction=Direction.IN)
203 public void removeFlowEntry(final IFlowEntry flowEntry);
Pankaj Berded0079742013-03-27 17:53:25 -0700204
205 @JsonIgnore
206 @GremlinGroovy("_().in('flow').out('switch')")
207 public Iterable<IDeviceObject> getSwitches();
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800208 }
209
210public interface IFlowEntry extends IBaseObject {
211 @Property("flow_entry_id")
212 public String getFlowEntryId();
213
214 @Property("flow_entry_id")
215 public void setFlowEntryId(String flowEntryId);
216
217 @Property("switch_dpid")
218 public String getSwitchDpid();
219
220 @Property("switch_dpid")
221 public void setSwitchDpid(String switchDpid);
222
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800223 @Property("user_state")
224 public String getUserState();
225
226 @Property("user_state")
227 public void setUserState(String userState);
228
229 @Property("switch_state")
230 public String getSwitchState();
231
232 @Property("switch_state")
233 public void setSwitchState(String switchState);
234
235 @Property("error_state_type")
236 public String getErrorStateType();
237
238 @Property("error_state_type")
239 public void setErrorStateType(String errorStateType);
240
241 @Property("error_state_code")
242 public String getErrorStateCode();
243
244 @Property("error_state_code")
245 public void setErrorStateCode(String errorStateCode);
Pavlin Radoslavove2f0de82013-03-12 01:39:30 -0700246
247 @Property("matchInPort")
248 public Short getMatchInPort();
249
250 @Property("matchInPort")
251 public void setMatchInPort(Short matchInPort);
252
253 @Property("matchEthernetFrameType")
254 public Short getMatchEthernetFrameType();
255
256 @Property("matchEthernetFrameType")
257 public void setMatchEthernetFrameType(Short matchEthernetFrameType);
258
259 @Property("matchSrcMac")
260 public String getMatchSrcMac();
261
262 @Property("matchSrcMac")
263 public void setMatchSrcMac(String matchSrcMac);
264
265 @Property("matchDstMac")
266 public String getMatchDstMac();
267
268 @Property("matchDstMac")
269 public void setMatchDstMac(String matchDstMac);
270
271 @Property("matchSrcIPv4Net")
272 public String getMatchSrcIPv4Net();
273
274 @Property("matchSrcIPv4Net")
275 public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
276
277 @Property("matchDstIPv4Net")
278 public String getMatchDstIPv4Net();
279
280 @Property("matchDstIPv4Net")
281 public void setMatchDstIPv4Net(String matchDstIPv4Net);
282
283 @Property("actionOutput")
284 public Short getActionOutput();
285
286 @Property("actionOutput")
287 public void setActionOutput(Short actionOutput);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700288
289 @Adjacency(label="flow")
290 public IFlowPath getFlow();
291
292 @Adjacency(label="flow")
293 public void setFlow(IFlowPath flow);
294
Pankaj Berded0079742013-03-27 17:53:25 -0700295 @Adjacency(label="switch")
296 public ISwitchObject getSwitch();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700297
Pankaj Berded0079742013-03-27 17:53:25 -0700298 @Adjacency(label="switch")
299 public void setSwitch(ISwitchObject sw);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700300
Pankaj Berded0079742013-03-27 17:53:25 -0700301 @Adjacency(label="inport")
302 public IPortObject getInPort();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700303
Pankaj Berded0079742013-03-27 17:53:25 -0700304 @Adjacency(label="inport")
305 public void setInPort(IPortObject port);
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700306
Pankaj Berded0079742013-03-27 17:53:25 -0700307 @Adjacency(label="outport")
308 public IPortObject getOutPort();
Pavlin Radoslavov1d4a1072013-03-28 05:29:49 -0700309
Pavlin Radoslavov4fead9c2013-03-28 03:09:27 -0700310 @Adjacency(label="outport")
Pankaj Berded0079742013-03-27 17:53:25 -0700311 public void setOutPort(IPortObject port);
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800312 }
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800313}