andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
andrea | eb70a94 | 2015-10-16 21:34:46 -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.netconf; |
| 18 | |
Akihiro Yamanouchi | 4512222 | 2016-07-15 13:13:11 +0900 | [diff] [blame] | 19 | import com.google.common.annotations.Beta; |
Andrea Campanella | c362784 | 2017-04-04 18:06:54 +0200 | [diff] [blame] | 20 | import org.slf4j.Logger; |
| 21 | import org.slf4j.LoggerFactory; |
Andrei Mihaescu | ac542ca | 2017-03-26 21:36:25 +0300 | [diff] [blame] | 22 | |
Aaron Kruglikov | 72db642 | 2017-02-13 12:16:51 -0800 | [diff] [blame] | 23 | import java.util.Set; |
Andrea Campanella | 101417d | 2015-12-11 17:58:07 -0800 | [diff] [blame] | 24 | import java.util.concurrent.CompletableFuture; |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 25 | |
| 26 | /** |
| 27 | * NETCONF session object that allows NETCONF operations on top with the physical |
| 28 | * device on top of an SSH connection. |
| 29 | */ |
Sean Condon | d2c8d47 | 2017-02-17 17:09:39 +0000 | [diff] [blame] | 30 | // TODO change return type of methods to <Capability, XMLdoc, string or yang obj> |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 31 | public interface NetconfSession { |
| 32 | |
| 33 | /** |
Andrea Campanella | 101417d | 2015-12-11 17:58:07 -0800 | [diff] [blame] | 34 | * Executes an asynchronous RPC to the server and obtains a future to be completed. |
| 35 | * |
Sean Condon | d2c8d47 | 2017-02-17 17:09:39 +0000 | [diff] [blame] | 36 | * The caller must ensure that the message-id in any request is unique |
| 37 | * for the session |
| 38 | * |
| 39 | * @deprecated - 1.10.0 do not remove needs reworking |
Andrea Campanella | 101417d | 2015-12-11 17:58:07 -0800 | [diff] [blame] | 40 | * @param request the XML containing the RPC for the server. |
| 41 | * @return Server response or ERROR |
| 42 | * @throws NetconfException when there is a problem in the communication process on |
| 43 | * the underlying connection |
| 44 | */ |
Sean Condon | d2c8d47 | 2017-02-17 17:09:39 +0000 | [diff] [blame] | 45 | @Deprecated |
Andrea Campanella | 101417d | 2015-12-11 17:58:07 -0800 | [diff] [blame] | 46 | CompletableFuture<String> request(String request) throws NetconfException; |
| 47 | |
Yuta HIGUCHI | 6e6c26e | 2017-09-06 14:25:57 -0700 | [diff] [blame] | 48 | /** |
| 49 | * Executes an asynchronous RPC request to the server and obtains a future |
| 50 | * for it's response. |
| 51 | * |
| 52 | * @param request the XML containing the RPC request for the server. |
| 53 | * @return Server response or ERROR |
| 54 | * @throws NetconfException when there is a problem in the communication process on |
| 55 | * the underlying connection |
| 56 | * @throws NetconfTransportException on secure transport-layer error |
| 57 | */ |
| 58 | default CompletableFuture<String> rpc(String request) throws NetconfException { |
| 59 | return request(request); |
| 60 | } |
| 61 | |
Andrea Campanella | 101417d | 2015-12-11 17:58:07 -0800 | [diff] [blame] | 62 | |
| 63 | /** |
Sean Condon | d2c8d47 | 2017-02-17 17:09:39 +0000 | [diff] [blame] | 64 | * Retrieves the requested configuration, different from get-config. |
Andrea Campanella | f4fd035 | 2015-12-14 17:03:05 -0800 | [diff] [blame] | 65 | * |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 66 | * @param request the XML containing the request to the server. |
| 67 | * @return device running configuration |
Andrea Campanella | 101417d | 2015-12-11 17:58:07 -0800 | [diff] [blame] | 68 | * @throws NetconfException when there is a problem in the communication process on |
| 69 | * the underlying connection |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 70 | */ |
Andrea Campanella | 101417d | 2015-12-11 17:58:07 -0800 | [diff] [blame] | 71 | String get(String request) throws NetconfException; |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 72 | |
| 73 | /** |
Sean Condon | d2c8d47 | 2017-02-17 17:09:39 +0000 | [diff] [blame] | 74 | * Retrieves the requested data. |
Akihiro Yamanouchi | 5e5d4df | 2016-06-08 17:06:33 +0900 | [diff] [blame] | 75 | * |
| 76 | * @param filterSchema XML subtrees to include in the reply |
| 77 | * @param withDefaultsMode with-defaults mode |
| 78 | * @return Server response |
| 79 | * @throws NetconfException when there is a problem in the communication process on |
| 80 | * the underlying connection |
| 81 | */ |
| 82 | String get(String filterSchema, String withDefaultsMode) |
| 83 | throws NetconfException; |
| 84 | |
| 85 | /** |
Akihiro Yamanouchi | 4512222 | 2016-07-15 13:13:11 +0900 | [diff] [blame] | 86 | * Executes an synchronous RPC to the server and wrap the request in RPC header. |
Akihiro Yamanouchi | 8d3a9d3 | 2016-07-12 11:41:44 +0900 | [diff] [blame] | 87 | * |
| 88 | * @param request the XML containing the request to the server. |
| 89 | * @return Server response or ERROR |
| 90 | * @throws NetconfException when there is a problem in the communication process on |
| 91 | * the underlying connection |
| 92 | */ |
| 93 | String doWrappedRpc(String request) throws NetconfException; |
| 94 | |
| 95 | /** |
Andrea Campanella | 101417d | 2015-12-11 17:58:07 -0800 | [diff] [blame] | 96 | * Executes an synchronous RPC to the server. |
Andrea Campanella | f4fd035 | 2015-12-14 17:03:05 -0800 | [diff] [blame] | 97 | * |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 98 | * @param request the XML containing the RPC for the server. |
| 99 | * @return Server response or ERROR |
Andrea Campanella | 101417d | 2015-12-11 17:58:07 -0800 | [diff] [blame] | 100 | * @throws NetconfException when there is a problem in the communication process on |
| 101 | * the underlying connection |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 102 | */ |
Andrea Campanella | 101417d | 2015-12-11 17:58:07 -0800 | [diff] [blame] | 103 | String requestSync(String request) throws NetconfException; |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 104 | |
| 105 | /** |
Yuta HIGUCHI | 89111d9 | 2017-05-04 11:29:17 -0700 | [diff] [blame] | 106 | * Retrieves the specified configuration. |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 107 | * |
Andrei Mihaescu | ac542ca | 2017-03-26 21:36:25 +0300 | [diff] [blame] | 108 | * @param netconfTargetConfig the type of configuration to retrieve. |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 109 | * @return specified configuration. |
Andrea Campanella | 101417d | 2015-12-11 17:58:07 -0800 | [diff] [blame] | 110 | * @throws NetconfException when there is a problem in the communication process on |
| 111 | * the underlying connection |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 112 | */ |
Yuta HIGUCHI | dd7c3f8 | 2017-09-03 14:18:01 -0700 | [diff] [blame] | 113 | String getConfig(DatastoreId netconfTargetConfig) throws NetconfException; |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 114 | |
| 115 | /** |
Yuta HIGUCHI | 89111d9 | 2017-05-04 11:29:17 -0700 | [diff] [blame] | 116 | * Retrieves part of the specified configuration based on the filterSchema. |
| 117 | * |
| 118 | * @param netconfTargetConfig the type of configuration to retrieve. |
| 119 | * @param configurationFilterSchema XML schema to filter the configuration |
| 120 | * elements we are interested in |
| 121 | * @return device running configuration. |
| 122 | * @throws NetconfException when there is a problem in the communication process on |
| 123 | * the underlying connection |
| 124 | */ |
Yuta HIGUCHI | dd7c3f8 | 2017-09-03 14:18:01 -0700 | [diff] [blame] | 125 | String getConfig(DatastoreId netconfTargetConfig, |
Yuta HIGUCHI | 89111d9 | 2017-05-04 11:29:17 -0700 | [diff] [blame] | 126 | String configurationFilterSchema) |
Yuta HIGUCHI | dd7c3f8 | 2017-09-03 14:18:01 -0700 | [diff] [blame] | 127 | throws NetconfException; |
Andrei Mihaescu | ac542ca | 2017-03-26 21:36:25 +0300 | [diff] [blame] | 128 | |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 129 | /** |
Yuta HIGUCHI | 89111d9 | 2017-05-04 11:29:17 -0700 | [diff] [blame] | 130 | * Retrieves part of the specified configuration based on the filterSchema. |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 131 | * |
| 132 | * @param newConfiguration configuration to set |
| 133 | * @return true if the configuration was edited correctly |
Andrea Campanella | 101417d | 2015-12-11 17:58:07 -0800 | [diff] [blame] | 134 | * @throws NetconfException when there is a problem in the communication process on |
| 135 | * the underlying connection |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 136 | */ |
Andrea Campanella | 101417d | 2015-12-11 17:58:07 -0800 | [diff] [blame] | 137 | boolean editConfig(String newConfiguration) throws NetconfException; |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 138 | |
| 139 | /** |
Yuta HIGUCHI | 89111d9 | 2017-05-04 11:29:17 -0700 | [diff] [blame] | 140 | * Retrieves part of the specified configuration based on the filterSchema. |
| 141 | * |
| 142 | * @param netconfTargetConfig the targetConfiguration to change |
Yuta HIGUCHI | e34c9c2 | 2017-12-04 17:47:14 -0800 | [diff] [blame] | 143 | * @param mode default-operation mode |
Yuta HIGUCHI | 89111d9 | 2017-05-04 11:29:17 -0700 | [diff] [blame] | 144 | * @param newConfiguration configuration to set |
| 145 | * @return true if the configuration was edited correctly |
| 146 | * @throws NetconfException when there is a problem in the communication process on |
| 147 | * the underlying connection |
| 148 | */ |
Yuta HIGUCHI | dd7c3f8 | 2017-09-03 14:18:01 -0700 | [diff] [blame] | 149 | boolean editConfig(DatastoreId netconfTargetConfig, String mode, String newConfiguration) |
| 150 | throws NetconfException; |
Yuta HIGUCHI | 89111d9 | 2017-05-04 11:29:17 -0700 | [diff] [blame] | 151 | |
| 152 | /** |
| 153 | * Copies the configuration between configuration datastores. |
| 154 | * <p> |
| 155 | * The target configuration can't be the running one |
| 156 | * |
| 157 | * @param destination configuration datastore |
| 158 | * @param source configuration datastore |
| 159 | * @return true if the configuration was copied correctly |
| 160 | * @throws NetconfException when there is a problem in the communication process on |
| 161 | * the underlying connection |
| 162 | */ |
Yuta HIGUCHI | dd7c3f8 | 2017-09-03 14:18:01 -0700 | [diff] [blame] | 163 | boolean copyConfig(DatastoreId destination, DatastoreId source) |
| 164 | throws NetconfException; |
Yuta HIGUCHI | 89111d9 | 2017-05-04 11:29:17 -0700 | [diff] [blame] | 165 | |
| 166 | /** |
| 167 | * Copies the new configuration, an Url or a complete configuration xml tree |
| 168 | * to the target configuration. |
| 169 | * The target configuration can't be the running one |
| 170 | * |
| 171 | * @param netconfTargetConfig the type of configuration to retrieve. |
| 172 | * @param newConfiguration configuration XML to set or URL tag to the configuration |
| 173 | * @return true if the configuration was copied correctly |
| 174 | * @throws NetconfException when there is a problem in the communication process on |
| 175 | * the underlying connection |
| 176 | */ |
Yuta HIGUCHI | dd7c3f8 | 2017-09-03 14:18:01 -0700 | [diff] [blame] | 177 | boolean copyConfig(DatastoreId netconfTargetConfig, String newConfiguration) |
| 178 | throws NetconfException; |
Andrea Campanella | f4fd035 | 2015-12-14 17:03:05 -0800 | [diff] [blame] | 179 | |
| 180 | /** |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 181 | * Copies the new configuration, an Url or a complete configuration xml tree |
| 182 | * to the target configuration. |
| 183 | * The target configuration can't be the running one |
| 184 | * |
Andrei Mihaescu | ac542ca | 2017-03-26 21:36:25 +0300 | [diff] [blame] | 185 | * @param netconfTargetConfig the type of configuration to retrieve. |
| 186 | * @param newConfiguration configuration to set |
| 187 | * @return true if the configuration was copied correctly |
| 188 | * @throws NetconfException when there is a problem in the communication process on |
| 189 | * the underlying connection |
Andrei Mihaescu | ac542ca | 2017-03-26 21:36:25 +0300 | [diff] [blame] | 190 | */ |
Andrei Mihaescu | ac542ca | 2017-03-26 21:36:25 +0300 | [diff] [blame] | 191 | boolean copyConfig(String netconfTargetConfig, String newConfiguration) |
| 192 | throws NetconfException; |
| 193 | |
| 194 | /** |
Yuta HIGUCHI | 89111d9 | 2017-05-04 11:29:17 -0700 | [diff] [blame] | 195 | * Deletes part of the specified configuration based on the filterSchema. |
| 196 | * |
| 197 | * @param netconfTargetConfig the name of the configuration to delete |
| 198 | * @return true if the configuration was copied correctly |
| 199 | * @throws NetconfException when there is a problem in the communication process on |
| 200 | * the underlying connection |
| 201 | */ |
Yuta HIGUCHI | dd7c3f8 | 2017-09-03 14:18:01 -0700 | [diff] [blame] | 202 | boolean deleteConfig(DatastoreId netconfTargetConfig) throws NetconfException; |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 203 | |
| 204 | /** |
helenyrwu | 0407c64 | 2016-06-09 12:01:30 -0700 | [diff] [blame] | 205 | * Starts subscription to the device's notifications. |
| 206 | * |
| 207 | * @throws NetconfException when there is a problem starting the subscription |
| 208 | */ |
| 209 | void startSubscription() throws NetconfException; |
| 210 | |
| 211 | /** |
Akihiro Yamanouchi | 4512222 | 2016-07-15 13:13:11 +0900 | [diff] [blame] | 212 | * Starts subscription to the device's notifications. |
| 213 | * |
| 214 | * @param filterSchema XML subtrees to indicate specific notification |
| 215 | * @throws NetconfException when there is a problem starting the subscription |
| 216 | */ |
| 217 | @Beta |
| 218 | void startSubscription(String filterSchema) throws NetconfException; |
| 219 | |
| 220 | /** |
helenyrwu | 0407c64 | 2016-06-09 12:01:30 -0700 | [diff] [blame] | 221 | * Ends subscription to the device's notifications. |
| 222 | * |
| 223 | * @throws NetconfException when there is a problem ending the subscription |
| 224 | */ |
| 225 | void endSubscription() throws NetconfException; |
| 226 | |
| 227 | /** |
| 228 | * Locks the specified configuration. |
| 229 | * |
Yuta HIGUCHI | 89111d9 | 2017-05-04 11:29:17 -0700 | [diff] [blame] | 230 | * @param datastore configuration datastore to be locked |
helenyrwu | 0407c64 | 2016-06-09 12:01:30 -0700 | [diff] [blame] | 231 | * @return true if successful. |
| 232 | * @throws NetconfException when there is a problem in the communication process on |
| 233 | * the underlying connection |
| 234 | */ |
Yuta HIGUCHI | dd7c3f8 | 2017-09-03 14:18:01 -0700 | [diff] [blame] | 235 | boolean lock(DatastoreId datastore) throws NetconfException; |
Yuta HIGUCHI | 89111d9 | 2017-05-04 11:29:17 -0700 | [diff] [blame] | 236 | |
| 237 | /** |
| 238 | * Unlocks the specified configuration. |
| 239 | * |
| 240 | * @param datastore configuration datastore to be unlocked |
| 241 | * @return true if successful. |
| 242 | * @throws NetconfException when there is a problem in the communication process on |
| 243 | * the underlying connection |
| 244 | */ |
Yuta HIGUCHI | dd7c3f8 | 2017-09-03 14:18:01 -0700 | [diff] [blame] | 245 | boolean unlock(DatastoreId datastore) throws NetconfException; |
helenyrwu | 0407c64 | 2016-06-09 12:01:30 -0700 | [diff] [blame] | 246 | |
| 247 | /** |
| 248 | * Locks the running configuration. |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 249 | * |
| 250 | * @return true if successful. |
Andrea Campanella | 101417d | 2015-12-11 17:58:07 -0800 | [diff] [blame] | 251 | * @throws NetconfException when there is a problem in the communication process on |
| 252 | * the underlying connection |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 253 | */ |
Yuta HIGUCHI | 89111d9 | 2017-05-04 11:29:17 -0700 | [diff] [blame] | 254 | default boolean lock() throws NetconfException { |
| 255 | return lock(DatastoreId.RUNNING); |
| 256 | } |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 257 | |
| 258 | /** |
helenyrwu | 0407c64 | 2016-06-09 12:01:30 -0700 | [diff] [blame] | 259 | * Unlocks the running configuration. |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 260 | * |
| 261 | * @return true if successful. |
Andrea Campanella | 101417d | 2015-12-11 17:58:07 -0800 | [diff] [blame] | 262 | * @throws NetconfException when there is a problem in the communication process on |
| 263 | * the underlying connection |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 264 | */ |
Yuta HIGUCHI | 89111d9 | 2017-05-04 11:29:17 -0700 | [diff] [blame] | 265 | default boolean unlock() throws NetconfException { |
| 266 | return unlock(DatastoreId.RUNNING); |
| 267 | } |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 268 | |
| 269 | /** |
| 270 | * Closes the Netconf session with the device. |
| 271 | * the first time it tries gracefully, then kills it forcefully |
Andrea Campanella | f4fd035 | 2015-12-14 17:03:05 -0800 | [diff] [blame] | 272 | * |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 273 | * @return true if closed |
Andrea Campanella | 101417d | 2015-12-11 17:58:07 -0800 | [diff] [blame] | 274 | * @throws NetconfException when there is a problem in the communication process on |
| 275 | * the underlying connection |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 276 | */ |
Andrea Campanella | 101417d | 2015-12-11 17:58:07 -0800 | [diff] [blame] | 277 | boolean close() throws NetconfException; |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 278 | |
| 279 | /** |
| 280 | * Gets the session ID of the Netconf session. |
| 281 | * |
| 282 | * @return Session ID as a string. |
| 283 | */ |
| 284 | String getSessionId(); |
| 285 | |
| 286 | /** |
Aaron Kruglikov | 72db642 | 2017-02-13 12:16:51 -0800 | [diff] [blame] | 287 | * Gets the capabilities of the remote Netconf device associated to this |
| 288 | * session. |
| 289 | * |
| 290 | * @return Network capabilities as strings in a Set. |
| 291 | * |
| 292 | * @since 1.10.0 |
Aaron Kruglikov | 72db642 | 2017-02-13 12:16:51 -0800 | [diff] [blame] | 293 | */ |
Yuta HIGUCHI | dd7c3f8 | 2017-09-03 14:18:01 -0700 | [diff] [blame] | 294 | Set<String> getDeviceCapabilitiesSet(); |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 295 | |
Andrea Campanella | 101417d | 2015-12-11 17:58:07 -0800 | [diff] [blame] | 296 | /** |
Andrea Campanella | c362784 | 2017-04-04 18:06:54 +0200 | [diff] [blame] | 297 | * Checks the state of the underlying SSH session and connection |
| 298 | * and if necessary it reestablishes it. |
| 299 | * Should be implemented, providing a default here for retrocompatibility. |
| 300 | * @throws NetconfException when there is a problem in reestablishing |
| 301 | * the connection or the session to the device. |
| 302 | */ |
Andrea Campanella | c362784 | 2017-04-04 18:06:54 +0200 | [diff] [blame] | 303 | default void checkAndReestablish() throws NetconfException { |
| 304 | Logger log = LoggerFactory.getLogger(NetconfSession.class); |
| 305 | log.error("Not implemented/exposed by the underlying session implementation"); |
| 306 | } |
Yuta HIGUCHI | 89111d9 | 2017-05-04 11:29:17 -0700 | [diff] [blame] | 307 | |
Aaron Kruglikov | 72db642 | 2017-02-13 12:16:51 -0800 | [diff] [blame] | 308 | /** |
| 309 | * Sets the ONOS side capabilities. |
| 310 | * |
| 311 | * @param capabilities list of capabilities ONOS has. |
| 312 | * |
| 313 | * @since 1.10.0 |
| 314 | */ |
| 315 | default void setOnosCapabilities(Iterable<String> capabilities) { |
| 316 | // default implementation should be removed in the future |
| 317 | // no-op |
| 318 | } |
Andrea Campanella | c362784 | 2017-04-04 18:06:54 +0200 | [diff] [blame] | 319 | |
| 320 | /** |
Andrea Campanella | 101417d | 2015-12-11 17:58:07 -0800 | [diff] [blame] | 321 | * Remove a listener from the underlying stream handler implementation. |
| 322 | * |
| 323 | * @param listener event listener. |
| 324 | */ |
| 325 | void addDeviceOutputListener(NetconfDeviceOutputEventListener listener); |
| 326 | |
| 327 | /** |
| 328 | * Remove a listener from the underlying stream handler implementation. |
| 329 | * |
| 330 | * @param listener event listener. |
| 331 | */ |
| 332 | void removeDeviceOutputListener(NetconfDeviceOutputEventListener listener); |
| 333 | |
Sean Condon | 54d8243 | 2017-07-26 22:27:25 +0100 | [diff] [blame] | 334 | /** |
| 335 | * Read the connect timeout that this session was created with. |
| 336 | * @return timeout in seconds |
| 337 | */ |
| 338 | default int timeoutConnectSec() { |
| 339 | return 0; |
| 340 | }; |
| 341 | |
| 342 | /** |
| 343 | * Read the reply timeout that this session was created with. |
| 344 | * @return timeout in seconds |
| 345 | */ |
| 346 | default int timeoutReplySec() { |
| 347 | return 0; |
| 348 | }; |
| 349 | |
| 350 | /** |
| 351 | * Read the idle timeout that this session was created with. |
| 352 | * @return timeout in seconds |
| 353 | */ |
| 354 | default int timeoutIdleSec() { |
| 355 | return 0; |
| 356 | }; |
| 357 | |
andrea | eb70a94 | 2015-10-16 21:34:46 -0700 | [diff] [blame] | 358 | } |