Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 1 | package net.floodlightcontroller.core; |
| 2 | |
Jonathan Hart | 01f2d27 | 2013-04-04 20:03:46 -0700 | [diff] [blame^] | 3 | import net.floodlightcontroller.flowcache.web.DatapathSummarySerializer; |
| 4 | |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 5 | import org.codehaus.jackson.annotate.JsonIgnore; |
| 6 | import org.codehaus.jackson.annotate.JsonProperty; |
Jonathan Hart | 01f2d27 | 2013-04-04 20:03:46 -0700 | [diff] [blame^] | 7 | import org.codehaus.jackson.map.annotate.JsonSerialize; |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 8 | |
| 9 | import com.tinkerpop.blueprints.Direction; |
| 10 | import com.tinkerpop.frames.Adjacency; |
| 11 | import com.tinkerpop.frames.Incidence; |
| 12 | import com.tinkerpop.frames.Property; |
| 13 | import com.tinkerpop.frames.annotations.gremlin.GremlinGroovy; |
| 14 | import com.tinkerpop.frames.VertexFrame; |
| 15 | |
| 16 | public interface INetMapTopologyObjects { |
| 17 | |
| 18 | public interface IBaseObject extends VertexFrame { |
| 19 | |
| 20 | @JsonProperty("state") |
| 21 | @Property("state") |
| 22 | public String getState(); |
Pankaj Berde | 1cde50b | 2013-02-19 20:16:06 -0800 | [diff] [blame] | 23 | |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 24 | @Property("state") |
| 25 | public void setState(final String state); |
| 26 | |
| 27 | @JsonIgnore |
| 28 | @Property("type") |
| 29 | public String getType(); |
| 30 | @Property("type") |
| 31 | public void setType(final String type); |
| 32 | |
| 33 | } |
| 34 | |
| 35 | public interface ISwitchObject extends IBaseObject{ |
| 36 | |
| 37 | @JsonProperty("dpid") |
| 38 | @Property("dpid") |
| 39 | public String getDPID(); |
| 40 | |
| 41 | @Property("dpid") |
| 42 | public void setDPID(String dpid); |
| 43 | |
| 44 | @JsonProperty("ports") |
| 45 | @Adjacency(label="on") |
| 46 | public Iterable<IPortObject> getPorts(); |
| 47 | |
| 48 | @Adjacency(label="on") |
Pankaj Berde | da80957 | 2013-02-22 15:31:20 -0800 | [diff] [blame] | 49 | public IPortObject getPort(final short port_num); |
| 50 | |
| 51 | @Adjacency(label="on") |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 52 | public void addPort(final IPortObject port); |
| 53 | |
| 54 | @Adjacency(label="on") |
| 55 | public void removePort(final IPortObject port); |
| 56 | |
| 57 | @JsonIgnore |
| 58 | @GremlinGroovy("_().out('on').out('host')") |
| 59 | public Iterable<IDeviceObject> getDevices(); |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 60 | |
| 61 | @JsonIgnore |
| 62 | @Incidence(label="switch",direction = Direction.IN) |
| 63 | public Iterable<IFlowEntry> getFlowEntries(); |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 64 | } |
| 65 | |
| 66 | public interface IPortObject extends IBaseObject{ |
| 67 | |
| 68 | @JsonProperty("number") |
| 69 | @Property("number") |
| 70 | public Short getNumber(); |
| 71 | |
Pankaj Berde | 1519309 | 2013-03-21 17:30:14 -0700 | [diff] [blame] | 72 | @Property("number") |
| 73 | public void setNumber(Short n); |
| 74 | |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 75 | @JsonProperty("desc") |
| 76 | @Property("desc") |
| 77 | public String getDesc(); |
| 78 | |
Pankaj Berde | 1519309 | 2013-03-21 17:30:14 -0700 | [diff] [blame] | 79 | @Property("desc") |
| 80 | public void setDesc(String s); |
| 81 | |
| 82 | @JsonIgnore |
| 83 | @Property("port_sate") |
| 84 | public Integer getPortState(); |
| 85 | |
| 86 | @Property("port_state") |
| 87 | public void setPortState(Integer s); |
| 88 | |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 89 | @JsonIgnore |
| 90 | @Incidence(label="on",direction = Direction.IN) |
| 91 | public ISwitchObject getSwitch(); |
| 92 | |
Pankaj Berde | ac1a8c3 | 2013-02-26 17:45:57 -0800 | [diff] [blame] | 93 | |
| 94 | @JsonProperty("devices") |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 95 | @Adjacency(label="host") |
| 96 | public Iterable<IDeviceObject> getDevices(); |
| 97 | |
| 98 | @Adjacency(label="host") |
| 99 | public void setDevice(final IDeviceObject device); |
| 100 | |
| 101 | @Adjacency(label="host") |
| 102 | public void removeDevice(final IDeviceObject device); |
| 103 | |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 104 | @JsonIgnore |
| 105 | @Incidence(label="inport",direction = Direction.IN) |
| 106 | public Iterable<IFlowEntry> getInFlowEntries(); |
| 107 | |
| 108 | @JsonIgnore |
| 109 | @Incidence(label="outport",direction = Direction.IN) |
| 110 | public Iterable<IFlowEntry> getOutFlowEntries(); |
| 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 { |
Jonathan Hart | 01f2d27 | 2013-04-04 20:03:46 -0700 | [diff] [blame^] | 161 | @JsonProperty("flowId") |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 162 | @Property("flow_id") |
| 163 | public String getFlowId(); |
| 164 | |
| 165 | @Property("flow_id") |
| 166 | public void setFlowId(String flowId); |
| 167 | |
Jonathan Hart | 01f2d27 | 2013-04-04 20:03:46 -0700 | [diff] [blame^] | 168 | @JsonProperty("installerId") |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 169 | @Property("installer_id") |
| 170 | public String getInstallerId(); |
| 171 | |
| 172 | @Property("installer_id") |
| 173 | public void setInstallerId(String installerId); |
| 174 | |
Jonathan Hart | 01f2d27 | 2013-04-04 20:03:46 -0700 | [diff] [blame^] | 175 | @JsonProperty("srcDpid") |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 176 | @Property("src_switch") |
| 177 | public String getSrcSwitch(); |
| 178 | |
| 179 | @Property("src_switch") |
| 180 | public void setSrcSwitch(String srcSwitch); |
| 181 | |
Jonathan Hart | 01f2d27 | 2013-04-04 20:03:46 -0700 | [diff] [blame^] | 182 | @JsonProperty("srcPort") |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 183 | @Property("src_port") |
| 184 | public Short getSrcPort(); |
| 185 | |
| 186 | @Property("src_port") |
| 187 | public void setSrcPort(Short srcPort); |
| 188 | |
Jonathan Hart | 01f2d27 | 2013-04-04 20:03:46 -0700 | [diff] [blame^] | 189 | @JsonProperty("dstDpid") |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 190 | @Property("dst_switch") |
| 191 | public String getDstSwitch(); |
| 192 | |
| 193 | @Property("dst_switch") |
| 194 | public void setDstSwitch(String dstSwitch); |
| 195 | |
Jonathan Hart | 01f2d27 | 2013-04-04 20:03:46 -0700 | [diff] [blame^] | 196 | @JsonProperty("dstPort") |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 197 | @Property("dst_port") |
| 198 | public Short getDstPort(); |
| 199 | |
| 200 | @Property("dst_port") |
| 201 | public void setDstPort(Short dstPort); |
| 202 | |
Jonathan Hart | 01f2d27 | 2013-04-04 20:03:46 -0700 | [diff] [blame^] | 203 | @JsonProperty("dataPath") |
| 204 | @JsonSerialize(using=DatapathSummarySerializer.class) |
Pavlin Radoslavov | dbaaf2e | 2013-03-29 04:25:55 -0700 | [diff] [blame] | 205 | @Property("data_path_summary") |
| 206 | public String getDataPathSummary(); |
| 207 | |
| 208 | @Property("data_path_summary") |
| 209 | public void setDataPathSummary(String dataPathSummary); |
| 210 | |
Jonathan Hart | 01f2d27 | 2013-04-04 20:03:46 -0700 | [diff] [blame^] | 211 | @JsonIgnore |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 212 | @Adjacency(label="flow", direction=Direction.IN) |
| 213 | public Iterable<IFlowEntry> getFlowEntries(); |
| 214 | |
| 215 | @Adjacency(label="flow", direction=Direction.IN) |
| 216 | public void addFlowEntry(final IFlowEntry flowEntry); |
| 217 | |
| 218 | @Adjacency(label="flow", direction=Direction.IN) |
| 219 | public void removeFlowEntry(final IFlowEntry flowEntry); |
Pavlin Radoslavov | 67b3ef3 | 2013-04-03 02:44:48 -0700 | [diff] [blame] | 220 | |
Jonathan Hart | 01f2d27 | 2013-04-04 20:03:46 -0700 | [diff] [blame^] | 221 | @JsonIgnore |
Pavlin Radoslavov | 67b3ef3 | 2013-04-03 02:44:48 -0700 | [diff] [blame] | 222 | @Property("matchEthernetFrameType") |
| 223 | public Short getMatchEthernetFrameType(); |
| 224 | |
| 225 | @Property("matchEthernetFrameType") |
| 226 | public void setMatchEthernetFrameType(Short matchEthernetFrameType); |
| 227 | |
Jonathan Hart | 01f2d27 | 2013-04-04 20:03:46 -0700 | [diff] [blame^] | 228 | @JsonIgnore |
Pavlin Radoslavov | 67b3ef3 | 2013-04-03 02:44:48 -0700 | [diff] [blame] | 229 | @Property("matchSrcMac") |
| 230 | public String getMatchSrcMac(); |
| 231 | |
| 232 | @Property("matchSrcMac") |
| 233 | public void setMatchSrcMac(String matchSrcMac); |
| 234 | |
Jonathan Hart | 01f2d27 | 2013-04-04 20:03:46 -0700 | [diff] [blame^] | 235 | @JsonIgnore |
Pavlin Radoslavov | 67b3ef3 | 2013-04-03 02:44:48 -0700 | [diff] [blame] | 236 | @Property("matchDstMac") |
| 237 | public String getMatchDstMac(); |
| 238 | |
| 239 | @Property("matchDstMac") |
| 240 | public void setMatchDstMac(String matchDstMac); |
| 241 | |
Jonathan Hart | 01f2d27 | 2013-04-04 20:03:46 -0700 | [diff] [blame^] | 242 | @JsonIgnore |
Pavlin Radoslavov | 67b3ef3 | 2013-04-03 02:44:48 -0700 | [diff] [blame] | 243 | @Property("matchSrcIPv4Net") |
| 244 | public String getMatchSrcIPv4Net(); |
| 245 | |
| 246 | @Property("matchSrcIPv4Net") |
| 247 | public void setMatchSrcIPv4Net(String matchSrcIPv4Net); |
| 248 | |
Jonathan Hart | 01f2d27 | 2013-04-04 20:03:46 -0700 | [diff] [blame^] | 249 | @JsonIgnore |
Pavlin Radoslavov | 67b3ef3 | 2013-04-03 02:44:48 -0700 | [diff] [blame] | 250 | @Property("matchDstIPv4Net") |
| 251 | public String getMatchDstIPv4Net(); |
| 252 | |
| 253 | @Property("matchDstIPv4Net") |
| 254 | public void setMatchDstIPv4Net(String matchDstIPv4Net); |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 255 | |
| 256 | @JsonIgnore |
| 257 | @GremlinGroovy("_().in('flow').out('switch')") |
| 258 | public Iterable<IDeviceObject> getSwitches(); |
Jonathan Hart | 01f2d27 | 2013-04-04 20:03:46 -0700 | [diff] [blame^] | 259 | |
| 260 | @JsonIgnore |
| 261 | @Property("state") |
| 262 | public String getState(); |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 263 | } |
| 264 | |
| 265 | public interface IFlowEntry extends IBaseObject { |
| 266 | @Property("flow_entry_id") |
| 267 | public String getFlowEntryId(); |
| 268 | |
| 269 | @Property("flow_entry_id") |
| 270 | public void setFlowEntryId(String flowEntryId); |
| 271 | |
| 272 | @Property("switch_dpid") |
| 273 | public String getSwitchDpid(); |
| 274 | |
| 275 | @Property("switch_dpid") |
| 276 | public void setSwitchDpid(String switchDpid); |
| 277 | |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 278 | @Property("user_state") |
| 279 | public String getUserState(); |
| 280 | |
| 281 | @Property("user_state") |
| 282 | public void setUserState(String userState); |
| 283 | |
| 284 | @Property("switch_state") |
| 285 | public String getSwitchState(); |
| 286 | |
| 287 | @Property("switch_state") |
| 288 | public void setSwitchState(String switchState); |
| 289 | |
| 290 | @Property("error_state_type") |
| 291 | public String getErrorStateType(); |
| 292 | |
| 293 | @Property("error_state_type") |
| 294 | public void setErrorStateType(String errorStateType); |
| 295 | |
| 296 | @Property("error_state_code") |
| 297 | public String getErrorStateCode(); |
| 298 | |
| 299 | @Property("error_state_code") |
| 300 | public void setErrorStateCode(String errorStateCode); |
Pavlin Radoslavov | e2f0de8 | 2013-03-12 01:39:30 -0700 | [diff] [blame] | 301 | |
| 302 | @Property("matchInPort") |
| 303 | public Short getMatchInPort(); |
| 304 | |
| 305 | @Property("matchInPort") |
| 306 | public void setMatchInPort(Short matchInPort); |
| 307 | |
| 308 | @Property("matchEthernetFrameType") |
| 309 | public Short getMatchEthernetFrameType(); |
| 310 | |
| 311 | @Property("matchEthernetFrameType") |
| 312 | public void setMatchEthernetFrameType(Short matchEthernetFrameType); |
| 313 | |
| 314 | @Property("matchSrcMac") |
| 315 | public String getMatchSrcMac(); |
| 316 | |
| 317 | @Property("matchSrcMac") |
| 318 | public void setMatchSrcMac(String matchSrcMac); |
| 319 | |
| 320 | @Property("matchDstMac") |
| 321 | public String getMatchDstMac(); |
| 322 | |
| 323 | @Property("matchDstMac") |
| 324 | public void setMatchDstMac(String matchDstMac); |
| 325 | |
| 326 | @Property("matchSrcIPv4Net") |
| 327 | public String getMatchSrcIPv4Net(); |
| 328 | |
| 329 | @Property("matchSrcIPv4Net") |
| 330 | public void setMatchSrcIPv4Net(String matchSrcIPv4Net); |
| 331 | |
| 332 | @Property("matchDstIPv4Net") |
| 333 | public String getMatchDstIPv4Net(); |
| 334 | |
| 335 | @Property("matchDstIPv4Net") |
| 336 | public void setMatchDstIPv4Net(String matchDstIPv4Net); |
| 337 | |
| 338 | @Property("actionOutput") |
| 339 | public Short getActionOutput(); |
| 340 | |
| 341 | @Property("actionOutput") |
| 342 | public void setActionOutput(Short actionOutput); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 343 | |
| 344 | @Adjacency(label="flow") |
| 345 | public IFlowPath getFlow(); |
| 346 | |
| 347 | @Adjacency(label="flow") |
| 348 | public void setFlow(IFlowPath flow); |
| 349 | |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 350 | @Adjacency(label="switch") |
| 351 | public ISwitchObject getSwitch(); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 352 | |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 353 | @Adjacency(label="switch") |
| 354 | public void setSwitch(ISwitchObject sw); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 355 | |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 356 | @Adjacency(label="inport") |
| 357 | public IPortObject getInPort(); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 358 | |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 359 | @Adjacency(label="inport") |
| 360 | public void setInPort(IPortObject port); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 361 | |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 362 | @Adjacency(label="outport") |
| 363 | public IPortObject getOutPort(); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 364 | |
Pavlin Radoslavov | 4fead9c | 2013-03-28 03:09:27 -0700 | [diff] [blame] | 365 | @Adjacency(label="outport") |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 366 | public void setOutPort(IPortObject port); |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 367 | } |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 368 | } |