Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 1 | package net.floodlightcontroller.core; |
| 2 | |
| 3 | import org.codehaus.jackson.annotate.JsonIgnore; |
| 4 | import org.codehaus.jackson.annotate.JsonProperty; |
| 5 | |
| 6 | import com.tinkerpop.blueprints.Direction; |
| 7 | import com.tinkerpop.frames.Adjacency; |
| 8 | import com.tinkerpop.frames.Incidence; |
| 9 | import com.tinkerpop.frames.Property; |
| 10 | import com.tinkerpop.frames.annotations.gremlin.GremlinGroovy; |
| 11 | import com.tinkerpop.frames.VertexFrame; |
| 12 | |
| 13 | public interface INetMapTopologyObjects { |
| 14 | |
| 15 | public interface IBaseObject extends VertexFrame { |
| 16 | |
| 17 | @JsonProperty("state") |
| 18 | @Property("state") |
| 19 | public String getState(); |
Pankaj Berde | 1cde50b | 2013-02-19 20:16:06 -0800 | [diff] [blame] | 20 | |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 21 | @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 | |
| 32 | public 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 Berde | da80957 | 2013-02-22 15:31:20 -0800 | [diff] [blame] | 46 | public IPortObject getPort(final short port_num); |
| 47 | |
| 48 | @Adjacency(label="on") |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 49 | 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 Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 57 | |
| 58 | @JsonIgnore |
| 59 | @Incidence(label="switch",direction = Direction.IN) |
| 60 | public Iterable<IFlowEntry> getFlowEntries(); |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 61 | } |
| 62 | |
| 63 | public interface IPortObject extends IBaseObject{ |
| 64 | |
| 65 | @JsonProperty("number") |
| 66 | @Property("number") |
| 67 | public Short getNumber(); |
| 68 | |
Pankaj Berde | 1519309 | 2013-03-21 17:30:14 -0700 | [diff] [blame] | 69 | @Property("number") |
| 70 | public void setNumber(Short n); |
| 71 | |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 72 | @JsonProperty("desc") |
| 73 | @Property("desc") |
| 74 | public String getDesc(); |
| 75 | |
Pankaj Berde | 1519309 | 2013-03-21 17:30:14 -0700 | [diff] [blame] | 76 | @Property("desc") |
| 77 | public void setDesc(String s); |
| 78 | |
| 79 | @JsonIgnore |
Pankaj Berde | f1404a7 | 2013-04-03 11:50:07 -0700 | [diff] [blame] | 80 | @Property("port_state") |
Pankaj Berde | 1519309 | 2013-03-21 17:30:14 -0700 | [diff] [blame] | 81 | public Integer getPortState(); |
| 82 | |
| 83 | @Property("port_state") |
| 84 | public void setPortState(Integer s); |
| 85 | |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 86 | @JsonIgnore |
| 87 | @Incidence(label="on",direction = Direction.IN) |
| 88 | public ISwitchObject getSwitch(); |
Pankaj Berde | a6b80c3 | 2013-03-29 09:02:56 -0700 | [diff] [blame] | 89 | |
Pankaj Berde | ac1a8c3 | 2013-02-26 17:45:57 -0800 | [diff] [blame] | 90 | @JsonProperty("devices") |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 91 | @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 Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 100 | @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 Berde | a6b80c3 | 2013-03-29 09:02:56 -0700 | [diff] [blame] | 108 | @Adjacency(label="link") |
| 109 | public void removeLink(final IPortObject dest_port); |
| 110 | |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 111 | // @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 Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 122 | public void setMACAddress(String macaddr); |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 123 | |
| 124 | @JsonProperty("ipv4") |
| 125 | @Property("nw_addr") |
| 126 | public String getIPAddress(); |
| 127 | @Property("dl_addr") |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 128 | public void setIPAddress(String ipaddr); |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 129 | |
| 130 | @JsonIgnore |
| 131 | @Incidence(label="host",direction = Direction.IN) |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 132 | 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 Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 141 | |
| 142 | @JsonIgnore |
| 143 | @GremlinGroovy("_().in('host').in('on')") |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 144 | public Iterable<ISwitchObject> getSwitch(); |
| 145 | |
Pankaj Berde | ac1a8c3 | 2013-02-26 17:45:57 -0800 | [diff] [blame] | 146 | /* @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 Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 154 | @JsonProperty("AttachmentPoint") |
| 155 | @GremlinGroovy("_().in('host').in('on').path(){it.number}{it.dpid}") |
Pankaj Berde | ac1a8c3 | 2013-02-26 17:45:57 -0800 | [diff] [blame] | 156 | public Iterable<SwitchPort> getAttachmentPoints();*/ |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 157 | } |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 158 | |
| 159 | public 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 Radoslavov | dbaaf2e | 2013-03-29 04:25:55 -0700 | [diff] [blame] | 196 | @Property("data_path_summary") |
| 197 | public String getDataPathSummary(); |
| 198 | |
| 199 | @Property("data_path_summary") |
| 200 | public void setDataPathSummary(String dataPathSummary); |
| 201 | |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 202 | @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); |
Pavlin Radoslavov | 67b3ef3 | 2013-04-03 02:44:48 -0700 | [diff] [blame] | 210 | |
| 211 | @Property("matchEthernetFrameType") |
| 212 | public Short getMatchEthernetFrameType(); |
| 213 | |
| 214 | @Property("matchEthernetFrameType") |
| 215 | public void setMatchEthernetFrameType(Short matchEthernetFrameType); |
| 216 | |
| 217 | @Property("matchSrcMac") |
| 218 | public String getMatchSrcMac(); |
| 219 | |
| 220 | @Property("matchSrcMac") |
| 221 | public void setMatchSrcMac(String matchSrcMac); |
| 222 | |
| 223 | @Property("matchDstMac") |
| 224 | public String getMatchDstMac(); |
| 225 | |
| 226 | @Property("matchDstMac") |
| 227 | public void setMatchDstMac(String matchDstMac); |
| 228 | |
| 229 | @Property("matchSrcIPv4Net") |
| 230 | public String getMatchSrcIPv4Net(); |
| 231 | |
| 232 | @Property("matchSrcIPv4Net") |
| 233 | public void setMatchSrcIPv4Net(String matchSrcIPv4Net); |
| 234 | |
| 235 | @Property("matchDstIPv4Net") |
| 236 | public String getMatchDstIPv4Net(); |
| 237 | |
| 238 | @Property("matchDstIPv4Net") |
| 239 | public void setMatchDstIPv4Net(String matchDstIPv4Net); |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 240 | |
| 241 | @JsonIgnore |
| 242 | @GremlinGroovy("_().in('flow').out('switch')") |
Pankaj Berde | f1404a7 | 2013-04-03 11:50:07 -0700 | [diff] [blame] | 243 | public Iterable<ISwitchObject> getSwitches(); |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 244 | } |
| 245 | |
| 246 | public interface IFlowEntry extends IBaseObject { |
| 247 | @Property("flow_entry_id") |
| 248 | public String getFlowEntryId(); |
| 249 | |
| 250 | @Property("flow_entry_id") |
| 251 | public void setFlowEntryId(String flowEntryId); |
| 252 | |
| 253 | @Property("switch_dpid") |
| 254 | public String getSwitchDpid(); |
| 255 | |
| 256 | @Property("switch_dpid") |
| 257 | public void setSwitchDpid(String switchDpid); |
| 258 | |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 259 | @Property("user_state") |
| 260 | public String getUserState(); |
| 261 | |
| 262 | @Property("user_state") |
| 263 | public void setUserState(String userState); |
| 264 | |
| 265 | @Property("switch_state") |
| 266 | public String getSwitchState(); |
| 267 | |
| 268 | @Property("switch_state") |
| 269 | public void setSwitchState(String switchState); |
| 270 | |
| 271 | @Property("error_state_type") |
| 272 | public String getErrorStateType(); |
| 273 | |
| 274 | @Property("error_state_type") |
| 275 | public void setErrorStateType(String errorStateType); |
| 276 | |
| 277 | @Property("error_state_code") |
| 278 | public String getErrorStateCode(); |
| 279 | |
| 280 | @Property("error_state_code") |
| 281 | public void setErrorStateCode(String errorStateCode); |
Pavlin Radoslavov | e2f0de8 | 2013-03-12 01:39:30 -0700 | [diff] [blame] | 282 | |
| 283 | @Property("matchInPort") |
| 284 | public Short getMatchInPort(); |
| 285 | |
| 286 | @Property("matchInPort") |
| 287 | public void setMatchInPort(Short matchInPort); |
| 288 | |
| 289 | @Property("matchEthernetFrameType") |
| 290 | public Short getMatchEthernetFrameType(); |
| 291 | |
| 292 | @Property("matchEthernetFrameType") |
| 293 | public void setMatchEthernetFrameType(Short matchEthernetFrameType); |
| 294 | |
| 295 | @Property("matchSrcMac") |
| 296 | public String getMatchSrcMac(); |
| 297 | |
| 298 | @Property("matchSrcMac") |
| 299 | public void setMatchSrcMac(String matchSrcMac); |
| 300 | |
| 301 | @Property("matchDstMac") |
| 302 | public String getMatchDstMac(); |
| 303 | |
| 304 | @Property("matchDstMac") |
| 305 | public void setMatchDstMac(String matchDstMac); |
| 306 | |
| 307 | @Property("matchSrcIPv4Net") |
| 308 | public String getMatchSrcIPv4Net(); |
| 309 | |
| 310 | @Property("matchSrcIPv4Net") |
| 311 | public void setMatchSrcIPv4Net(String matchSrcIPv4Net); |
| 312 | |
| 313 | @Property("matchDstIPv4Net") |
| 314 | public String getMatchDstIPv4Net(); |
| 315 | |
| 316 | @Property("matchDstIPv4Net") |
| 317 | public void setMatchDstIPv4Net(String matchDstIPv4Net); |
| 318 | |
| 319 | @Property("actionOutput") |
| 320 | public Short getActionOutput(); |
| 321 | |
| 322 | @Property("actionOutput") |
| 323 | public void setActionOutput(Short actionOutput); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 324 | |
| 325 | @Adjacency(label="flow") |
| 326 | public IFlowPath getFlow(); |
| 327 | |
| 328 | @Adjacency(label="flow") |
| 329 | public void setFlow(IFlowPath flow); |
| 330 | |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 331 | @Adjacency(label="switch") |
| 332 | public ISwitchObject getSwitch(); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 333 | |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 334 | @Adjacency(label="switch") |
| 335 | public void setSwitch(ISwitchObject sw); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 336 | |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 337 | @Adjacency(label="inport") |
| 338 | public IPortObject getInPort(); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 339 | |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 340 | @Adjacency(label="inport") |
| 341 | public void setInPort(IPortObject port); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 342 | |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 343 | @Adjacency(label="outport") |
| 344 | public IPortObject getOutPort(); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 345 | |
Pavlin Radoslavov | 4fead9c | 2013-03-28 03:09:27 -0700 | [diff] [blame] | 346 | @Adjacency(label="outport") |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 347 | public void setOutPort(IPortObject port); |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 348 | } |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 349 | } |