Thomas Vachuska | 84922b3 | 2016-02-18 13:52:11 -0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
Thomas Vachuska | 84922b3 | 2016-02-18 13:52:11 -0800 | [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 | */ |
| 16 | |
| 17 | package org.onosproject.net.device; |
| 18 | |
| 19 | import org.onosproject.net.driver.HandlerBehaviour; |
| 20 | |
| 21 | import java.util.List; |
| 22 | |
| 23 | /** |
| 24 | * Handler behaviour capable of creating device and port descriptions. |
| 25 | * These descriptions should be appropriately annotated to support downstream |
| 26 | * projections of the respective devices and their ports. |
| 27 | */ |
| 28 | public interface DeviceDescriptionDiscovery extends HandlerBehaviour { |
| 29 | |
| 30 | /** |
Andrea Campanella | 6c71a05 | 2016-04-22 11:56:31 -0700 | [diff] [blame] | 31 | * Returns a device description appropriately annotated to support |
Thomas Vachuska | 84922b3 | 2016-02-18 13:52:11 -0800 | [diff] [blame] | 32 | * downstream model extension via projections of the resulting device, |
| 33 | * as in the following example. |
| 34 | * <pre> |
| 35 | * MicrowaveDevice device = deviceService.get(id).as(MicrowaveDevice.class); |
| 36 | * </pre> |
| 37 | * |
| 38 | * @return annotated device description |
| 39 | */ |
| 40 | DeviceDescription discoverDeviceDetails(); |
| 41 | |
| 42 | /** |
Andrea Campanella | 6c71a05 | 2016-04-22 11:56:31 -0700 | [diff] [blame] | 43 | * Returns a list of port descriptions appropriately annotated to support |
Thomas Vachuska | 84922b3 | 2016-02-18 13:52:11 -0800 | [diff] [blame] | 44 | * downstream model extension via projections of their parent device, |
| 45 | * as in the following example. |
| 46 | * <pre> |
| 47 | * MicrowaveDevice device = deviceService.get(id).as(MicrowaveDevice.class); |
| 48 | * List<MicrowavePort> ports = device.microwavePorts(deviceService.getPorts(id)); |
| 49 | * </pre> |
| 50 | * |
| 51 | * @return annotated device description |
| 52 | */ |
| 53 | List<PortDescription> discoverPortDetails(); |
| 54 | |
| 55 | } |