diff options
Diffstat (limited to 'src/main/resources')
-rw-r--r-- | src/main/resources/Dockerfile | 6 | ||||
-rw-r--r-- | src/main/resources/schemas/org.3GPP.28.550#measData | 131 | ||||
-rw-r--r-- | src/main/resources/schemas/org.3GPP.32.435#measCollec | 159 | ||||
-rw-r--r-- | src/main/resources/templates/org.3GPP.28.550#measData | 132 | ||||
-rw-r--r-- | src/main/resources/templates/org.3GPP.32.435#measCollec | 133 |
5 files changed, 558 insertions, 3 deletions
diff --git a/src/main/resources/Dockerfile b/src/main/resources/Dockerfile index bf59524..c4eeb2e 100644 --- a/src/main/resources/Dockerfile +++ b/src/main/resources/Dockerfile @@ -1,6 +1,6 @@ # # ============LICENSE_START======================================================= -# Copyright (C) 2019 Nordix Foundation. +# Copyright (C) 2019-2020 Nordix Foundation. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -34,8 +34,8 @@ USER pm-mapper COPY ${project.build.directory}/${ext.dep.dir.path}/ ${ext.dep.dir.path}/ COPY ${project.build.directory}/${JAR} . -COPY ${project.build.directory}/classes/mapping.ftl ./etc/mapping.ftl -COPY ${project.build.directory}/classes/measCollec_plusString.xsd ./etc/measCollec_plusString.xsd +COPY ${project.build.directory}/classes/schemas ./etc/schemas/ +COPY ${project.build.directory}/classes/templates ./etc/templates/ COPY ${project.build.directory}/classes/reconfigure.sh ./etc/reconfigure.sh COPY --chown=pm-mapper ${project.build.directory}/classes/logback.xml ./etc/logback.xml diff --git a/src/main/resources/schemas/org.3GPP.28.550#measData b/src/main/resources/schemas/org.3GPP.28.550#measData new file mode 100644 index 0000000..d3a9fef --- /dev/null +++ b/src/main/resources/schemas/org.3GPP.28.550#measData @@ -0,0 +1,131 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 3GPP TS 28.550 Measurements data XML file format definition + data file XML schema + measData.xsd +--> +<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:md="http://www.3gpp.org/ftp/specs/archive/28_series/28.550#measData" targetNamespace="http://www.3gpp.org/ftp/specs/archive/28_series/28.550#measData" elementFormDefault="qualified"> + <!-- Measurement collection data file root XML element --> + <element name="MeasDataFile"> + <complexType> + <sequence> + <element name="fileHeader"> + <complexType> + <sequence> + <element name="fileSender"> + <complexType> + <attribute name="senderName" type="string" use="optional"/> + <attribute name="senderType" type="string" use="optional"/> + </complexType> + </element> + <element name="MeasData"> + <complexType> + <attribute name="beginTime" type="dateTime" use="required"/> + </complexType> + </element> + </sequence> + <attribute name="fileFormatVersion" type="string" use="required"/> + <attribute name="vendorName" type="string" use="optional"/> + <attribute name="dnPrefix" type="string" use="optional"/> + </complexType> + </element> + <element name="measData" minOccurs="0" maxOccurs="unbounded"> + <complexType> + <sequence> + <element name="measuredEntity"> + <complexType> + <attribute name="userLabel" type="string" use="optional"/> + <attribute name="localDn" type="string" use="optional"/> + <attribute name="swVersion" type="string" use="optional"/> + </complexType> + </element> + <element name="measInfo" minOccurs="0" maxOccurs="unbounded"> + <complexType> + <sequence> + <element name="job" minOccurs="0"> + <complexType> + <attribute name="jobId" type="string" use="required"/> + </complexType> + </element> + <element name="granPeriod"> + <complexType> + <attribute name="duration" type="duration" use="required"/> + <attribute name="endTime" type="dateTime" use="required"/> + </complexType> + </element> + <element name="repPeriod" minOccurs="0"> + <complexType> + <attribute name="duration" type="duration" use="required"/> + </complexType> + </element> + <choice> + <element name="measTypes"> + <simpleType> + <list itemType="Name"/> + </simpleType> + </element> + <element name="measType" minOccurs="0" maxOccurs="unbounded"> + <complexType> + <simpleContent> + <extension base="Name"> + <attribute name="p" type="positiveInteger" use="required"/> + </extension> + </simpleContent> + </complexType> + </element> + </choice> + <element name="measValue" minOccurs="0" maxOccurs="unbounded"> + <complexType> + <sequence> + <choice> + <element name="measResults"> + <simpleType> + <list itemType="md:measResultType"/> + </simpleType> + </element> + <element name="r" minOccurs="0" maxOccurs="unbounded"> + <complexType> + <simpleContent> + <extension base="md:measResultType"> + <attribute name="p" type="positiveInteger" use="required"/> + </extension> + </simpleContent> + </complexType> + </element> + </choice> + <element name="suspect" type="boolean" minOccurs="0"/> + </sequence> + <attribute name="measObjLdn" type="string" use="required"/> + </complexType> + </element> + </sequence> + <attribute name="measInfoId" type="string" use="optional"/> + </complexType> + </element> + </sequence> + </complexType> + </element> + <element name="fileFooter"> + <complexType> + <sequence> + <element name="MeasData"> + <complexType> + <attribute name="endTime" type="dateTime" use="required"/> + </complexType> + </element> + </sequence> + </complexType> + </element> + </sequence> + </complexType> + </element> + <simpleType name="measResultType"> + <union memberTypes="integer float string"> + <simpleType> + <restriction base="string"> + <enumeration value="NULL"/> + </restriction> + </simpleType> + </union> + </simpleType> +</schema>
\ No newline at end of file diff --git a/src/main/resources/schemas/org.3GPP.32.435#measCollec b/src/main/resources/schemas/org.3GPP.32.435#measCollec new file mode 100644 index 0000000..309bcb9 --- /dev/null +++ b/src/main/resources/schemas/org.3GPP.32.435#measCollec @@ -0,0 +1,159 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + Modified PM XML file format definition to allow arbitrary string values. + Based on 3GPP TS 32.435 Performance Measurement XML file format definition + data file XML schema + measCollec.xsd +--> + +<schema + targetNamespace= + "http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec" + elementFormDefault="qualified" + xmlns="http://www.w3.org/2001/XMLSchema" + xmlns:mc= + "http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec" +> + + <!-- Measurement collection data file root XML element --> + + <element name="measCollecFile"> + <complexType> + <sequence> + <element name="fileHeader"> + <complexType> + <sequence> + <element name="fileSender"> + <complexType> + <attribute name="localDn" type="string" use="optional"/> + <attribute name="elementType" type="string" use="optional"/> + </complexType> + </element> + <element name="measCollec"> + <complexType> + <attribute name="beginTime" type="dateTime" use="required"/> + </complexType> + </element> + </sequence> + <attribute name="fileFormatVersion" type="string" use="required"/> + <attribute name="vendorName" type="string" use="optional"/> + <attribute name="dnPrefix" type="string" use="optional"/> + </complexType> + </element> + <element name="measData" minOccurs="0" maxOccurs="unbounded"> + <complexType> + <sequence> + <element name="managedElement"> + <complexType> + <attribute name="localDn" type="string" use="optional"/> + <attribute name="userLabel" type="string" use="optional"/> + <attribute name="swVersion" type="string" use="optional"/> + </complexType> + </element> + <element name="measInfo" minOccurs="0" maxOccurs="unbounded"> + <complexType> + <sequence> + <element name="job" minOccurs="0"> + <complexType> + <attribute name="jobId" type="string" use="required"/> + </complexType> + </element> + <element name="granPeriod"> + <complexType> + <attribute + name="duration" + type="duration" + use="required" + /> + <attribute + name="endTime" + type="dateTime" + use="required" + /> + </complexType> + </element> + <element name="repPeriod" minOccurs="0"> + <complexType> + <attribute name="duration" + type="duration" use="required"/> + </complexType> + </element> + <choice> + <element name="measTypes"> + <simpleType> + <list itemType="Name"/> + </simpleType> + </element> + <element name="measType" + minOccurs="0" maxOccurs="unbounded"> + <complexType> + <simpleContent> + <extension base="Name"> + <attribute name="p" + type="positiveInteger" use="required"/> + </extension> + </simpleContent> + </complexType> + </element> + </choice> + <element name="measValue" + minOccurs="0" maxOccurs="unbounded"> + <complexType> + <sequence> + <choice> + <element name="measResults"> + <simpleType> + <list itemType="mc:measResultType"/> + </simpleType> + </element> + <element name="r" + minOccurs="0" maxOccurs="unbounded"> + <complexType> + <simpleContent> + <extension base="mc:measResultType"> + <attribute name="p" type="positiveInteger" + use="required"/> + </extension> + </simpleContent> + </complexType> + </element> + </choice> + <element name="suspect" type="boolean" minOccurs="0"/> + </sequence> + <attribute name="measObjLdn" + type="string" use="required"/> + </complexType> + </element> + </sequence> + <attribute name="measInfoId" type="string" use="optional"/> + </complexType> + </element> + </sequence> + </complexType> + </element> + <element name="fileFooter"> + <complexType> + <sequence> + <element name="measCollec"> + <complexType> + <attribute name="endTime" type="dateTime" use="required"/> + </complexType> + </element> + </sequence> + </complexType> + </element> + </sequence> + </complexType> + </element> + + <!-- + Removed the 'NIL' restriction. + --> + + <simpleType name="measResultType"> + <union memberTypes="float string"> + </union> + </simpleType> + +</schema>
\ No newline at end of file diff --git a/src/main/resources/templates/org.3GPP.28.550#measData b/src/main/resources/templates/org.3GPP.28.550#measData new file mode 100644 index 0000000..653077e --- /dev/null +++ b/src/main/resources/templates/org.3GPP.28.550#measData @@ -0,0 +1,132 @@ +<#ftl> +<#-- + ============LICENSE_START======================================================= + Copyright (C) 2019-2020 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========================================================= + --> +<#compress> +<#assign fileHeader = xml.MeasDataFile.fileHeader> +<#assign fileFooter = xml.MeasDataFile.fileFooter> +<#assign measData = xml.MeasDataFile.measData> +<#setting datetime_format="iso"> +{ + "event": { + "commonEventHeader": <@commonEventHeader/> + <#if measData?has_content>, + "perf3gppFields": <@perf3gppFields/> + </#if> + } +} + + +<#macro commonEventHeader> +{ + "domain": "perf3gpp", + "eventId": "${eventId}", + "sequence": 0, + "eventName": "perf3gpp_${metadata.productName}-${metadata.vendorName}_pmMeasResult", + "sourceName": "${metadata.sourceName}", + "reportingEntityName": "", + "priority": "Normal", + "startEpochMicrosec": ${fileHeader.MeasData.@beginTime?datetime?long?c}, + "lastEpochMicrosec": ${fileFooter.MeasData.@endTime?datetime?long?c}, + "version": "4.0", + "vesEventListenerVersion": "7.1", + "timeZoneOffset": "${metadata.timeZoneOffset}" +} +</#macro> + + +<#macro measTypes measInfo> +{ + "sMeasTypesList":[ + <#if measInfo.measType?has_content> + <#list measInfo.measType as measType> + "${measType}"<#sep>,</#sep> + </#list> + <#else> + <#list measInfo.measTypes?split(" ") as measType> + "${measType}"<#sep>,</#sep> + </#list> + </#if> + ] +} +</#macro> + + +<#macro measValuesList measInfo> +[ +<#list measInfo.measValue as measValue> + { + "measObjInstId": "${measValue.@measObjLdn[0]!}", + "suspectFlag": "${measValue.suspect[0]! "false"}", + "measResults": [ + <#if measValue.r?has_content> + <#list measValue.r as r> + { + "p": ${r.@p}, + "sValue": "${r}" + }<#sep>,</#sep> + </#list> + <#else> + <#list measValue.measResults?split(" ") as r> + { + "p":${r?index+1}, + "sValue": "${r}" + }<#sep>,</#sep> + </#list> + </#if> + ] + } +<#sep>,</#sep> +</#list> +] +</#macro> + + +<#macro measInfoList> +[ +<#list measData.measInfo as measInfo> + { + "measInfoId": { + "sMeasInfoId": "${measInfo.@measInfoId[0]!}" + }, + "measTypes": <@measTypes measInfo/>, + "measValuesList": <@measValuesList measInfo/> + }<#sep>,</#sep> +</#list> +] +</#macro> + + +<#macro measDataCollection> +{ + "granularityPeriod": ${measData.measInfo.granPeriod.@endTime[0]!?datetime?long?c}, + "measuredEntityUserName": "${measData.measuredEntity.@userLabel[0]!}", + "measuredEntityDn": "${measData.measuredEntity.@localDn[0]!}", + "measuredEntitySoftwareVersion": "${measData.measuredEntity.@swVersion[0]!}", + "measInfoList": <@measInfoList/> +} +</#macro> + +<#macro perf3gppFields> +{ + "perf3gppFieldsVersion": "1.0", + "measDataCollection": <@measDataCollection/> +} +</#macro> +</#compress>
\ No newline at end of file diff --git a/src/main/resources/templates/org.3GPP.32.435#measCollec b/src/main/resources/templates/org.3GPP.32.435#measCollec new file mode 100644 index 0000000..422977e --- /dev/null +++ b/src/main/resources/templates/org.3GPP.32.435#measCollec @@ -0,0 +1,133 @@ +<#ftl> +<#-- + ============LICENSE_START======================================================= + Copyright (C) 2019-2020 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========================================================= + --> +<#compress> +<#assign fileHeader = xml.measCollecFile.fileHeader> +<#assign fileFooter = xml.measCollecFile.fileFooter> +<#assign measData = xml.measCollecFile.measData> +<#setting datetime_format="iso"> +{ + "event": { + "commonEventHeader": <@commonEventHeader/> + <#if measData?has_content>, + "perf3gppFields": <@perf3gppFields/> + </#if> + } +} + + +<#macro commonEventHeader> +{ + "domain": "perf3gpp", + "eventId": "${eventId}", + "sequence": 0, + "eventName": "perf3gpp_${metadata.productName}-${metadata.vendorName}_pmMeasResult", + "sourceName": "${metadata.sourceName}", + "reportingEntityName": "", + "priority": "Normal", + "startEpochMicrosec": ${fileHeader.measCollec.@beginTime?datetime?long?c}, + "lastEpochMicrosec": ${fileFooter.measCollec.@endTime?datetime?long?c}, + "version": "4.0", + "vesEventListenerVersion": "7.1", + "timeZoneOffset": "${metadata.timeZoneOffset}" +} +</#macro> + + +<#macro measTypes measInfo> +{ + "sMeasTypesList":[ + <#if measInfo.measType?has_content> + <#list measInfo.measType as measType> + "${measType}"<#sep>,</#sep> + </#list> + <#else> + <#list measInfo.measTypes?split(" ") as measType> + "${measType}"<#sep>,</#sep> + </#list> + </#if> + ] +} +</#macro> + + +<#macro measValuesList measInfo> +[ +<#list measInfo.measValue as measValue> + { + "measObjInstId": "${measValue.@measObjLdn[0]!}", + "suspectFlag": "${measValue.suspect[0]! "false"}", + "measResults": [ + <#if measValue.r?has_content> + <#list measValue.r as r> + { + "p": ${r.@p}, + "sValue": "${r}" + }<#sep>,</#sep> + </#list> + <#else> + <#list measValue.measResults?split(" ") as r> + { + "p":${r?index+1}, + "sValue": "${r}" + }<#sep>,</#sep> + </#list> + </#if> + ] + } +<#sep>,</#sep> +</#list> +] +</#macro> + + +<#macro measInfoList> +[ +<#list measData.measInfo as measInfo> + { + "measInfoId": { + "sMeasInfoId": "${measInfo.@measInfoId[0]!}" + }, + "measTypes": <@measTypes measInfo/>, + "measValuesList": <@measValuesList measInfo/> + }<#sep>,</#sep> +</#list> +] +</#macro> + + +<#macro measDataCollection> +{ + "granularityPeriod": ${measData.measInfo.granPeriod.@endTime[0]!?datetime?long?c}, + "measuredEntityUserName": "${measData.managedElement.@userLabel[0]!}", + "measuredEntityDn": "${measData.managedElement.@localDn[0]!}", + "measuredEntitySoftwareVersion": "${measData.managedElement.@swVersion[0]!}", + "measInfoList": <@measInfoList/> +} +</#macro> + + +<#macro perf3gppFields> +{ + "perf3gppFieldsVersion": "1.0", + "measDataCollection": <@measDataCollection/> +} +</#macro> +</#compress>
\ No newline at end of file |