blob: af556cf5e8bed21036e581689e53df674fb88db8 [file] [log] [blame]
Michele Santuari576f09c2016-09-28 14:20:00 +02001/*
2 * Copyright 2016-present 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 */
16
17package org.onosproject.provider.netconf.device.impl;
18
19import org.onlab.packet.IpAddress;
20import org.onosproject.net.DeviceId;
21import org.onosproject.netconf.NetconfController;
22import org.onosproject.netconf.NetconfDevice;
23import org.onosproject.netconf.NetconfDeviceListener;
24import org.onosproject.netconf.NetconfException;
25
26import java.util.Map;
27import java.util.Set;
28import java.util.concurrent.ConcurrentHashMap;
29
30/**
31 * Test Adapter for NetconfControllerAdapter API.
32 */
33public class NetconfControllerAdapter implements NetconfController {
34
35 private Map<DeviceId, NetconfDevice> netconfDeviceMap = new ConcurrentHashMap<>();
36
37 @Override
38 public void addDeviceListener(NetconfDeviceListener listener) {
39 }
40
41 @Override
42 public void removeDeviceListener(NetconfDeviceListener listener) {
43 }
44
45 @Override
46 public NetconfDevice connectDevice(DeviceId deviceId) throws NetconfException {
47 return null;
48 }
49
50 @Override
51 public void disconnectDevice(DeviceId deviceId, boolean remove) {
52 }
53
54 @Override
55 public void removeDevice(DeviceId deviceId) {
56
57 }
58
59 @Override
60 public Map<DeviceId, NetconfDevice> getDevicesMap() {
61 return netconfDeviceMap;
62 }
63
64 @Override
65 public Set<DeviceId> getNetconfDevices() {
66 return netconfDeviceMap.keySet();
67 }
68
69 @Override
70 public NetconfDevice getNetconfDevice(DeviceId deviceInfo) {
71 return netconfDeviceMap.get(deviceInfo);
72 }
73
74 @Override
75 public NetconfDevice getNetconfDevice(IpAddress ip, int port) {
76 return null;
77 }
78}