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