Andrea Campanella | c2d754b | 2016-03-29 17:51:07 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Foundation |
Andrea Campanella | c2d754b | 2016-03-29 17:51:07 -0700 | [diff] [blame] | 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.snmp; |
| 18 | |
Laszlo Papp | 9655b18 | 2017-01-31 13:01:45 -0800 | [diff] [blame] | 19 | import com.google.common.annotations.Beta; |
Andrea Campanella | c2d754b | 2016-03-29 17:51:07 -0700 | [diff] [blame] | 20 | import org.onosproject.net.DeviceId; |
Laszlo Papp | 9655b18 | 2017-01-31 13:01:45 -0800 | [diff] [blame] | 21 | import org.snmp4j.Snmp; |
Andrea Campanella | c2d754b | 2016-03-29 17:51:07 -0700 | [diff] [blame] | 22 | |
| 23 | /** |
| 24 | * Abstraction a default Snmp Device. |
| 25 | */ |
Laszlo Papp | 9655b18 | 2017-01-31 13:01:45 -0800 | [diff] [blame] | 26 | @Beta |
Andrea Campanella | c2d754b | 2016-03-29 17:51:07 -0700 | [diff] [blame] | 27 | public 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 Papp | 9655b18 | 2017-01-31 13:01:45 -0800 | [diff] [blame] | 37 | * Returns an Snmp session context for this device. |
| 38 | * |
| 39 | * @return snmp session |
| 40 | */ |
| 41 | Snmp getSession(); |
| 42 | |
| 43 | /** |
Andrea Campanella | c2d754b | 2016-03-29 17:51:07 -0700 | [diff] [blame] | 44 | * 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 Papp | 9655b18 | 2017-01-31 13:01:45 -0800 | [diff] [blame] | 70 | * Returns the notification port for asynchronous messages from the device. |
| 71 | * |
| 72 | * @return notification port |
| 73 | */ |
| 74 | int getNotificationPort(); |
| 75 | |
| 76 | /** |
Andrea Campanella | c2d754b | 2016-03-29 17:51:07 -0700 | [diff] [blame] | 77 | * 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 Papp | 9655b18 | 2017-01-31 13:01:45 -0800 | [diff] [blame] | 91 | * 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 Campanella | c2d754b | 2016-03-29 17:51:07 -0700 | [diff] [blame] | 105 | * Return the SNMP device deviceID. |
| 106 | * |
| 107 | * @return DeviceId |
| 108 | */ |
| 109 | DeviceId deviceId(); |
| 110 | } |