tom | 3065d12 | 2014-09-03 21:56:43 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net; |
| 2 | |
| 3 | import org.onlab.onos.net.provider.ProviderId; |
| 4 | |
| 5 | /** |
| 6 | * Base implementation of network elements, i.e. devices or hosts. |
| 7 | */ |
tom | 5a9383a | 2014-10-02 07:33:52 -0700 | [diff] [blame] | 8 | public abstract class AbstractElement extends AbstractModel implements Element { |
tom | 3065d12 | 2014-09-03 21:56:43 -0700 | [diff] [blame] | 9 | |
| 10 | protected final ElementId id; |
| 11 | |
tom | c649132 | 2014-09-19 15:27:40 -0700 | [diff] [blame] | 12 | // For serialization |
| 13 | public AbstractElement() { |
| 14 | id = null; |
| 15 | } |
| 16 | |
tom | 3065d12 | 2014-09-03 21:56:43 -0700 | [diff] [blame] | 17 | /** |
| 18 | * Creates a network element attributed to the specified provider. |
| 19 | * |
tom | f5d85d4 | 2014-10-02 05:27:56 -0700 | [diff] [blame] | 20 | * @param providerId identity of the provider |
| 21 | * @param id element identifier |
| 22 | * @param annotations optional key/value annotations |
tom | 3065d12 | 2014-09-03 21:56:43 -0700 | [diff] [blame] | 23 | */ |
tom | f5d85d4 | 2014-10-02 05:27:56 -0700 | [diff] [blame] | 24 | protected AbstractElement(ProviderId providerId, ElementId id, |
| 25 | Annotations... annotations) { |
| 26 | super(providerId, annotations); |
tom | 3065d12 | 2014-09-03 21:56:43 -0700 | [diff] [blame] | 27 | this.id = id; |
| 28 | } |
| 29 | |
tom | 3065d12 | 2014-09-03 21:56:43 -0700 | [diff] [blame] | 30 | } |