blob: e58b19f7d1af3de571013e4e4ef8e987d0effee0 [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();
57 }
58
59 public interface IPortObject extends IBaseObject{
60
61 @JsonProperty("number")
62 @Property("number")
63 public Short getNumber();
64
Pankaj Berde15193092013-03-21 17:30:14 -070065 @Property("number")
66 public void setNumber(Short n);
67
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080068 @JsonProperty("desc")
69 @Property("desc")
70 public String getDesc();
71
Pankaj Berde15193092013-03-21 17:30:14 -070072 @Property("desc")
73 public void setDesc(String s);
74
75 @JsonIgnore
76 @Property("port_sate")
77 public Integer getPortState();
78
79 @Property("port_state")
80 public void setPortState(Integer s);
81
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080082 @JsonIgnore
83 @Incidence(label="on",direction = Direction.IN)
84 public ISwitchObject getSwitch();
85
Pankaj Berdeac1a8c32013-02-26 17:45:57 -080086
87 @JsonProperty("devices")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080088 @Adjacency(label="host")
89 public Iterable<IDeviceObject> getDevices();
90
91 @Adjacency(label="host")
92 public void setDevice(final IDeviceObject device);
93
94 @Adjacency(label="host")
95 public void removeDevice(final IDeviceObject device);
96
97// @JsonIgnore
98// @Adjacency(label="link")
99// public Iterable<ILinkObject> getLinks();
100 }
101
102 public interface IDeviceObject extends IBaseObject {
103
104 @JsonProperty("mac")
105 @Property("dl_addr")
106 public String getMACAddress();
107 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800108 public void setMACAddress(String macaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800109
110 @JsonProperty("ipv4")
111 @Property("nw_addr")
112 public String getIPAddress();
113 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800114 public void setIPAddress(String ipaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800115
116 @JsonIgnore
117 @Incidence(label="host",direction = Direction.IN)
Pankaj Berde2497e542013-02-19 18:51:24 -0800118 public Iterable<IPortObject> getAttachedPorts();
119
120 @JsonIgnore
121 @Incidence(label="host",direction=Direction.IN)
122 public void setHostPort(final IPortObject port);
123
124 @JsonIgnore
125 @Incidence(label="host",direction=Direction.IN)
126 public void removeHostPort(final IPortObject port);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800127
128 @JsonIgnore
129 @GremlinGroovy("_().in('host').in('on')")
Pankaj Berde2497e542013-02-19 18:51:24 -0800130 public Iterable<ISwitchObject> getSwitch();
131
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800132/* @JsonProperty("dpid")
133 @GremlinGroovy("_().in('host').in('on').next().getProperty('dpid')")
134 public Iterable<String> getSwitchDPID();
135
136 @JsonProperty("number")
137 @GremlinGroovy("_().in('host').transform{it.number}")
138 public Iterable<Short> getPortNumber();
139
Pankaj Berde2497e542013-02-19 18:51:24 -0800140 @JsonProperty("AttachmentPoint")
141 @GremlinGroovy("_().in('host').in('on').path(){it.number}{it.dpid}")
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800142 public Iterable<SwitchPort> getAttachmentPoints();*/
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800143 }
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800144
145public interface IFlowPath extends IBaseObject {
146 @Property("flow_id")
147 public String getFlowId();
148
149 @Property("flow_id")
150 public void setFlowId(String flowId);
151
152 @Property("installer_id")
153 public String getInstallerId();
154
155 @Property("installer_id")
156 public void setInstallerId(String installerId);
157
158 @Property("src_switch")
159 public String getSrcSwitch();
160
161 @Property("src_switch")
162 public void setSrcSwitch(String srcSwitch);
163
164 @Property("src_port")
165 public Short getSrcPort();
166
167 @Property("src_port")
168 public void setSrcPort(Short srcPort);
169
170 @Property("dst_switch")
171 public String getDstSwitch();
172
173 @Property("dst_switch")
174 public void setDstSwitch(String dstSwitch);
175
176 @Property("dst_port")
177 public Short getDstPort();
178
179 @Property("dst_port")
180 public void setDstPort(Short dstPort);
181
182 @Adjacency(label="flow", direction=Direction.IN)
183 public Iterable<IFlowEntry> getFlowEntries();
184
185 @Adjacency(label="flow", direction=Direction.IN)
186 public void addFlowEntry(final IFlowEntry flowEntry);
187
188 @Adjacency(label="flow", direction=Direction.IN)
189 public void removeFlowEntry(final IFlowEntry flowEntry);
190 }
191
192public interface IFlowEntry extends IBaseObject {
193 @Property("flow_entry_id")
194 public String getFlowEntryId();
195
196 @Property("flow_entry_id")
197 public void setFlowEntryId(String flowEntryId);
198
199 @Property("switch_dpid")
200 public String getSwitchDpid();
201
202 @Property("switch_dpid")
203 public void setSwitchDpid(String switchDpid);
204
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800205 @Property("user_state")
206 public String getUserState();
207
208 @Property("user_state")
209 public void setUserState(String userState);
210
211 @Property("switch_state")
212 public String getSwitchState();
213
214 @Property("switch_state")
215 public void setSwitchState(String switchState);
216
217 @Property("error_state_type")
218 public String getErrorStateType();
219
220 @Property("error_state_type")
221 public void setErrorStateType(String errorStateType);
222
223 @Property("error_state_code")
224 public String getErrorStateCode();
225
226 @Property("error_state_code")
227 public void setErrorStateCode(String errorStateCode);
Pavlin Radoslavove2f0de82013-03-12 01:39:30 -0700228
229 @Property("matchInPort")
230 public Short getMatchInPort();
231
232 @Property("matchInPort")
233 public void setMatchInPort(Short matchInPort);
234
235 @Property("matchEthernetFrameType")
236 public Short getMatchEthernetFrameType();
237
238 @Property("matchEthernetFrameType")
239 public void setMatchEthernetFrameType(Short matchEthernetFrameType);
240
241 @Property("matchSrcMac")
242 public String getMatchSrcMac();
243
244 @Property("matchSrcMac")
245 public void setMatchSrcMac(String matchSrcMac);
246
247 @Property("matchDstMac")
248 public String getMatchDstMac();
249
250 @Property("matchDstMac")
251 public void setMatchDstMac(String matchDstMac);
252
253 @Property("matchSrcIPv4Net")
254 public String getMatchSrcIPv4Net();
255
256 @Property("matchSrcIPv4Net")
257 public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
258
259 @Property("matchDstIPv4Net")
260 public String getMatchDstIPv4Net();
261
262 @Property("matchDstIPv4Net")
263 public void setMatchDstIPv4Net(String matchDstIPv4Net);
264
265 @Property("actionOutput")
266 public Short getActionOutput();
267
268 @Property("actionOutput")
269 public void setActionOutput(Short actionOutput);
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800270 }
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800271}