blob: a2564d1c61e28154d3d9075eff99c72e01d08eb7 [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();
89
Pankaj Berdeac1a8c32013-02-26 17:45:57 -080090
91 @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 Berde1b8a42f2013-02-15 08:25:03 -0800109// @JsonIgnore
110// @Adjacency(label="link")
111// public Iterable<ILinkObject> getLinks();
112 }
113
114 public interface IDeviceObject extends IBaseObject {
115
116 @JsonProperty("mac")
117 @Property("dl_addr")
118 public String getMACAddress();
119 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800120 public void setMACAddress(String macaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800121
122 @JsonProperty("ipv4")
123 @Property("nw_addr")
124 public String getIPAddress();
125 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800126 public void setIPAddress(String ipaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800127
128 @JsonIgnore
129 @Incidence(label="host",direction = Direction.IN)
Pankaj Berde2497e542013-02-19 18:51:24 -0800130 public Iterable<IPortObject> getAttachedPorts();
131
132 @JsonIgnore
133 @Incidence(label="host",direction=Direction.IN)
134 public void setHostPort(final IPortObject port);
135
136 @JsonIgnore
137 @Incidence(label="host",direction=Direction.IN)
138 public void removeHostPort(final IPortObject port);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800139
140 @JsonIgnore
141 @GremlinGroovy("_().in('host').in('on')")
Pankaj Berde2497e542013-02-19 18:51:24 -0800142 public Iterable<ISwitchObject> getSwitch();
143
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800144/* @JsonProperty("dpid")
145 @GremlinGroovy("_().in('host').in('on').next().getProperty('dpid')")
146 public Iterable<String> getSwitchDPID();
147
148 @JsonProperty("number")
149 @GremlinGroovy("_().in('host').transform{it.number}")
150 public Iterable<Short> getPortNumber();
151
Pankaj Berde2497e542013-02-19 18:51:24 -0800152 @JsonProperty("AttachmentPoint")
153 @GremlinGroovy("_().in('host').in('on').path(){it.number}{it.dpid}")
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800154 public Iterable<SwitchPort> getAttachmentPoints();*/
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800155 }
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800156
157public interface IFlowPath extends IBaseObject {
158 @Property("flow_id")
159 public String getFlowId();
160
161 @Property("flow_id")
162 public void setFlowId(String flowId);
163
164 @Property("installer_id")
165 public String getInstallerId();
166
167 @Property("installer_id")
168 public void setInstallerId(String installerId);
169
170 @Property("src_switch")
171 public String getSrcSwitch();
172
173 @Property("src_switch")
174 public void setSrcSwitch(String srcSwitch);
175
176 @Property("src_port")
177 public Short getSrcPort();
178
179 @Property("src_port")
180 public void setSrcPort(Short srcPort);
181
182 @Property("dst_switch")
183 public String getDstSwitch();
184
185 @Property("dst_switch")
186 public void setDstSwitch(String dstSwitch);
187
188 @Property("dst_port")
189 public Short getDstPort();
190
191 @Property("dst_port")
192 public void setDstPort(Short dstPort);
193
194 @Adjacency(label="flow", direction=Direction.IN)
195 public Iterable<IFlowEntry> getFlowEntries();
196
197 @Adjacency(label="flow", direction=Direction.IN)
198 public void addFlowEntry(final IFlowEntry flowEntry);
199
200 @Adjacency(label="flow", direction=Direction.IN)
201 public void removeFlowEntry(final IFlowEntry flowEntry);
Pankaj Berded0079742013-03-27 17:53:25 -0700202
203 @JsonIgnore
204 @GremlinGroovy("_().in('flow').out('switch')")
205 public Iterable<IDeviceObject> getSwitches();
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800206 }
207
208public interface IFlowEntry extends IBaseObject {
209 @Property("flow_entry_id")
210 public String getFlowEntryId();
211
212 @Property("flow_entry_id")
213 public void setFlowEntryId(String flowEntryId);
214
215 @Property("switch_dpid")
216 public String getSwitchDpid();
217
218 @Property("switch_dpid")
219 public void setSwitchDpid(String switchDpid);
220
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800221 @Property("user_state")
222 public String getUserState();
223
224 @Property("user_state")
225 public void setUserState(String userState);
226
227 @Property("switch_state")
228 public String getSwitchState();
229
230 @Property("switch_state")
231 public void setSwitchState(String switchState);
232
233 @Property("error_state_type")
234 public String getErrorStateType();
235
236 @Property("error_state_type")
237 public void setErrorStateType(String errorStateType);
238
239 @Property("error_state_code")
240 public String getErrorStateCode();
241
242 @Property("error_state_code")
243 public void setErrorStateCode(String errorStateCode);
Pavlin Radoslavove2f0de82013-03-12 01:39:30 -0700244
245 @Property("matchInPort")
246 public Short getMatchInPort();
247
248 @Property("matchInPort")
249 public void setMatchInPort(Short matchInPort);
250
251 @Property("matchEthernetFrameType")
252 public Short getMatchEthernetFrameType();
253
254 @Property("matchEthernetFrameType")
255 public void setMatchEthernetFrameType(Short matchEthernetFrameType);
256
257 @Property("matchSrcMac")
258 public String getMatchSrcMac();
259
260 @Property("matchSrcMac")
261 public void setMatchSrcMac(String matchSrcMac);
262
263 @Property("matchDstMac")
264 public String getMatchDstMac();
265
266 @Property("matchDstMac")
267 public void setMatchDstMac(String matchDstMac);
268
269 @Property("matchSrcIPv4Net")
270 public String getMatchSrcIPv4Net();
271
272 @Property("matchSrcIPv4Net")
273 public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
274
275 @Property("matchDstIPv4Net")
276 public String getMatchDstIPv4Net();
277
278 @Property("matchDstIPv4Net")
279 public void setMatchDstIPv4Net(String matchDstIPv4Net);
280
281 @Property("actionOutput")
282 public Short getActionOutput();
283
284 @Property("actionOutput")
285 public void setActionOutput(Short actionOutput);
Pankaj Berded0079742013-03-27 17:53:25 -0700286
287 @Adjacency(label="switch")
288 public ISwitchObject getSwitch();
289
290 @Adjacency(label="switch")
291 public void setSwitch(ISwitchObject sw);
292
293 @Adjacency(label="inport")
294 public IPortObject getInPort();
295
296 @Adjacency(label="inport")
297 public void setInPort(IPortObject port);
298
299 @Adjacency(label="outport")
300 public IPortObject getOutPort();
301
Pavlin Radoslavov4fead9c2013-03-28 03:09:27 -0700302 @Adjacency(label="outport")
Pankaj Berded0079742013-03-27 17:53:25 -0700303 public void setOutPort(IPortObject port);
304
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800305 }
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800306}