2 * ============LICENSE_START========================================================================
3 * ONAP : tr-069-adapter
4 * =================================================================================================
5 * Copyright (C) 2020 CommScope Inc Intellectual Property.
6 * =================================================================================================
7 * This tr-069-adapter software file is distributed by CommScope Inc under the Apache License,
8 * Version 2.0 (the "License"); you may not use this file except in compliance with the License. You
9 * may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
14 * either express or implied. See the License for the specific language governing permissions and
15 * limitations under the License.
16 * ===============LICENSE_END=======================================================================
19 package org.commscope.tr069adapter.mapper;
\r
21 import java.io.File;
\r
22 import java.io.IOException;
\r
24 import org.apache.commons.io.FileUtils;
\r
25 import org.commscope.tr069adapter.acs.common.DeviceRPCRequest;
\r
26 import org.commscope.tr069adapter.acs.common.dto.TR069OperationCode;
\r
27 import org.commscope.tr069adapter.mapper.util.MOMetaDataUtil;
\r
28 import org.commscope.tr069adapter.mapper.util.NetconfToTr069MapperUtil;
\r
29 import org.w3c.dom.Element;
\r
33 public static final String INDEX_STR = "index";
\r
34 public static final String INDEX_REGEX = "[0-9]{1,}";
\r
36 public static void main(String[] args) throws IOException {
\r
37 File file = new File("rpc_set_input.xml");
\r
38 String requestXML = FileUtils.readFileToString(file, "UTF-8");
\r
41 StringBuilder buff = new StringBuilder();
\r
42 for (int i = 6400; i <= 9600; i++) {
\r
43 buff.append(i).append(",");
\r
45 System.out.println(buff.toString());
\r
47 MOMetaDataUtil util = new MOMetaDataUtil();
\r
48 util.loadMetaData();
\r
49 Element el = NetconfToTr069MapperUtil.convertStringToDocument(requestXML);
\r
51 DeviceRPCRequest req = NetconfToTr069MapperUtil.prepareTR069Request("0005B9AAAAA3", el, "rpc",
\r
52 TR069OperationCode.GET_PARAMETER_VALUES);
\r
54 .setParmeters(util.getSupportedChildParameters(req.getOpDetails().getParmeters()));
\r
56 System.out.println(req);
\r