Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 1 | package net.floodlightcontroller.core; |
| 2 | |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 3 | import java.util.List; |
| 4 | |
| 5 | import net.floodlightcontroller.devicemanager.SwitchPort; |
| 6 | |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 7 | import org.codehaus.jackson.annotate.JsonIgnore; |
| 8 | import org.codehaus.jackson.annotate.JsonProperty; |
| 9 | |
| 10 | import com.tinkerpop.blueprints.Direction; |
| 11 | import com.tinkerpop.frames.Adjacency; |
| 12 | import com.tinkerpop.frames.Incidence; |
| 13 | import com.tinkerpop.frames.Property; |
| 14 | import com.tinkerpop.frames.annotations.gremlin.GremlinGroovy; |
| 15 | import com.tinkerpop.frames.VertexFrame; |
| 16 | |
| 17 | public interface INetMapTopologyObjects { |
| 18 | |
| 19 | public interface IBaseObject extends VertexFrame { |
| 20 | |
| 21 | @JsonProperty("state") |
| 22 | @Property("state") |
| 23 | public String getState(); |
Pankaj Berde | 1cde50b | 2013-02-19 20:16:06 -0800 | [diff] [blame] | 24 | |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 25 | @Property("state") |
| 26 | public void setState(final String state); |
| 27 | |
| 28 | @JsonIgnore |
| 29 | @Property("type") |
| 30 | public String getType(); |
| 31 | @Property("type") |
| 32 | public void setType(final String type); |
| 33 | |
| 34 | } |
| 35 | |
| 36 | public interface ISwitchObject extends IBaseObject{ |
| 37 | |
| 38 | @JsonProperty("dpid") |
| 39 | @Property("dpid") |
| 40 | public String getDPID(); |
| 41 | |
| 42 | @Property("dpid") |
| 43 | public void setDPID(String dpid); |
| 44 | |
| 45 | @JsonProperty("ports") |
| 46 | @Adjacency(label="on") |
| 47 | public Iterable<IPortObject> getPorts(); |
| 48 | |
| 49 | @Adjacency(label="on") |
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(); |
| 61 | } |
| 62 | |
| 63 | public interface IPortObject extends IBaseObject{ |
| 64 | |
| 65 | @JsonProperty("number") |
| 66 | @Property("number") |
| 67 | public Short getNumber(); |
| 68 | |
| 69 | @JsonProperty("desc") |
| 70 | @Property("desc") |
| 71 | public String getDesc(); |
| 72 | |
| 73 | @JsonIgnore |
| 74 | @Incidence(label="on",direction = Direction.IN) |
| 75 | public ISwitchObject getSwitch(); |
| 76 | |
Pankaj Berde | ac1a8c3 | 2013-02-26 17:45:57 -0800 | [diff] [blame] | 77 | |
| 78 | @JsonProperty("devices") |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 79 | @Adjacency(label="host") |
| 80 | public Iterable<IDeviceObject> getDevices(); |
| 81 | |
| 82 | @Adjacency(label="host") |
| 83 | public void setDevice(final IDeviceObject device); |
| 84 | |
| 85 | @Adjacency(label="host") |
| 86 | public void removeDevice(final IDeviceObject device); |
| 87 | |
| 88 | // @JsonIgnore |
| 89 | // @Adjacency(label="link") |
| 90 | // public Iterable<ILinkObject> getLinks(); |
| 91 | } |
| 92 | |
| 93 | public interface IDeviceObject extends IBaseObject { |
| 94 | |
| 95 | @JsonProperty("mac") |
| 96 | @Property("dl_addr") |
| 97 | public String getMACAddress(); |
| 98 | @Property("dl_addr") |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 99 | public void setMACAddress(String macaddr); |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 100 | |
| 101 | @JsonProperty("ipv4") |
| 102 | @Property("nw_addr") |
| 103 | public String getIPAddress(); |
| 104 | @Property("dl_addr") |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 105 | public void setIPAddress(String ipaddr); |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 106 | |
| 107 | @JsonIgnore |
| 108 | @Incidence(label="host",direction = Direction.IN) |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 109 | public Iterable<IPortObject> getAttachedPorts(); |
| 110 | |
| 111 | @JsonIgnore |
| 112 | @Incidence(label="host",direction=Direction.IN) |
| 113 | public void setHostPort(final IPortObject port); |
| 114 | |
| 115 | @JsonIgnore |
| 116 | @Incidence(label="host",direction=Direction.IN) |
| 117 | public void removeHostPort(final IPortObject port); |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 118 | |
| 119 | @JsonIgnore |
| 120 | @GremlinGroovy("_().in('host').in('on')") |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 121 | public Iterable<ISwitchObject> getSwitch(); |
| 122 | |
Pankaj Berde | ac1a8c3 | 2013-02-26 17:45:57 -0800 | [diff] [blame] | 123 | /* @JsonProperty("dpid") |
| 124 | @GremlinGroovy("_().in('host').in('on').next().getProperty('dpid')") |
| 125 | public Iterable<String> getSwitchDPID(); |
| 126 | |
| 127 | @JsonProperty("number") |
| 128 | @GremlinGroovy("_().in('host').transform{it.number}") |
| 129 | public Iterable<Short> getPortNumber(); |
| 130 | |
Pankaj Berde | 2497e54 | 2013-02-19 18:51:24 -0800 | [diff] [blame] | 131 | @JsonProperty("AttachmentPoint") |
| 132 | @GremlinGroovy("_().in('host').in('on').path(){it.number}{it.dpid}") |
Pankaj Berde | ac1a8c3 | 2013-02-26 17:45:57 -0800 | [diff] [blame] | 133 | public Iterable<SwitchPort> getAttachmentPoints();*/ |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 134 | } |
Pavlin Radoslavov | b6f5354 | 2013-03-01 16:02:14 -0800 | [diff] [blame] | 135 | |
| 136 | public interface IFlowPath extends IBaseObject { |
| 137 | @Property("flow_id") |
| 138 | public String getFlowId(); |
| 139 | |
| 140 | @Property("flow_id") |
| 141 | public void setFlowId(String flowId); |
| 142 | |
| 143 | @Property("installer_id") |
| 144 | public String getInstallerId(); |
| 145 | |
| 146 | @Property("installer_id") |
| 147 | public void setInstallerId(String installerId); |
| 148 | |
| 149 | @Property("src_switch") |
| 150 | public String getSrcSwitch(); |
| 151 | |
| 152 | @Property("src_switch") |
| 153 | public void setSrcSwitch(String srcSwitch); |
| 154 | |
| 155 | @Property("src_port") |
| 156 | public Short getSrcPort(); |
| 157 | |
| 158 | @Property("src_port") |
| 159 | public void setSrcPort(Short srcPort); |
| 160 | |
| 161 | @Property("dst_switch") |
| 162 | public String getDstSwitch(); |
| 163 | |
| 164 | @Property("dst_switch") |
| 165 | public void setDstSwitch(String dstSwitch); |
| 166 | |
| 167 | @Property("dst_port") |
| 168 | public Short getDstPort(); |
| 169 | |
| 170 | @Property("dst_port") |
| 171 | public void setDstPort(Short dstPort); |
| 172 | |
| 173 | @Adjacency(label="flow", direction=Direction.IN) |
| 174 | public Iterable<IFlowEntry> getFlowEntries(); |
| 175 | |
| 176 | @Adjacency(label="flow", direction=Direction.IN) |
| 177 | public void addFlowEntry(final IFlowEntry flowEntry); |
| 178 | |
| 179 | @Adjacency(label="flow", direction=Direction.IN) |
| 180 | public void removeFlowEntry(final IFlowEntry flowEntry); |
| 181 | } |
| 182 | |
| 183 | public interface IFlowEntry extends IBaseObject { |
| 184 | @Property("flow_entry_id") |
| 185 | public String getFlowEntryId(); |
| 186 | |
| 187 | @Property("flow_entry_id") |
| 188 | public void setFlowEntryId(String flowEntryId); |
| 189 | |
| 190 | @Property("switch_dpid") |
| 191 | public String getSwitchDpid(); |
| 192 | |
| 193 | @Property("switch_dpid") |
| 194 | public void setSwitchDpid(String switchDpid); |
| 195 | |
| 196 | @Property("in_port") |
| 197 | public Short getInPort(); |
| 198 | |
| 199 | @Property("in_port") |
| 200 | public void setInPort(Short inPort); |
| 201 | |
| 202 | @Property("out_port") |
| 203 | public Short getOutPort(); |
| 204 | |
| 205 | @Property("out_port") |
| 206 | public void setOutPort(Short outPort); |
| 207 | |
| 208 | @Property("user_state") |
| 209 | public String getUserState(); |
| 210 | |
| 211 | @Property("user_state") |
| 212 | public void setUserState(String userState); |
| 213 | |
| 214 | @Property("switch_state") |
| 215 | public String getSwitchState(); |
| 216 | |
| 217 | @Property("switch_state") |
| 218 | public void setSwitchState(String switchState); |
| 219 | |
| 220 | @Property("error_state_type") |
| 221 | public String getErrorStateType(); |
| 222 | |
| 223 | @Property("error_state_type") |
| 224 | public void setErrorStateType(String errorStateType); |
| 225 | |
| 226 | @Property("error_state_code") |
| 227 | public String getErrorStateCode(); |
| 228 | |
| 229 | @Property("error_state_code") |
| 230 | public void setErrorStateCode(String errorStateCode); |
| 231 | } |
Pankaj Berde | 1b8a42f | 2013-02-15 08:25:03 -0800 | [diff] [blame] | 232 | } |