blob: 41bcabd7064535408a422097caba35845deb6e07 [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
2 * Copyright 2014 Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
tom3065d122014-09-03 21:56:43 -070016package org.onlab.onos.net;
17
18import org.onlab.onos.net.provider.ProviderId;
19
20/**
21 * Base implementation of a network model entity.
22 */
tom5a9383a2014-10-02 07:33:52 -070023public abstract class AbstractModel extends AbstractAnnotated implements Provided {
tom3065d122014-09-03 21:56:43 -070024
25 private final ProviderId providerId;
26
tomc6491322014-09-19 15:27:40 -070027 // For serialization
28 public AbstractModel() {
29 providerId = null;
30 }
31
tom3065d122014-09-03 21:56:43 -070032 /**
tom27ae0e62014-10-01 20:35:01 -070033 * Creates a model entity attributed to the specified provider and
34 * optionally annotated.
tom3065d122014-09-03 21:56:43 -070035 *
tom27ae0e62014-10-01 20:35:01 -070036 * @param providerId identity of the provider
37 * @param annotations optional key/value annotations
tom3065d122014-09-03 21:56:43 -070038 */
tomf5d85d42014-10-02 05:27:56 -070039 protected AbstractModel(ProviderId providerId, Annotations... annotations) {
tom27ae0e62014-10-01 20:35:01 -070040 super(annotations);
tom3065d122014-09-03 21:56:43 -070041 this.providerId = providerId;
42 }
43
44 @Override
45 public ProviderId providerId() {
46 return providerId;
47 }
48
tom3065d122014-09-03 21:56:43 -070049}