Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2014-present Open Networking Foundation |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 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'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.net; |
tom | 3065d12 | 2014-09-03 21:56:43 -0700 | [diff] [blame] | 17 | |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 18 | import org.onosproject.net.provider.ProviderId; |
tom | 3065d12 | 2014-09-03 21:56:43 -0700 | [diff] [blame] | 19 | |
| 20 | /** |
| 21 | * Base implementation of network elements, i.e. devices or hosts. |
| 22 | */ |
Thomas Vachuska | 3afbc7f | 2016-02-01 15:55:38 -0800 | [diff] [blame] | 23 | public abstract class AbstractElement extends AbstractProjectableModel implements Element { |
tom | 3065d12 | 2014-09-03 21:56:43 -0700 | [diff] [blame] | 24 | |
| 25 | protected final ElementId id; |
| 26 | |
tom | c649132 | 2014-09-19 15:27:40 -0700 | [diff] [blame] | 27 | // For serialization |
| 28 | public AbstractElement() { |
| 29 | id = null; |
| 30 | } |
| 31 | |
tom | 3065d12 | 2014-09-03 21:56:43 -0700 | [diff] [blame] | 32 | /** |
| 33 | * Creates a network element attributed to the specified provider. |
| 34 | * |
tom | f5d85d4 | 2014-10-02 05:27:56 -0700 | [diff] [blame] | 35 | * @param providerId identity of the provider |
| 36 | * @param id element identifier |
| 37 | * @param annotations optional key/value annotations |
tom | 3065d12 | 2014-09-03 21:56:43 -0700 | [diff] [blame] | 38 | */ |
tom | f5d85d4 | 2014-10-02 05:27:56 -0700 | [diff] [blame] | 39 | protected AbstractElement(ProviderId providerId, ElementId id, |
| 40 | Annotations... annotations) { |
| 41 | super(providerId, annotations); |
tom | 3065d12 | 2014-09-03 21:56:43 -0700 | [diff] [blame] | 42 | this.id = id; |
| 43 | } |
| 44 | |
tom | 3065d12 | 2014-09-03 21:56:43 -0700 | [diff] [blame] | 45 | } |