blob: bd20dc7bbe8c6fc5b63d9ddfa6b3f78421d4caa1 [file] [log] [blame]
Andrea Campanella58454b92016-04-01 15:19:00 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Andrea Campanella58454b92016-04-01 15:19:00 -07003 *
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.snmp.device.impl;
18
19import com.btisystems.pronx.ems.core.snmp.ISnmpSession;
20import org.onosproject.incubator.net.faultmanagement.alarm.DefaultAlarm;
21import org.onosproject.net.DeviceId;
22import org.onosproject.snmp.*;
23import org.onosproject.snmp.SnmpDevice;
24
25import java.io.IOException;
26import java.util.ArrayList;
27import java.util.Collection;
28import java.util.HashMap;
29import java.util.List;
30
31/**
32 * Test Adapter for SnmpController API.
33 */
34public class SnmpControllerAdapter implements SnmpController {
35
36 protected HashMap<DeviceId, SnmpDevice> devices = new HashMap<>();
37 @Override
38 public Collection<SnmpDevice> getDevices() {
39 return devices.values();
40 }
41
42 @Override
43 public SnmpDevice getDevice(DeviceId deviceId) {
44 return devices.get(deviceId);
45 }
46
47 @Override
48 public void removeDevice(DeviceId deviceId) {
49 devices.remove(deviceId);
50 }
51
52 @Override
53 public void addDevice(DeviceId deviceId, SnmpDevice snmpDevice) {
54 devices.put(deviceId,snmpDevice);
55 }
56
57 @Override
58 public ISnmpSession getSession(DeviceId deviceId) throws IOException {
59 return null;
60 }
61
62 @Override
63 public DefaultAlarm buildWalkFailedAlarm(DeviceId deviceId) {
64 return null;
65 }
66}