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 | */ |
Naoki Shiota | b2d17e8 | 2013-10-18 18:08:16 -0700 | [diff] [blame^] | 13 | public void init(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 |
| 17 | */ |
| 18 | public void update(Link link, LinkInfo linkinfo, DM_OPERATION op); |
| 19 | |
| 20 | /* |
| 21 | * Link creation |
| 22 | */ |
| 23 | public void addLink(Link link); |
| 24 | public void addLinks(List<Link> links); |
| 25 | |
| 26 | /* |
| 27 | * Link deletion |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 28 | */ |
Umesh Krishnaswamy | f962d64 | 2013-01-23 19:04:23 -0800 | [diff] [blame] | 29 | public void deleteLink(Link link); |
Naoki Shiota | b2d17e8 | 2013-10-18 18:08:16 -0700 | [diff] [blame^] | 30 | public void deleteLinks(List<Link> links); |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 31 | |
| 32 | /* |
Naoki Shiota | b2d17e8 | 2013-10-18 18:08:16 -0700 | [diff] [blame^] | 33 | * Utility method to delete links associated with dpid and port |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 34 | * If only dpid is used, All links associated for switch are removed |
| 35 | * Useful for port up/down and also switch join/remove events |
| 36 | */ |
Umesh Krishnaswamy | f962d64 | 2013-01-23 19:04:23 -0800 | [diff] [blame] | 37 | public void deleteLinksOnPort(Long dpid, short port); |
Umesh Krishnaswamy | f962d64 | 2013-01-23 19:04:23 -0800 | [diff] [blame] | 38 | |
| 39 | /* |
| 40 | * Get Links from Storage |
| 41 | * If dpid and port both are specified specific link is retrieved |
| 42 | * If only dpid is set all links associated with Switch are retrieved |
| 43 | */ |
| 44 | public List<Link> getLinks(Long dpid, short port); |
Pankaj Berde | ff42180 | 2013-01-29 20:28:52 -0800 | [diff] [blame] | 45 | public List<Link> getLinks(String dpid); |
| 46 | public List<Link> getActiveLinks(); |
Pankaj Berde | ff42180 | 2013-01-29 20:28:52 -0800 | [diff] [blame] | 47 | |
Naoki Shiota | b2d17e8 | 2013-10-18 18:08:16 -0700 | [diff] [blame^] | 48 | public LinkInfo getLinkInfo(Link link); |
Pankaj Berde | e73452c | 2013-01-03 14:57:07 -0800 | [diff] [blame] | 49 | } |