blob: 492f9f838f1137654b77ef587840313378530d49 [file] [log] [blame]
Andrea Campanellac2d754b2016-03-29 17:51:07 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Andrea Campanellac2d754b2016-03-29 17:51:07 -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.snmp;
18
19import com.btisystems.pronx.ems.core.snmp.ISnmpSession;
20import org.onosproject.incubator.net.faultmanagement.alarm.DefaultAlarm;
21import org.onosproject.net.DeviceId;
22
23import java.io.IOException;
24import java.util.Collection;
25
26/**
27 * Snmp Controller.
28 */
29public interface SnmpController {
30
31 /**
32 * Return all the devices that this controller has notion of.
33 * @return Set of all Snmp devices
34 */
35 Collection<SnmpDevice> getDevices();
36
37 /**
38 * Gets a device for a specific deviceId.
39 * @param deviceId device id of the device
40 * @return SnmpDevice for given deviceId
41 */
42 SnmpDevice getDevice(DeviceId deviceId);
43
44 /**
45 * Removes a specific device.
46 * @param deviceId device id of the device to be removed
47 */
48 void removeDevice(DeviceId deviceId);
49
50 /**
51 * Add a device with a specific DeviceId.
52 * @param deviceId deviceId of the device
53 * @param device device to add to this controller
54 */
55 void addDevice(DeviceId deviceId, SnmpDevice device);
56
57 /**
58 * Gets an Instance of ISnmpSession for a specific device.
59 *
60 * @param deviceId device to retrieve the session for.
61 * @return ISnmp session.
62 * @throws IOException if the session can't be established.
63 */
64 ISnmpSession getSession(DeviceId deviceId) throws IOException;
65
66 /**
67 * Creates an error alarm if the interaction with the device failed.
68 *
69 * @param deviceId the device with a failed interaction
70 * @return default alarm error
71 */
72 DefaultAlarm buildWalkFailedAlarm(DeviceId deviceId);
73}