HIGUCHI Yuta | 2d01158 | 2013-06-15 01:47:11 -0700 | [diff] [blame] | 1 | package net.onrc.onos.ofcontroller.core; |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 2 | |
| 3 | import java.util.List; |
| 4 | |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 5 | import net.floodlightcontroller.routing.Link; |
HIGUCHI Yuta | a56fbde | 2013-06-17 14:26:05 -0700 | [diff] [blame] | 6 | import net.onrc.onos.ofcontroller.linkdiscovery.LinkInfo; |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 7 | |
| 8 | public interface ILinkStorage extends INetMapStorage { |
| 9 | |
| 10 | /* |
Naoki Shiota | b2d17e8 | 2013-10-18 18:08:16 -0700 | [diff] [blame] | 11 | * Init with Storage conf |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 12 | */ |
yoshi | 0fee3de | 2013-11-23 09:13:37 -0800 | [diff] [blame] | 13 | public void init(final String dbStore, final String conf); |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 14 | |
| 15 | /* |
Naoki Shiota | b2d17e8 | 2013-10-18 18:08:16 -0700 | [diff] [blame] | 16 | * Generic operation method |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 17 | */ |
Naoki Shiota | 987a572 | 2013-10-23 11:59:36 -0700 | [diff] [blame] | 18 | public boolean update(Link link, LinkInfo linkinfo, DM_OPERATION op); |
Naoki Shiota | b2d17e8 | 2013-10-18 18:08:16 -0700 | [diff] [blame] | 19 | |
| 20 | /* |
| 21 | * Link creation |
| 22 | */ |
Naoki Shiota | 987a572 | 2013-10-23 11:59:36 -0700 | [diff] [blame] | 23 | public boolean addLink(Link link); |
| 24 | public boolean addLink(Link link, LinkInfo linfo); |
| 25 | public boolean addLinks(List<Link> links); |
Naoki Shiota | b2d17e8 | 2013-10-18 18:08:16 -0700 | [diff] [blame] | 26 | |
| 27 | /* |
| 28 | * Link deletion |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 29 | */ |
Naoki Shiota | 987a572 | 2013-10-23 11:59:36 -0700 | [diff] [blame] | 30 | public boolean deleteLink(Link link); |
| 31 | public boolean deleteLinks(List<Link> links); |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 32 | |
| 33 | /* |
Naoki Shiota | b2d17e8 | 2013-10-18 18:08:16 -0700 | [diff] [blame] | 34 | * Utility method to delete links associated with dpid and port |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 35 | * If only dpid is used, All links associated for switch are removed |
| 36 | * Useful for port up/down and also switch join/remove events |
| 37 | */ |
Naoki Shiota | 987a572 | 2013-10-23 11:59:36 -0700 | [diff] [blame] | 38 | public boolean deleteLinksOnPort(Long dpid, short port); |
Umesh Krishnaswamy | f962d64 | 2013-01-23 19:04:23 -0800 | [diff] [blame] | 39 | |
| 40 | /* |
| 41 | * Get Links from Storage |
| 42 | * If dpid and port both are specified specific link is retrieved |
| 43 | * If only dpid is set all links associated with Switch are retrieved |
| 44 | */ |
| 45 | public List<Link> getLinks(Long dpid, short port); |
Pankaj Berde | ff42180 | 2013-01-29 20:28:52 -0800 | [diff] [blame] | 46 | |
Pavlin Radoslavov | 43781cd | 2013-11-04 18:19:10 -0800 | [diff] [blame] | 47 | /** |
| 48 | * Get list of all reverse links connected to the port specified by given DPID and port number. |
| 49 | * @param dpid DPID of desired port. |
| 50 | * @param port Port number of desired port. |
| 51 | * @return List of reverse links. Empty list if no port was found. |
| 52 | */ |
| 53 | public List<Link> getReverseLinks(Long dpid, short port); |
| 54 | |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 55 | public List<Link> getLinks(String dpid); |
Pavlin Radoslavov | c934b4a | 2013-11-02 14:53:52 -0700 | [diff] [blame] | 56 | |
| 57 | /** |
| 58 | * Get list of all reverse links connected to the switch specified by |
| 59 | * given DPID. |
| 60 | * @param dpid DPID of desired switch. |
| 61 | * @return List of reverse links. Empty list if no port was found. |
| 62 | */ |
yoshi | 0fee3de | 2013-11-23 09:13:37 -0800 | [diff] [blame] | 63 | |
| 64 | public List<Link> getReverseLinks(String dpid); |
Pavlin Radoslavov | c934b4a | 2013-11-02 14:53:52 -0700 | [diff] [blame] | 65 | |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 66 | public List<Link> getActiveLinks(); |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 67 | |
Naoki Shiota | b2d17e8 | 2013-10-18 18:08:16 -0700 | [diff] [blame] | 68 | public LinkInfo getLinkInfo(Link link); |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 69 | } |