2 * Copyright © 2017-2018 AT&T Intellectual Property.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package org.onap.ccsdk.apps.blueprintsprocessor.functions.netconf.executor.api
19 import java.util.concurrent.CompletableFuture
21 interface NetconfSession {
24 * Establish netconf session
30 * Disconnect netconf session
35 * Reconnect netconf session
40 * Executes an synchronous RPC request.
42 * @param request the XML request
43 * @param messageId message id of the request.
46 @Throws(NetconfException::class)
47 fun syncRpc(request: String, messageId: String): String
50 * Executes an asynchronous RPC request.
52 * @param request the XML request
53 * @param messageId message id of the request.
56 @Throws(NetconfException::class)
57 fun asyncRpc(request: String, messageId: String): CompletableFuture<String>
60 * Checks the state of the underlying SSH session and connection and if necessary it reestablishes
63 @Throws(NetconfException::class)
64 fun checkAndReestablish()
67 * Get the device information for initialised session.
69 * @return DeviceInfo as device information
71 fun getDeviceInfo(): DeviceInfo
74 * Gets the session ID of the Netconf session.
76 * @return Session ID as a string.
78 fun getSessionId(): String
81 * Gets the capabilities of the remote Netconf device associated to this session.
83 * @return Network capabilities as strings in a Set.
85 fun getDeviceCapabilitiesSet(): Set<String>