tom | dc361b6 | 2014-09-09 20:36:52 -0700 | [diff] [blame^] | 1 | package org.onlab.onos.net.trivial.impl; |
| 2 | |
| 3 | import org.onlab.onos.net.AbstractModel; |
| 4 | import org.onlab.onos.net.provider.ProviderId; |
| 5 | import org.onlab.onos.net.topology.Topology; |
| 6 | |
| 7 | /** |
| 8 | * Default implementation of the topology descriptor. This carries the |
| 9 | * backing topology data. |
| 10 | */ |
| 11 | public class DefaultTopology extends AbstractModel implements Topology { |
| 12 | |
| 13 | private final long time; |
| 14 | private final int clusterCount; |
| 15 | private final int deviceCount; |
| 16 | private final int linkCount; |
| 17 | private final int pathCount; |
| 18 | |
| 19 | /** |
| 20 | * Creates a topology descriptor attributed to the specified provider. |
| 21 | * |
| 22 | * @param providerId identity of the provider |
| 23 | * @param time creation time in system nanos |
| 24 | * @param clusterCount number of clusters |
| 25 | * @param deviceCount number of devices |
| 26 | * @param linkCount number of links |
| 27 | * @param pathCount number of pre-computed paths |
| 28 | */ |
| 29 | DefaultTopology(ProviderId providerId, long time, int clusterCount, |
| 30 | int deviceCount, int linkCount, int pathCount) { |
| 31 | super(providerId); |
| 32 | this.time = time; |
| 33 | this.clusterCount = clusterCount; |
| 34 | this.deviceCount = deviceCount; |
| 35 | this.linkCount = linkCount; |
| 36 | this.pathCount = pathCount; |
| 37 | } |
| 38 | |
| 39 | @Override |
| 40 | public long time() { |
| 41 | return time; |
| 42 | } |
| 43 | |
| 44 | @Override |
| 45 | public int clusterCount() { |
| 46 | return clusterCount; |
| 47 | } |
| 48 | |
| 49 | @Override |
| 50 | public int deviceCount() { |
| 51 | return deviceCount; |
| 52 | } |
| 53 | |
| 54 | @Override |
| 55 | public int linkCount() { |
| 56 | return linkCount; |
| 57 | } |
| 58 | |
| 59 | @Override |
| 60 | public int pathCount() { |
| 61 | return pathCount; |
| 62 | } |
| 63 | |
| 64 | } |