blob: 0b97dfa440a5f843b09af07ed07a6b3d63ae64b7 [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.
7 *
8 * Everything returned by these interfaces must be either Unmodifiable view,
9 * immutable object, or a copy of the original "SB" In-memory Topology.
10 *
11 */
Jonathan Hart062a2e82014-02-03 09:41:57 -080012public interface Switch {
Toshio Koide2f570c12014-02-06 16:55:32 -080013 public Long getDpid();
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080014
Jonathan Hart062a2e82014-02-03 09:41:57 -080015 public Collection<Port> getPorts();
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080016
Toshio Koide2f570c12014-02-06 16:55:32 -080017 public Port getPort(Long number);
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080018
19
Jonathan Hart062a2e82014-02-03 09:41:57 -080020 // Graph traversal API
Yuta HIGUCHI9b028ca2014-02-11 14:07:58 -080021 // XXX What is the Definition of neighbor? Link exist in both direction or one-way is sufficient to be a neighbor, etc.
Jonathan Hart062a2e82014-02-03 09:41:57 -080022 public Iterable<Switch> getNeighbors();
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080023
Toshio Koide2f570c12014-02-06 16:55:32 -080024 public Iterable<Link> getOutgoingLinks();
25 public Iterable<Link> getIncomingLinks();
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080026
Toshio Koide2f570c12014-02-06 16:55:32 -080027 public Link getLinkToNeighbor(Long dpid);
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080028
Yuta HIGUCHIcb951982014-02-11 13:31:44 -080029 // XXX Iterable or Collection?
Jonathan Hart062a2e82014-02-03 09:41:57 -080030 public Collection<Device> getDevices();
31}