blob: 587e2b16965f9b779c5193d4e6505bfe95cc678a [file] [log] [blame]
Andrea Campanellac2d754b2016-03-29 17:51:07 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
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
Laszlo Papp9655b182017-01-31 13:01:45 -080019import com.google.common.annotations.Beta;
Andrea Campanellac2d754b2016-03-29 17:51:07 -070020import org.onosproject.net.DeviceId;
Laszlo Papp9655b182017-01-31 13:01:45 -080021import org.snmp4j.Snmp;
Andrea Campanellac2d754b2016-03-29 17:51:07 -070022
23/**
24 * Abstraction a default Snmp Device.
25 */
Laszlo Papp9655b182017-01-31 13:01:45 -080026@Beta
Andrea Campanellac2d754b2016-03-29 17:51:07 -070027public interface SnmpDevice {
28
29 /**
30 * Returns host IP and host Port, used by this particular SNMP Device.
31 *
32 * @return Device Information.
33 */
34 String deviceInfo();
35
36 /**
Laszlo Papp9655b182017-01-31 13:01:45 -080037 * Returns an Snmp session context for this device.
38 *
39 * @return snmp session
40 */
41 Snmp getSession();
42
43 /**
Andrea Campanellac2d754b2016-03-29 17:51:07 -070044 * Terminates the device connection.
45 */
46 void disconnect();
47
48 /**
49 * Retrieves the device state.
50 *
51 * @return true if connected
52 */
53 boolean isReachable();
54
55 /**
56 * Returns the IP used connect ssh on the device.
57 *
58 * @return SNMP Device IP
59 */
60 String getSnmpHost();
61
62 /**
63 * Returns the SSH Port used connect the device.
64 *
65 * @return SSH Port number
66 */
67 int getSnmpPort();
68
69 /**
Laszlo Papp9655b182017-01-31 13:01:45 -080070 * Returns the notification port for asynchronous messages from the device.
71 *
72 * @return notification port
73 */
74 int getNotificationPort();
75
76 /**
Andrea Campanellac2d754b2016-03-29 17:51:07 -070077 * Retrieves the username of the device.
78 *
79 * @return username
80 */
81 String getUsername();
82
83 /**
84 * Retrieves the community (password) of the device.
85 *
86 * @return password
87 */
88 String getCommunity();
89
90 /**
Laszlo Papp9655b182017-01-31 13:01:45 -080091 * Returns the protocol of the device.
92 *
93 * @return protocol
94 */
95 String getProtocol();
96
97 /**
98 * Returns the notification protocol of the device.
99 *
100 * @return notification protocol
101 */
102 String getNotificationProtocol();
103
104 /**
Andrea Campanellac2d754b2016-03-29 17:51:07 -0700105 * Return the SNMP device deviceID.
106 *
107 * @return DeviceId
108 */
109 DeviceId deviceId();
110}