blob: 2c19f68846dd36ef1175bd7a58512696e8cdaff9 [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
65 @JsonProperty("desc")
66 @Property("desc")
67 public String getDesc();
68
69 @JsonIgnore
70 @Incidence(label="on",direction = Direction.IN)
71 public ISwitchObject getSwitch();
72
Pankaj Berdeac1a8c32013-02-26 17:45:57 -080073
74 @JsonProperty("devices")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080075 @Adjacency(label="host")
76 public Iterable<IDeviceObject> getDevices();
77
78 @Adjacency(label="host")
79 public void setDevice(final IDeviceObject device);
80
81 @Adjacency(label="host")
82 public void removeDevice(final IDeviceObject device);
83
84// @JsonIgnore
85// @Adjacency(label="link")
86// public Iterable<ILinkObject> getLinks();
87 }
88
89 public interface IDeviceObject extends IBaseObject {
90
91 @JsonProperty("mac")
92 @Property("dl_addr")
93 public String getMACAddress();
94 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -080095 public void setMACAddress(String macaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080096
97 @JsonProperty("ipv4")
98 @Property("nw_addr")
99 public String getIPAddress();
100 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800101 public void setIPAddress(String ipaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800102
103 @JsonIgnore
104 @Incidence(label="host",direction = Direction.IN)
Pankaj Berde2497e542013-02-19 18:51:24 -0800105 public Iterable<IPortObject> getAttachedPorts();
106
107 @JsonIgnore
108 @Incidence(label="host",direction=Direction.IN)
109 public void setHostPort(final IPortObject port);
110
111 @JsonIgnore
112 @Incidence(label="host",direction=Direction.IN)
113 public void removeHostPort(final IPortObject port);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800114
115 @JsonIgnore
116 @GremlinGroovy("_().in('host').in('on')")
Pankaj Berde2497e542013-02-19 18:51:24 -0800117 public Iterable<ISwitchObject> getSwitch();
118
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800119/* @JsonProperty("dpid")
120 @GremlinGroovy("_().in('host').in('on').next().getProperty('dpid')")
121 public Iterable<String> getSwitchDPID();
122
123 @JsonProperty("number")
124 @GremlinGroovy("_().in('host').transform{it.number}")
125 public Iterable<Short> getPortNumber();
126
Pankaj Berde2497e542013-02-19 18:51:24 -0800127 @JsonProperty("AttachmentPoint")
128 @GremlinGroovy("_().in('host').in('on').path(){it.number}{it.dpid}")
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800129 public Iterable<SwitchPort> getAttachmentPoints();*/
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800130 }
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800131
132public interface IFlowPath extends IBaseObject {
133 @Property("flow_id")
134 public String getFlowId();
135
136 @Property("flow_id")
137 public void setFlowId(String flowId);
138
139 @Property("installer_id")
140 public String getInstallerId();
141
142 @Property("installer_id")
143 public void setInstallerId(String installerId);
144
145 @Property("src_switch")
146 public String getSrcSwitch();
147
148 @Property("src_switch")
149 public void setSrcSwitch(String srcSwitch);
150
151 @Property("src_port")
152 public Short getSrcPort();
153
154 @Property("src_port")
155 public void setSrcPort(Short srcPort);
156
157 @Property("dst_switch")
158 public String getDstSwitch();
159
160 @Property("dst_switch")
161 public void setDstSwitch(String dstSwitch);
162
163 @Property("dst_port")
164 public Short getDstPort();
165
166 @Property("dst_port")
167 public void setDstPort(Short dstPort);
168
169 @Adjacency(label="flow", direction=Direction.IN)
170 public Iterable<IFlowEntry> getFlowEntries();
171
172 @Adjacency(label="flow", direction=Direction.IN)
173 public void addFlowEntry(final IFlowEntry flowEntry);
174
175 @Adjacency(label="flow", direction=Direction.IN)
176 public void removeFlowEntry(final IFlowEntry flowEntry);
177 }
178
179public interface IFlowEntry extends IBaseObject {
180 @Property("flow_entry_id")
181 public String getFlowEntryId();
182
183 @Property("flow_entry_id")
184 public void setFlowEntryId(String flowEntryId);
185
186 @Property("switch_dpid")
187 public String getSwitchDpid();
188
189 @Property("switch_dpid")
190 public void setSwitchDpid(String switchDpid);
191
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800192 @Property("user_state")
193 public String getUserState();
194
195 @Property("user_state")
196 public void setUserState(String userState);
197
198 @Property("switch_state")
199 public String getSwitchState();
200
201 @Property("switch_state")
202 public void setSwitchState(String switchState);
203
204 @Property("error_state_type")
205 public String getErrorStateType();
206
207 @Property("error_state_type")
208 public void setErrorStateType(String errorStateType);
209
210 @Property("error_state_code")
211 public String getErrorStateCode();
212
213 @Property("error_state_code")
214 public void setErrorStateCode(String errorStateCode);
Pavlin Radoslavove2f0de82013-03-12 01:39:30 -0700215
216 @Property("matchInPort")
217 public Short getMatchInPort();
218
219 @Property("matchInPort")
220 public void setMatchInPort(Short matchInPort);
221
222 @Property("matchEthernetFrameType")
223 public Short getMatchEthernetFrameType();
224
225 @Property("matchEthernetFrameType")
226 public void setMatchEthernetFrameType(Short matchEthernetFrameType);
227
228 @Property("matchSrcMac")
229 public String getMatchSrcMac();
230
231 @Property("matchSrcMac")
232 public void setMatchSrcMac(String matchSrcMac);
233
234 @Property("matchDstMac")
235 public String getMatchDstMac();
236
237 @Property("matchDstMac")
238 public void setMatchDstMac(String matchDstMac);
239
240 @Property("matchSrcIPv4Net")
241 public String getMatchSrcIPv4Net();
242
243 @Property("matchSrcIPv4Net")
244 public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
245
246 @Property("matchDstIPv4Net")
247 public String getMatchDstIPv4Net();
248
249 @Property("matchDstIPv4Net")
250 public void setMatchDstIPv4Net(String matchDstIPv4Net);
251
252 @Property("actionOutput")
253 public Short getActionOutput();
254
255 @Property("actionOutput")
256 public void setActionOutput(Short actionOutput);
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800257 }
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800258}