Jonathan Hart | e37e4e2 | 2014-05-13 19:12:02 -0700 | [diff] [blame] | 1 | package net.onrc.onos.core.topology; |
| 2 | |
Yuta HIGUCHI | bf0a871 | 2014-06-30 18:59:46 -0700 | [diff] [blame] | 3 | import org.apache.commons.lang.Validate; |
| 4 | |
Jonathan Hart | e37e4e2 | 2014-05-13 19:12:02 -0700 | [diff] [blame] | 5 | |
Praseed Balakrishnan | 57ed843 | 2014-06-26 11:49:56 -0700 | [diff] [blame] | 6 | |
Yuta HIGUCHI | c45e0b6 | 2014-06-24 22:34:20 -0700 | [diff] [blame] | 7 | /** |
| 8 | * Base class for Topology Objects. |
| 9 | */ |
Yuta HIGUCHI | 692e68e | 2014-07-09 18:08:02 -0700 | [diff] [blame] | 10 | public abstract class TopologyObject implements ITopologyElement { |
Jonathan Hart | e37e4e2 | 2014-05-13 19:12:02 -0700 | [diff] [blame] | 11 | |
Yuta HIGUCHI | 1222ac5 | 2014-07-09 16:50:28 -0700 | [diff] [blame] | 12 | // XXX This will be a snapshot, thus should be replaceable |
Yuta HIGUCHI | c45e0b6 | 2014-06-24 22:34:20 -0700 | [diff] [blame] | 13 | /** |
| 14 | * Topology instance this object belongs to. |
| 15 | */ |
Jonathan Hart | e37e4e2 | 2014-05-13 19:12:02 -0700 | [diff] [blame] | 16 | protected final Topology topology; |
| 17 | |
Yuta HIGUCHI | c45e0b6 | 2014-06-24 22:34:20 -0700 | [diff] [blame] | 18 | /** |
| 19 | * Constructor. |
| 20 | * |
| 21 | * @param topology Topology instance this object belongs to |
| 22 | */ |
| 23 | protected TopologyObject(Topology topology) { |
Yuta HIGUCHI | bf0a871 | 2014-06-30 18:59:46 -0700 | [diff] [blame] | 24 | Validate.notNull(topology); |
Jonathan Hart | e37e4e2 | 2014-05-13 19:12:02 -0700 | [diff] [blame] | 25 | this.topology = topology; |
| 26 | } |
| 27 | |
Praseed Balakrishnan | 57ed843 | 2014-06-26 11:49:56 -0700 | [diff] [blame] | 28 | |
| 29 | /** |
| 30 | * Returns the type of topology object. |
| 31 | * |
| 32 | * @return the type of the topology object |
| 33 | */ |
Yuta HIGUCHI | 692e68e | 2014-07-09 18:08:02 -0700 | [diff] [blame] | 34 | @Override |
Praseed Balakrishnan | 57ed843 | 2014-06-26 11:49:56 -0700 | [diff] [blame] | 35 | public abstract String getType(); |
| 36 | |
| 37 | |
Jonathan Hart | e37e4e2 | 2014-05-13 19:12:02 -0700 | [diff] [blame] | 38 | } |