17a2448881acd57e3e9083e38950f8161f94c367
[ccsdk/cds.git] /
1 /*
2  * Copyright © 2017-2018 AT&T Intellectual Property.
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 package org.onap.ccsdk.apps.blueprintsprocessor.functions.netconf.executor.interfaces
17
18 import org.onap.ccsdk.apps.blueprintsprocessor.functions.netconf.executor.data.DeviceResponse
19
20 interface NetconfRpcClientService {
21
22     fun disconnect()
23
24
25     fun reconnect()
26
27     /**
28      * @param messageId message id of the request.
29      * @param configTarget config target ( running or candidate)
30      * @param messageTimeout message timeout of the request.
31      * @return Device response
32      */
33     fun lock(messageId: String, configTarget: String, messageTimeout: Int): DeviceResponse
34
35     /**
36      * @param messageId message id of the request.
37      * @param messageContent filter content.
38      * @param configTarget config target ( running or candidate)
39      * @param messageTimeout message timeout of the request.
40      * @return Device response
41      */
42     fun getConfig(messageId: String, messageContent: String, configTarget: String, messageTimeout: Int): DeviceResponse
43
44     /**
45      * @param messageId message id of the request.
46      * @param configTarget config target ( running or candidate)
47      * @param messageTimeout message timeout of the request.
48      * @return Device response
49      */
50     fun deleteConfig(messageId: String, configTarget: String, messageTimeout: Int): DeviceResponse
51
52     /**
53      * @param messageId message id of the request.
54      * @param messageContent edit config content.
55      * @param reConnect reconnect session
56      * @param wait waiting time to perform operation ( 0 indicates no wait )
57      * @param lock lock the device before performing edit.
58      * @param configTarget config target ( running or candidate)
59      * @param editDefaultOperation edit default operation (merge | replace | create | delete | remove or
60      * delete)
61      * @param clearCandidate commit after edit config
62      * @param commit clear candiate store before edit
63      * @param discardChanges Rollback on failure
64      * @param validate validate the config before commit
65      * @param unlock unlock device after edit
66      * @param preRestartWait
67      * @param postRestartWait
68      * @param messageTimeout message timeout of the request.
69      * @return Device response
70      */
71     fun editConfig(messageId: String, messageContent: String, reConnect: Boolean, wait: Int, lock: Boolean,
72                    configTarget: String, editDefaultOperation: String, clearCandidate: Boolean, validate: Boolean, commit: Boolean,
73                    discardChanges: Boolean, unlock: Boolean, preRestartWait: Int, postRestartWait: Int, messageTimeout: Int): DeviceResponse
74
75     /**
76      * @param messageId message id of the request.
77      * @param configTarget config target ( running or candidate)
78      * @param messageTimeout message timeout of the request.
79      * @return Device response
80      */
81     fun validate(messageId: String, configTarget: String, messageTimeout: Int): DeviceResponse
82
83     /**
84      * @param messageId message id of the request.
85      * @param message optional commit message
86      * @param discardChanges Rollback on failure
87      * @param messageTimeout message timeout of the request.
88      * @return Device response
89      */
90     fun commit(messageId: String, message: String, discardChanges: Boolean, messageTimeout: Int): DeviceResponse
91
92     /**
93      * @param messageId message id of the request.
94      * @param configTarget config target ( running or candidate)
95      * @param messageTimeout message timeout of the request.
96      * @return Device response
97      */
98     fun unLock(messageId: String, configTarget: String, messageTimeout: Int): DeviceResponse
99
100     /**
101      * @param messageId message id of the request.
102      * @param messageTimeout message timeout of the request.
103      * @return Device response
104      */
105     fun discardConfig(messageId: String, messageTimeout: Int): DeviceResponse
106
107     /**
108      * @param messageId message id of the request.
109      * @param force force close
110      * @param messageTimeout message timeout of the request.
111      * @return Device response
112      */
113     fun close(messageId: String, force: Boolean, messageTimeout: Int): DeviceResponse
114
115     /**
116      * Executes an RPC request to the netconf server.
117      *
118      * @param request the XML containing the RPC request for the server.
119      * @param messageId message id of the request.
120      * @param messageTimeout message timeout of the request.
121      * @return Device response
122      */
123     fun asyncRpc(request: String, messageId: String, messageTimeout: Int): DeviceResponse
124 }