e0cbde532ea157fca3bfde46c9ba1498888c8506
[ccsdk/cds.git] /
1 /*
2  * Copyright © 2017-2019 AT&T, Bell Canada
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.utils
17
18 object NetconfDatastore {
19     const val RUNNING = "running"
20     const val CANDIDATE = "candidate"
21 }
22
23 object RpcStatus {
24     const val SUCCESS = "success"
25     const val FAILURE = "failure"
26 }
27
28 object RpcMessageUtils {
29     const val OPEN = "<"
30     const val CLOSE = ">"
31     const val EQUAL = "="
32
33     const val HASH = "#"
34     const val HASH_CHAR = '#'
35
36     const val LF_CHAR = '\n'
37     const val NEW_LINE = "\n"
38
39     const val QUOTE = "\""
40     const val QUOTE_SPACE = "\" "
41
42     const val TAG_CLOSE = "/>"
43     const val END_OF_RPC_OPEN_TAG = "\">"
44     const val END_PATTERN = "]]>]]>"
45
46     const val HELLO = "hello"
47     const val RPC_REPLY = "rpc-reply"
48     const val RPC_ERROR = "rpc-error"
49
50     const val RPC_OPEN = "<rpc "
51     const val RPC_CLOSE = "</rpc>"
52     const val WITH_DEFAULT_OPEN = "<with-defaults "
53     const val WITH_DEFAULT_CLOSE = "</with-defaults>"
54     const val DEFAULT_OPERATION_OPEN = "<default-operation>"
55     const val DEFAULT_OPERATION_CLOSE = "</default-operation>"
56     const val SUBTREE_FILTER_OPEN = "<filter type=\"subtree\">"
57     const val SUBTREE_FILTER_CLOSE = "</filter>"
58     const val TARGET_OPEN = "<target>"
59     const val TARGET_CLOSE = "</target>"
60     const val SOURCE_OPEN = "<source>"
61     const val SOURCE_CLOSE = "</source>"
62     const val CONFIG_OPEN = "<config xmlns:nc=\"urn:ietf:params:xml:ns:netconf:base:1.0\">"
63     const val CONFIG_CLOSE = "</config>"
64     const val MSGLEN_REGEX_PATTERN = "\n#\\d+\n"
65
66     const val NUMBER_BETWEEN_QUOTES_MATCHER = "\"+([0-9]+)+\""
67
68     const val XML_HEADER = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
69     const val NETCONF_BASE_NAMESPACE = "xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\""
70     const val NETCONF_WITH_DEFAULTS_NAMESPACE = "xmlns=\"urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults\""
71     const val SUBSCRIPTION_SUBTREE_FILTER_OPEN =
72         "<filter xmlns:base10=\"urn:ietf:params:xml:ns:netconf:base:1.0\" base10:type=\"subtree\">"
73
74     const val INTERLEAVE_CAPABILITY_STRING = "urn:ietf:params:netconf:capability:interleave:1.0"
75
76     const val CAPABILITY_REGEX = "capability>\\s*(.*?)\\s*capability>"
77
78     const val SESSION_ID_REGEX = "session-id>\\s*(.*?)\\s*session-id>"
79
80     const val MESSAGE_ID_STRING = "message-id"
81
82     const val NETCONF_10_CAPABILITY = "urn:ietf:params:netconf:base:1.0"
83     const val NETCONF_11_CAPABILITY = "urn:ietf:params:netconf:base:1.1"
84 }