blob: f5f768927d8816d7865f31188a79de90649e3882 [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 a network model entity.
7 */
tom5a9383a2014-10-02 07:33:52 -07008public abstract class AbstractModel extends AbstractAnnotated implements Provided {
tom3065d122014-09-03 21:56:43 -07009
10 private final ProviderId providerId;
11
tomc6491322014-09-19 15:27:40 -070012 // For serialization
13 public AbstractModel() {
14 providerId = null;
15 }
16
tom3065d122014-09-03 21:56:43 -070017 /**
tom27ae0e62014-10-01 20:35:01 -070018 * Creates a model entity attributed to the specified provider and
19 * optionally annotated.
tom3065d122014-09-03 21:56:43 -070020 *
tom27ae0e62014-10-01 20:35:01 -070021 * @param providerId identity of the provider
22 * @param annotations optional key/value annotations
tom3065d122014-09-03 21:56:43 -070023 */
tomf5d85d42014-10-02 05:27:56 -070024 protected AbstractModel(ProviderId providerId, Annotations... annotations) {
tom27ae0e62014-10-01 20:35:01 -070025 super(annotations);
tom3065d122014-09-03 21:56:43 -070026 this.providerId = providerId;
27 }
28
29 @Override
30 public ProviderId providerId() {
31 return providerId;
32 }
33
tom3065d122014-09-03 21:56:43 -070034}