Andrea Campanella | b2f40e9 | 2017-11-23 12:52:43 +0100 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2017-present Open Networking Foundation |
| 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.drivers.netconf; |
| 18 | |
| 19 | import com.google.common.collect.ImmutableList; |
| 20 | import org.onlab.packet.ChassisId; |
| 21 | import org.onosproject.net.Device; |
| 22 | import org.onosproject.net.device.DefaultDeviceDescription; |
| 23 | import org.onosproject.net.device.DeviceDescription; |
| 24 | import org.onosproject.net.device.DeviceDescriptionDiscovery; |
| 25 | import org.onosproject.net.device.PortDescription; |
| 26 | import org.onosproject.net.driver.AbstractHandlerBehaviour; |
| 27 | import org.slf4j.Logger; |
| 28 | |
| 29 | import java.util.List; |
| 30 | |
| 31 | import static org.slf4j.LoggerFactory.getLogger; |
| 32 | |
| 33 | /** |
| 34 | * Discovers the device detail of the ovs based simulator used in NETCONF SB testing and development. |
| 35 | */ |
| 36 | public class OvsNetconfDeviceDescriptionDiscovery |
| 37 | extends AbstractHandlerBehaviour implements DeviceDescriptionDiscovery { |
| 38 | |
| 39 | private final Logger log = getLogger(getClass()); |
| 40 | |
| 41 | @Override |
| 42 | public DeviceDescription discoverDeviceDetails() { |
| 43 | log.debug("Discovering device details {}", handler().data().deviceId()); |
| 44 | return new DefaultDeviceDescription(handler().data().deviceId().uri(), |
| 45 | Device.Type.VIRTUAL, |
| 46 | "Of-Config", |
| 47 | "VirtualBox", |
| 48 | "1.0", |
| 49 | "1", |
| 50 | new ChassisId()); |
| 51 | } |
| 52 | |
| 53 | @Override |
| 54 | public List<PortDescription> discoverPortDetails() { |
| 55 | log.debug("Discovering device ports {}", handler().data().deviceId()); |
| 56 | return ImmutableList.of(); |
| 57 | } |
| 58 | } |