Andrea Campanella | 58454b9 | 2016-04-01 15:19:00 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2016 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 | |
| 17 | package org.onosproject.provider.snmp.device.impl; |
| 18 | |
| 19 | import com.btisystems.pronx.ems.core.snmp.ISnmpSession; |
| 20 | import org.onosproject.incubator.net.faultmanagement.alarm.DefaultAlarm; |
| 21 | import org.onosproject.net.DeviceId; |
| 22 | import org.onosproject.snmp.*; |
| 23 | import org.onosproject.snmp.SnmpDevice; |
| 24 | |
| 25 | import java.io.IOException; |
| 26 | import java.util.ArrayList; |
| 27 | import java.util.Collection; |
| 28 | import java.util.HashMap; |
| 29 | import java.util.List; |
| 30 | |
| 31 | /** |
| 32 | * Test Adapter for SnmpController API. |
| 33 | */ |
| 34 | public 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 | } |