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(); |
| 89 | |
Pankaj Berde | ac1a8c3 | 2013-02-26 17:45:57 -0800 | [diff] [blame] | 90 | |
| 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 | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 109 | // @JsonIgnore |
| 110 | // @Adjacency(label="link") |
| 111 | // public Iterable<ILinkObject> getLinks(); |
| 112 | } |
| 113 | |
| 114 | public interface IDeviceObject extends IBaseObject { |
| 115 | |
| 116 | @JsonProperty("mac") |
| 117 | @Property("dl_addr") |
| 118 | public String getMACAddress(); |
| 119 | @Property("dl_addr") |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 120 | public void setMACAddress(String macaddr); |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 121 | |
| 122 | @JsonProperty("ipv4") |
| 123 | @Property("nw_addr") |
| 124 | public String getIPAddress(); |
| 125 | @Property("dl_addr") |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 126 | public void setIPAddress(String ipaddr); |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 127 | |
| 128 | @JsonIgnore |
| 129 | @Incidence(label="host",direction = Direction.IN) |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 130 | public Iterable<IPortObject> getAttachedPorts(); |
| 131 | |
| 132 | @JsonIgnore |
| 133 | @Incidence(label="host",direction=Direction.IN) |
| 134 | public void setHostPort(final IPortObject port); |
| 135 | |
| 136 | @JsonIgnore |
| 137 | @Incidence(label="host",direction=Direction.IN) |
| 138 | public void removeHostPort(final IPortObject port); |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 139 | |
| 140 | @JsonIgnore |
| 141 | @GremlinGroovy("_().in('host').in('on')") |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 142 | public Iterable<ISwitchObject> getSwitch(); |
| 143 | |
Pankaj Berde | ac1a8c3 | 2013-02-26 17:45:57 -0800 | [diff] [blame] | 144 | /* @JsonProperty("dpid") |
| 145 | @GremlinGroovy("_().in('host').in('on').next().getProperty('dpid')") |
| 146 | public Iterable<String> getSwitchDPID(); |
| 147 | |
| 148 | @JsonProperty("number") |
| 149 | @GremlinGroovy("_().in('host').transform{it.number}") |
| 150 | public Iterable<Short> getPortNumber(); |
| 151 | |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 152 | @JsonProperty("AttachmentPoint") |
| 153 | @GremlinGroovy("_().in('host').in('on').path(){it.number}{it.dpid}") |
Pankaj Berde | ac1a8c3 | 2013-02-26 17:45:57 -0800 | [diff] [blame] | 154 | public Iterable<SwitchPort> getAttachmentPoints();*/ |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 155 | } |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 156 | |
| 157 | public interface IFlowPath extends IBaseObject { |
| 158 | @Property("flow_id") |
| 159 | public String getFlowId(); |
| 160 | |
| 161 | @Property("flow_id") |
| 162 | public void setFlowId(String flowId); |
| 163 | |
| 164 | @Property("installer_id") |
| 165 | public String getInstallerId(); |
| 166 | |
| 167 | @Property("installer_id") |
| 168 | public void setInstallerId(String installerId); |
| 169 | |
| 170 | @Property("src_switch") |
| 171 | public String getSrcSwitch(); |
| 172 | |
| 173 | @Property("src_switch") |
| 174 | public void setSrcSwitch(String srcSwitch); |
| 175 | |
| 176 | @Property("src_port") |
| 177 | public Short getSrcPort(); |
| 178 | |
| 179 | @Property("src_port") |
| 180 | public void setSrcPort(Short srcPort); |
| 181 | |
| 182 | @Property("dst_switch") |
| 183 | public String getDstSwitch(); |
| 184 | |
| 185 | @Property("dst_switch") |
| 186 | public void setDstSwitch(String dstSwitch); |
| 187 | |
| 188 | @Property("dst_port") |
| 189 | public Short getDstPort(); |
| 190 | |
| 191 | @Property("dst_port") |
| 192 | public void setDstPort(Short dstPort); |
| 193 | |
| 194 | @Adjacency(label="flow", direction=Direction.IN) |
| 195 | public Iterable<IFlowEntry> getFlowEntries(); |
| 196 | |
| 197 | @Adjacency(label="flow", direction=Direction.IN) |
| 198 | public void addFlowEntry(final IFlowEntry flowEntry); |
| 199 | |
| 200 | @Adjacency(label="flow", direction=Direction.IN) |
| 201 | public void removeFlowEntry(final IFlowEntry flowEntry); |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 202 | |
| 203 | @JsonIgnore |
| 204 | @GremlinGroovy("_().in('flow').out('switch')") |
| 205 | public Iterable<IDeviceObject> getSwitches(); |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 206 | } |
| 207 | |
| 208 | public interface IFlowEntry extends IBaseObject { |
| 209 | @Property("flow_entry_id") |
| 210 | public String getFlowEntryId(); |
| 211 | |
| 212 | @Property("flow_entry_id") |
| 213 | public void setFlowEntryId(String flowEntryId); |
| 214 | |
| 215 | @Property("switch_dpid") |
| 216 | public String getSwitchDpid(); |
| 217 | |
| 218 | @Property("switch_dpid") |
| 219 | public void setSwitchDpid(String switchDpid); |
| 220 | |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 221 | @Property("user_state") |
| 222 | public String getUserState(); |
| 223 | |
| 224 | @Property("user_state") |
| 225 | public void setUserState(String userState); |
| 226 | |
| 227 | @Property("switch_state") |
| 228 | public String getSwitchState(); |
| 229 | |
| 230 | @Property("switch_state") |
| 231 | public void setSwitchState(String switchState); |
| 232 | |
| 233 | @Property("error_state_type") |
| 234 | public String getErrorStateType(); |
| 235 | |
| 236 | @Property("error_state_type") |
| 237 | public void setErrorStateType(String errorStateType); |
| 238 | |
| 239 | @Property("error_state_code") |
| 240 | public String getErrorStateCode(); |
| 241 | |
| 242 | @Property("error_state_code") |
| 243 | public void setErrorStateCode(String errorStateCode); |
Pavlin Radoslavov | e2f0de8 | 2013-03-12 01:39:30 -0700 | [diff] [blame] | 244 | |
| 245 | @Property("matchInPort") |
| 246 | public Short getMatchInPort(); |
| 247 | |
| 248 | @Property("matchInPort") |
| 249 | public void setMatchInPort(Short matchInPort); |
| 250 | |
| 251 | @Property("matchEthernetFrameType") |
| 252 | public Short getMatchEthernetFrameType(); |
| 253 | |
| 254 | @Property("matchEthernetFrameType") |
| 255 | public void setMatchEthernetFrameType(Short matchEthernetFrameType); |
| 256 | |
| 257 | @Property("matchSrcMac") |
| 258 | public String getMatchSrcMac(); |
| 259 | |
| 260 | @Property("matchSrcMac") |
| 261 | public void setMatchSrcMac(String matchSrcMac); |
| 262 | |
| 263 | @Property("matchDstMac") |
| 264 | public String getMatchDstMac(); |
| 265 | |
| 266 | @Property("matchDstMac") |
| 267 | public void setMatchDstMac(String matchDstMac); |
| 268 | |
| 269 | @Property("matchSrcIPv4Net") |
| 270 | public String getMatchSrcIPv4Net(); |
| 271 | |
| 272 | @Property("matchSrcIPv4Net") |
| 273 | public void setMatchSrcIPv4Net(String matchSrcIPv4Net); |
| 274 | |
| 275 | @Property("matchDstIPv4Net") |
| 276 | public String getMatchDstIPv4Net(); |
| 277 | |
| 278 | @Property("matchDstIPv4Net") |
| 279 | public void setMatchDstIPv4Net(String matchDstIPv4Net); |
| 280 | |
| 281 | @Property("actionOutput") |
| 282 | public Short getActionOutput(); |
| 283 | |
| 284 | @Property("actionOutput") |
| 285 | public void setActionOutput(Short actionOutput); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 286 | |
| 287 | @Adjacency(label="flow") |
| 288 | public IFlowPath getFlow(); |
| 289 | |
| 290 | @Adjacency(label="flow") |
| 291 | public void setFlow(IFlowPath flow); |
| 292 | |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 293 | @Adjacency(label="switch") |
| 294 | public ISwitchObject getSwitch(); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 295 | |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 296 | @Adjacency(label="switch") |
| 297 | public void setSwitch(ISwitchObject sw); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 298 | |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 299 | @Adjacency(label="inport") |
| 300 | public IPortObject getInPort(); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 301 | |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 302 | @Adjacency(label="inport") |
| 303 | public void setInPort(IPortObject port); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 304 | |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 305 | @Adjacency(label="outport") |
| 306 | public IPortObject getOutPort(); |
Pavlin Radoslavov | 1d4a107 | 2013-03-28 05:29:49 -0700 | [diff] [blame] | 307 | |
Pavlin Radoslavov | 4fead9c | 2013-03-28 03:09:27 -0700 | [diff] [blame] | 308 | @Adjacency(label="outport") |
Pankaj Berde | d007974 | 2013-03-27 17:53:25 -0700 | [diff] [blame] | 309 | public void setOutPort(IPortObject port); |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 310 | } |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 311 | } |