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 |
| 80 | @Property("port_sate") |
| 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); |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 210 | |
| 211 | @JsonIgnore |
| 212 | @GremlinGroovy("_().in('flow').out('switch')") |
| 213 | public Iterable<IDeviceObject> getSwitches(); |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 214 | } |
| 215 | |
| 216 | public interface IFlowEntry extends IBaseObject { |
| 217 | @Property("flow_entry_id") |
| 218 | public String getFlowEntryId(); |
| 219 | |
| 220 | @Property("flow_entry_id") |
| 221 | public void setFlowEntryId(String flowEntryId); |
| 222 | |
| 223 | @Property("switch_dpid") |
| 224 | public String getSwitchDpid(); |
| 225 | |
| 226 | @Property("switch_dpid") |
| 227 | public void setSwitchDpid(String switchDpid); |
| 228 | |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 229 | @Property("user_state") |
| 230 | public String getUserState(); |
| 231 | |
| 232 | @Property("user_state") |
| 233 | public void setUserState(String userState); |
| 234 | |
| 235 | @Property("switch_state") |
| 236 | public String getSwitchState(); |
| 237 | |
| 238 | @Property("switch_state") |
| 239 | public void setSwitchState(String switchState); |
| 240 | |
| 241 | @Property("error_state_type") |
| 242 | public String getErrorStateType(); |
| 243 | |
| 244 | @Property("error_state_type") |
| 245 | public void setErrorStateType(String errorStateType); |
| 246 | |
| 247 | @Property("error_state_code") |
| 248 | public String getErrorStateCode(); |
| 249 | |
| 250 | @Property("error_state_code") |
| 251 | public void setErrorStateCode(String errorStateCode); |
Pavlin Radoslavov | e2f0de8 | 2013-03-12 01:39:30 -0700 | [diff] [blame] | 252 | |
| 253 | @Property("matchInPort") |
| 254 | public Short getMatchInPort(); |
| 255 | |
| 256 | @Property("matchInPort") |
| 257 | public void setMatchInPort(Short matchInPort); |
| 258 | |
| 259 | @Property("matchEthernetFrameType") |
| 260 | public Short getMatchEthernetFrameType(); |
| 261 | |
| 262 | @Property("matchEthernetFrameType") |
| 263 | public void setMatchEthernetFrameType(Short matchEthernetFrameType); |
| 264 | |
| 265 | @Property("matchSrcMac") |
| 266 | public String getMatchSrcMac(); |
| 267 | |
| 268 | @Property("matchSrcMac") |
| 269 | public void setMatchSrcMac(String matchSrcMac); |
| 270 | |
| 271 | @Property("matchDstMac") |
| 272 | public String getMatchDstMac(); |
| 273 | |
| 274 | @Property("matchDstMac") |
| 275 | public void setMatchDstMac(String matchDstMac); |
| 276 | |
| 277 | @Property("matchSrcIPv4Net") |
| 278 | public String getMatchSrcIPv4Net(); |
| 279 | |
| 280 | @Property("matchSrcIPv4Net") |
| 281 | public void setMatchSrcIPv4Net(String matchSrcIPv4Net); |
| 282 | |
| 283 | @Property("matchDstIPv4Net") |
| 284 | public String getMatchDstIPv4Net(); |
| 285 | |
| 286 | @Property("matchDstIPv4Net") |
| 287 | public void setMatchDstIPv4Net(String matchDstIPv4Net); |
| 288 | |
| 289 | @Property("actionOutput") |
| 290 | public Short getActionOutput(); |
| 291 | |
| 292 | @Property("actionOutput") |
| 293 | public void setActionOutput(Short actionOutput); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 294 | |
| 295 | @Adjacency(label="flow") |
| 296 | public IFlowPath getFlow(); |
| 297 | |
| 298 | @Adjacency(label="flow") |
| 299 | public void setFlow(IFlowPath flow); |
| 300 | |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 301 | @Adjacency(label="switch") |
| 302 | public ISwitchObject getSwitch(); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 303 | |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 304 | @Adjacency(label="switch") |
| 305 | public void setSwitch(ISwitchObject sw); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 306 | |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 307 | @Adjacency(label="inport") |
| 308 | public IPortObject getInPort(); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 309 | |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 310 | @Adjacency(label="inport") |
| 311 | public void setInPort(IPortObject port); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 312 | |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 313 | @Adjacency(label="outport") |
| 314 | public IPortObject getOutPort(); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 315 | |
Pavlin Radoslavov | 4fead9c | 2013-03-28 03:09:27 -0700 | [diff] [blame] | 316 | @Adjacency(label="outport") |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 317 | public void setOutPort(IPortObject port); |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 318 | } |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 319 | } |