blob: 6bdda72666abee66fafb508f102edcd97f486c0f [file] [log] [blame]
tom3065d122014-09-03 21:56:43 -07001package org.onlab.onos.net;
2
3import org.onlab.onos.net.provider.ProviderId;
4
tom2482e6f2014-10-01 16:51:48 -07005import java.util.Map;
tom2482e6f2014-10-01 16:51:48 -07006
tom3065d122014-09-03 21:56:43 -07007/**
8 * Base implementation of a network model entity.
9 */
tom27ae0e62014-10-01 20:35:01 -070010public class AbstractModel extends AbstractAnnotated implements Provided {
tom3065d122014-09-03 21:56:43 -070011
12 private final ProviderId providerId;
13
tomc6491322014-09-19 15:27:40 -070014 // For serialization
15 public AbstractModel() {
16 providerId = null;
17 }
18
tom3065d122014-09-03 21:56:43 -070019 /**
tom27ae0e62014-10-01 20:35:01 -070020 * Creates a model entity attributed to the specified provider and
21 * optionally annotated.
tom3065d122014-09-03 21:56:43 -070022 *
tom27ae0e62014-10-01 20:35:01 -070023 * @param providerId identity of the provider
24 * @param annotations optional key/value annotations
tom3065d122014-09-03 21:56:43 -070025 */
tom27ae0e62014-10-01 20:35:01 -070026 @SafeVarargs
27 protected AbstractModel(ProviderId providerId,
28 Map<String, String>... annotations) {
29 super(annotations);
tom3065d122014-09-03 21:56:43 -070030 this.providerId = providerId;
31 }
32
33 @Override
34 public ProviderId providerId() {
35 return providerId;
36 }
37
tom3065d122014-09-03 21:56:43 -070038}