From 1f982f9e7f9f38743bbc1bcf2609292579762341 Mon Sep 17 00:00:00 2001 From: emartin Date: Tue, 5 Mar 2019 16:29:36 +0000 Subject: Added Filtering of Measurement file Change-Id: I32cd7147c20cbee7273d7c7180a06d9f2fdf620b Issue-ID: DCAEGEN2-1288 Signed-off-by: emartin --- .../pmmapper/filtering/MeasFilterHandler.java | 141 ++ .../dcaegen2/services/pmmapper/model/Event.java | 2 + .../services/pmmapper/model/MapperConfig.java | 3 + .../services/pmmapper/model/MeasCollecFile.java | 1844 ++++++++++++++++++++ .../services/pmmapper/model/MeasFilterConfig.java | 53 + .../services/pmmapper/model/package-info.java | 24 + .../services/pmmapper/utils/MeasConverter.java | 76 + 7 files changed, 2143 insertions(+) create mode 100644 src/main/java/org/onap/dcaegen2/services/pmmapper/filtering/MeasFilterHandler.java create mode 100644 src/main/java/org/onap/dcaegen2/services/pmmapper/model/MeasCollecFile.java create mode 100644 src/main/java/org/onap/dcaegen2/services/pmmapper/model/MeasFilterConfig.java create mode 100644 src/main/java/org/onap/dcaegen2/services/pmmapper/model/package-info.java create mode 100644 src/main/java/org/onap/dcaegen2/services/pmmapper/utils/MeasConverter.java (limited to 'src/main/java') diff --git a/src/main/java/org/onap/dcaegen2/services/pmmapper/filtering/MeasFilterHandler.java b/src/main/java/org/onap/dcaegen2/services/pmmapper/filtering/MeasFilterHandler.java new file mode 100644 index 0000000..a6017b6 --- /dev/null +++ b/src/main/java/org/onap/dcaegen2/services/pmmapper/filtering/MeasFilterHandler.java @@ -0,0 +1,141 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.dcaegen2.services.pmmapper.filtering; + +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; +import org.onap.dcaegen2.services.pmmapper.model.Event; +import org.onap.dcaegen2.services.pmmapper.model.MeasCollecFile; +import org.onap.dcaegen2.services.pmmapper.model.MeasCollecFile.MeasData; +import org.onap.dcaegen2.services.pmmapper.model.MeasCollecFile.MeasData.MeasInfo; +import org.onap.dcaegen2.services.pmmapper.model.MeasCollecFile.MeasData.MeasInfo.MeasType; +import org.onap.dcaegen2.services.pmmapper.model.MeasCollecFile.MeasData.MeasInfo.MeasValue; +import org.onap.dcaegen2.services.pmmapper.model.MeasCollecFile.MeasData.MeasInfo.MeasValue.R; +import org.onap.dcaegen2.services.pmmapper.model.MeasFilterConfig.Filter; +import org.onap.dcaegen2.services.pmmapper.utils.MeasConverter; +import org.onap.logging.ref.slf4j.ONAPLogAdapter; +import org.slf4j.LoggerFactory; + +/** + * Provides filtering of the contents of the 3GPP PM Measurement file. + **/ +public class MeasFilterHandler { + private static final ONAPLogAdapter logger = new ONAPLogAdapter(LoggerFactory.getLogger(MeasFilterHandler.class)); + private Filter filter; + private MeasConverter converter; + + public MeasFilterHandler(MeasConverter converter) { + this.converter = converter; + } + + public void setFilter(Filter filter) { + this.filter = filter; + } + + /** + * Filters each measInfo node for measTypes that match the given measTypes from filters. + **/ + public boolean filterByMeasType(Event event) { + logger.unwrap().debug("Filtering the measurement file."); + + MeasCollecFile measCollecFile = event.getMeasCollecFile(); + if(filter.getMeasTypes().isEmpty() || measCollecFile.getMeasData().isEmpty()) { + return false; + } + + MeasData measData = measCollecFile.getMeasData().get(0); + List measInfos = measData.getMeasInfo(); + List filteredMeasInfos = new ArrayList<>(); + + for (int i = 0; i < measInfos.size(); i++) { + MeasInfo currentMeasInfo = measInfos.get(i); + List measTypesNode = currentMeasInfo.getMeasTypes(); + if(!measTypesNode.isEmpty()) { + setMeasInfosFromMeasTypes(currentMeasInfo,filteredMeasInfos); + }else { + setMeasInfoFromMeasType(currentMeasInfo,filteredMeasInfos); + } + } + + if (filteredMeasInfos.isEmpty()) { + return false; + } + + measData.setMeasInfo(filteredMeasInfos); + String filteredXMl = converter.convert(measCollecFile); + event.setBody(filteredXMl); + return true; + } + + private void setMeasInfoFromMeasType(MeasInfo currentMeasInfo, List filteredMeasInfos) { + MeasValue currentMeasValue = currentMeasInfo.getMeasValue() + .get(0); + List measResultsRNodes = currentMeasValue.getR(); + Map mappedR = measResultsRNodes.stream() + .collect(Collectors.toMap(R::getP, Function.identity())); + List filteredRs = new ArrayList<>(); + List filteredMeasTypes = currentMeasInfo.getMeasType() + .stream().filter(mt -> { + List measTypeFilters = filter.getMeasTypes(); + if (measTypeFilters.contains(mt.getValue())) { + filteredRs.add(mappedR.get(mt.getP())); + return true; + } + return false; + }) + .collect(Collectors.toList()); + if (!filteredMeasTypes.isEmpty()) { + currentMeasInfo.replaceMeasType(filteredMeasTypes); + currentMeasValue.replaceR(filteredRs); + filteredMeasInfos.add(currentMeasInfo); + } + + } + + private void setMeasInfosFromMeasTypes(MeasInfo currentMeasInfo, List filteredMeasInfos) { + MeasValue currentMeasValue = currentMeasInfo.getMeasValue() + .get(0); + List measTypesNode = currentMeasInfo.getMeasTypes(); + List measResultsNode = currentMeasValue.getMeasResults(); + List filteredMeasResults = new ArrayList<>(); + + List filteredMeasTypes = new ArrayList<>(); + for (int j = 0; j < measTypesNode.size(); j++) { + String currentMeasType = measTypesNode.get(j); + List measTypeFilters = filter.getMeasTypes(); + if (measTypeFilters.contains(currentMeasType)) { + filteredMeasTypes.add(currentMeasType); + filteredMeasResults.add(measResultsNode.get(j)); + } + } + + if (!filteredMeasTypes.isEmpty()) { + currentMeasInfo.replaceMeasTypes(filteredMeasTypes); + currentMeasValue.replaceMeasResults(filteredMeasResults); + filteredMeasInfos.add(currentMeasInfo); + } + } + +} diff --git a/src/main/java/org/onap/dcaegen2/services/pmmapper/model/Event.java b/src/main/java/org/onap/dcaegen2/services/pmmapper/model/Event.java index 7a7cb1f..0e82119 100644 --- a/src/main/java/org/onap/dcaegen2/services/pmmapper/model/Event.java +++ b/src/main/java/org/onap/dcaegen2/services/pmmapper/model/Event.java @@ -40,4 +40,6 @@ public class Event { private Map mdc; @NonNull private String publishIdentity; + + MeasCollecFile measCollecFile; } diff --git a/src/main/java/org/onap/dcaegen2/services/pmmapper/model/MapperConfig.java b/src/main/java/org/onap/dcaegen2/services/pmmapper/model/MapperConfig.java index 0412ece..2f13080 100644 --- a/src/main/java/org/onap/dcaegen2/services/pmmapper/model/MapperConfig.java +++ b/src/main/java/org/onap/dcaegen2/services/pmmapper/model/MapperConfig.java @@ -141,4 +141,7 @@ public class MapperConfig { @SerializedName("topic_url") private String topicUrl; } + + @SerializedName("pm-mapper-filter") + MeasFilterConfig filterConfig; } \ No newline at end of file diff --git a/src/main/java/org/onap/dcaegen2/services/pmmapper/model/MeasCollecFile.java b/src/main/java/org/onap/dcaegen2/services/pmmapper/model/MeasCollecFile.java new file mode 100644 index 0000000..572b46b --- /dev/null +++ b/src/main/java/org/onap/dcaegen2/services/pmmapper/model/MeasCollecFile.java @@ -0,0 +1,1844 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ +package org.onap.dcaegen2.services.pmmapper.model; + +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlList; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.datatype.Duration; +import javax.xml.datatype.XMLGregorianCalendar; + +/** + *

+ * Generated Java class using XJC to represent 3GPP PM Measurement file + * + *

+ * The following schema fragment specifies the expected content contained within + * this class. + * + *

+ * <complexType>
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="fileHeader">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="fileSender">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <attribute name="localDn" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="elementType" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                   <element name="measCollec">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <attribute name="beginTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *                 <attribute name="fileFormatVersion" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 <attribute name="vendorName" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 <attribute name="dnPrefix" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="measData" maxOccurs="unbounded" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="managedElement">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <attribute name="localDn" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="userLabel" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                           <attribute name="swVersion" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                   <element name="measInfo" maxOccurs="unbounded" minOccurs="0">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <sequence>
+ *                             <element name="job" minOccurs="0">
+ *                               <complexType>
+ *                                 <complexContent>
+ *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                     <attribute name="jobId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                   </restriction>
+ *                                 </complexContent>
+ *                               </complexType>
+ *                             </element>
+ *                             <element name="granPeriod">
+ *                               <complexType>
+ *                                 <complexContent>
+ *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                     <attribute name="duration" use="required" type="{http://www.w3.org/2001/XMLSchema}duration" />
+ *                                     <attribute name="endTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
+ *                                   </restriction>
+ *                                 </complexContent>
+ *                               </complexType>
+ *                             </element>
+ *                             <element name="repPeriod" minOccurs="0">
+ *                               <complexType>
+ *                                 <complexContent>
+ *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                     <attribute name="duration" use="required" type="{http://www.w3.org/2001/XMLSchema}duration" />
+ *                                   </restriction>
+ *                                 </complexContent>
+ *                               </complexType>
+ *                             </element>
+ *                             <choice>
+ *                               <element name="measTypes">
+ *                                 <simpleType>
+ *                                   <list itemType="{http://www.w3.org/2001/XMLSchema}Name" />
+ *                                 </simpleType>
+ *                               </element>
+ *                               <element name="measType" maxOccurs="unbounded" minOccurs="0">
+ *                                 <complexType>
+ *                                   <simpleContent>
+ *                                     <extension base="<http://www.w3.org/2001/XMLSchema>Name">
+ *                                       <attribute name="p" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *                                     </extension>
+ *                                   </simpleContent>
+ *                                 </complexType>
+ *                               </element>
+ *                             </choice>
+ *                             <element name="measValue" maxOccurs="unbounded" minOccurs="0">
+ *                               <complexType>
+ *                                 <complexContent>
+ *                                   <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                                     <sequence>
+ *                                       <choice>
+ *                                         <element name="measResults">
+ *                                           <simpleType>
+ *                                             <list itemType="{http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec}measResultType" />
+ *                                           </simpleType>
+ *                                         </element>
+ *                                         <element name="r" maxOccurs="unbounded" minOccurs="0">
+ *                                           <complexType>
+ *                                             <simpleContent>
+ *                                               <extension base="<http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec>measResultType">
+ *                                                 <attribute name="p" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+ *                                               </extension>
+ *                                             </simpleContent>
+ *                                           </complexType>
+ *                                         </element>
+ *                                       </choice>
+ *                                       <element name="suspect" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *                                     </sequence>
+ *                                     <attribute name="measObjLdn" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                                   </restriction>
+ *                                 </complexContent>
+ *                               </complexType>
+ *                             </element>
+ *                           </sequence>
+ *                           <attribute name="measInfoId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="fileFooter">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="measCollec">
+ *                     <complexType>
+ *                       <complexContent>
+ *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                           <attribute name="endTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
+ *                         </restriction>
+ *                       </complexContent>
+ *                     </complexType>
+ *                   </element>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "fileHeader", + "measData", + "fileFooter" +}) +@XmlRootElement(name = "measCollecFile") +public class MeasCollecFile { + + @XmlElement(required = true) + protected MeasCollecFile.FileHeader fileHeader; + protected List measData; + @XmlElement(required = true) + protected MeasCollecFile.FileFooter fileFooter; + + /** + * Gets the value of the fileHeader property. + * + * @return + * possible object is + * {@link MeasCollecFile.FileHeader } + * + */ + public MeasCollecFile.FileHeader getFileHeader() { + return fileHeader; + } + + /** + * Sets the value of the fileHeader property. + * + * @param value + * allowed object is + * {@link MeasCollecFile.FileHeader } + * + */ + public void setFileHeader(MeasCollecFile.FileHeader value) { + this.fileHeader = value; + } + + /** + * Gets the value of the measData property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the measData property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getMeasData().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link MeasCollecFile.MeasData } + * + * + */ + public List getMeasData() { + if (measData == null) { + measData = new ArrayList(); + } + return this.measData; + } + + /** + * Gets the value of the fileFooter property. + * + * @return + * possible object is + * {@link MeasCollecFile.FileFooter } + * + */ + public MeasCollecFile.FileFooter getFileFooter() { + return fileFooter; + } + + /** + * Sets the value of the fileFooter property. + * + * @param value + * allowed object is + * {@link MeasCollecFile.FileFooter } + * + */ + public void setFileFooter(MeasCollecFile.FileFooter value) { + this.fileFooter = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="measCollec">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <attribute name="endTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "measCollec" + }) + public static class FileFooter { + + @XmlElement(required = true) + protected MeasCollecFile.FileFooter.MeasCollec measCollec; + + /** + * Gets the value of the measCollec property. + * + * @return + * possible object is + * {@link MeasCollecFile.FileFooter.MeasCollec } + * + */ + public MeasCollecFile.FileFooter.MeasCollec getMeasCollec() { + return measCollec; + } + + /** + * Sets the value of the measCollec property. + * + * @param value + * allowed object is + * {@link MeasCollecFile.FileFooter.MeasCollec } + * + */ + public void setMeasCollec(MeasCollecFile.FileFooter.MeasCollec value) { + this.measCollec = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+         * <complexType>
+         *   <complexContent>
+         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       <attribute name="endTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class MeasCollec { + + @XmlAttribute(name = "endTime", required = true) + @XmlSchemaType(name = "dateTime") + protected XMLGregorianCalendar endTime; + + /** + * Gets the value of the endTime property. + * + * @return + * possible object is + * {@link XMLGregorianCalendar } + * + */ + public XMLGregorianCalendar getEndTime() { + return endTime; + } + + /** + * Sets the value of the endTime property. + * + * @param value + * allowed object is + * {@link XMLGregorianCalendar } + * + */ + public void setEndTime(XMLGregorianCalendar value) { + this.endTime = value; + } + + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="fileSender">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <attribute name="localDn" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 <attribute name="elementType" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *         <element name="measCollec">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <attribute name="beginTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *       <attribute name="fileFormatVersion" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       <attribute name="vendorName" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       <attribute name="dnPrefix" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "fileSender", + "measCollec" + }) + public static class FileHeader { + + @XmlElement(required = true) + protected MeasCollecFile.FileHeader.FileSender fileSender; + @XmlElement(required = true) + protected MeasCollecFile.FileHeader.MeasCollec measCollec; + @XmlAttribute(name = "fileFormatVersion", required = true) + protected String fileFormatVersion; + @XmlAttribute(name = "vendorName") + protected String vendorName; + @XmlAttribute(name = "dnPrefix") + protected String dnPrefix; + + /** + * Gets the value of the fileSender property. + * + * @return + * possible object is + * {@link MeasCollecFile.FileHeader.FileSender } + * + */ + public MeasCollecFile.FileHeader.FileSender getFileSender() { + return fileSender; + } + + /** + * Sets the value of the fileSender property. + * + * @param value + * allowed object is + * {@link MeasCollecFile.FileHeader.FileSender } + * + */ + public void setFileSender(MeasCollecFile.FileHeader.FileSender value) { + this.fileSender = value; + } + + /** + * Gets the value of the measCollec property. + * + * @return + * possible object is + * {@link MeasCollecFile.FileHeader.MeasCollec } + * + */ + public MeasCollecFile.FileHeader.MeasCollec getMeasCollec() { + return measCollec; + } + + /** + * Sets the value of the measCollec property. + * + * @param value + * allowed object is + * {@link MeasCollecFile.FileHeader.MeasCollec } + * + */ + public void setMeasCollec(MeasCollecFile.FileHeader.MeasCollec value) { + this.measCollec = value; + } + + /** + * Gets the value of the fileFormatVersion property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getFileFormatVersion() { + return fileFormatVersion; + } + + /** + * Sets the value of the fileFormatVersion property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setFileFormatVersion(String value) { + this.fileFormatVersion = value; + } + + /** + * Gets the value of the vendorName property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getVendorName() { + return vendorName; + } + + /** + * Sets the value of the vendorName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setVendorName(String value) { + this.vendorName = value; + } + + /** + * Gets the value of the dnPrefix property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getDnPrefix() { + return dnPrefix; + } + + /** + * Sets the value of the dnPrefix property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setDnPrefix(String value) { + this.dnPrefix = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+         * <complexType>
+         *   <complexContent>
+         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       <attribute name="localDn" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       <attribute name="elementType" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class FileSender { + + @XmlAttribute(name = "localDn") + protected String localDn; + @XmlAttribute(name = "elementType") + protected String elementType; + + /** + * Gets the value of the localDn property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLocalDn() { + return localDn; + } + + /** + * Sets the value of the localDn property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLocalDn(String value) { + this.localDn = value; + } + + /** + * Gets the value of the elementType property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getElementType() { + return elementType; + } + + /** + * Sets the value of the elementType property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setElementType(String value) { + this.elementType = value; + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+         * <complexType>
+         *   <complexContent>
+         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       <attribute name="beginTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class MeasCollec { + + @XmlAttribute(name = "beginTime", required = true) + @XmlSchemaType(name = "dateTime") + protected XMLGregorianCalendar beginTime; + + /** + * Gets the value of the beginTime property. + * + * @return + * possible object is + * {@link XMLGregorianCalendar } + * + */ + public XMLGregorianCalendar getBeginTime() { + return beginTime; + } + + /** + * Sets the value of the beginTime property. + * + * @param value + * allowed object is + * {@link XMLGregorianCalendar } + * + */ + public void setBeginTime(XMLGregorianCalendar value) { + this.beginTime = value; + } + + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="managedElement">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <attribute name="localDn" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 <attribute name="userLabel" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                 <attribute name="swVersion" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *         <element name="measInfo" maxOccurs="unbounded" minOccurs="0">
+     *           <complexType>
+     *             <complexContent>
+     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                 <sequence>
+     *                   <element name="job" minOccurs="0">
+     *                     <complexType>
+     *                       <complexContent>
+     *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                           <attribute name="jobId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                         </restriction>
+     *                       </complexContent>
+     *                     </complexType>
+     *                   </element>
+     *                   <element name="granPeriod">
+     *                     <complexType>
+     *                       <complexContent>
+     *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                           <attribute name="duration" use="required" type="{http://www.w3.org/2001/XMLSchema}duration" />
+     *                           <attribute name="endTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
+     *                         </restriction>
+     *                       </complexContent>
+     *                     </complexType>
+     *                   </element>
+     *                   <element name="repPeriod" minOccurs="0">
+     *                     <complexType>
+     *                       <complexContent>
+     *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                           <attribute name="duration" use="required" type="{http://www.w3.org/2001/XMLSchema}duration" />
+     *                         </restriction>
+     *                       </complexContent>
+     *                     </complexType>
+     *                   </element>
+     *                   <choice>
+     *                     <element name="measTypes">
+     *                       <simpleType>
+     *                         <list itemType="{http://www.w3.org/2001/XMLSchema}Name" />
+     *                       </simpleType>
+     *                     </element>
+     *                     <element name="measType" maxOccurs="unbounded" minOccurs="0">
+     *                       <complexType>
+     *                         <simpleContent>
+     *                           <extension base="<http://www.w3.org/2001/XMLSchema>Name">
+     *                             <attribute name="p" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+     *                           </extension>
+     *                         </simpleContent>
+     *                       </complexType>
+     *                     </element>
+     *                   </choice>
+     *                   <element name="measValue" maxOccurs="unbounded" minOccurs="0">
+     *                     <complexType>
+     *                       <complexContent>
+     *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *                           <sequence>
+     *                             <choice>
+     *                               <element name="measResults">
+     *                                 <simpleType>
+     *                                   <list itemType="{http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec}measResultType" />
+     *                                 </simpleType>
+     *                               </element>
+     *                               <element name="r" maxOccurs="unbounded" minOccurs="0">
+     *                                 <complexType>
+     *                                   <simpleContent>
+     *                                     <extension base="<http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec>measResultType">
+     *                                       <attribute name="p" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+     *                                     </extension>
+     *                                   </simpleContent>
+     *                                 </complexType>
+     *                               </element>
+     *                             </choice>
+     *                             <element name="suspect" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+     *                           </sequence>
+     *                           <attribute name="measObjLdn" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *                         </restriction>
+     *                       </complexContent>
+     *                     </complexType>
+     *                   </element>
+     *                 </sequence>
+     *                 <attribute name="measInfoId" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *               </restriction>
+     *             </complexContent>
+     *           </complexType>
+     *         </element>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "managedElement", + "measInfo" + }) + public static class MeasData { + + @XmlElement(required = true) + protected MeasCollecFile.MeasData.ManagedElement managedElement; + protected List measInfo; + + /** + * Gets the value of the managedElement property. + * + * @return + * possible object is + * {@link MeasCollecFile.MeasData.ManagedElement } + * + */ + public MeasCollecFile.MeasData.ManagedElement getManagedElement() { + return managedElement; + } + + /** + * Sets the value of the managedElement property. + * + * @param value + * allowed object is + * {@link MeasCollecFile.MeasData.ManagedElement } + * + */ + public void setManagedElement(MeasCollecFile.MeasData.ManagedElement value) { + this.managedElement = value; + } + + /** + * Gets the value of the measInfo property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the measInfo property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getMeasInfo().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link MeasCollecFile.MeasData.MeasInfo } + * + * + */ + public List getMeasInfo() { + if (measInfo == null) { + measInfo = new ArrayList(); + } + return this.measInfo; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+         * <complexType>
+         *   <complexContent>
+         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       <attribute name="localDn" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       <attribute name="userLabel" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *       <attribute name="swVersion" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class ManagedElement { + + @XmlAttribute(name = "localDn") + protected String localDn; + @XmlAttribute(name = "userLabel") + protected String userLabel; + @XmlAttribute(name = "swVersion") + protected String swVersion; + + /** + * Gets the value of the localDn property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getLocalDn() { + return localDn; + } + + /** + * Sets the value of the localDn property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLocalDn(String value) { + this.localDn = value; + } + + /** + * Gets the value of the userLabel property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getUserLabel() { + return userLabel; + } + + /** + * Sets the value of the userLabel property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setUserLabel(String value) { + this.userLabel = value; + } + + /** + * Gets the value of the swVersion property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSwVersion() { + return swVersion; + } + + /** + * Sets the value of the swVersion property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSwVersion(String value) { + this.swVersion = value; + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+         * <complexType>
+         *   <complexContent>
+         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *       <sequence>
+         *         <element name="job" minOccurs="0">
+         *           <complexType>
+         *             <complexContent>
+         *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                 <attribute name="jobId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *               </restriction>
+         *             </complexContent>
+         *           </complexType>
+         *         </element>
+         *         <element name="granPeriod">
+         *           <complexType>
+         *             <complexContent>
+         *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                 <attribute name="duration" use="required" type="{http://www.w3.org/2001/XMLSchema}duration" />
+         *                 <attribute name="endTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
+         *               </restriction>
+         *             </complexContent>
+         *           </complexType>
+         *         </element>
+         *         <element name="repPeriod" minOccurs="0">
+         *           <complexType>
+         *             <complexContent>
+         *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                 <attribute name="duration" use="required" type="{http://www.w3.org/2001/XMLSchema}duration" />
+         *               </restriction>
+         *             </complexContent>
+         *           </complexType>
+         *         </element>
+         *         <choice>
+         *           <element name="measTypes">
+         *             <simpleType>
+         *               <list itemType="{http://www.w3.org/2001/XMLSchema}Name" />
+         *             </simpleType>
+         *           </element>
+         *           <element name="measType" maxOccurs="unbounded" minOccurs="0">
+         *             <complexType>
+         *               <simpleContent>
+         *                 <extension base="<http://www.w3.org/2001/XMLSchema>Name">
+         *                   <attribute name="p" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+         *                 </extension>
+         *               </simpleContent>
+         *             </complexType>
+         *           </element>
+         *         </choice>
+         *         <element name="measValue" maxOccurs="unbounded" minOccurs="0">
+         *           <complexType>
+         *             <complexContent>
+         *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+         *                 <sequence>
+         *                   <choice>
+         *                     <element name="measResults">
+         *                       <simpleType>
+         *                         <list itemType="{http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec}measResultType" />
+         *                       </simpleType>
+         *                     </element>
+         *                     <element name="r" maxOccurs="unbounded" minOccurs="0">
+         *                       <complexType>
+         *                         <simpleContent>
+         *                           <extension base="<http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec>measResultType">
+         *                             <attribute name="p" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+         *                           </extension>
+         *                         </simpleContent>
+         *                       </complexType>
+         *                     </element>
+         *                   </choice>
+         *                   <element name="suspect" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+         *                 </sequence>
+         *                 <attribute name="measObjLdn" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *               </restriction>
+         *             </complexContent>
+         *           </complexType>
+         *         </element>
+         *       </sequence>
+         *       <attribute name="measInfoId" type="{http://www.w3.org/2001/XMLSchema}string" />
+         *     </restriction>
+         *   </complexContent>
+         * </complexType>
+         * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "job", + "granPeriod", + "repPeriod", + "measTypes", + "measType", + "measValue" + }) + public static class MeasInfo { + + protected MeasCollecFile.MeasData.MeasInfo.Job job; + @XmlElement(required = true) + protected MeasCollecFile.MeasData.MeasInfo.GranPeriod granPeriod; + protected MeasCollecFile.MeasData.MeasInfo.RepPeriod repPeriod; + @XmlList + protected List measTypes; + protected List measType; + protected List measValue; + @XmlAttribute(name = "measInfoId") + protected String measInfoId; + + /** + * Gets the value of the job property. + * + * @return + * possible object is + * {@link MeasCollecFile.MeasData.MeasInfo.Job } + * + */ + public MeasCollecFile.MeasData.MeasInfo.Job getJob() { + return job; + } + + /** + * Sets the value of the job property. + * + * @param value + * allowed object is + * {@link MeasCollecFile.MeasData.MeasInfo.Job } + * + */ + public void setJob(MeasCollecFile.MeasData.MeasInfo.Job value) { + this.job = value; + } + + /** + * Gets the value of the granPeriod property. + * + * @return + * possible object is + * {@link MeasCollecFile.MeasData.MeasInfo.GranPeriod } + * + */ + public MeasCollecFile.MeasData.MeasInfo.GranPeriod getGranPeriod() { + return granPeriod; + } + + /** + * Sets the value of the granPeriod property. + * + * @param value + * allowed object is + * {@link MeasCollecFile.MeasData.MeasInfo.GranPeriod } + * + */ + public void setGranPeriod(MeasCollecFile.MeasData.MeasInfo.GranPeriod value) { + this.granPeriod = value; + } + + /** + * Gets the value of the repPeriod property. + * + * @return + * possible object is + * {@link MeasCollecFile.MeasData.MeasInfo.RepPeriod } + * + */ + public MeasCollecFile.MeasData.MeasInfo.RepPeriod getRepPeriod() { + return repPeriod; + } + + /** + * Sets the value of the repPeriod property. + * + * @param value + * allowed object is + * {@link MeasCollecFile.MeasData.MeasInfo.RepPeriod } + * + */ + public void setRepPeriod(MeasCollecFile.MeasData.MeasInfo.RepPeriod value) { + this.repPeriod = value; + } + + /** + * Gets the value of the measTypes property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the measTypes property. + * + *

+ * For example, to add a new item, do as follows: + *

+             *    getMeasTypes().add(newItem);
+             * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getMeasTypes() { + if (measTypes == null) { + measTypes = new ArrayList(); + } + return this.measTypes; + } + + /** + * Gets the value of the measType property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the measType property. + * + *

+ * For example, to add a new item, do as follows: + *

+             *    getMeasType().add(newItem);
+             * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link MeasCollecFile.MeasData.MeasInfo.MeasType } + * + * + */ + public List getMeasType() { + if (measType == null) { + measType = new ArrayList(); + } + return this.measType; + } + + /** + * Gets the value of the measValue property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the measValue property. + * + *

+ * For example, to add a new item, do as follows: + *

+             *    getMeasValue().add(newItem);
+             * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link MeasCollecFile.MeasData.MeasInfo.MeasValue } + * + * + */ + public List getMeasValue() { + if (measValue == null) { + measValue = new ArrayList(); + } + return this.measValue; + } + + /** + * Gets the value of the measInfoId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMeasInfoId() { + return measInfoId; + } + + /** + * Sets the value of the measInfoId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMeasInfoId(String value) { + this.measInfoId = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+             * <complexType>
+             *   <complexContent>
+             *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *       <attribute name="duration" use="required" type="{http://www.w3.org/2001/XMLSchema}duration" />
+             *       <attribute name="endTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
+             *     </restriction>
+             *   </complexContent>
+             * </complexType>
+             * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class GranPeriod { + + @XmlAttribute(name = "duration", required = true) + protected Duration duration; + @XmlAttribute(name = "endTime", required = true) + @XmlSchemaType(name = "dateTime") + protected XMLGregorianCalendar endTime; + + /** + * Gets the value of the duration property. + * + * @return + * possible object is + * {@link Duration } + * + */ + public Duration getDuration() { + return duration; + } + + /** + * Sets the value of the duration property. + * + * @param value + * allowed object is + * {@link Duration } + * + */ + public void setDuration(Duration value) { + this.duration = value; + } + + /** + * Gets the value of the endTime property. + * + * @return + * possible object is + * {@link XMLGregorianCalendar } + * + */ + public XMLGregorianCalendar getEndTime() { + return endTime; + } + + /** + * Sets the value of the endTime property. + * + * @param value + * allowed object is + * {@link XMLGregorianCalendar } + * + */ + public void setEndTime(XMLGregorianCalendar value) { + this.endTime = value; + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+             * <complexType>
+             *   <complexContent>
+             *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *       <attribute name="jobId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *     </restriction>
+             *   </complexContent>
+             * </complexType>
+             * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class Job { + + @XmlAttribute(name = "jobId", required = true) + protected String jobId; + + /** + * Gets the value of the jobId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getJobId() { + return jobId; + } + + /** + * Sets the value of the jobId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setJobId(String value) { + this.jobId = value; + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+             * <complexType>
+             *   <simpleContent>
+             *     <extension base="<http://www.w3.org/2001/XMLSchema>Name">
+             *       <attribute name="p" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+             *     </extension>
+             *   </simpleContent>
+             * </complexType>
+             * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "value" + }) + public static class MeasType { + + @XmlValue + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "Name") + protected String value; + @XmlAttribute(name = "p", required = true) + @XmlSchemaType(name = "positiveInteger") + protected BigInteger p; + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + + /** + * Gets the value of the p property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + public BigInteger getP() { + return p; + } + + /** + * Sets the value of the p property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setP(BigInteger value) { + this.p = value; + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+             * <complexType>
+             *   <complexContent>
+             *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *       <sequence>
+             *         <choice>
+             *           <element name="measResults">
+             *             <simpleType>
+             *               <list itemType="{http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec}measResultType" />
+             *             </simpleType>
+             *           </element>
+             *           <element name="r" maxOccurs="unbounded" minOccurs="0">
+             *             <complexType>
+             *               <simpleContent>
+             *                 <extension base="<http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec>measResultType">
+             *                   <attribute name="p" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+             *                 </extension>
+             *               </simpleContent>
+             *             </complexType>
+             *           </element>
+             *         </choice>
+             *         <element name="suspect" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+             *       </sequence>
+             *       <attribute name="measObjLdn" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+             *     </restriction>
+             *   </complexContent>
+             * </complexType>
+             * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "measResults", + "r", + "suspect" + }) + public static class MeasValue { + + @XmlList + protected List measResults; + protected List r; + protected Boolean suspect; + @XmlAttribute(name = "measObjLdn", required = true) + protected String measObjLdn; + + /** + * Gets the value of the measResults property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the measResults property. + * + *

+ * For example, to add a new item, do as follows: + *

+                 *    getMeasResults().add(newItem);
+                 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link String } + * + * + */ + public List getMeasResults() { + if (measResults == null) { + measResults = new ArrayList(); + } + return this.measResults; + } + + /** + * Gets the value of the r property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the r property. + * + *

+ * For example, to add a new item, do as follows: + *

+                 *    getR().add(newItem);
+                 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link MeasCollecFile.MeasData.MeasInfo.MeasValue.R } + * + * + */ + public List getR() { + if (r == null) { + r = new ArrayList(); + } + return this.r; + } + + /** + * Gets the value of the suspect property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isSuspect() { + return suspect; + } + + /** + * Sets the value of the suspect property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setSuspect(Boolean value) { + this.suspect = value; + } + + /** + * Gets the value of the measObjLdn property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMeasObjLdn() { + return measObjLdn; + } + + /** + * Sets the value of the measObjLdn property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMeasObjLdn(String value) { + this.measObjLdn = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+                 * <complexType>
+                 *   <simpleContent>
+                 *     <extension base="<http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec>measResultType">
+                 *       <attribute name="p" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
+                 *     </extension>
+                 *   </simpleContent>
+                 * </complexType>
+                 * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "value" + }) + public static class R { + + @XmlValue + protected String value; + @XmlAttribute(name = "p", required = true) + @XmlSchemaType(name = "positiveInteger") + protected BigInteger p; + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + + /** + * Gets the value of the p property. + * + * @return + * possible object is + * {@link BigInteger } + * + */ + public BigInteger getP() { + return p; + } + + /** + * Sets the value of the p property. + * + * @param value + * allowed object is + * {@link BigInteger } + * + */ + public void setP(BigInteger value) { + this.p = value; + } + + } + + + public void replaceR(List filteredRs) { + this.r = filteredRs; + + } + + public void replaceMeasResults(List filteredMeasResults) { + this.measResults = filteredMeasResults; + + } + + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+             * <complexType>
+             *   <complexContent>
+             *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+             *       <attribute name="duration" use="required" type="{http://www.w3.org/2001/XMLSchema}duration" />
+             *     </restriction>
+             *   </complexContent>
+             * </complexType>
+             * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class RepPeriod { + + @XmlAttribute(name = "duration", required = true) + protected Duration duration; + + /** + * Gets the value of the duration property. + * + * @return + * possible object is + * {@link Duration } + * + */ + public Duration getDuration() { + return duration; + } + + /** + * Sets the value of the duration property. + * + * @param value + * allowed object is + * {@link Duration } + * + */ + public void setDuration(Duration value) { + this.duration = value; + } + } + + + public void replaceMeasTypes(List newMeasTypes) { + this.measTypes = newMeasTypes; + } + + public void replaceMeasType(List filteredMeasTypes) { + this.measType = filteredMeasTypes; + } + + } + + + public void setMeasInfo(List filteredMeasInfos) { + this.measInfo = filteredMeasInfos; + } + + } + +} diff --git a/src/main/java/org/onap/dcaegen2/services/pmmapper/model/MeasFilterConfig.java b/src/main/java/org/onap/dcaegen2/services/pmmapper/model/MeasFilterConfig.java new file mode 100644 index 0000000..458a6cd --- /dev/null +++ b/src/main/java/org/onap/dcaegen2/services/pmmapper/model/MeasFilterConfig.java @@ -0,0 +1,53 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.dcaegen2.services.pmmapper.model; + +import java.util.List; +import com.google.gson.annotations.SerializedName; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +@Data +@EqualsAndHashCode +@NoArgsConstructor +public class MeasFilterConfig { + + @SerializedName("filters") + public List filters; + + @Data + public class Filter { + @SerializedName("pmDefVsn") + private String dictionaryVersion; + + @SerializedName("nfType") + private String nfType; + + @SerializedName("vendor") + private String vendor; + + @SerializedName("measTypes") + private List measTypes; + + } +} diff --git a/src/main/java/org/onap/dcaegen2/services/pmmapper/model/package-info.java b/src/main/java/org/onap/dcaegen2/services/pmmapper/model/package-info.java new file mode 100644 index 0000000..92c83be --- /dev/null +++ b/src/main/java/org/onap/dcaegen2/services/pmmapper/model/package-info.java @@ -0,0 +1,24 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +@XmlSchema(namespace = "http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec", elementFormDefault = XmlNsForm.QUALIFIED) +package org.onap.dcaegen2.services.pmmapper.model; +import javax.xml.bind.annotation.XmlSchema; +import javax.xml.bind.annotation.XmlNsForm; \ No newline at end of file diff --git a/src/main/java/org/onap/dcaegen2/services/pmmapper/utils/MeasConverter.java b/src/main/java/org/onap/dcaegen2/services/pmmapper/utils/MeasConverter.java new file mode 100644 index 0000000..b9c01e6 --- /dev/null +++ b/src/main/java/org/onap/dcaegen2/services/pmmapper/utils/MeasConverter.java @@ -0,0 +1,76 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2019 Nordix Foundation. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.dcaegen2.services.pmmapper.utils; + +import java.io.StringReader; +import java.io.StringWriter; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; +import javax.xml.bind.Unmarshaller; + +import org.onap.dcaegen2.services.pmmapper.exceptions.MappingException; +import org.onap.dcaegen2.services.pmmapper.model.MeasCollecFile; +import org.onap.logging.ref.slf4j.ONAPLogAdapter; +import org.slf4j.LoggerFactory; + +/** + * Converts 3GPP PM Measurement xml string to MeasCollecFil and vice versa. + **/ +public class MeasConverter { + private static final ONAPLogAdapter logger = new ONAPLogAdapter(LoggerFactory.getLogger(MeasConverter.class)); + + /** + * Converts 3GPP Measurement xml string to MeasCollecFile. + **/ + public MeasCollecFile convert(String eventBody) { + logger.unwrap().debug("Converting 3GPP xml string to MeasCollecFile"); + MeasCollecFile measCollecFile = null; + try { + JAXBContext jaxbContext = null; + jaxbContext = JAXBContext.newInstance(MeasCollecFile.class); + Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); + measCollecFile = (MeasCollecFile) unmarshaller.unmarshal(new StringReader(eventBody)); + } catch (JAXBException e) { + throw new MappingException("Unable to convert 3GPP xml to MeasCollecFile", e); + } + return measCollecFile; + } + + /** + * Converts MeasCollecFile to 3GPP Measurement xml string. + **/ + public String convert(MeasCollecFile measCollecFile) { + logger.unwrap().debug("Converting MeasCollecFile to 3GPP xml string"); + StringWriter writer = new StringWriter(); + try { + JAXBContext jaxbContext = JAXBContext.newInstance(MeasCollecFile.class); + Marshaller marshaller = jaxbContext.createMarshaller(); + marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); + marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE); + marshaller.marshal(measCollecFile, writer); + } catch (JAXBException e) { + throw new MappingException("Unable to convert MeasCollecFile to 3GPP xml", e); + } + return writer.toString(); + } +} -- cgit 1.2.3-korg