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(); |
| 57 | } |
| 58 | |
| 59 | public interface IPortObject extends IBaseObject{ |
| 60 | |
| 61 | @JsonProperty("number") |
| 62 | @Property("number") |
| 63 | public Short getNumber(); |
| 64 | |
| 65 | @JsonProperty("desc") |
| 66 | @Property("desc") |
| 67 | public String getDesc(); |
| 68 | |
| 69 | @JsonIgnore |
| 70 | @Incidence(label="on",direction = Direction.IN) |
| 71 | public ISwitchObject getSwitch(); |
| 72 | |
Pankaj Berde | ac1a8c3 | 2013-02-26 17:45:57 -0800 | [diff] [blame] | 73 | |
| 74 | @JsonProperty("devices") |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 75 | @Adjacency(label="host") |
| 76 | public Iterable<IDeviceObject> getDevices(); |
| 77 | |
| 78 | @Adjacency(label="host") |
| 79 | public void setDevice(final IDeviceObject device); |
| 80 | |
| 81 | @Adjacency(label="host") |
| 82 | public void removeDevice(final IDeviceObject device); |
| 83 | |
| 84 | // @JsonIgnore |
| 85 | // @Adjacency(label="link") |
| 86 | // public Iterable<ILinkObject> getLinks(); |
| 87 | } |
| 88 | |
| 89 | public interface IDeviceObject extends IBaseObject { |
| 90 | |
| 91 | @JsonProperty("mac") |
| 92 | @Property("dl_addr") |
| 93 | public String getMACAddress(); |
| 94 | @Property("dl_addr") |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 95 | public void setMACAddress(String macaddr); |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 96 | |
| 97 | @JsonProperty("ipv4") |
| 98 | @Property("nw_addr") |
| 99 | public String getIPAddress(); |
| 100 | @Property("dl_addr") |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 101 | public void setIPAddress(String ipaddr); |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 102 | |
| 103 | @JsonIgnore |
| 104 | @Incidence(label="host",direction = Direction.IN) |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 105 | public Iterable<IPortObject> getAttachedPorts(); |
| 106 | |
| 107 | @JsonIgnore |
| 108 | @Incidence(label="host",direction=Direction.IN) |
| 109 | public void setHostPort(final IPortObject port); |
| 110 | |
| 111 | @JsonIgnore |
| 112 | @Incidence(label="host",direction=Direction.IN) |
| 113 | public void removeHostPort(final IPortObject port); |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 114 | |
| 115 | @JsonIgnore |
| 116 | @GremlinGroovy("_().in('host').in('on')") |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 117 | public Iterable<ISwitchObject> getSwitch(); |
| 118 | |
Pankaj Berde | ac1a8c3 | 2013-02-26 17:45:57 -0800 | [diff] [blame] | 119 | /* @JsonProperty("dpid") |
| 120 | @GremlinGroovy("_().in('host').in('on').next().getProperty('dpid')") |
| 121 | public Iterable<String> getSwitchDPID(); |
| 122 | |
| 123 | @JsonProperty("number") |
| 124 | @GremlinGroovy("_().in('host').transform{it.number}") |
| 125 | public Iterable<Short> getPortNumber(); |
| 126 | |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 127 | @JsonProperty("AttachmentPoint") |
| 128 | @GremlinGroovy("_().in('host').in('on').path(){it.number}{it.dpid}") |
Pankaj Berde | ac1a8c3 | 2013-02-26 17:45:57 -0800 | [diff] [blame] | 129 | public Iterable<SwitchPort> getAttachmentPoints();*/ |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 130 | } |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 131 | |
| 132 | public interface IFlowPath extends IBaseObject { |
| 133 | @Property("flow_id") |
| 134 | public String getFlowId(); |
| 135 | |
| 136 | @Property("flow_id") |
| 137 | public void setFlowId(String flowId); |
| 138 | |
| 139 | @Property("installer_id") |
| 140 | public String getInstallerId(); |
| 141 | |
| 142 | @Property("installer_id") |
| 143 | public void setInstallerId(String installerId); |
| 144 | |
| 145 | @Property("src_switch") |
| 146 | public String getSrcSwitch(); |
| 147 | |
| 148 | @Property("src_switch") |
| 149 | public void setSrcSwitch(String srcSwitch); |
| 150 | |
| 151 | @Property("src_port") |
| 152 | public Short getSrcPort(); |
| 153 | |
| 154 | @Property("src_port") |
| 155 | public void setSrcPort(Short srcPort); |
| 156 | |
| 157 | @Property("dst_switch") |
| 158 | public String getDstSwitch(); |
| 159 | |
| 160 | @Property("dst_switch") |
| 161 | public void setDstSwitch(String dstSwitch); |
| 162 | |
| 163 | @Property("dst_port") |
| 164 | public Short getDstPort(); |
| 165 | |
| 166 | @Property("dst_port") |
| 167 | public void setDstPort(Short dstPort); |
| 168 | |
| 169 | @Adjacency(label="flow", direction=Direction.IN) |
| 170 | public Iterable<IFlowEntry> getFlowEntries(); |
| 171 | |
| 172 | @Adjacency(label="flow", direction=Direction.IN) |
| 173 | public void addFlowEntry(final IFlowEntry flowEntry); |
| 174 | |
| 175 | @Adjacency(label="flow", direction=Direction.IN) |
| 176 | public void removeFlowEntry(final IFlowEntry flowEntry); |
| 177 | } |
| 178 | |
| 179 | public interface IFlowEntry extends IBaseObject { |
| 180 | @Property("flow_entry_id") |
| 181 | public String getFlowEntryId(); |
| 182 | |
| 183 | @Property("flow_entry_id") |
| 184 | public void setFlowEntryId(String flowEntryId); |
| 185 | |
| 186 | @Property("switch_dpid") |
| 187 | public String getSwitchDpid(); |
| 188 | |
| 189 | @Property("switch_dpid") |
| 190 | public void setSwitchDpid(String switchDpid); |
| 191 | |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 192 | @Property("user_state") |
| 193 | public String getUserState(); |
| 194 | |
| 195 | @Property("user_state") |
| 196 | public void setUserState(String userState); |
| 197 | |
| 198 | @Property("switch_state") |
| 199 | public String getSwitchState(); |
| 200 | |
| 201 | @Property("switch_state") |
| 202 | public void setSwitchState(String switchState); |
| 203 | |
| 204 | @Property("error_state_type") |
| 205 | public String getErrorStateType(); |
| 206 | |
| 207 | @Property("error_state_type") |
| 208 | public void setErrorStateType(String errorStateType); |
| 209 | |
| 210 | @Property("error_state_code") |
| 211 | public String getErrorStateCode(); |
| 212 | |
| 213 | @Property("error_state_code") |
| 214 | public void setErrorStateCode(String errorStateCode); |
Pavlin Radoslavov | e2f0de8 | 2013-03-12 01:39:30 -0700 | [diff] [blame] | 215 | |
| 216 | @Property("matchInPort") |
| 217 | public Short getMatchInPort(); |
| 218 | |
| 219 | @Property("matchInPort") |
| 220 | public void setMatchInPort(Short matchInPort); |
| 221 | |
| 222 | @Property("matchEthernetFrameType") |
| 223 | public Short getMatchEthernetFrameType(); |
| 224 | |
| 225 | @Property("matchEthernetFrameType") |
| 226 | public void setMatchEthernetFrameType(Short matchEthernetFrameType); |
| 227 | |
| 228 | @Property("matchSrcMac") |
| 229 | public String getMatchSrcMac(); |
| 230 | |
| 231 | @Property("matchSrcMac") |
| 232 | public void setMatchSrcMac(String matchSrcMac); |
| 233 | |
| 234 | @Property("matchDstMac") |
| 235 | public String getMatchDstMac(); |
| 236 | |
| 237 | @Property("matchDstMac") |
| 238 | public void setMatchDstMac(String matchDstMac); |
| 239 | |
| 240 | @Property("matchSrcIPv4Net") |
| 241 | public String getMatchSrcIPv4Net(); |
| 242 | |
| 243 | @Property("matchSrcIPv4Net") |
| 244 | public void setMatchSrcIPv4Net(String matchSrcIPv4Net); |
| 245 | |
| 246 | @Property("matchDstIPv4Net") |
| 247 | public String getMatchDstIPv4Net(); |
| 248 | |
| 249 | @Property("matchDstIPv4Net") |
| 250 | public void setMatchDstIPv4Net(String matchDstIPv4Net); |
| 251 | |
| 252 | @Property("actionOutput") |
| 253 | public Short getActionOutput(); |
| 254 | |
| 255 | @Property("actionOutput") |
| 256 | public void setActionOutput(Short actionOutput); |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 257 | } |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 258 | } |