blob: 690cea8f3f6c490865dea6ea69c4d231eae0ee09 [file] [log] [blame]
Jonathan Hart472062d2014-04-03 10:56:48 -07001package net.onrc.onos.core.topology;
Jonathan Hart062a2e82014-02-03 09:41:57 -08002
3import java.util.Collection;
4
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -08005/**
6 * Interface of Switch Object exposed to the "NB" read-only Topology.
Ray Milkey269ffb92014-04-03 14:43:30 -07007 * <p/>
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -08008 * Everything returned by these interfaces must be either Unmodifiable view,
9 * immutable object, or a copy of the original "SB" In-memory Topology.
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080010 */
Jonathan Hart062a2e82014-02-03 09:41:57 -080011public interface Switch {
Ray Milkey269ffb92014-04-03 14:43:30 -070012 public Long getDpid();
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080013
Ray Milkey269ffb92014-04-03 14:43:30 -070014 public Collection<Port> getPorts();
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080015
Ray Milkey269ffb92014-04-03 14:43:30 -070016 public Port getPort(Long number);
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080017
Ray Milkey269ffb92014-04-03 14:43:30 -070018 // Graph traversal API
19 // XXX What is the Definition of neighbor? Link exist in both direction or one-way is sufficient to be a neighbor, etc.
20 public Iterable<Switch> getNeighbors();
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080021
Ray Milkey269ffb92014-04-03 14:43:30 -070022 public Iterable<Link> getOutgoingLinks();
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080023
Ray Milkey269ffb92014-04-03 14:43:30 -070024 public Iterable<Link> getIncomingLinks();
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080025
Ray Milkey269ffb92014-04-03 14:43:30 -070026 public Link getLinkToNeighbor(Long dpid);
27
28 // XXX Iterable or Collection?
29 public Collection<Device> getDevices();
Jonathan Hart062a2e82014-02-03 09:41:57 -080030}