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