Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 1 | package net.floodlightcontroller.core; |
| 2 | |
| 3 | import java.util.Collection; |
Pankaj Berde | 1e2f731 | 2013-02-15 08:25:31 -0800 | [diff] [blame] | 4 | |
| 5 | import net.floodlightcontroller.core.INetMapTopologyObjects.ISwitchObject; |
| 6 | |
Pankaj Berde | ff42180 | 2013-01-29 20:28:52 -0800 | [diff] [blame] | 7 | import org.codehaus.jackson.annotate.JsonIgnore; |
| 8 | import org.codehaus.jackson.annotate.JsonProperty; |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 9 | import org.openflow.protocol.OFPhysicalPort; |
| 10 | |
Pankaj Berde | ff42180 | 2013-01-29 20:28:52 -0800 | [diff] [blame] | 11 | import com.tinkerpop.blueprints.Direction; |
| 12 | import com.tinkerpop.frames.Adjacency; |
| 13 | import com.tinkerpop.frames.Incidence; |
| 14 | import com.tinkerpop.frames.Property; |
Pankaj Berde | 5024ec1 | 2013-01-31 17:07:29 -0800 | [diff] [blame] | 15 | import com.tinkerpop.frames.VertexFrame; |
Pankaj Berde | ff42180 | 2013-01-29 20:28:52 -0800 | [diff] [blame] | 16 | |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 17 | public interface ISwitchStorage extends INetMapStorage { |
| 18 | |
Pankaj Berde | 28cc61c | 2013-01-08 18:19:33 -0800 | [diff] [blame] | 19 | public enum SwitchState { |
Pankaj Berde | 8557a46 | 2013-01-07 08:59:31 -0800 | [diff] [blame] | 20 | INACTIVE, |
| 21 | ACTIVE |
| 22 | } |
| 23 | |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 24 | /* |
| 25 | * Update the switch details |
| 26 | */ |
Pankaj Berde | 8557a46 | 2013-01-07 08:59:31 -0800 | [diff] [blame] | 27 | public void update(String dpid,SwitchState state, DM_OPERATION op); |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 28 | /* |
| 29 | * Associate a port on switch |
| 30 | */ |
Pankaj Berde | 4dea346 | 2013-01-03 18:02:38 -0800 | [diff] [blame] | 31 | public void addPort(String dpid, OFPhysicalPort port); |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 32 | /* |
| 33 | * Get all ports associated on a switch |
| 34 | */ |
| 35 | public Collection<OFPhysicalPort> getPorts(long dpid); |
| 36 | /* |
| 37 | * Get Port by Number |
| 38 | */ |
Pankaj Berde | 4dea346 | 2013-01-03 18:02:38 -0800 | [diff] [blame] | 39 | public OFPhysicalPort getPort(String dpid, short portnum); |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 40 | /* |
| 41 | * Get port by name |
| 42 | */ |
Pankaj Berde | 4dea346 | 2013-01-03 18:02:38 -0800 | [diff] [blame] | 43 | public OFPhysicalPort getPort(String dpid, String portName); |
| 44 | /* |
| 45 | * Add a switch |
| 46 | */ |
| 47 | public void addSwitch(String dpid); |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 48 | /* |
| 49 | * Delete switch and associated ports |
| 50 | */ |
Pankaj Berde | 4dea346 | 2013-01-03 18:02:38 -0800 | [diff] [blame] | 51 | public void deleteSwitch(String dpid); |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 52 | /* |
| 53 | * Delete a port on a switch by num |
| 54 | */ |
Pankaj Berde | 4dea346 | 2013-01-03 18:02:38 -0800 | [diff] [blame] | 55 | public void deletePort(String dpid, short port); |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 56 | /* |
| 57 | * Delete port on a switch by name |
| 58 | */ |
Pankaj Berde | 4dea346 | 2013-01-03 18:02:38 -0800 | [diff] [blame] | 59 | public void deletePort(String dpid, String portName); |
| 60 | |
Pankaj Berde | ff42180 | 2013-01-29 20:28:52 -0800 | [diff] [blame] | 61 | public Iterable<ISwitchObject> getActiveSwitches(); |
| 62 | public Iterable<ISwitchObject> getAllSwitches(); |
| 63 | public Iterable<ISwitchObject> getInactiveSwitches(); |
Pankaj Berde | 8557a46 | 2013-01-07 08:59:31 -0800 | [diff] [blame] | 64 | |
Pankaj Berde | 4dea346 | 2013-01-03 18:02:38 -0800 | [diff] [blame] | 65 | /* |
| 66 | * Initialize |
| 67 | */ |
| 68 | public void init(String conf); |
Pankaj Berde | d1259e8 | 2013-01-23 14:10:00 -0800 | [diff] [blame] | 69 | |
| 70 | |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 71 | } |