2 * ============LICENSE_START========================================================================
\r
3 * ONAP : tr-069-adapter
\r
4 * =================================================================================================
\r
5 * Copyright (C) 2020 CommScope Inc Intellectual Property.
\r
6 * =================================================================================================
\r
7 * This tr-069-adapter software file is distributed by CommScope Inc under the Apache License,
\r
8 * Version 2.0 (the "License"); you may not use this file except in compliance with the License. You
\r
9 * may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
\r
14 * either express or implied. See the License for the specific language governing permissions and
\r
15 * limitations under the License.
\r
16 * ===============LICENSE_END=======================================================================
\r
19 package org.commscope.tr069adapter.acs.cpe.rpc;
\r
21 import java.io.Serializable;
\r
22 import java.util.Iterator;
\r
24 import javax.xml.soap.Name;
\r
25 import javax.xml.soap.SOAPBodyElement;
\r
26 import javax.xml.soap.SOAPElement;
\r
27 import javax.xml.soap.SOAPException;
\r
28 import javax.xml.soap.SOAPFactory;
\r
30 import org.commscope.tr069adapter.acs.cpe.TR069RPC;
\r
32 public class GetParameterAttributesResponse extends TR069RPC {
\r
34 private static final long serialVersionUID = 5241691699448063027L;
\r
36 /** Creates a new instance of GetParameterAttributes */
\r
37 public GetParameterAttributesResponse() {
\r
38 name = "GetParameterAttributesResponse";
\r
41 protected void createBody(SOAPBodyElement body, SOAPFactory spf) throws SOAPException {
\r
42 logger.isDebugEnabled();
\r
45 @SuppressWarnings({"rawtypes", "unused"})
\r
46 protected void parseBody(SOAPBodyElement body, SOAPFactory spf) throws SOAPException {
\r
47 SOAPElement ml = getRequestChildElement(spf, body, "ParameterList");
\r
48 int i = getArrayCount(spf, ml);
\r
49 Iterator<SOAPElement> mlist = ml.getChildElements(spf.createName("ParameterAttributeStruct"));
\r
50 attributes = new ParameterAttributeStruct[i];
\r
51 Name nameKey = spf.createName("Name");
\r
52 Name nameNotification = spf.createName("Notification");
\r
53 Name nameString = spf.createName("string");
\r
55 while (mlist.hasNext()) {
\r
56 SOAPElement param = mlist.next();
\r
57 attributes[i] = new ParameterAttributeStruct();
\r
58 attributes[i].name = getRequestElement(param, nameKey);
\r
59 attributes[i].notification = Integer.parseInt(getRequestElement(param, nameNotification));
\r
61 SOAPElement elementAccessList = getRequestChildElement(spf, param, "AccessList");
\r
62 int ii = getArrayCount(spf, elementAccessList);
\r
63 attributes[i].accessList = new String[ii];
\r
66 Iterator<SOAPElement> iteratorAccessList = elementAccessList.getChildElements(nameString);
\r
67 while (iteratorAccessList.hasNext()) {
\r
68 attributes[i].accessList[ii++] = ((SOAPElement) iteratorAccessList.next()).getValue();
\r
75 private ParameterAttributeStruct[] attributes;
\r
77 public ParameterAttributeStruct[] getAttributes() {
\r
81 public void setAttributes(ParameterAttributeStruct[] attributes) {
\r
82 this.attributes = attributes;
\r
85 public class ParameterAttributeStruct implements Serializable {
\r
87 private static final long serialVersionUID = -5185719453218694220L;
\r
89 ParameterAttributeStruct() {}
\r
91 private String name;
\r
92 private int notification;
\r
93 private String[] accessList;
\r
95 public String getName() {
\r
99 public int getNotification() {
\r
100 return notification;
\r
103 public String[] getAccessList() {
\r