blob: 595e7b9c542f9141d9ce0679dc0816d7cd81c6a9 [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 */
Brian O'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.net;
tom3065d122014-09-03 21:56:43 -070017
Brian O'Connorabafb502014-12-02 22:26:20 -080018import org.onosproject.net.provider.ProviderId;
tom3065d122014-09-03 21:56:43 -070019
20/**
21 * Base implementation of network elements, i.e. devices or hosts.
22 */
tom5a9383a2014-10-02 07:33:52 -070023public abstract class AbstractElement extends AbstractModel implements Element {
tom3065d122014-09-03 21:56:43 -070024
25 protected final ElementId id;
26
tomc6491322014-09-19 15:27:40 -070027 // For serialization
28 public AbstractElement() {
29 id = null;
30 }
31
tom3065d122014-09-03 21:56:43 -070032 /**
33 * Creates a network element attributed to the specified provider.
34 *
tomf5d85d42014-10-02 05:27:56 -070035 * @param providerId identity of the provider
36 * @param id element identifier
37 * @param annotations optional key/value annotations
tom3065d122014-09-03 21:56:43 -070038 */
tomf5d85d42014-10-02 05:27:56 -070039 protected AbstractElement(ProviderId providerId, ElementId id,
40 Annotations... annotations) {
41 super(providerId, annotations);
tom3065d122014-09-03 21:56:43 -070042 this.id = id;
43 }
44
tom3065d122014-09-03 21:56:43 -070045}