blob: 4baa357161d8139fa75dfb999dc9f1eca1b74de6 [file] [log] [blame]
Laszlo Papp9655b182017-01-31 13:01:45 -08001/*
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.incubator.net.faultmanagement.alarm;
18
19import org.onlab.packet.IpAddress;
20import org.onosproject.net.driver.HandlerBehaviour;
21
22import java.util.List;
23import java.util.Set;
24
25/**
26 * Abstraction of a device behaviour capable of translating a list of
27 * alarms from a device. Also provides a method to configure the address where to
28 * send the alarms/traps/notifications.
29 */
30public interface DeviceAlarmConfig extends HandlerBehaviour {
31
32 /**
33 * Configures the device to send alarms to a particular Ip and port combination.
34 *
35 * @param address address to wich the device should send alarms
36 * @param port port on which the controller is listening
37 * @param protocol tcp or udp
38 * @return boolean true if the device was properly configured
39 */
40 boolean configureDevice(IpAddress address, int port, String protocol);
41
42 /**
43 * Returns the list of translated alarms from device-specific representation
44 * to ONOS alarms.
45 *
46 * @param unparsedAlarms alarms arrived from the device depending on protocol
47 * @param <T> type of object given from the device
48 * @return list of alarms consumed from the device
49 */
50 <T> Set<Alarm> translateAlarms(List<T> unparsedAlarms);
51
52}