blob: 26a92ac6024e8e226d0b78ee668b47cc328156df [file] [log] [blame]
Andrea Campanellab2f40e92017-11-23 12:52:43 +01001/*
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
17package org.onosproject.drivers.netconf;
18
19import com.google.common.collect.ImmutableList;
20import org.onlab.packet.ChassisId;
21import org.onosproject.net.Device;
22import org.onosproject.net.device.DefaultDeviceDescription;
23import org.onosproject.net.device.DeviceDescription;
24import org.onosproject.net.device.DeviceDescriptionDiscovery;
25import org.onosproject.net.device.PortDescription;
26import org.onosproject.net.driver.AbstractHandlerBehaviour;
27import org.slf4j.Logger;
28
29import java.util.List;
30
31import 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 */
36public 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}