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 | |
Pankaj Berde | 73ea7e5 | 2013-04-04 14:52:50 -0700 | [diff] [blame^] | 45 | @JsonIgnore |
| 46 | @GremlinGroovy("_().out('on').has('number',portnum)") |
Pankaj Berde | da80957 | 2013-02-22 15:31:20 -0800 | [diff] [blame] | 47 | public IPortObject getPort(final short port_num); |
| 48 | |
| 49 | @Adjacency(label="on") |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 50 | public void addPort(final IPortObject port); |
| 51 | |
| 52 | @Adjacency(label="on") |
| 53 | public void removePort(final IPortObject port); |
| 54 | |
| 55 | @JsonIgnore |
| 56 | @GremlinGroovy("_().out('on').out('host')") |
| 57 | public Iterable<IDeviceObject> getDevices(); |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 58 | |
| 59 | @JsonIgnore |
| 60 | @Incidence(label="switch",direction = Direction.IN) |
| 61 | public Iterable<IFlowEntry> getFlowEntries(); |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | public interface IPortObject extends IBaseObject{ |
| 65 | |
| 66 | @JsonProperty("number") |
| 67 | @Property("number") |
| 68 | public Short getNumber(); |
| 69 | |
Pankaj Berde | 1519309 | 2013-03-21 17:30:14 -0700 | [diff] [blame] | 70 | @Property("number") |
| 71 | public void setNumber(Short n); |
| 72 | |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 73 | @JsonProperty("desc") |
| 74 | @Property("desc") |
| 75 | public String getDesc(); |
| 76 | |
Pankaj Berde | 1519309 | 2013-03-21 17:30:14 -0700 | [diff] [blame] | 77 | @Property("desc") |
| 78 | public void setDesc(String s); |
| 79 | |
| 80 | @JsonIgnore |
Pankaj Berde | f1404a7 | 2013-04-03 11:50:07 -0700 | [diff] [blame] | 81 | @Property("port_state") |
Pankaj Berde | 1519309 | 2013-03-21 17:30:14 -0700 | [diff] [blame] | 82 | public Integer getPortState(); |
| 83 | |
| 84 | @Property("port_state") |
| 85 | public void setPortState(Integer s); |
| 86 | |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 87 | @JsonIgnore |
| 88 | @Incidence(label="on",direction = Direction.IN) |
| 89 | public ISwitchObject getSwitch(); |
Pankaj Berde | a6b80c3 | 2013-03-29 09:02:56 -0700 | [diff] [blame] | 90 | |
Pankaj Berde | ac1a8c3 | 2013-02-26 17:45:57 -0800 | [diff] [blame] | 91 | @JsonProperty("devices") |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 92 | @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 Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 101 | @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 Berde | a6b80c3 | 2013-03-29 09:02:56 -0700 | [diff] [blame] | 109 | @Adjacency(label="link") |
| 110 | public void removeLink(final IPortObject dest_port); |
| 111 | |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 112 | // @JsonIgnore |
| 113 | // @Adjacency(label="link") |
| 114 | // public Iterable<ILinkObject> getLinks(); |
| 115 | } |
| 116 | |
| 117 | public interface IDeviceObject extends IBaseObject { |
| 118 | |
| 119 | @JsonProperty("mac") |
| 120 | @Property("dl_addr") |
| 121 | public String getMACAddress(); |
| 122 | @Property("dl_addr") |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 123 | public void setMACAddress(String macaddr); |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 124 | |
| 125 | @JsonProperty("ipv4") |
| 126 | @Property("nw_addr") |
| 127 | public String getIPAddress(); |
| 128 | @Property("dl_addr") |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 129 | public void setIPAddress(String ipaddr); |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 130 | |
| 131 | @JsonIgnore |
| 132 | @Incidence(label="host",direction = Direction.IN) |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 133 | public Iterable<IPortObject> getAttachedPorts(); |
| 134 | |
| 135 | @JsonIgnore |
| 136 | @Incidence(label="host",direction=Direction.IN) |
| 137 | public void setHostPort(final IPortObject port); |
| 138 | |
| 139 | @JsonIgnore |
| 140 | @Incidence(label="host",direction=Direction.IN) |
| 141 | public void removeHostPort(final IPortObject port); |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 142 | |
| 143 | @JsonIgnore |
| 144 | @GremlinGroovy("_().in('host').in('on')") |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 145 | public Iterable<ISwitchObject> getSwitch(); |
| 146 | |
Pankaj Berde | ac1a8c3 | 2013-02-26 17:45:57 -0800 | [diff] [blame] | 147 | /* @JsonProperty("dpid") |
| 148 | @GremlinGroovy("_().in('host').in('on').next().getProperty('dpid')") |
| 149 | public Iterable<String> getSwitchDPID(); |
| 150 | |
| 151 | @JsonProperty("number") |
| 152 | @GremlinGroovy("_().in('host').transform{it.number}") |
| 153 | public Iterable<Short> getPortNumber(); |
| 154 | |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 155 | @JsonProperty("AttachmentPoint") |
| 156 | @GremlinGroovy("_().in('host').in('on').path(){it.number}{it.dpid}") |
Pankaj Berde | ac1a8c3 | 2013-02-26 17:45:57 -0800 | [diff] [blame] | 157 | public Iterable<SwitchPort> getAttachmentPoints();*/ |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 158 | } |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 159 | |
| 160 | public interface IFlowPath extends IBaseObject { |
| 161 | @Property("flow_id") |
| 162 | public String getFlowId(); |
| 163 | |
| 164 | @Property("flow_id") |
| 165 | public void setFlowId(String flowId); |
| 166 | |
| 167 | @Property("installer_id") |
| 168 | public String getInstallerId(); |
| 169 | |
| 170 | @Property("installer_id") |
| 171 | public void setInstallerId(String installerId); |
| 172 | |
| 173 | @Property("src_switch") |
| 174 | public String getSrcSwitch(); |
| 175 | |
| 176 | @Property("src_switch") |
| 177 | public void setSrcSwitch(String srcSwitch); |
| 178 | |
| 179 | @Property("src_port") |
| 180 | public Short getSrcPort(); |
| 181 | |
| 182 | @Property("src_port") |
| 183 | public void setSrcPort(Short srcPort); |
| 184 | |
| 185 | @Property("dst_switch") |
| 186 | public String getDstSwitch(); |
| 187 | |
| 188 | @Property("dst_switch") |
| 189 | public void setDstSwitch(String dstSwitch); |
| 190 | |
| 191 | @Property("dst_port") |
| 192 | public Short getDstPort(); |
| 193 | |
| 194 | @Property("dst_port") |
| 195 | public void setDstPort(Short dstPort); |
| 196 | |
Pavlin Radoslavov | dbaaf2e | 2013-03-29 04:25:55 -0700 | [diff] [blame] | 197 | @Property("data_path_summary") |
| 198 | public String getDataPathSummary(); |
| 199 | |
| 200 | @Property("data_path_summary") |
| 201 | public void setDataPathSummary(String dataPathSummary); |
| 202 | |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 203 | @Adjacency(label="flow", direction=Direction.IN) |
| 204 | public Iterable<IFlowEntry> getFlowEntries(); |
| 205 | |
| 206 | @Adjacency(label="flow", direction=Direction.IN) |
| 207 | public void addFlowEntry(final IFlowEntry flowEntry); |
| 208 | |
| 209 | @Adjacency(label="flow", direction=Direction.IN) |
| 210 | public void removeFlowEntry(final IFlowEntry flowEntry); |
Pavlin Radoslavov | 67b3ef3 | 2013-04-03 02:44:48 -0700 | [diff] [blame] | 211 | |
| 212 | @Property("matchEthernetFrameType") |
| 213 | public Short getMatchEthernetFrameType(); |
| 214 | |
| 215 | @Property("matchEthernetFrameType") |
| 216 | public void setMatchEthernetFrameType(Short matchEthernetFrameType); |
| 217 | |
| 218 | @Property("matchSrcMac") |
| 219 | public String getMatchSrcMac(); |
| 220 | |
| 221 | @Property("matchSrcMac") |
| 222 | public void setMatchSrcMac(String matchSrcMac); |
| 223 | |
| 224 | @Property("matchDstMac") |
| 225 | public String getMatchDstMac(); |
| 226 | |
| 227 | @Property("matchDstMac") |
| 228 | public void setMatchDstMac(String matchDstMac); |
| 229 | |
| 230 | @Property("matchSrcIPv4Net") |
| 231 | public String getMatchSrcIPv4Net(); |
| 232 | |
| 233 | @Property("matchSrcIPv4Net") |
| 234 | public void setMatchSrcIPv4Net(String matchSrcIPv4Net); |
| 235 | |
| 236 | @Property("matchDstIPv4Net") |
| 237 | public String getMatchDstIPv4Net(); |
| 238 | |
| 239 | @Property("matchDstIPv4Net") |
| 240 | public void setMatchDstIPv4Net(String matchDstIPv4Net); |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 241 | |
| 242 | @JsonIgnore |
| 243 | @GremlinGroovy("_().in('flow').out('switch')") |
Pankaj Berde | f1404a7 | 2013-04-03 11:50:07 -0700 | [diff] [blame] | 244 | public Iterable<ISwitchObject> getSwitches(); |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 245 | } |
| 246 | |
| 247 | public interface IFlowEntry extends IBaseObject { |
| 248 | @Property("flow_entry_id") |
| 249 | public String getFlowEntryId(); |
| 250 | |
| 251 | @Property("flow_entry_id") |
| 252 | public void setFlowEntryId(String flowEntryId); |
| 253 | |
| 254 | @Property("switch_dpid") |
| 255 | public String getSwitchDpid(); |
| 256 | |
| 257 | @Property("switch_dpid") |
| 258 | public void setSwitchDpid(String switchDpid); |
| 259 | |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 260 | @Property("user_state") |
| 261 | public String getUserState(); |
| 262 | |
| 263 | @Property("user_state") |
| 264 | public void setUserState(String userState); |
| 265 | |
| 266 | @Property("switch_state") |
| 267 | public String getSwitchState(); |
| 268 | |
| 269 | @Property("switch_state") |
| 270 | public void setSwitchState(String switchState); |
| 271 | |
| 272 | @Property("error_state_type") |
| 273 | public String getErrorStateType(); |
| 274 | |
| 275 | @Property("error_state_type") |
| 276 | public void setErrorStateType(String errorStateType); |
| 277 | |
| 278 | @Property("error_state_code") |
| 279 | public String getErrorStateCode(); |
| 280 | |
| 281 | @Property("error_state_code") |
| 282 | public void setErrorStateCode(String errorStateCode); |
Pavlin Radoslavov | e2f0de8 | 2013-03-12 01:39:30 -0700 | [diff] [blame] | 283 | |
| 284 | @Property("matchInPort") |
| 285 | public Short getMatchInPort(); |
| 286 | |
| 287 | @Property("matchInPort") |
| 288 | public void setMatchInPort(Short matchInPort); |
| 289 | |
| 290 | @Property("matchEthernetFrameType") |
| 291 | public Short getMatchEthernetFrameType(); |
| 292 | |
| 293 | @Property("matchEthernetFrameType") |
| 294 | public void setMatchEthernetFrameType(Short matchEthernetFrameType); |
| 295 | |
| 296 | @Property("matchSrcMac") |
| 297 | public String getMatchSrcMac(); |
| 298 | |
| 299 | @Property("matchSrcMac") |
| 300 | public void setMatchSrcMac(String matchSrcMac); |
| 301 | |
| 302 | @Property("matchDstMac") |
| 303 | public String getMatchDstMac(); |
| 304 | |
| 305 | @Property("matchDstMac") |
| 306 | public void setMatchDstMac(String matchDstMac); |
| 307 | |
| 308 | @Property("matchSrcIPv4Net") |
| 309 | public String getMatchSrcIPv4Net(); |
| 310 | |
| 311 | @Property("matchSrcIPv4Net") |
| 312 | public void setMatchSrcIPv4Net(String matchSrcIPv4Net); |
| 313 | |
| 314 | @Property("matchDstIPv4Net") |
| 315 | public String getMatchDstIPv4Net(); |
| 316 | |
| 317 | @Property("matchDstIPv4Net") |
| 318 | public void setMatchDstIPv4Net(String matchDstIPv4Net); |
| 319 | |
| 320 | @Property("actionOutput") |
| 321 | public Short getActionOutput(); |
| 322 | |
| 323 | @Property("actionOutput") |
| 324 | public void setActionOutput(Short actionOutput); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 325 | |
| 326 | @Adjacency(label="flow") |
| 327 | public IFlowPath getFlow(); |
| 328 | |
| 329 | @Adjacency(label="flow") |
| 330 | public void setFlow(IFlowPath flow); |
| 331 | |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 332 | @Adjacency(label="switch") |
| 333 | public ISwitchObject getSwitch(); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 334 | |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 335 | @Adjacency(label="switch") |
| 336 | public void setSwitch(ISwitchObject sw); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 337 | |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 338 | @Adjacency(label="inport") |
| 339 | public IPortObject getInPort(); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 340 | |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 341 | @Adjacency(label="inport") |
| 342 | public void setInPort(IPortObject port); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 343 | |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 344 | @Adjacency(label="outport") |
| 345 | public IPortObject getOutPort(); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 346 | |
Pavlin Radoslavov | 4fead9c | 2013-03-28 03:09:27 -0700 | [diff] [blame] | 347 | @Adjacency(label="outport") |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 348 | public void setOutPort(IPortObject port); |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 349 | } |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 350 | } |