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