blob: f39469bf326c1a0940b8329bdbf877ef250a4868 [file] [log] [blame]
tom3065d122014-09-03 21:56:43 -07001package org.onlab.onos.net;
2
3import org.onlab.onos.net.provider.ProviderId;
4
5/**
6 * Base implementation of network elements, i.e. devices or hosts.
7 */
tom5a9383a2014-10-02 07:33:52 -07008public abstract class AbstractElement extends AbstractModel implements Element {
tom3065d122014-09-03 21:56:43 -07009
10 protected final ElementId id;
11
tomc6491322014-09-19 15:27:40 -070012 // For serialization
13 public AbstractElement() {
14 id = null;
15 }
16
tom3065d122014-09-03 21:56:43 -070017 /**
18 * Creates a network element attributed to the specified provider.
19 *
tomf5d85d42014-10-02 05:27:56 -070020 * @param providerId identity of the provider
21 * @param id element identifier
22 * @param annotations optional key/value annotations
tom3065d122014-09-03 21:56:43 -070023 */
tomf5d85d42014-10-02 05:27:56 -070024 protected AbstractElement(ProviderId providerId, ElementId id,
25 Annotations... annotations) {
26 super(providerId, annotations);
tom3065d122014-09-03 21:56:43 -070027 this.id = id;
28 }
29
tom3065d122014-09-03 21:56:43 -070030}