Reduce technical debt 84/93684/5
authorJoeOLeary <joseph.o.leary@est.tech>
Wed, 21 Aug 2019 11:48:37 +0000 (11:48 +0000)
committerJoeOLeary <joseph.o.leary@est.tech>
Wed, 21 Aug 2019 11:48:37 +0000 (11:48 +0000)
* Improve code coverage
* Remove sonar smells

Issue-ID: DCAEGEN2-1731
Change-Id: Iefc7c18dc9daf1d60a498db4c4c5660d8acca779
Signed-off-by: JoeOLeary <joseph.o.leary@est.tech>
25 files changed:
src/main/java/org/onap/dcaegen2/services/pmmapper/App.java
src/main/java/org/onap/dcaegen2/services/pmmapper/config/ConfigHandler.java
src/main/java/org/onap/dcaegen2/services/pmmapper/config/DynamicConfiguration.java
src/main/java/org/onap/dcaegen2/services/pmmapper/datarouter/DeliveryHandler.java
src/main/java/org/onap/dcaegen2/services/pmmapper/exceptions/CBSServerError.java
src/main/java/org/onap/dcaegen2/services/pmmapper/exceptions/MapperConfigException.java
src/main/java/org/onap/dcaegen2/services/pmmapper/exceptions/RequestFailure.java [moved from src/main/java/org/onap/dcaegen2/services/pmmapper/exceptions/TooManyTriesException.java with 81% similarity]
src/main/java/org/onap/dcaegen2/services/pmmapper/exceptions/ServerResponseException.java
src/main/java/org/onap/dcaegen2/services/pmmapper/filtering/MeasFilterHandler.java
src/main/java/org/onap/dcaegen2/services/pmmapper/healthcheck/HealthCheckHandler.java
src/main/java/org/onap/dcaegen2/services/pmmapper/messagerouter/VESPublisher.java
src/main/java/org/onap/dcaegen2/services/pmmapper/model/MeasCollecFile.java
src/main/java/org/onap/dcaegen2/services/pmmapper/model/ServerHandler.java [new file with mode: 0644]
src/main/java/org/onap/dcaegen2/services/pmmapper/utils/MeasSplitter.java
src/main/java/org/onap/dcaegen2/services/pmmapper/utils/RequestSender.java
src/test/java/org/onap/dcaegen2/pmmapper/messagerouter/VESPublisherTest.java
src/test/java/org/onap/dcaegen2/services/pmmapper/AppTest.java
src/test/java/org/onap/dcaegen2/services/pmmapper/config/ConfigHandlerTests.java
src/test/java/org/onap/dcaegen2/services/pmmapper/filtering/MeasFilterHandlerTest.java
src/test/java/org/onap/dcaegen2/services/pmmapper/mapping/MapperTest.java
src/test/java/org/onap/dcaegen2/services/pmmapper/utils/MeasSplitterTest.java
src/test/java/org/onap/dcaegen2/services/pmmapper/utils/RequestSenderTests.java
src/test/java/utils/EventUtils.java
src/test/resources/filter_test/meas_type_and_r_filtered.xml
src/test/resources/filter_test/meas_type_and_r_manyInfo_filtered.xml

index 11a91f8..fdb4ee4 100644 (file)
 package org.onap.dcaegen2.services.pmmapper;
 
 import ch.qos.logback.classic.util.ContextInitializer;
-import io.undertow.Handlers;
 import io.undertow.Undertow;
+import io.undertow.server.RoutingHandler;
 import io.undertow.util.StatusCodes;
 
+import java.util.Arrays;
+import lombok.Data;
 import lombok.NonNull;
 import org.onap.dcaegen2.services.pmmapper.config.ConfigHandler;
-import org.onap.dcaegen2.services.pmmapper.config.Configurable;
 import org.onap.dcaegen2.services.pmmapper.config.DynamicConfiguration;
 import org.onap.dcaegen2.services.pmmapper.datarouter.DeliveryHandler;
 import org.onap.dcaegen2.services.pmmapper.exceptions.CBSServerError;
@@ -41,6 +42,7 @@ import org.onap.dcaegen2.services.pmmapper.messagerouter.VESPublisher;
 import org.onap.dcaegen2.services.pmmapper.model.Event;
 import org.onap.dcaegen2.services.pmmapper.model.MapperConfig;
 import org.onap.dcaegen2.services.pmmapper.healthcheck.HealthCheckHandler;
+import org.onap.dcaegen2.services.pmmapper.model.ServerHandler;
 import org.onap.dcaegen2.services.pmmapper.ssl.SSLContextFactory;
 import org.onap.dcaegen2.services.pmmapper.utils.DataRouterUtils;
 import org.onap.dcaegen2.services.pmmapper.utils.MeasConverter;
@@ -60,65 +62,121 @@ import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.List;
 
+@Data
 public class App {
-
     static {
         System.setProperty(ContextInitializer.CONFIG_FILE_PROPERTY, "/opt/app/pm-mapper/etc/logback.xml");
     }
 
     private static final ONAPLogAdapter logger = new ONAPLogAdapter(LoggerFactory.getLogger(App.class));
+    private static final int HTTP_PORT = 8081;
+    private static final int HTTPS_PORT = 8443;
     private static Path mappingTemplate = Paths.get("/opt/app/pm-mapper/etc/mapping.ftl");
     private static Path xmlSchema = Paths.get("/opt/app/pm-mapper/etc/measCollec_plusString.xsd");
-    private static FluxSink<Event> fluxSink;
-
-    public static void main(String[] args) throws EnvironmentConfigException, CBSServerError, MapperConfigException, IOException {
-        Flux<Event> flux = Flux.create(eventFluxSink -> fluxSink = eventFluxSink);
-        HealthCheckHandler healthCheckHandler = new HealthCheckHandler();
-        MapperConfig mapperConfig = new ConfigHandler().getMapperConfig();
-        MetadataFilter metadataFilter = new MetadataFilter(mapperConfig);
-        MeasConverter measConverter = new MeasConverter();
-        MeasFilterHandler filterHandler = new MeasFilterHandler(measConverter);
-        Mapper mapper = new Mapper(mappingTemplate, measConverter);
-        MeasSplitter splitter = new MeasSplitter(measConverter);
-        XMLValidator validator = new XMLValidator(xmlSchema);
-        VESPublisher vesPublisher = new VESPublisher(mapperConfig);
-
-        flux.onBackpressureDrop(App::handleBackPressure)
+
+    private MapperConfig mapperConfig;
+    private MetadataFilter metadataFilter;
+    private MeasConverter measConverter;
+    private MeasFilterHandler filterHandler;
+    private Mapper mapper;
+    private MeasSplitter splitter;
+    private XMLValidator validator;
+    private VESPublisher vesPublisher;
+    private DeliveryHandler deliveryHandler;
+    private DynamicConfiguration dynamicConfiguration;
+    private HealthCheckHandler healthCheckHandler;
+    private int httpPort;
+    private int httpsPort;
+
+    private Undertow applicationServer;
+    private List<ServerHandler> serverHandlers;
+    private Flux<Event> flux;
+    private FluxSink<Event> fluxSink;
+
+    /**
+     * Creates an instance of the application.
+     * @param mappingTemplate path to template used to convert xml to VES.
+     * @param xmlSchema path to schema used to verify incoming XML will work with template.
+     * @param httpPort http port to start http server on.
+     * @param httpsPort https port to start https server on.
+     * @param configHandler instance of the ConfigurationHandler used to acquire config.
+     */
+    public App(Path mappingTemplate, Path xmlSchema, int httpPort, int httpsPort, ConfigHandler configHandler) {
+        try {
+            this.mapperConfig = configHandler.getMapperConfig();
+        } catch (EnvironmentConfigException | CBSServerError | MapperConfigException e) {
+            logger.unwrap().error("Failed to acquire initial configuration, Application cannot start", e);
+            throw new IllegalStateException("Config acquisition failed");
+        }
+        this.httpPort = httpPort;
+        this.httpsPort = httpsPort;
+        this.metadataFilter = new MetadataFilter(mapperConfig);
+        this.measConverter = new MeasConverter();
+        this.filterHandler = new MeasFilterHandler(measConverter);
+        this.mapper = new Mapper(mappingTemplate, this.measConverter);
+        this.splitter =  new MeasSplitter(measConverter);
+        this.validator = new XMLValidator(xmlSchema);
+        this.vesPublisher = new VESPublisher(mapperConfig);
+        this.flux = Flux.create(eventFluxSink -> this.fluxSink = eventFluxSink);
+
+        this.flux.onBackpressureDrop(App::handleBackPressure)
                 .doOnNext(App::receiveRequest)
                 .limitRate(1)
                 .parallel()
                 .runOn(Schedulers.newParallel(""), 1)
                 .doOnNext(event -> MDC.setContextMap(event.getMdc()))
-                .filter(metadataFilter::filter)
-                .filter(event -> App.filterByFileType(filterHandler, event, mapperConfig))
-                .filter(event -> App.validate(validator, event, mapperConfig))
-                .concatMap(event -> App.split(splitter,event, mapperConfig))
-                .filter(events -> App.filter(filterHandler, events, mapperConfig))
-                .concatMap(events -> App.map(mapper, events, mapperConfig))
-                .concatMap(vesPublisher::publish)
-                .subscribe(event -> App.sendEventProcessed(mapperConfig, event));
-
-        DeliveryHandler deliveryHandler = new DeliveryHandler(fluxSink::next);
-        ArrayList<Configurable> configurables = new ArrayList<>();
-        configurables.add(mapperConfig);
-        DynamicConfiguration dynamicConfiguration = new DynamicConfiguration(configurables, mapperConfig);
+                .filter(this.metadataFilter::filter)
+                .filter(event -> App.filterByFileType(this.filterHandler, event, this.mapperConfig))
+                .filter(event -> App.validate(this.validator, event, this.mapperConfig))
+                .concatMap(event -> App.split(this.splitter,event, this.mapperConfig))
+                .filter(events -> App.filter(this.filterHandler, events, this.mapperConfig))
+                .concatMap(events -> App.map(this.mapper, events, this.mapperConfig))
+                .concatMap(this.vesPublisher::publish)
+                .subscribe(event -> App.sendEventProcessed(this.mapperConfig, event));
 
-        Undertow.Builder builder = Undertow.builder();
+        this.healthCheckHandler = new HealthCheckHandler();
+        this.deliveryHandler = new DeliveryHandler(fluxSink::next);
+        this.dynamicConfiguration = new DynamicConfiguration(Arrays.asList(mapperConfig), mapperConfig);
+        this.serverHandlers = Arrays.asList(healthCheckHandler, deliveryHandler, dynamicConfiguration);
+        try {
+            this.applicationServer = server(this.mapperConfig, this.serverHandlers);
+        } catch (IOException e) {
+            logger.unwrap().error("Failed to create server instance.", e);
+            throw new IllegalStateException("Server instantiation failed");
+        }
+    }
 
-        SSLContextFactory sslContextFactory = new SSLContextFactory(mapperConfig);
-        SSLContext sslContext = sslContextFactory.createSSLContext(mapperConfig);
-        SSLContext.setDefault(sslContext);
+    /**
+     * Starts the application server.
+     */
+    public void start() {
+        this.applicationServer.start();
+    }
+
+    /**
+     * Stops the application server.
+     */
+    public void stop() {
+        this.applicationServer.stop();
+    }
 
-        if(mapperConfig.getEnableHttp()) {
-            builder.addHttpListener(8081, "0.0.0.0");
+    private Undertow server(MapperConfig config, List<ServerHandler> serverHandlers) throws IOException {
+        SSLContextFactory sslContextFactory = new SSLContextFactory(config);
+        SSLContext sslContext = sslContextFactory.createSSLContext(config);
+        SSLContext.setDefault(sslContext);
+        Undertow.Builder builder = Undertow.builder();
+        if (config.getEnableHttp()) {
+            builder.addHttpListener(this.httpPort, "0.0.0.0");
         }
+        RoutingHandler routes = new RoutingHandler();
+        serverHandlers.forEach(handler -> routes.add(handler.getMethod(), handler.getTemplate(), handler.getHandler()));
+        return builder.addHttpsListener(this.httpsPort, "0.0.0.0", sslContext)
+                .setHandler(routes)
+                .build();
+    }
 
-        builder.addHttpsListener(8443, "0.0.0.0", sslContext)
-                .setHandler(Handlers.routing()
-                        .add("put", "/delivery/{filename}", deliveryHandler)
-                        .add("get", "/healthcheck", healthCheckHandler)
-                        .add("get", "/reconfigure", dynamicConfiguration))
-                .build().start();
+    public static void main(String[] args) {
+        new App(mappingTemplate, xmlSchema, HTTP_PORT, HTTPS_PORT, new ConfigHandler()).start();
     }
 
     public static boolean filterByFileType(MeasFilterHandler filterHandler,Event event, MapperConfig config) {
index fef1d19..273c953 100644 (file)
@@ -63,11 +63,8 @@ public class ConfigHandler {
      * Retrieves PM-Mapper Configuration from DCAE's ConfigBinding Service.
      *
      * @throws EnvironmentConfigException
-     * @throws CBSServerError
-     * @throws MapperConfigException
      */
-    public MapperConfig getMapperConfig() throws EnvironmentConfigException,
-            CBSServerError, MapperConfigException {
+    public MapperConfig getMapperConfig() throws EnvironmentConfigException {
         String mapperConfigJson = "";
         String cbsSocketAddress = this.environmentConfig.getCBSHostName() + ":" + this.environmentConfig.getCBSPort();
         String requestURL = "http://" + cbsSocketAddress + "/service_component/" + this.environmentConfig.getServiceName();
@@ -84,7 +81,7 @@ public class ConfigHandler {
         return convertMapperConfigToObject(mapperConfigJson);
     }
 
-    private MapperConfig convertMapperConfigToObject(String mapperConfigJson) throws MapperConfigException {
+    private MapperConfig convertMapperConfigToObject(String mapperConfigJson) {
         MapperConfig mapperConfig;
         try {
             JsonObject config = new Gson().fromJson(mapperConfigJson, JsonObject.class);
index 7e2c894..4516183 100644 (file)
@@ -27,13 +27,16 @@ import java.util.List;
 import lombok.Data;
 import org.onap.dcaegen2.services.pmmapper.exceptions.ReconfigurationException;
 import org.onap.dcaegen2.services.pmmapper.model.MapperConfig;
+import org.onap.dcaegen2.services.pmmapper.model.ServerHandler;
 import org.onap.dcaegen2.services.pmmapper.utils.HttpServerExchangeAdapter;
 import org.onap.logging.ref.slf4j.ONAPLogAdapter;
 import org.slf4j.LoggerFactory;
 
 @Data
-public class DynamicConfiguration implements HttpHandler {
+public class DynamicConfiguration implements HttpHandler, ServerHandler {
     private static final ONAPLogAdapter logger = new ONAPLogAdapter(LoggerFactory.getLogger(DynamicConfiguration.class));
+    private static final String METHOD = "get";
+    private static final String ENDPOINT_TEMPLATE = "/reconfigure";
     private List<Configurable> configurables;
     private MapperConfig originalConfig;
     private ConfigHandler configHandler;
@@ -87,4 +90,19 @@ public class DynamicConfiguration implements HttpHandler {
             logger.exiting();
         }
     }
+
+    @Override
+    public String getMethod() {
+        return METHOD;
+    }
+
+    @Override
+    public String getTemplate() {
+        return ENDPOINT_TEMPLATE;
+    }
+
+    @Override
+    public HttpHandler getHandler() {
+        return this;
+    }
 }
index 4d6af29..ba218cb 100644 (file)
@@ -34,6 +34,7 @@ import io.undertow.server.HttpHandler;
 import io.undertow.server.HttpServerExchange;
 import io.undertow.util.StatusCodes;
 
+import org.onap.dcaegen2.services.pmmapper.model.ServerHandler;
 import org.onap.dcaegen2.services.pmmapper.utils.HttpServerExchangeAdapter;
 import org.onap.dcaegen2.services.pmmapper.utils.RequiredFieldDeserializer;
 import org.onap.logging.ref.slf4j.ONAPLogAdapter;
@@ -47,7 +48,7 @@ import java.util.Optional;
  * Provides an undertow HttpHandler to be used as an endpoint for data router to send events to.
  */
 @Data
-public class DeliveryHandler implements HttpHandler {
+public class DeliveryHandler implements HttpHandler, ServerHandler {
 
     public static final String METADATA_HEADER = "X-DMAAP-DR-META";
     public static final String PUB_ID_HEADER = "X-DMAAP-DR-PUBLISH-ID";
@@ -56,6 +57,8 @@ public class DeliveryHandler implements HttpHandler {
 
     private static final String BAD_METADATA_MESSAGE = "Malformed Metadata.";
     private static final String NO_METADATA_MESSAGE = "Missing Metadata.";
+    private static final String METHOD = "put";
+    private static final String ENDPOINT_TEMPLATE = "/delivery/{filename}";
 
     private Gson metadataBuilder;
 
@@ -116,4 +119,19 @@ public class DeliveryHandler implements HttpHandler {
             logger.exiting();
         }
     }
+
+    @Override
+    public String getMethod() {
+        return METHOD;
+    }
+
+    @Override
+    public String getTemplate() {
+        return ENDPOINT_TEMPLATE;
+    }
+
+    @Override
+    public HttpHandler getHandler() {
+        return this;
+    }
 }
index 787d21f..58262ba 100644 (file)
@@ -19,7 +19,7 @@
  */\r
 package org.onap.dcaegen2.services.pmmapper.exceptions;\r
 \r
-public class CBSServerError extends Exception {\r
+public class CBSServerError extends RuntimeException {\r
     public CBSServerError(String message, Throwable cause) {\r
         super(message, cause);\r
     }\r
index e78da98..4669871 100644 (file)
@@ -19,7 +19,7 @@
  */\r
 package org.onap.dcaegen2.services.pmmapper.exceptions;\r
 \r
-public class MapperConfigException extends Exception {\r
+public class MapperConfigException extends RuntimeException {\r
     public MapperConfigException(String message, Throwable cause) {\r
         super(message, cause);\r
     }\r
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.dcaegen2.services.pmmapper.exceptions;
 
-/**
- * Exception indicates that a task has been attempted too many times.
- */
-public class TooManyTriesException extends Exception {
-    public TooManyTriesException(String errorMessage){
-        super(errorMessage);
+public class RequestFailure extends RuntimeException {
+    public RequestFailure(Throwable cause) {
+        super(cause);
     }
 }
index b52e2d4..a392bb5 100644 (file)
@@ -20,7 +20,7 @@
 
 package org.onap.dcaegen2.services.pmmapper.exceptions;
 
-public class ServerResponseException extends Exception {
+public class ServerResponseException extends RuntimeException {
     public ServerResponseException(String message, Throwable cause) {
         super(message, cause);
     }
index 0438530..562f46c 100644 (file)
@@ -57,12 +57,12 @@ public class MeasFilterHandler {
         Optional<Filter> filter = Optional.ofNullable(event.getFilter());
         MeasCollecFile measCollecFile = event.getMeasCollecFile();
 
-        if(hasNoFilters(filter)) {
+        if (hasNoFilters(filter)) {
             logger.unwrap().info("Skipping filtering by measTypes as filter config does not contain measTypes.");
             return true;
         }
 
-        if(measCollecFile.getMeasData().isEmpty()) {
+        if (measCollecFile.getMeasData().isEmpty()) {
             logger.unwrap().info("Measurement file will not be processed further as MeasData is empty.");
             return false;
         }
@@ -72,13 +72,12 @@ public class MeasFilterHandler {
         List<MeasInfo> measInfos = measData.getMeasInfo();
         List<MeasInfo> filteredMeasInfos = new ArrayList<>();
 
-        for (int i = 0; i < measInfos.size(); i++) {
-            MeasInfo currentMeasInfo = measInfos.get(i);
+        for (MeasInfo currentMeasInfo : measInfos) {
             List<String> measTypesNode = currentMeasInfo.getMeasTypes();
-            if(!measTypesNode.isEmpty()) {
-                setMeasInfosFromMeasTypes(currentMeasInfo,filteredMeasInfos, filter.get());
-            }else {
-                setMeasInfoFromMeasType(currentMeasInfo,filteredMeasInfos, filter.get());
+            if (measTypesNode != null && !measTypesNode.isEmpty()) {
+                setMeasInfosFromMeasTypes(currentMeasInfo, filteredMeasInfos, filter.get());
+            } else {
+                setMeasInfoFromMeasType(currentMeasInfo, filteredMeasInfos, filter.get());
             }
         }
 
index 70a9596..ddf55c7 100644 (file)
@@ -22,6 +22,7 @@
 
 package org.onap.dcaegen2.services.pmmapper.healthcheck;
 
+import org.onap.dcaegen2.services.pmmapper.model.ServerHandler;
 import org.onap.dcaegen2.services.pmmapper.utils.HttpServerExchangeAdapter;
 import org.onap.logging.ref.slf4j.ONAPLogAdapter;
 import org.slf4j.LoggerFactory;
@@ -30,8 +31,11 @@ import io.undertow.server.HttpHandler;
 import io.undertow.server.HttpServerExchange;
 import io.undertow.util.StatusCodes;
 
-public class HealthCheckHandler implements HttpHandler {
+public class HealthCheckHandler implements HttpHandler, ServerHandler {
     private static final ONAPLogAdapter logger = new ONAPLogAdapter(LoggerFactory.getLogger(HealthCheckHandler.class));
+    private static final String METHOD = "get";
+    private static final String ENDPOINT_TEMPLATE = "/healthcheck";
+
     @Override
     public void handleRequest(HttpServerExchange exchange) {
         try {
@@ -45,4 +49,18 @@ public class HealthCheckHandler implements HttpHandler {
         }
     }
 
+    @Override
+    public String getMethod() {
+        return METHOD;
+    }
+
+    @Override
+    public String getTemplate() {
+        return ENDPOINT_TEMPLATE;
+    }
+
+    @Override
+    public HttpHandler getHandler() {
+        return this;
+    }
 }
index 744696a..6aaf1d6 100644 (file)
@@ -53,8 +53,8 @@ public class VESPublisher {
         try {\r
             events.forEach(e -> this.publish(e.getVes()));\r
             logger.unwrap().info("Successfully published VES events to messagerouter.");\r
-        } catch(MRPublisherException e) {\r
-            logger.unwrap().error("Failed to publish VES event(s) to messagerouter. {}", e.getMessage());\r
+        } catch (MRPublisherException e) {\r
+            logger.unwrap().error("Failed to publish VES event(s) to messagerouter.", e);\r
             return Flux.empty();\r
         }\r
         return Flux.just(event);\r
index 6e9e254..cc6ca0f 100644 (file)
  * SPDX-License-Identifier: Apache-2.0\r
  * ============LICENSE_END=========================================================\r
  */\r
+\r
 package org.onap.dcaegen2.services.pmmapper.model;\r
 \r
 import java.math.BigInteger;\r
-import java.util.ArrayList;\r
 import java.util.List;\r
 \r
 import javax.xml.bind.annotation.XmlAccessType;\r
@@ -36,183 +36,8 @@ import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;\r
 import javax.xml.datatype.Duration;\r
 import javax.xml.datatype.XMLGregorianCalendar;\r
+import lombok.Data;\r
 \r
-/**\r
- * <p>\r
- * Generated Java class using XJC to represent 3GPP PM Measurement file\r
- *\r
- * <p>\r
- * The following schema fragment specifies the expected content contained within\r
- * this class.\r
- *\r
- * <pre>\r
- * &lt;complexType>\r
- *   &lt;complexContent>\r
- *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
- *       &lt;sequence>\r
- *         &lt;element name="fileHeader">\r
- *           &lt;complexType>\r
- *             &lt;complexContent>\r
- *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
- *                 &lt;sequence>\r
- *                   &lt;element name="fileSender">\r
- *                     &lt;complexType>\r
- *                       &lt;complexContent>\r
- *                         &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
- *                           &lt;attribute name="localDn" type="{http://www.w3.org/2001/XMLSchema}string" />\r
- *                           &lt;attribute name="elementType" type="{http://www.w3.org/2001/XMLSchema}string" />\r
- *                         &lt;/restriction>\r
- *                       &lt;/complexContent>\r
- *                     &lt;/complexType>\r
- *                   &lt;/element>\r
- *                   &lt;element name="measCollec">\r
- *                     &lt;complexType>\r
- *                       &lt;complexContent>\r
- *                         &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
- *                           &lt;attribute name="beginTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />\r
- *                         &lt;/restriction>\r
- *                       &lt;/complexContent>\r
- *                     &lt;/complexType>\r
- *                   &lt;/element>\r
- *                 &lt;/sequence>\r
- *                 &lt;attribute name="fileFormatVersion" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />\r
- *                 &lt;attribute name="vendorName" type="{http://www.w3.org/2001/XMLSchema}string" />\r
- *                 &lt;attribute name="dnPrefix" type="{http://www.w3.org/2001/XMLSchema}string" />\r
- *               &lt;/restriction>\r
- *             &lt;/complexContent>\r
- *           &lt;/complexType>\r
- *         &lt;/element>\r
- *         &lt;element name="measData" maxOccurs="unbounded" minOccurs="0">\r
- *           &lt;complexType>\r
- *             &lt;complexContent>\r
- *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
- *                 &lt;sequence>\r
- *                   &lt;element name="managedElement">\r
- *                     &lt;complexType>\r
- *                       &lt;complexContent>\r
- *                         &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
- *                           &lt;attribute name="localDn" type="{http://www.w3.org/2001/XMLSchema}string" />\r
- *                           &lt;attribute name="userLabel" type="{http://www.w3.org/2001/XMLSchema}string" />\r
- *                           &lt;attribute name="swVersion" type="{http://www.w3.org/2001/XMLSchema}string" />\r
- *                         &lt;/restriction>\r
- *                       &lt;/complexContent>\r
- *                     &lt;/complexType>\r
- *                   &lt;/element>\r
- *                   &lt;element name="measInfo" maxOccurs="unbounded" minOccurs="0">\r
- *                     &lt;complexType>\r
- *                       &lt;complexContent>\r
- *                         &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
- *                           &lt;sequence>\r
- *                             &lt;element name="job" minOccurs="0">\r
- *                               &lt;complexType>\r
- *                                 &lt;complexContent>\r
- *                                   &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
- *                                     &lt;attribute name="jobId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />\r
- *                                   &lt;/restriction>\r
- *                                 &lt;/complexContent>\r
- *                               &lt;/complexType>\r
- *                             &lt;/element>\r
- *                             &lt;element name="granPeriod">\r
- *                               &lt;complexType>\r
- *                                 &lt;complexContent>\r
- *                                   &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
- *                                     &lt;attribute name="duration" use="required" type="{http://www.w3.org/2001/XMLSchema}duration" />\r
- *                                     &lt;attribute name="endTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />\r
- *                                   &lt;/restriction>\r
- *                                 &lt;/complexContent>\r
- *                               &lt;/complexType>\r
- *                             &lt;/element>\r
- *                             &lt;element name="repPeriod" minOccurs="0">\r
- *                               &lt;complexType>\r
- *                                 &lt;complexContent>\r
- *                                   &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
- *                                     &lt;attribute name="duration" use="required" type="{http://www.w3.org/2001/XMLSchema}duration" />\r
- *                                   &lt;/restriction>\r
- *                                 &lt;/complexContent>\r
- *                               &lt;/complexType>\r
- *                             &lt;/element>\r
- *                             &lt;choice>\r
- *                               &lt;element name="measTypes">\r
- *                                 &lt;simpleType>\r
- *                                   &lt;list itemType="{http://www.w3.org/2001/XMLSchema}Name" />\r
- *                                 &lt;/simpleType>\r
- *                               &lt;/element>\r
- *                               &lt;element name="measType" maxOccurs="unbounded" minOccurs="0">\r
- *                                 &lt;complexType>\r
- *                                   &lt;simpleContent>\r
- *                                     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>Name">\r
- *                                       &lt;attribute name="p" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />\r
- *                                     &lt;/extension>\r
- *                                   &lt;/simpleContent>\r
- *                                 &lt;/complexType>\r
- *                               &lt;/element>\r
- *                             &lt;/choice>\r
- *                             &lt;element name="measValue" maxOccurs="unbounded" minOccurs="0">\r
- *                               &lt;complexType>\r
- *                                 &lt;complexContent>\r
- *                                   &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
- *                                     &lt;sequence>\r
- *                                       &lt;choice>\r
- *                                         &lt;element name="measResults">\r
- *                                           &lt;simpleType>\r
- *                                             &lt;list itemType="{http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec}measResultType" />\r
- *                                           &lt;/simpleType>\r
- *                                         &lt;/element>\r
- *                                         &lt;element name="r" maxOccurs="unbounded" minOccurs="0">\r
- *                                           &lt;complexType>\r
- *                                             &lt;simpleContent>\r
- *                                               &lt;extension base="&lt;http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec>measResultType">\r
- *                                                 &lt;attribute name="p" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />\r
- *                                               &lt;/extension>\r
- *                                             &lt;/simpleContent>\r
- *                                           &lt;/complexType>\r
- *                                         &lt;/element>\r
- *                                       &lt;/choice>\r
- *                                       &lt;element name="suspect" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>\r
- *                                     &lt;/sequence>\r
- *                                     &lt;attribute name="measObjLdn" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />\r
- *                                   &lt;/restriction>\r
- *                                 &lt;/complexContent>\r
- *                               &lt;/complexType>\r
- *                             &lt;/element>\r
- *                           &lt;/sequence>\r
- *                           &lt;attribute name="measInfoId" type="{http://www.w3.org/2001/XMLSchema}string" />\r
- *                         &lt;/restriction>\r
- *                       &lt;/complexContent>\r
- *                     &lt;/complexType>\r
- *                   &lt;/element>\r
- *                 &lt;/sequence>\r
- *               &lt;/restriction>\r
- *             &lt;/complexContent>\r
- *           &lt;/complexType>\r
- *         &lt;/element>\r
- *         &lt;element name="fileFooter">\r
- *           &lt;complexType>\r
- *             &lt;complexContent>\r
- *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
- *                 &lt;sequence>\r
- *                   &lt;element name="measCollec">\r
- *                     &lt;complexType>\r
- *                       &lt;complexContent>\r
- *                         &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
- *                           &lt;attribute name="endTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />\r
- *                         &lt;/restriction>\r
- *                       &lt;/complexContent>\r
- *                     &lt;/complexType>\r
- *                   &lt;/element>\r
- *                 &lt;/sequence>\r
- *               &lt;/restriction>\r
- *             &lt;/complexContent>\r
- *           &lt;/complexType>\r
- *         &lt;/element>\r
- *       &lt;/sequence>\r
- *     &lt;/restriction>\r
- *   &lt;/complexContent>\r
- * &lt;/complexType>\r
- * </pre>\r
- *\r
- *\r
- */\r
 @XmlAccessorType(XmlAccessType.FIELD)\r
 @XmlType(name = "", propOrder = {\r
     "fileHeader",\r
@@ -220,6 +45,7 @@ import javax.xml.datatype.XMLGregorianCalendar;
     "fileFooter"\r
 })\r
 @XmlRootElement(name = "measCollecFile")\r
+@Data\r
 public class MeasCollecFile {\r
 \r
     @XmlElement(required = true)\r
@@ -227,247 +53,34 @@ public class MeasCollecFile {
     protected List<MeasCollecFile.MeasData> measData;\r
     @XmlElement(required = true)\r
     protected MeasCollecFile.FileFooter fileFooter;\r
-\r
-    /**\r
-     * Gets the value of the fileHeader property.\r
-     *\r
-     * @return\r
-     *     possible object is\r
-     *     {@link MeasCollecFile.FileHeader }\r
-     *\r
-     */\r
-    public MeasCollecFile.FileHeader getFileHeader() {\r
-        return fileHeader;\r
-    }\r
-\r
-    /**\r
-     * Sets the value of the fileHeader property.\r
-     *\r
-     * @param value\r
-     *     allowed object is\r
-     *     {@link MeasCollecFile.FileHeader }\r
-     *\r
-     */\r
-    public void setFileHeader(MeasCollecFile.FileHeader value) {\r
-        this.fileHeader = value;\r
-    }\r
-\r
-    /**\r
-     * Gets the value of the measData property.\r
-     *\r
-     * <p>\r
-     * This accessor method returns a reference to the live list,\r
-     * not a snapshot. Therefore any modification you make to the\r
-     * returned list will be present inside the JAXB object.\r
-     * This is why there is not a <CODE>set</CODE> method for the measData property.\r
-     *\r
-     * <p>\r
-     * For example, to add a new item, do as follows:\r
-     * <pre>\r
-     *    getMeasData().add(newItem);\r
-     * </pre>\r
-     *\r
-     *\r
-     * <p>\r
-     * Objects of the following type(s) are allowed in the list\r
-     * {@link MeasCollecFile.MeasData }\r
-     *\r
-     *\r
-     */\r
-    public List<MeasCollecFile.MeasData> getMeasData() {\r
-        if (measData == null) {\r
-            measData = new ArrayList<MeasCollecFile.MeasData>();\r
-        }\r
-        return this.measData;\r
-    }\r
-\r
-    /**\r
-     * Gets the value of the fileFooter property.\r
-     *\r
-     * @return\r
-     *     possible object is\r
-     *     {@link MeasCollecFile.FileFooter }\r
-     *\r
-     */\r
-    public MeasCollecFile.FileFooter getFileFooter() {\r
-        return fileFooter;\r
-    }\r
-\r
-    /**\r
-     * Sets the value of the fileFooter property.\r
-     *\r
-     * @param value\r
-     *     allowed object is\r
-     *     {@link MeasCollecFile.FileFooter }\r
-     *\r
-     */\r
-    public void setFileFooter(MeasCollecFile.FileFooter value) {\r
-        this.fileFooter = value;\r
-    }\r
-\r
-\r
-    /**\r
-     * <p>Java class for anonymous complex type.\r
-     *\r
-     * <p>The following schema fragment specifies the expected content contained within this class.\r
-     *\r
-     * <pre>\r
-     * &lt;complexType>\r
-     *   &lt;complexContent>\r
-     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
-     *       &lt;sequence>\r
-     *         &lt;element name="measCollec">\r
-     *           &lt;complexType>\r
-     *             &lt;complexContent>\r
-     *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
-     *                 &lt;attribute name="endTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />\r
-     *               &lt;/restriction>\r
-     *             &lt;/complexContent>\r
-     *           &lt;/complexType>\r
-     *         &lt;/element>\r
-     *       &lt;/sequence>\r
-     *     &lt;/restriction>\r
-     *   &lt;/complexContent>\r
-     * &lt;/complexType>\r
-     * </pre>\r
-     *\r
-     *\r
-     */\r
     @XmlAccessorType(XmlAccessType.FIELD)\r
     @XmlType(name = "", propOrder = {\r
         "measCollec"\r
     })\r
+    @Data\r
     public static class FileFooter {\r
 \r
         @XmlElement(required = true)\r
         protected MeasCollecFile.FileFooter.MeasCollec measCollec;\r
 \r
-        /**\r
-         * Gets the value of the measCollec property.\r
-         *\r
-         * @return\r
-         *     possible object is\r
-         *     {@link MeasCollecFile.FileFooter.MeasCollec }\r
-         *\r
-         */\r
-        public MeasCollecFile.FileFooter.MeasCollec getMeasCollec() {\r
-            return measCollec;\r
-        }\r
-\r
-        /**\r
-         * Sets the value of the measCollec property.\r
-         *\r
-         * @param value\r
-         *     allowed object is\r
-         *     {@link MeasCollecFile.FileFooter.MeasCollec }\r
-         *\r
-         */\r
-        public void setMeasCollec(MeasCollecFile.FileFooter.MeasCollec value) {\r
-            this.measCollec = value;\r
-        }\r
-\r
-\r
-        /**\r
-         * <p>Java class for anonymous complex type.\r
-         *\r
-         * <p>The following schema fragment specifies the expected content contained within this class.\r
-         *\r
-         * <pre>\r
-         * &lt;complexType>\r
-         *   &lt;complexContent>\r
-         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
-         *       &lt;attribute name="endTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />\r
-         *     &lt;/restriction>\r
-         *   &lt;/complexContent>\r
-         * &lt;/complexType>\r
-         * </pre>\r
-         *\r
-         *\r
-         */\r
         @XmlAccessorType(XmlAccessType.FIELD)\r
         @XmlType(name = "")\r
         public static class MeasCollec {\r
-\r
             @XmlAttribute(name = "endTime", required = true)\r
             @XmlSchemaType(name = "dateTime")\r
             protected XMLGregorianCalendar endTime;\r
-\r
-            /**\r
-             * Gets the value of the endTime property.\r
-             *\r
-             * @return\r
-             *     possible object is\r
-             *     {@link XMLGregorianCalendar }\r
-             *\r
-             */\r
-            public XMLGregorianCalendar getEndTime() {\r
-                return endTime;\r
-            }\r
-\r
-            /**\r
-             * Sets the value of the endTime property.\r
-             *\r
-             * @param value\r
-             *     allowed object is\r
-             *     {@link XMLGregorianCalendar }\r
-             *\r
-             */\r
-            public void setEndTime(XMLGregorianCalendar value) {\r
-                this.endTime = value;\r
-            }\r
-\r
         }\r
 \r
     }\r
 \r
 \r
-    /**\r
-     * <p>Java class for anonymous complex type.\r
-     *\r
-     * <p>The following schema fragment specifies the expected content contained within this class.\r
-     *\r
-     * <pre>\r
-     * &lt;complexType>\r
-     *   &lt;complexContent>\r
-     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
-     *       &lt;sequence>\r
-     *         &lt;element name="fileSender">\r
-     *           &lt;complexType>\r
-     *             &lt;complexContent>\r
-     *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
-     *                 &lt;attribute name="localDn" type="{http://www.w3.org/2001/XMLSchema}string" />\r
-     *                 &lt;attribute name="elementType" type="{http://www.w3.org/2001/XMLSchema}string" />\r
-     *               &lt;/restriction>\r
-     *             &lt;/complexContent>\r
-     *           &lt;/complexType>\r
-     *         &lt;/element>\r
-     *         &lt;element name="measCollec">\r
-     *           &lt;complexType>\r
-     *             &lt;complexContent>\r
-     *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
-     *                 &lt;attribute name="beginTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />\r
-     *               &lt;/restriction>\r
-     *             &lt;/complexContent>\r
-     *           &lt;/complexType>\r
-     *         &lt;/element>\r
-     *       &lt;/sequence>\r
-     *       &lt;attribute name="fileFormatVersion" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />\r
-     *       &lt;attribute name="vendorName" type="{http://www.w3.org/2001/XMLSchema}string" />\r
-     *       &lt;attribute name="dnPrefix" type="{http://www.w3.org/2001/XMLSchema}string" />\r
-     *     &lt;/restriction>\r
-     *   &lt;/complexContent>\r
-     * &lt;/complexType>\r
-     * </pre>\r
-     *\r
-     *\r
-     */\r
     @XmlAccessorType(XmlAccessType.FIELD)\r
     @XmlType(name = "", propOrder = {\r
         "fileSender",\r
         "measCollec"\r
     })\r
+    @Data\r
     public static class FileHeader {\r
-\r
         @XmlElement(required = true)\r
         protected MeasCollecFile.FileHeader.FileSender fileSender;\r
         @XmlElement(required = true)\r
@@ -479,632 +92,52 @@ public class MeasCollecFile {
         @XmlAttribute(name = "dnPrefix")\r
         protected String dnPrefix;\r
 \r
-        /**\r
-         * Gets the value of the fileSender property.\r
-         *\r
-         * @return\r
-         *     possible object is\r
-         *     {@link MeasCollecFile.FileHeader.FileSender }\r
-         *\r
-         */\r
-        public MeasCollecFile.FileHeader.FileSender getFileSender() {\r
-            return fileSender;\r
-        }\r
-\r
-        /**\r
-         * Sets the value of the fileSender property.\r
-         *\r
-         * @param value\r
-         *     allowed object is\r
-         *     {@link MeasCollecFile.FileHeader.FileSender }\r
-         *\r
-         */\r
-        public void setFileSender(MeasCollecFile.FileHeader.FileSender value) {\r
-            this.fileSender = value;\r
-        }\r
-\r
-        /**\r
-         * Gets the value of the measCollec property.\r
-         *\r
-         * @return\r
-         *     possible object is\r
-         *     {@link MeasCollecFile.FileHeader.MeasCollec }\r
-         *\r
-         */\r
-        public MeasCollecFile.FileHeader.MeasCollec getMeasCollec() {\r
-            return measCollec;\r
-        }\r
-\r
-        /**\r
-         * Sets the value of the measCollec property.\r
-         *\r
-         * @param value\r
-         *     allowed object is\r
-         *     {@link MeasCollecFile.FileHeader.MeasCollec }\r
-         *\r
-         */\r
-        public void setMeasCollec(MeasCollecFile.FileHeader.MeasCollec value) {\r
-            this.measCollec = value;\r
-        }\r
-\r
-        /**\r
-         * Gets the value of the fileFormatVersion property.\r
-         *\r
-         * @return\r
-         *     possible object is\r
-         *     {@link String }\r
-         *\r
-         */\r
-        public String getFileFormatVersion() {\r
-            return fileFormatVersion;\r
-        }\r
-\r
-        /**\r
-         * Sets the value of the fileFormatVersion property.\r
-         *\r
-         * @param value\r
-         *     allowed object is\r
-         *     {@link String }\r
-         *\r
-         */\r
-        public void setFileFormatVersion(String value) {\r
-            this.fileFormatVersion = value;\r
-        }\r
-\r
-        /**\r
-         * Gets the value of the vendorName property.\r
-         *\r
-         * @return\r
-         *     possible object is\r
-         *     {@link String }\r
-         *\r
-         */\r
-        public String getVendorName() {\r
-            return vendorName;\r
-        }\r
-\r
-        /**\r
-         * Sets the value of the vendorName property.\r
-         *\r
-         * @param value\r
-         *     allowed object is\r
-         *     {@link String }\r
-         *\r
-         */\r
-        public void setVendorName(String value) {\r
-            this.vendorName = value;\r
-        }\r
-\r
-        /**\r
-         * Gets the value of the dnPrefix property.\r
-         *\r
-         * @return\r
-         *     possible object is\r
-         *     {@link String }\r
-         *\r
-         */\r
-        public String getDnPrefix() {\r
-            return dnPrefix;\r
-        }\r
-\r
-        /**\r
-         * Sets the value of the dnPrefix property.\r
-         *\r
-         * @param value\r
-         *     allowed object is\r
-         *     {@link String }\r
-         *\r
-         */\r
-        public void setDnPrefix(String value) {\r
-            this.dnPrefix = value;\r
-        }\r
-\r
-\r
-        /**\r
-         * <p>Java class for anonymous complex type.\r
-         *\r
-         * <p>The following schema fragment specifies the expected content contained within this class.\r
-         *\r
-         * <pre>\r
-         * &lt;complexType>\r
-         *   &lt;complexContent>\r
-         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
-         *       &lt;attribute name="localDn" type="{http://www.w3.org/2001/XMLSchema}string" />\r
-         *       &lt;attribute name="elementType" type="{http://www.w3.org/2001/XMLSchema}string" />\r
-         *     &lt;/restriction>\r
-         *   &lt;/complexContent>\r
-         * &lt;/complexType>\r
-         * </pre>\r
-         *\r
-         *\r
-         */\r
         @XmlAccessorType(XmlAccessType.FIELD)\r
         @XmlType(name = "")\r
+        @Data\r
         public static class FileSender {\r
-\r
             @XmlAttribute(name = "localDn")\r
             protected String localDn;\r
             @XmlAttribute(name = "elementType")\r
             protected String elementType;\r
-\r
-            /**\r
-             * Gets the value of the localDn property.\r
-             *\r
-             * @return\r
-             *     possible object is\r
-             *     {@link String }\r
-             *\r
-             */\r
-            public String getLocalDn() {\r
-                return localDn;\r
-            }\r
-\r
-            /**\r
-             * Sets the value of the localDn property.\r
-             *\r
-             * @param value\r
-             *     allowed object is\r
-             *     {@link String }\r
-             *\r
-             */\r
-            public void setLocalDn(String value) {\r
-                this.localDn = value;\r
-            }\r
-\r
-            /**\r
-             * Gets the value of the elementType property.\r
-             *\r
-             * @return\r
-             *     possible object is\r
-             *     {@link String }\r
-             *\r
-             */\r
-            public String getElementType() {\r
-                return elementType;\r
-            }\r
-\r
-            /**\r
-             * Sets the value of the elementType property.\r
-             *\r
-             * @param value\r
-             *     allowed object is\r
-             *     {@link String }\r
-             *\r
-             */\r
-            public void setElementType(String value) {\r
-                this.elementType = value;\r
-            }\r
-\r
         }\r
 \r
 \r
-        /**\r
-         * <p>Java class for anonymous complex type.\r
-         *\r
-         * <p>The following schema fragment specifies the expected content contained within this class.\r
-         *\r
-         * <pre>\r
-         * &lt;complexType>\r
-         *   &lt;complexContent>\r
-         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
-         *       &lt;attribute name="beginTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />\r
-         *     &lt;/restriction>\r
-         *   &lt;/complexContent>\r
-         * &lt;/complexType>\r
-         * </pre>\r
-         *\r
-         *\r
-         */\r
         @XmlAccessorType(XmlAccessType.FIELD)\r
         @XmlType(name = "")\r
+        @Data\r
         public static class MeasCollec {\r
-\r
             @XmlAttribute(name = "beginTime", required = true)\r
             @XmlSchemaType(name = "dateTime")\r
             protected XMLGregorianCalendar beginTime;\r
-\r
-            /**\r
-             * Gets the value of the beginTime property.\r
-             *\r
-             * @return\r
-             *     possible object is\r
-             *     {@link XMLGregorianCalendar }\r
-             *\r
-             */\r
-            public XMLGregorianCalendar getBeginTime() {\r
-                return beginTime;\r
-            }\r
-\r
-            /**\r
-             * Sets the value of the beginTime property.\r
-             *\r
-             * @param value\r
-             *     allowed object is\r
-             *     {@link XMLGregorianCalendar }\r
-             *\r
-             */\r
-            public void setBeginTime(XMLGregorianCalendar value) {\r
-                this.beginTime = value;\r
-            }\r
-\r
         }\r
 \r
     }\r
 \r
 \r
-    /**\r
-     * <p>Java class for anonymous complex type.\r
-     *\r
-     * <p>The following schema fragment specifies the expected content contained within this class.\r
-     *\r
-     * <pre>\r
-     * &lt;complexType>\r
-     *   &lt;complexContent>\r
-     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
-     *       &lt;sequence>\r
-     *         &lt;element name="managedElement">\r
-     *           &lt;complexType>\r
-     *             &lt;complexContent>\r
-     *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
-     *                 &lt;attribute name="localDn" type="{http://www.w3.org/2001/XMLSchema}string" />\r
-     *                 &lt;attribute name="userLabel" type="{http://www.w3.org/2001/XMLSchema}string" />\r
-     *                 &lt;attribute name="swVersion" type="{http://www.w3.org/2001/XMLSchema}string" />\r
-     *               &lt;/restriction>\r
-     *             &lt;/complexContent>\r
-     *           &lt;/complexType>\r
-     *         &lt;/element>\r
-     *         &lt;element name="measInfo" maxOccurs="unbounded" minOccurs="0">\r
-     *           &lt;complexType>\r
-     *             &lt;complexContent>\r
-     *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
-     *                 &lt;sequence>\r
-     *                   &lt;element name="job" minOccurs="0">\r
-     *                     &lt;complexType>\r
-     *                       &lt;complexContent>\r
-     *                         &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
-     *                           &lt;attribute name="jobId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />\r
-     *                         &lt;/restriction>\r
-     *                       &lt;/complexContent>\r
-     *                     &lt;/complexType>\r
-     *                   &lt;/element>\r
-     *                   &lt;element name="granPeriod">\r
-     *                     &lt;complexType>\r
-     *                       &lt;complexContent>\r
-     *                         &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
-     *                           &lt;attribute name="duration" use="required" type="{http://www.w3.org/2001/XMLSchema}duration" />\r
-     *                           &lt;attribute name="endTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />\r
-     *                         &lt;/restriction>\r
-     *                       &lt;/complexContent>\r
-     *                     &lt;/complexType>\r
-     *                   &lt;/element>\r
-     *                   &lt;element name="repPeriod" minOccurs="0">\r
-     *                     &lt;complexType>\r
-     *                       &lt;complexContent>\r
-     *                         &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
-     *                           &lt;attribute name="duration" use="required" type="{http://www.w3.org/2001/XMLSchema}duration" />\r
-     *                         &lt;/restriction>\r
-     *                       &lt;/complexContent>\r
-     *                     &lt;/complexType>\r
-     *                   &lt;/element>\r
-     *                   &lt;choice>\r
-     *                     &lt;element name="measTypes">\r
-     *                       &lt;simpleType>\r
-     *                         &lt;list itemType="{http://www.w3.org/2001/XMLSchema}Name" />\r
-     *                       &lt;/simpleType>\r
-     *                     &lt;/element>\r
-     *                     &lt;element name="measType" maxOccurs="unbounded" minOccurs="0">\r
-     *                       &lt;complexType>\r
-     *                         &lt;simpleContent>\r
-     *                           &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>Name">\r
-     *                             &lt;attribute name="p" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />\r
-     *                           &lt;/extension>\r
-     *                         &lt;/simpleContent>\r
-     *                       &lt;/complexType>\r
-     *                     &lt;/element>\r
-     *                   &lt;/choice>\r
-     *                   &lt;element name="measValue" maxOccurs="unbounded" minOccurs="0">\r
-     *                     &lt;complexType>\r
-     *                       &lt;complexContent>\r
-     *                         &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
-     *                           &lt;sequence>\r
-     *                             &lt;choice>\r
-     *                               &lt;element name="measResults">\r
-     *                                 &lt;simpleType>\r
-     *                                   &lt;list itemType="{http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec}measResultType" />\r
-     *                                 &lt;/simpleType>\r
-     *                               &lt;/element>\r
-     *                               &lt;element name="r" maxOccurs="unbounded" minOccurs="0">\r
-     *                                 &lt;complexType>\r
-     *                                   &lt;simpleContent>\r
-     *                                     &lt;extension base="&lt;http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec>measResultType">\r
-     *                                       &lt;attribute name="p" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />\r
-     *                                     &lt;/extension>\r
-     *                                   &lt;/simpleContent>\r
-     *                                 &lt;/complexType>\r
-     *                               &lt;/element>\r
-     *                             &lt;/choice>\r
-     *                             &lt;element name="suspect" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>\r
-     *                           &lt;/sequence>\r
-     *                           &lt;attribute name="measObjLdn" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />\r
-     *                         &lt;/restriction>\r
-     *                       &lt;/complexContent>\r
-     *                     &lt;/complexType>\r
-     *                   &lt;/element>\r
-     *                 &lt;/sequence>\r
-     *                 &lt;attribute name="measInfoId" type="{http://www.w3.org/2001/XMLSchema}string" />\r
-     *               &lt;/restriction>\r
-     *             &lt;/complexContent>\r
-     *           &lt;/complexType>\r
-     *         &lt;/element>\r
-     *       &lt;/sequence>\r
-     *     &lt;/restriction>\r
-     *   &lt;/complexContent>\r
-     * &lt;/complexType>\r
-     * </pre>\r
-     *\r
-     *\r
-     */\r
     @XmlAccessorType(XmlAccessType.FIELD)\r
     @XmlType(name = "", propOrder = {\r
         "managedElement",\r
         "measInfo"\r
     })\r
+    @Data\r
     public static class MeasData {\r
-\r
         @XmlElement(required = true)\r
         protected MeasCollecFile.MeasData.ManagedElement managedElement;\r
         protected List<MeasCollecFile.MeasData.MeasInfo> measInfo;\r
 \r
-        /**\r
-         * Gets the value of the managedElement property.\r
-         *\r
-         * @return\r
-         *     possible object is\r
-         *     {@link MeasCollecFile.MeasData.ManagedElement }\r
-         *\r
-         */\r
-        public MeasCollecFile.MeasData.ManagedElement getManagedElement() {\r
-            return managedElement;\r
-        }\r
-\r
-        /**\r
-         * Sets the value of the managedElement property.\r
-         *\r
-         * @param value\r
-         *     allowed object is\r
-         *     {@link MeasCollecFile.MeasData.ManagedElement }\r
-         *\r
-         */\r
-        public void setManagedElement(MeasCollecFile.MeasData.ManagedElement value) {\r
-            this.managedElement = value;\r
-        }\r
-\r
-        /**\r
-         * Gets the value of the measInfo property.\r
-         *\r
-         * <p>\r
-         * This accessor method returns a reference to the live list,\r
-         * not a snapshot. Therefore any modification you make to the\r
-         * returned list will be present inside the JAXB object.\r
-         * This is why there is not a <CODE>set</CODE> method for the measInfo property.\r
-         *\r
-         * <p>\r
-         * For example, to add a new item, do as follows:\r
-         * <pre>\r
-         *    getMeasInfo().add(newItem);\r
-         * </pre>\r
-         *\r
-         *\r
-         * <p>\r
-         * Objects of the following type(s) are allowed in the list\r
-         * {@link MeasCollecFile.MeasData.MeasInfo }\r
-         *\r
-         *\r
-         */\r
-        public List<MeasCollecFile.MeasData.MeasInfo> getMeasInfo() {\r
-            if (measInfo == null) {\r
-                measInfo = new ArrayList<MeasCollecFile.MeasData.MeasInfo>();\r
-            }\r
-            return this.measInfo;\r
-        }\r
-\r
-\r
-        /**\r
-         * <p>Java class for anonymous complex type.\r
-         *\r
-         * <p>The following schema fragment specifies the expected content contained within this class.\r
-         *\r
-         * <pre>\r
-         * &lt;complexType>\r
-         *   &lt;complexContent>\r
-         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
-         *       &lt;attribute name="localDn" type="{http://www.w3.org/2001/XMLSchema}string" />\r
-         *       &lt;attribute name="userLabel" type="{http://www.w3.org/2001/XMLSchema}string" />\r
-         *       &lt;attribute name="swVersion" type="{http://www.w3.org/2001/XMLSchema}string" />\r
-         *     &lt;/restriction>\r
-         *   &lt;/complexContent>\r
-         * &lt;/complexType>\r
-         * </pre>\r
-         *\r
-         *\r
-         */\r
         @XmlAccessorType(XmlAccessType.FIELD)\r
         @XmlType(name = "")\r
+        @Data\r
         public static class ManagedElement {\r
-\r
             @XmlAttribute(name = "localDn")\r
             protected String localDn;\r
             @XmlAttribute(name = "userLabel")\r
             protected String userLabel;\r
             @XmlAttribute(name = "swVersion")\r
             protected String swVersion;\r
-\r
-            /**\r
-             * Gets the value of the localDn property.\r
-             *\r
-             * @return\r
-             *     possible object is\r
-             *     {@link String }\r
-             *\r
-             */\r
-            public String getLocalDn() {\r
-                return localDn;\r
-            }\r
-\r
-            /**\r
-             * Sets the value of the localDn property.\r
-             *\r
-             * @param value\r
-             *     allowed object is\r
-             *     {@link String }\r
-             *\r
-             */\r
-            public void setLocalDn(String value) {\r
-                this.localDn = value;\r
-            }\r
-\r
-            /**\r
-             * Gets the value of the userLabel property.\r
-             *\r
-             * @return\r
-             *     possible object is\r
-             *     {@link String }\r
-             *\r
-             */\r
-            public String getUserLabel() {\r
-                return userLabel;\r
-            }\r
-\r
-            /**\r
-             * Sets the value of the userLabel property.\r
-             *\r
-             * @param value\r
-             *     allowed object is\r
-             *     {@link String }\r
-             *\r
-             */\r
-            public void setUserLabel(String value) {\r
-                this.userLabel = value;\r
-            }\r
-\r
-            /**\r
-             * Gets the value of the swVersion property.\r
-             *\r
-             * @return\r
-             *     possible object is\r
-             *     {@link String }\r
-             *\r
-             */\r
-            public String getSwVersion() {\r
-                return swVersion;\r
-            }\r
-\r
-            /**\r
-             * Sets the value of the swVersion property.\r
-             *\r
-             * @param value\r
-             *     allowed object is\r
-             *     {@link String }\r
-             *\r
-             */\r
-            public void setSwVersion(String value) {\r
-                this.swVersion = value;\r
-            }\r
-\r
         }\r
 \r
-\r
-        /**\r
-         * <p>Java class for anonymous complex type.\r
-         *\r
-         * <p>The following schema fragment specifies the expected content contained within this class.\r
-         *\r
-         * <pre>\r
-         * &lt;complexType>\r
-         *   &lt;complexContent>\r
-         *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
-         *       &lt;sequence>\r
-         *         &lt;element name="job" minOccurs="0">\r
-         *           &lt;complexType>\r
-         *             &lt;complexContent>\r
-         *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
-         *                 &lt;attribute name="jobId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />\r
-         *               &lt;/restriction>\r
-         *             &lt;/complexContent>\r
-         *           &lt;/complexType>\r
-         *         &lt;/element>\r
-         *         &lt;element name="granPeriod">\r
-         *           &lt;complexType>\r
-         *             &lt;complexContent>\r
-         *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
-         *                 &lt;attribute name="duration" use="required" type="{http://www.w3.org/2001/XMLSchema}duration" />\r
-         *                 &lt;attribute name="endTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />\r
-         *               &lt;/restriction>\r
-         *             &lt;/complexContent>\r
-         *           &lt;/complexType>\r
-         *         &lt;/element>\r
-         *         &lt;element name="repPeriod" minOccurs="0">\r
-         *           &lt;complexType>\r
-         *             &lt;complexContent>\r
-         *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
-         *                 &lt;attribute name="duration" use="required" type="{http://www.w3.org/2001/XMLSchema}duration" />\r
-         *               &lt;/restriction>\r
-         *             &lt;/complexContent>\r
-         *           &lt;/complexType>\r
-         *         &lt;/element>\r
-         *         &lt;choice>\r
-         *           &lt;element name="measTypes">\r
-         *             &lt;simpleType>\r
-         *               &lt;list itemType="{http://www.w3.org/2001/XMLSchema}Name" />\r
-         *             &lt;/simpleType>\r
-         *           &lt;/element>\r
-         *           &lt;element name="measType" maxOccurs="unbounded" minOccurs="0">\r
-         *             &lt;complexType>\r
-         *               &lt;simpleContent>\r
-         *                 &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>Name">\r
-         *                   &lt;attribute name="p" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />\r
-         *                 &lt;/extension>\r
-         *               &lt;/simpleContent>\r
-         *             &lt;/complexType>\r
-         *           &lt;/element>\r
-         *         &lt;/choice>\r
-         *         &lt;element name="measValue" maxOccurs="unbounded" minOccurs="0">\r
-         *           &lt;complexType>\r
-         *             &lt;complexContent>\r
-         *               &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
-         *                 &lt;sequence>\r
-         *                   &lt;choice>\r
-         *                     &lt;element name="measResults">\r
-         *                       &lt;simpleType>\r
-         *                         &lt;list itemType="{http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec}measResultType" />\r
-         *                       &lt;/simpleType>\r
-         *                     &lt;/element>\r
-         *                     &lt;element name="r" maxOccurs="unbounded" minOccurs="0">\r
-         *                       &lt;complexType>\r
-         *                         &lt;simpleContent>\r
-         *                           &lt;extension base="&lt;http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec>measResultType">\r
-         *                             &lt;attribute name="p" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />\r
-         *                           &lt;/extension>\r
-         *                         &lt;/simpleContent>\r
-         *                       &lt;/complexType>\r
-         *                     &lt;/element>\r
-         *                   &lt;/choice>\r
-         *                   &lt;element name="suspect" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>\r
-         *                 &lt;/sequence>\r
-         *                 &lt;attribute name="measObjLdn" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />\r
-         *               &lt;/restriction>\r
-         *             &lt;/complexContent>\r
-         *           &lt;/complexType>\r
-         *         &lt;/element>\r
-         *       &lt;/sequence>\r
-         *       &lt;attribute name="measInfoId" type="{http://www.w3.org/2001/XMLSchema}string" />\r
-         *     &lt;/restriction>\r
-         *   &lt;/complexContent>\r
-         * &lt;/complexType>\r
-         * </pre>\r
-         *\r
-         *\r
-         */\r
         @XmlAccessorType(XmlAccessType.FIELD)\r
         @XmlType(name = "", propOrder = {\r
             "job",\r
@@ -1114,6 +147,7 @@ public class MeasCollecFile {
             "measType",\r
             "measValue"\r
         })\r
+        @Data\r
         public static class MeasInfo {\r
 \r
             protected MeasCollecFile.MeasData.MeasInfo.Job job;\r
@@ -1127,343 +161,32 @@ public class MeasCollecFile {
             @XmlAttribute(name = "measInfoId")\r
             protected String measInfoId;\r
 \r
-            /**\r
-             * Gets the value of the job property.\r
-             *\r
-             * @return\r
-             *     possible object is\r
-             *     {@link MeasCollecFile.MeasData.MeasInfo.Job }\r
-             *\r
-             */\r
-            public MeasCollecFile.MeasData.MeasInfo.Job getJob() {\r
-                return job;\r
-            }\r
-\r
-            /**\r
-             * Sets the value of the job property.\r
-             *\r
-             * @param value\r
-             *     allowed object is\r
-             *     {@link MeasCollecFile.MeasData.MeasInfo.Job }\r
-             *\r
-             */\r
-            public void setJob(MeasCollecFile.MeasData.MeasInfo.Job value) {\r
-                this.job = value;\r
-            }\r
-\r
-            /**\r
-             * Gets the value of the granPeriod property.\r
-             *\r
-             * @return\r
-             *     possible object is\r
-             *     {@link MeasCollecFile.MeasData.MeasInfo.GranPeriod }\r
-             *\r
-             */\r
-            public MeasCollecFile.MeasData.MeasInfo.GranPeriod getGranPeriod() {\r
-                return granPeriod;\r
-            }\r
-\r
-            /**\r
-             * Sets the value of the granPeriod property.\r
-             *\r
-             * @param value\r
-             *     allowed object is\r
-             *     {@link MeasCollecFile.MeasData.MeasInfo.GranPeriod }\r
-             *\r
-             */\r
-            public void setGranPeriod(MeasCollecFile.MeasData.MeasInfo.GranPeriod value) {\r
-                this.granPeriod = value;\r
-            }\r
-\r
-            /**\r
-             * Gets the value of the repPeriod property.\r
-             *\r
-             * @return\r
-             *     possible object is\r
-             *     {@link MeasCollecFile.MeasData.MeasInfo.RepPeriod }\r
-             *\r
-             */\r
-            public MeasCollecFile.MeasData.MeasInfo.RepPeriod getRepPeriod() {\r
-                return repPeriod;\r
-            }\r
-\r
-            /**\r
-             * Sets the value of the repPeriod property.\r
-             *\r
-             * @param value\r
-             *     allowed object is\r
-             *     {@link MeasCollecFile.MeasData.MeasInfo.RepPeriod }\r
-             *\r
-             */\r
-            public void setRepPeriod(MeasCollecFile.MeasData.MeasInfo.RepPeriod value) {\r
-                this.repPeriod = value;\r
-            }\r
-\r
-            /**\r
-             * Gets the value of the measTypes property.\r
-             *\r
-             * <p>\r
-             * This accessor method returns a reference to the live list,\r
-             * not a snapshot. Therefore any modification you make to the\r
-             * returned list will be present inside the JAXB object.\r
-             * This is why there is not a <CODE>set</CODE> method for the measTypes property.\r
-             *\r
-             * <p>\r
-             * For example, to add a new item, do as follows:\r
-             * <pre>\r
-             *    getMeasTypes().add(newItem);\r
-             * </pre>\r
-             *\r
-             *\r
-             * <p>\r
-             * Objects of the following type(s) are allowed in the list\r
-             * {@link String }\r
-             *\r
-             *\r
-             */\r
-            public List<String> getMeasTypes() {\r
-                if (measTypes == null) {\r
-                    measTypes = new ArrayList<String>();\r
-                }\r
-                return this.measTypes;\r
-            }\r
-\r
-            /**\r
-             * Gets the value of the measType property.\r
-             *\r
-             * <p>\r
-             * This accessor method returns a reference to the live list,\r
-             * not a snapshot. Therefore any modification you make to the\r
-             * returned list will be present inside the JAXB object.\r
-             * This is why there is not a <CODE>set</CODE> method for the measType property.\r
-             *\r
-             * <p>\r
-             * For example, to add a new item, do as follows:\r
-             * <pre>\r
-             *    getMeasType().add(newItem);\r
-             * </pre>\r
-             *\r
-             *\r
-             * <p>\r
-             * Objects of the following type(s) are allowed in the list\r
-             * {@link MeasCollecFile.MeasData.MeasInfo.MeasType }\r
-             *\r
-             *\r
-             */\r
-            public List<MeasCollecFile.MeasData.MeasInfo.MeasType> getMeasType() {\r
-                if (measType == null) {\r
-                    measType = new ArrayList<MeasCollecFile.MeasData.MeasInfo.MeasType>();\r
-                }\r
-                return this.measType;\r
-            }\r
-\r
-            /**\r
-             * Gets the value of the measValue property.\r
-             *\r
-             * <p>\r
-             * This accessor method returns a reference to the live list,\r
-             * not a snapshot. Therefore any modification you make to the\r
-             * returned list will be present inside the JAXB object.\r
-             * This is why there is not a <CODE>set</CODE> method for the measValue property.\r
-             *\r
-             * <p>\r
-             * For example, to add a new item, do as follows:\r
-             * <pre>\r
-             *    getMeasValue().add(newItem);\r
-             * </pre>\r
-             *\r
-             *\r
-             * <p>\r
-             * Objects of the following type(s) are allowed in the list\r
-             * {@link MeasCollecFile.MeasData.MeasInfo.MeasValue }\r
-             *\r
-             *\r
-             */\r
-            public List<MeasCollecFile.MeasData.MeasInfo.MeasValue> getMeasValue() {\r
-                if (measValue == null) {\r
-                    measValue = new ArrayList<MeasCollecFile.MeasData.MeasInfo.MeasValue>();\r
-                }\r
-                return this.measValue;\r
-            }\r
-\r
-            /**\r
-             * Gets the value of the measInfoId property.\r
-             *\r
-             * @return\r
-             *     possible object is\r
-             *     {@link String }\r
-             *\r
-             */\r
-            public String getMeasInfoId() {\r
-                return measInfoId;\r
-            }\r
-\r
-            /**\r
-             * Sets the value of the measInfoId property.\r
-             *\r
-             * @param value\r
-             *     allowed object is\r
-             *     {@link String }\r
-             *\r
-             */\r
-            public void setMeasInfoId(String value) {\r
-                this.measInfoId = value;\r
-            }\r
-\r
-\r
-            /**\r
-             * <p>Java class for anonymous complex type.\r
-             *\r
-             * <p>The following schema fragment specifies the expected content contained within this class.\r
-             *\r
-             * <pre>\r
-             * &lt;complexType>\r
-             *   &lt;complexContent>\r
-             *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
-             *       &lt;attribute name="duration" use="required" type="{http://www.w3.org/2001/XMLSchema}duration" />\r
-             *       &lt;attribute name="endTime" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />\r
-             *     &lt;/restriction>\r
-             *   &lt;/complexContent>\r
-             * &lt;/complexType>\r
-             * </pre>\r
-             *\r
-             *\r
-             */\r
             @XmlAccessorType(XmlAccessType.FIELD)\r
             @XmlType(name = "")\r
+            @Data\r
             public static class GranPeriod {\r
-\r
                 @XmlAttribute(name = "duration", required = true)\r
                 protected Duration duration;\r
                 @XmlAttribute(name = "endTime", required = true)\r
                 @XmlSchemaType(name = "dateTime")\r
                 protected XMLGregorianCalendar endTime;\r
-\r
-                /**\r
-                 * Gets the value of the duration property.\r
-                 *\r
-                 * @return\r
-                 *     possible object is\r
-                 *     {@link Duration }\r
-                 *\r
-                 */\r
-                public Duration getDuration() {\r
-                    return duration;\r
-                }\r
-\r
-                /**\r
-                 * Sets the value of the duration property.\r
-                 *\r
-                 * @param value\r
-                 *     allowed object is\r
-                 *     {@link Duration }\r
-                 *\r
-                 */\r
-                public void setDuration(Duration value) {\r
-                    this.duration = value;\r
-                }\r
-\r
-                /**\r
-                 * Gets the value of the endTime property.\r
-                 *\r
-                 * @return\r
-                 *     possible object is\r
-                 *     {@link XMLGregorianCalendar }\r
-                 *\r
-                 */\r
-                public XMLGregorianCalendar getEndTime() {\r
-                    return endTime;\r
-                }\r
-\r
-                /**\r
-                 * Sets the value of the endTime property.\r
-                 *\r
-                 * @param value\r
-                 *     allowed object is\r
-                 *     {@link XMLGregorianCalendar }\r
-                 *\r
-                 */\r
-                public void setEndTime(XMLGregorianCalendar value) {\r
-                    this.endTime = value;\r
-                }\r
-\r
             }\r
 \r
 \r
-            /**\r
-             * <p>Java class for anonymous complex type.\r
-             *\r
-             * <p>The following schema fragment specifies the expected content contained within this class.\r
-             *\r
-             * <pre>\r
-             * &lt;complexType>\r
-             *   &lt;complexContent>\r
-             *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
-             *       &lt;attribute name="jobId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />\r
-             *     &lt;/restriction>\r
-             *   &lt;/complexContent>\r
-             * &lt;/complexType>\r
-             * </pre>\r
-             *\r
-             *\r
-             */\r
             @XmlAccessorType(XmlAccessType.FIELD)\r
             @XmlType(name = "")\r
+            @Data\r
             public static class Job {\r
-\r
                 @XmlAttribute(name = "jobId", required = true)\r
                 protected String jobId;\r
-\r
-                /**\r
-                 * Gets the value of the jobId property.\r
-                 *\r
-                 * @return\r
-                 *     possible object is\r
-                 *     {@link String }\r
-                 *\r
-                 */\r
-                public String getJobId() {\r
-                    return jobId;\r
-                }\r
-\r
-                /**\r
-                 * Sets the value of the jobId property.\r
-                 *\r
-                 * @param value\r
-                 *     allowed object is\r
-                 *     {@link String }\r
-                 *\r
-                 */\r
-                public void setJobId(String value) {\r
-                    this.jobId = value;\r
-                }\r
-\r
             }\r
 \r
-\r
-            /**\r
-             * <p>Java class for anonymous complex type.\r
-             *\r
-             * <p>The following schema fragment specifies the expected content contained within this class.\r
-             *\r
-             * <pre>\r
-             * &lt;complexType>\r
-             *   &lt;simpleContent>\r
-             *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>Name">\r
-             *       &lt;attribute name="p" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />\r
-             *     &lt;/extension>\r
-             *   &lt;/simpleContent>\r
-             * &lt;/complexType>\r
-             * </pre>\r
-             *\r
-             *\r
-             */\r
             @XmlAccessorType(XmlAccessType.FIELD)\r
             @XmlType(name = "", propOrder = {\r
                 "value"\r
             })\r
+            @Data\r
             public static class MeasType {\r
-\r
                 @XmlValue\r
                 @XmlJavaTypeAdapter(CollapsedStringAdapter.class)\r
                 @XmlSchemaType(name = "Name")\r
@@ -1471,102 +194,16 @@ public class MeasCollecFile {
                 @XmlAttribute(name = "p", required = true)\r
                 @XmlSchemaType(name = "positiveInteger")\r
                 protected BigInteger p;\r
-\r
-                /**\r
-                 * Gets the value of the value property.\r
-                 *\r
-                 * @return\r
-                 *     possible object is\r
-                 *     {@link String }\r
-                 *\r
-                 */\r
-                public String getValue() {\r
-                    return value;\r
-                }\r
-\r
-                /**\r
-                 * Sets the value of the value property.\r
-                 *\r
-                 * @param value\r
-                 *     allowed object is\r
-                 *     {@link String }\r
-                 *\r
-                 */\r
-                public void setValue(String value) {\r
-                    this.value = value;\r
-                }\r
-\r
-                /**\r
-                 * Gets the value of the p property.\r
-                 *\r
-                 * @return\r
-                 *     possible object is\r
-                 *     {@link BigInteger }\r
-                 *\r
-                 */\r
-                public BigInteger getP() {\r
-                    return p;\r
-                }\r
-\r
-                /**\r
-                 * Sets the value of the p property.\r
-                 *\r
-                 * @param value\r
-                 *     allowed object is\r
-                 *     {@link BigInteger }\r
-                 *\r
-                 */\r
-                public void setP(BigInteger value) {\r
-                    this.p = value;\r
-                }\r
-\r
             }\r
 \r
-\r
-            /**\r
-             * <p>Java class for anonymous complex type.\r
-             *\r
-             * <p>The following schema fragment specifies the expected content contained within this class.\r
-             *\r
-             * <pre>\r
-             * &lt;complexType>\r
-             *   &lt;complexContent>\r
-             *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
-             *       &lt;sequence>\r
-             *         &lt;choice>\r
-             *           &lt;element name="measResults">\r
-             *             &lt;simpleType>\r
-             *               &lt;list itemType="{http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec}measResultType" />\r
-             *             &lt;/simpleType>\r
-             *           &lt;/element>\r
-             *           &lt;element name="r" maxOccurs="unbounded" minOccurs="0">\r
-             *             &lt;complexType>\r
-             *               &lt;simpleContent>\r
-             *                 &lt;extension base="&lt;http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec>measResultType">\r
-             *                   &lt;attribute name="p" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />\r
-             *                 &lt;/extension>\r
-             *               &lt;/simpleContent>\r
-             *             &lt;/complexType>\r
-             *           &lt;/element>\r
-             *         &lt;/choice>\r
-             *         &lt;element name="suspect" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>\r
-             *       &lt;/sequence>\r
-             *       &lt;attribute name="measObjLdn" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />\r
-             *     &lt;/restriction>\r
-             *   &lt;/complexContent>\r
-             * &lt;/complexType>\r
-             * </pre>\r
-             *\r
-             *\r
-             */\r
             @XmlAccessorType(XmlAccessType.FIELD)\r
             @XmlType(name = "", propOrder = {\r
                 "measResults",\r
                 "r",\r
                 "suspect"\r
             })\r
+            @Data\r
             public static class MeasValue {\r
-\r
                 @XmlList\r
                 protected List<String> measResults;\r
                 protected List<MeasCollecFile.MeasData.MeasInfo.MeasValue.R> r;\r
@@ -1574,256 +211,36 @@ public class MeasCollecFile {
                 @XmlAttribute(name = "measObjLdn", required = true)\r
                 protected String measObjLdn;\r
 \r
-                /**\r
-                 * Gets the value of the measResults property.\r
-                 *\r
-                 * <p>\r
-                 * This accessor method returns a reference to the live list,\r
-                 * not a snapshot. Therefore any modification you make to the\r
-                 * returned list will be present inside the JAXB object.\r
-                 * This is why there is not a <CODE>set</CODE> method for the measResults property.\r
-                 *\r
-                 * <p>\r
-                 * For example, to add a new item, do as follows:\r
-                 * <pre>\r
-                 *    getMeasResults().add(newItem);\r
-                 * </pre>\r
-                 *\r
-                 *\r
-                 * <p>\r
-                 * Objects of the following type(s) are allowed in the list\r
-                 * {@link String }\r
-                 *\r
-                 *\r
-                 */\r
-                public List<String> getMeasResults() {\r
-                    if (measResults == null) {\r
-                        measResults = new ArrayList<String>();\r
-                    }\r
-                    return this.measResults;\r
-                }\r
-\r
-                /**\r
-                 * Gets the value of the r property.\r
-                 *\r
-                 * <p>\r
-                 * This accessor method returns a reference to the live list,\r
-                 * not a snapshot. Therefore any modification you make to the\r
-                 * returned list will be present inside the JAXB object.\r
-                 * This is why there is not a <CODE>set</CODE> method for the r property.\r
-                 *\r
-                 * <p>\r
-                 * For example, to add a new item, do as follows:\r
-                 * <pre>\r
-                 *    getR().add(newItem);\r
-                 * </pre>\r
-                 *\r
-                 *\r
-                 * <p>\r
-                 * Objects of the following type(s) are allowed in the list\r
-                 * {@link MeasCollecFile.MeasData.MeasInfo.MeasValue.R }\r
-                 *\r
-                 *\r
-                 */\r
-                public List<MeasCollecFile.MeasData.MeasInfo.MeasValue.R> getR() {\r
-                    if (r == null) {\r
-                        r = new ArrayList<MeasCollecFile.MeasData.MeasInfo.MeasValue.R>();\r
-                    }\r
-                    return this.r;\r
-                }\r
-\r
-                /**\r
-                 * Gets the value of the suspect property.\r
-                 *\r
-                 * @return\r
-                 *     possible object is\r
-                 *     {@link Boolean }\r
-                 *\r
-                 */\r
-                public Boolean isSuspect() {\r
-                    return suspect;\r
-                }\r
-\r
-                /**\r
-                 * Sets the value of the suspect property.\r
-                 *\r
-                 * @param value\r
-                 *     allowed object is\r
-                 *     {@link Boolean }\r
-                 *\r
-                 */\r
-                public void setSuspect(Boolean value) {\r
-                    this.suspect = value;\r
-                }\r
-\r
-                /**\r
-                 * Gets the value of the measObjLdn property.\r
-                 *\r
-                 * @return\r
-                 *     possible object is\r
-                 *     {@link String }\r
-                 *\r
-                 */\r
-                public String getMeasObjLdn() {\r
-                    return measObjLdn;\r
-                }\r
-\r
-                /**\r
-                 * Sets the value of the measObjLdn property.\r
-                 *\r
-                 * @param value\r
-                 *     allowed object is\r
-                 *     {@link String }\r
-                 *\r
-                 */\r
-                public void setMeasObjLdn(String value) {\r
-                    this.measObjLdn = value;\r
-                }\r
-\r
-\r
-                /**\r
-                 * <p>Java class for anonymous complex type.\r
-                 *\r
-                 * <p>The following schema fragment specifies the expected content contained within this class.\r
-                 *\r
-                 * <pre>\r
-                 * &lt;complexType>\r
-                 *   &lt;simpleContent>\r
-                 *     &lt;extension base="&lt;http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec>measResultType">\r
-                 *       &lt;attribute name="p" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />\r
-                 *     &lt;/extension>\r
-                 *   &lt;/simpleContent>\r
-                 * &lt;/complexType>\r
-                 * </pre>\r
-                 *\r
-                 *\r
-                 */\r
                 @XmlAccessorType(XmlAccessType.FIELD)\r
                 @XmlType(name = "", propOrder = {\r
                     "value"\r
                 })\r
+                @Data\r
                 public static class R {\r
-\r
                     @XmlValue\r
                     protected String value;\r
                     @XmlAttribute(name = "p", required = true)\r
                     @XmlSchemaType(name = "positiveInteger")\r
                     protected BigInteger p;\r
-\r
-                    /**\r
-                     * Gets the value of the value property.\r
-                     *\r
-                     * @return\r
-                     *     possible object is\r
-                     *     {@link String }\r
-                     *\r
-                     */\r
-                    public String getValue() {\r
-                        return value;\r
-                    }\r
-\r
-                    /**\r
-                     * Sets the value of the value property.\r
-                     *\r
-                     * @param value\r
-                     *     allowed object is\r
-                     *     {@link String }\r
-                     *\r
-                     */\r
-                    public void setValue(String value) {\r
-                        this.value = value;\r
-                    }\r
-\r
-                    /**\r
-                     * Gets the value of the p property.\r
-                     *\r
-                     * @return\r
-                     *     possible object is\r
-                     *     {@link BigInteger }\r
-                     *\r
-                     */\r
-                    public BigInteger getP() {\r
-                        return p;\r
-                    }\r
-\r
-                    /**\r
-                     * Sets the value of the p property.\r
-                     *\r
-                     * @param value\r
-                     *     allowed object is\r
-                     *     {@link BigInteger }\r
-                     *\r
-                     */\r
-                    public void setP(BigInteger value) {\r
-                        this.p = value;\r
-                    }\r
-\r
                 }\r
-\r
-\r
                 public void replaceR(List<R> filteredRs) {\r
                     this.r = filteredRs;\r
 \r
                 }\r
-\r
                 public void replaceMeasResults(List<String> filteredMeasResults) {\r
                    this.measResults = filteredMeasResults;\r
 \r
                 }\r
-\r
             }\r
-\r
-\r
-            /**\r
-             * <p>Java class for anonymous complex type.\r
-             *\r
-             * <p>The following schema fragment specifies the expected content contained within this class.\r
-             *\r
-             * <pre>\r
-             * &lt;complexType>\r
-             *   &lt;complexContent>\r
-             *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">\r
-             *       &lt;attribute name="duration" use="required" type="{http://www.w3.org/2001/XMLSchema}duration" />\r
-             *     &lt;/restriction>\r
-             *   &lt;/complexContent>\r
-             * &lt;/complexType>\r
-             * </pre>\r
-             *\r
-             *\r
-             */\r
             @XmlAccessorType(XmlAccessType.FIELD)\r
             @XmlType(name = "")\r
+            @Data\r
             public static class RepPeriod {\r
 \r
                 @XmlAttribute(name = "duration", required = true)\r
                 protected Duration duration;\r
-\r
-                /**\r
-                 * Gets the value of the duration property.\r
-                 *\r
-                 * @return\r
-                 *     possible object is\r
-                 *     {@link Duration }\r
-                 *\r
-                 */\r
-                public Duration getDuration() {\r
-                    return duration;\r
-                }\r
-\r
-                /**\r
-                 * Sets the value of the duration property.\r
-                 *\r
-                 * @param value\r
-                 *     allowed object is\r
-                 *     {@link Duration }\r
-                 *\r
-                 */\r
-                public void setDuration(Duration value) {\r
-                    this.duration = value;\r
-                }\r
             }\r
 \r
-\r
             public void replaceMeasTypes(List<String> newMeasTypes) {\r
                 this.measTypes = newMeasTypes;\r
             }\r
diff --git a/src/main/java/org/onap/dcaegen2/services/pmmapper/model/ServerHandler.java b/src/main/java/org/onap/dcaegen2/services/pmmapper/model/ServerHandler.java
new file mode 100644 (file)
index 0000000..9212375
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * -
+ *  * ============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 io.undertow.server.HttpHandler;
+
+public interface ServerHandler {
+
+    String getMethod();
+
+    String getTemplate();
+
+    HttpHandler getHandler();
+}
index 1821803..92d9e17 100644 (file)
@@ -42,7 +42,7 @@ public class MeasSplitter {
     public MeasSplitter(MeasConverter converter) {\r
         this.converter = converter;\r
     }\r
-
+\r
     /**\r
      * Splits the MeasCollecFile to multiple MeasCollecFile based on the number of MeasData\r
      **/\r
@@ -50,10 +50,10 @@ public class MeasSplitter {
         logger.unwrap().debug("Splitting 3GPP xml MeasData to individual MeasCollecFile");\r
         MeasCollecFile currentMeasurement = converter.convert(event.getBody());\r
         event.setMeasCollecFile(currentMeasurement);\r
-        if(currentMeasurement.getMeasData().isEmpty()) {\r
+        if (currentMeasurement.getMeasData() == null || currentMeasurement.getMeasData().isEmpty()) {\r
             throw new NoSuchElementException("MeasData is empty.");\r
         }\r
-        return currentMeasurement.getMeasData().stream().map( measData -> {\r
+        return currentMeasurement.getMeasData().stream().map(measData -> {\r
             Event newEvent  = generateNewEvent(event);\r
             MeasCollecFile newMeasCollec = generateNewMeasCollec(newEvent,measData);\r
             newEvent.setMeasCollecFile(newMeasCollec);\r
index 411196c..9938eed 100644 (file)
@@ -27,10 +27,12 @@ import java.io.OutputStream;
 import java.net.HttpURLConnection;\r
 import java.net.URL;\r
 import java.nio.charset.StandardCharsets;\r
+import java.security.NoSuchAlgorithmException;\r
 import java.util.Optional;\r
 import java.util.UUID;\r
 import java.util.stream.Collectors;\r
 \r
+import org.onap.dcaegen2.services.pmmapper.exceptions.RequestFailure;\r
 import org.onap.dcaegen2.services.pmmapper.exceptions.ServerResponseException;\r
 import org.onap.dcaegen2.services.pmmapper.model.MapperConfig;\r
 import org.onap.logging.ref.slf4j.ONAPLogAdapter;\r
@@ -56,7 +58,7 @@ public class RequestSender {
      * is set to {@code GET} by default.\r
      * @see RequestSender#send(String,String,String)\r
      */\r
-    public String send(final String urlString) throws Exception {\r
+    public String send(final String urlString) throws InterruptedException {\r
         return send("GET", urlString);\r
     }\r
 \r
@@ -65,7 +67,7 @@ public class RequestSender {
      * is set to empty String by default.\r
      * @see RequestSender#send(String,String,String)\r
      */\r
-    public String send(String method, final String urlString) throws Exception {\r
+    public String send(String method, final String urlString) throws InterruptedException {\r
        return send(method,urlString,"");\r
     }\r
 \r
@@ -74,7 +76,7 @@ public class RequestSender {
      * is set to empty String by default.\r
      * @see RequestSender#send(String,String,String,String)\r
      */\r
-    public String send(String method, final String urlString, final String body) throws Exception {\r
+    public String send(String method, final String urlString, final String body) throws InterruptedException {\r
         return send(method,urlString,body,"");\r
     }\r
 \r
@@ -85,56 +87,47 @@ public class RequestSender {
      * @param body of the request as json\r
      * @param encodedCredentials base64-encoded username password credentials\r
      * @return http response body\r
-     * @throws Exception\r
+     * @throws InterruptedException\r
      */\r
-    public String send(String method, final String urlString, final String body, final String encodedCredentials) throws Exception {\r
-       String invocationID = Optional.ofNullable((String)MDC.get(ONAPLogConstants.MDCs.INVOCATION_ID))\r
-            .orElse(logger.invoke(ONAPLogConstants.InvocationMode.SYNCHRONOUS).toString());\r
+    public String send(String method, final String urlString, final String body, final String encodedCredentials)\r
+             throws InterruptedException {\r
+        String invocationID = Optional.ofNullable((String)MDC.get(ONAPLogConstants.MDCs.INVOCATION_ID))\r
+                 .orElse(logger.invoke(ONAPLogConstants.InvocationMode.SYNCHRONOUS).toString());\r
         String requestID =  Optional.ofNullable((String)MDC.get(ONAPLogConstants.MDCs.REQUEST_ID))\r
-            .orElse( UUID.randomUUID().toString());\r
+                .orElse(UUID.randomUUID().toString());\r
         String result = "";\r
+        boolean status = false;\r
+        int attempts = 1;\r
+        try {\r
+            while (!status && attempts <= MAX_RETRIES) {\r
+                final URL url = new URL(urlString);\r
+                final HttpURLConnection connection = getHttpURLConnection(method, url, invocationID, requestID);\r
+\r
+                if ("https".equalsIgnoreCase(url.getProtocol())) {\r
+                    HttpsURLConnection.setDefaultSSLSocketFactory(SSLContext.getDefault().getSocketFactory());\r
+                }\r
 \r
-        for (int i = 1; i <= MAX_RETRIES; i++) {\r
-            final URL url = new URL(urlString);\r
-            final HttpURLConnection connection = getHttpURLConnection(method, url, invocationID, requestID);\r
-\r
-\r
-            if("https".equalsIgnoreCase(url.getProtocol())) {\r
-                HttpsURLConnection.setDefaultSSLSocketFactory(SSLContext.getDefault().getSocketFactory());\r
-            }\r
-\r
-            if(!encodedCredentials.isEmpty()) {\r
-                connection.setRequestProperty("Authorization", "Basic " + encodedCredentials);\r
-            }\r
-\r
-            if(!body.isEmpty()) {\r
-                setMessageBody(connection, body);\r
-            }\r
-\r
-            logger.unwrap().info("Sending {} request to {}.", method, urlString);\r
-\r
-            try (InputStream is = connection.getInputStream();\r
-                    BufferedReader reader = new BufferedReader(new InputStreamReader(is))) {\r
-                result = reader.lines()\r
-                        .collect(Collectors.joining("\n"));\r
-                int responseCode = connection.getResponseCode();\r
-                if (!(isWithinErrorRange(responseCode))) {\r
-                    logger.unwrap().info("Response code: {}, Server Response Received:\n{}",responseCode, result);\r
-                    break;\r
+                if (!encodedCredentials.isEmpty()) {\r
+                    connection.setRequestProperty("Authorization", "Basic " + encodedCredentials);\r
                 }\r
-            } catch (Exception e) {\r
-                if (retryLimitReached(i)) {\r
-                    logger.unwrap().error("Execution error: {}", connection.getResponseMessage(), e);\r
-                    throw new ServerResponseException(SERVER_ERROR_MESSAGE + ": " + connection.getResponseMessage(), e);\r
+\r
+                if (!body.isEmpty()) {\r
+                    setMessageBody(connection, body);\r
                 }\r
+                result = getResult(attempts, connection);\r
+                status = !isWithinErrorRange(connection.getResponseCode());\r
+                attempts++;\r
+                Thread.sleep(RETRY_INTERVAL);\r
             }\r
-\r
-            Thread.sleep(RETRY_INTERVAL);\r
+        } catch (IOException | NoSuchAlgorithmException ex) {\r
+            logger.unwrap().warn("Request failure", ex);\r
+            throw new RequestFailure(ex);\r
         }\r
         return result;\r
     }\r
 \r
-    private HttpURLConnection getHttpURLConnection(String method, URL url, String invocationID, String requestID) throws IOException {\r
+    private HttpURLConnection getHttpURLConnection(String method, URL url, String invocationID, String requestID)\r
+                throws IOException {\r
         HttpURLConnection connection = (HttpURLConnection) url.openConnection();\r
         connection.setReadTimeout(DEFAULT_READ_TIMEOUT);\r
         connection.setRequestProperty(ONAPLogConstants.Headers.REQUEST_ID, requestID);\r
@@ -161,4 +154,23 @@ public class RequestSender {
     private boolean isWithinErrorRange(final int responseCode) {\r
         return responseCode >= ERROR_START_RANGE;\r
     }\r
+\r
+    private String getResult(int attemptNumber, HttpURLConnection connection) throws IOException {\r
+        logger.unwrap().info("Sending {} request to {}.", connection.getRequestMethod(), connection.getURL());\r
+        String result = "";\r
+        try (InputStream is = connection.getInputStream();\r
+                BufferedReader reader = new BufferedReader(new InputStreamReader(is))) {\r
+            result = reader.lines().collect(Collectors.joining("\n"));\r
+            int responseCode = connection.getResponseCode();\r
+            if (!(isWithinErrorRange(responseCode))) {\r
+                logger.unwrap().info("Response code: {}, Server Response Received:\n{}", responseCode, result);\r
+            }\r
+        } catch (Exception e) {\r
+            if (retryLimitReached(attemptNumber)) {\r
+                logger.unwrap().error("Execution error: {}", connection.getResponseMessage(), e);\r
+                throw new ServerResponseException(SERVER_ERROR_MESSAGE + ": " + connection.getResponseMessage(), e);\r
+            }\r
+        }\r
+        return result;\r
+    }\r
 }
\ No newline at end of file
index ef508f3..1772452 100644 (file)
  * ============LICENSE_END=========================================================
  */
 package org.onap.dcaegen2.pmmapper.messagerouter;
-import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
+
+import org.onap.dcaegen2.services.pmmapper.exceptions.RequestFailure;
 import reactor.test.StepVerifier;
 import java.util.Arrays;
 import java.util.List;
@@ -31,7 +32,6 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mockito;
-import org.onap.dcaegen2.services.pmmapper.exceptions.MRPublisherException;
 import org.onap.dcaegen2.services.pmmapper.messagerouter.VESPublisher;
 import org.onap.dcaegen2.services.pmmapper.utils.EnvironmentConfig;
 import org.onap.dcaegen2.services.pmmapper.model.Event;
@@ -79,7 +79,7 @@ public class VESPublisherTest {
         Event event = mock(Event.class);
         List<Event> events  = Arrays.asList(event,event,event);
         when(event.getVes()).thenReturn(ves);
-        when(sender.send("POST",topicURL,ves,"base64encoded")).thenThrow(Exception.class);
+        when(sender.send("POST",topicURL,ves,"base64encoded")).thenThrow(RequestFailure.class);
 
         Flux<Event> flux = sut.publish(events);
 
index 11215b3..46994b3 100644 (file)
 
 package org.onap.dcaegen2.services.pmmapper;
 
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.mockito.Mockito.*;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
 import static org.mockserver.integration.ClientAndServer.startClientAndServer;
 import static org.mockserver.model.HttpResponse.response;
+import static utils.ConfigUtils.getMapperConfigFromFile;
 
 import java.io.IOException;
 import java.nio.file.Files;
@@ -37,6 +42,12 @@ import java.util.List;
 import com.google.gson.Gson;
 import io.undertow.server.HttpServerExchange;
 import io.undertow.util.StatusCodes;
+import org.junit.jupiter.api.BeforeEach;
+import org.onap.dcaegen2.services.pmmapper.config.ConfigHandler;
+import org.onap.dcaegen2.services.pmmapper.exceptions.CBSServerError;
+import org.onap.dcaegen2.services.pmmapper.exceptions.EnvironmentConfigException;
+import org.onap.dcaegen2.services.pmmapper.exceptions.MapperConfigException;
+
 import org.onap.dcaegen2.services.pmmapper.utils.XMLValidator;
 import reactor.core.publisher.Flux;
 
@@ -66,23 +77,76 @@ class AppTest {
     static MockServerClient client;
 
     private static EventMetadata eventMetadata;
+    private static MapperConfig mapperConfig;
+    private static ConfigHandler configHandler;
 
     private static final Path dataDirectory = Paths.get("src/test/resources/mapper_test/mapping_data/");
     private static final Path metadata = Paths.get("src/test/resources/valid_metadata.json");
+    private static final Path template = Paths.get("src/main/resources/mapping.ftl");
     private static final Path schema = Paths.get("src/main/resources/measCollec_plusString.xsd");
+    private static final String config = "valid_mapper_config.json";
+
+    private App objUnderTest;
 
 
     @BeforeAll
-    public static void setup() {
+    static void setup() {
         mockServer =  startClientAndServer(35454);
         client = new MockServerClient("127.0.0.1", 35454);
+        mapperConfig = getMapperConfigFromFile(config);
     }
 
     @AfterAll
-    public static void teardown() {
+    static void teardown() {
         mockServer.stop();
     }
 
+    @BeforeEach
+    void beforeEach() {
+        configHandler = mock(ConfigHandler.class);
+    }
+
+    @Test
+    void testDisabledHTTPServer() throws Exception {
+
+        MapperConfig mockConfig = Mockito.spy(mapperConfig);
+        when(mockConfig.getEnableHttp()).thenReturn(false);
+        when(configHandler.getMapperConfig()).thenReturn(mockConfig);
+        objUnderTest = new App(template, schema, 0, 0, configHandler);
+        objUnderTest.start();
+        assertEquals(1, objUnderTest.getApplicationServer().getListenerInfo().size());
+        assertEquals("https", objUnderTest.getApplicationServer().getListenerInfo().get(0).getProtcol());
+        objUnderTest.stop();
+    }
+
+    @Test
+    void testEnabledHTTPServer() throws Exception {
+        MapperConfig mockConfig = Mockito.spy(mapperConfig);
+        when(mockConfig.getEnableHttp()).thenReturn(true);
+        when(configHandler.getMapperConfig()).thenReturn(mockConfig);
+        objUnderTest = new App(template, schema, 0, 0, configHandler);
+        objUnderTest.start();
+        assertEquals(2, objUnderTest.getApplicationServer().getListenerInfo().size());
+        assertEquals("http", objUnderTest.getApplicationServer().getListenerInfo().get(0).getProtcol());
+        objUnderTest.stop();
+    }
+
+    @Test
+    void testConfigFailure() throws EnvironmentConfigException, CBSServerError, MapperConfigException {
+        when(configHandler.getMapperConfig()).thenThrow(MapperConfigException.class);
+        assertThrows(IllegalStateException.class, () -> new App(template, schema, 0, 0, configHandler));
+
+    }
+
+    @Test
+    void testServerCreationFailure() throws EnvironmentConfigException, CBSServerError, MapperConfigException {
+        MapperConfig mockConfig = Mockito.spy(mapperConfig);
+        when(mockConfig.getKeyStorePath()).thenReturn("not_a_file");
+        when(configHandler.getMapperConfig()).thenReturn(mockConfig);
+        assertThrows(IllegalStateException.class, () -> new App(template, schema, 0, 0, configHandler));
+
+    }
+
     @Test
     void testHandleBackPressureNullValue() {
         assertThrows(NullPointerException.class, () -> App.handleBackPressure(null));
@@ -110,7 +174,7 @@ class AppTest {
     }
 
     @Test
-    public void testFilterByFileType_success() {
+    void testFilterByFileType_success() {
         Event mockEvent = Mockito.mock(Event.class);
         MapperConfig mockConfig = Mockito.mock(MapperConfig.class);
 
@@ -123,7 +187,7 @@ class AppTest {
     }
 
     @Test
-    public void testFilterByFileType_NonXML() {
+    void testFilterByFileType_NonXML() {
         Event mockEvent = Mockito.mock(Event.class);
         MapperConfig mockConfig = Mockito.mock(MapperConfig.class);
 
@@ -136,7 +200,7 @@ class AppTest {
     }
 
     @Test
-    public void testFilterByFileType_throwException() {
+    void testFilterByFileType_throwException() {
         Event mockEvent = Mockito.mock(Event.class);
         MeasFilterHandler mockFilter = Mockito.mock(MeasFilterHandler.class);
         MapperConfig mockConfig = Mockito.mock(MapperConfig.class);
@@ -148,7 +212,7 @@ class AppTest {
     }
 
     @Test
-    public void testValidateXML_success() throws IOException {
+    void testValidateXML_success() throws IOException {
         XMLValidator mockValidator = new XMLValidator(schema);
         MapperConfig mockConfig = Mockito.mock(MapperConfig.class);
 
@@ -164,7 +228,7 @@ class AppTest {
     }
 
     @Test
-    public void testValidateXML_failure() throws IOException {
+    void testValidateXML_failure() throws IOException {
         XMLValidator mockValidator = new XMLValidator(schema);
         MapperConfig mockConfig = Mockito.mock(MapperConfig.class);
 
@@ -180,7 +244,7 @@ class AppTest {
     }
 
     @Test
-    public void testValidateXML_throwException() {
+    void testValidateXML_throwException() {
         Event mockEvent = Mockito.mock(Event.class);
         XMLValidator mockValidator = Mockito.mock(XMLValidator.class);
         MapperConfig mockConfig = Mockito.mock(MapperConfig.class);
@@ -192,7 +256,7 @@ class AppTest {
     }
 
     @Test
-    public void testFilter_success() {
+    void testFilter_success() {
         Event mockEvent = Mockito.mock(Event.class);
         List<Event> mockEvents = Arrays.asList(mockEvent);
         MapperConfig mockConfig = Mockito.mock(MapperConfig.class);
@@ -201,7 +265,7 @@ class AppTest {
     }
 
     @Test
-    public void testFilter_throwException() {
+    void testFilter_throwException() {
         HttpRequest req = HttpRequest.request();
         client.when(req).respond( response().withStatusCode(200));
 
@@ -222,36 +286,33 @@ class AppTest {
     }
 
     @Test
-    public void testSplit_empty_success() {
+    void testSplit_empty_success() {
         Event mockEvent = Mockito.mock(Event.class);
         MapperConfig mockConfig = Mockito.mock(MapperConfig.class);
         MeasConverter mockMeasConverter = Mockito.mock(MeasConverter.class);
         Flux<List<Event>> splitResult = App.split(new MeasSplitter(mockMeasConverter), mockEvent, mockConfig);
-        splitResult.equals(Flux.<List<Event>>empty());
+        assertEquals(splitResult, Flux.<List<Event>>empty());
     }
 
     @Test
-    public void testSplit_success() {
+    void testSplit_success() {
         Event mockEvent = Mockito.mock(Event.class);
         List<Event> mockEvents = Arrays.asList(mockEvent,mockEvent);
         MapperConfig mockConfig = Mockito.mock(MapperConfig.class);
         MeasSplitter mockSplitter  = Mockito.mock(MeasSplitter.class);
         Mockito.when(mockSplitter.split(mockEvent)).thenReturn(mockEvents);
-
         Flux<List<Event>> splitResult = App.split(mockSplitter, mockEvent, mockConfig);
-
-        splitResult.equals(Flux.just(mockEvents));
+        assertEquals(splitResult.toString(), Flux.just(mockEvents).toString());
     }
 
     @Test
-    public void testMapping_empty_success() {
+    void testMapping_empty_success() {
         Event mockEvent = Mockito.mock(Event.class);
         MeasConverter mockMeasConverter = Mockito.mock(MeasConverter.class);
         List<Event> mockEvents = Arrays.asList(mockEvent);
         MapperConfig mockConfig = Mockito.mock(MapperConfig.class);
         Path mappingTemplate = Paths.get("src/main/resources/mapping.ftl");
         Flux<List<Event>> mappingResult = App.map(new Mapper(mappingTemplate,mockMeasConverter), mockEvents, mockConfig);
-        mappingResult.equals(Flux.<List<Event>>empty());
+        assertEquals(mappingResult, Flux.<List<Event>>empty());
     }
-
 }
index 92d2c93..2cbfffa 100644 (file)
@@ -45,6 +45,7 @@ import org.onap.dcaegen2.services.pmmapper.exceptions.CBSConfigException;
 import org.onap.dcaegen2.services.pmmapper.exceptions.CBSServerError;
 import org.onap.dcaegen2.services.pmmapper.exceptions.EnvironmentConfigException;
 import org.onap.dcaegen2.services.pmmapper.exceptions.MapperConfigException;
+import org.onap.dcaegen2.services.pmmapper.exceptions.RequestFailure;
 import org.onap.dcaegen2.services.pmmapper.utils.EnvironmentConfig;
 import org.onap.dcaegen2.services.pmmapper.model.MapperConfig;
 import org.onap.dcaegen2.services.pmmapper.utils.RequestSender;
@@ -99,6 +100,9 @@ class ConfigHandlerTests {
         MapperConfig actualConfig = getMapperConfig();
         JsonObject expectedConfigJson = gson.fromJson(validMapperConfig, JsonObject.class);
         MapperConfig expectedConfig = gson.fromJson(expectedConfigJson, MapperConfig.class);
+        assertEquals(expectedConfig.getPublisherTopicUrl(), actualConfig.getPublisherTopicUrl());
+        assertEquals(expectedConfig.getPublisherUserName(), actualConfig.getPublisherUserName());
+        assertEquals(expectedConfig.getPublisherPassword(), actualConfig.getPublisherPassword());
         assertEquals(expectedConfig, actualConfig);
         assertTrue(logAppender.list.get(1).getMessage().contains("Received pm-mapper configuration from ConfigBinding Service"));
         logAppender.stop();
@@ -106,7 +110,7 @@ class ConfigHandlerTests {
 
     @Test
     void configbinding_server_error() throws Exception {
-        when(sender.send(anyString())).thenThrow(CBSServerError.class);
+        when(sender.send(anyString())).thenThrow(RequestFailure.class);
         assertThrows(CBSServerError.class, this::getMapperConfig);
     }
 
index 031a3c8..34b71f4 100644 (file)
@@ -213,9 +213,7 @@ class MeasFilterHandlerTest {
         when(exchange.getRequestPath())
             .thenReturn(invalidFiletypes.toString());
 
-        invalidFiletypes.forEach(c -> {
-            assertFalse(objUnderTest.filterByFileType(event));
-        });
+        invalidFiletypes.forEach(c -> assertFalse(objUnderTest.filterByFileType(event)));
     }
 
 
@@ -227,7 +225,7 @@ class MeasFilterHandlerTest {
 
     private Event generateEvent(String inputPath, Filter filter) {
         String inputXml = EventUtils.fileContentsToString(Paths.get(inputPath + ".xml"));
-        Event event = new Event(exchange, inputXml, metaData, new HashMap<String, String>(), "");
+        Event event = new Event(exchange, inputXml, metaData, new HashMap<>(), "");
         event.setMeasCollecFile(converter.convert(inputXml));
         event.setFilter(filter);
         return event;
index 7a8602e..f623d57 100644 (file)
@@ -20,7 +20,7 @@
 
 package org.onap.dcaegen2.services.pmmapper.mapping;
 
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
@@ -37,7 +37,6 @@ import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
-import java.util.ArrayList;
 import java.util.List;
 
 import org.everit.json.schema.Schema;
@@ -49,15 +48,12 @@ import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.MethodSource;
-import org.mockito.Mockito;
 import org.mockito.junit.jupiter.MockitoExtension;
 import org.onap.dcaegen2.services.pmmapper.exceptions.MappingException;
-import org.onap.dcaegen2.services.pmmapper.exceptions.XMLParseException;
 import org.onap.dcaegen2.services.pmmapper.model.Event;
 import org.onap.dcaegen2.services.pmmapper.model.EventMetadata;
 import org.onap.dcaegen2.services.pmmapper.model.MeasCollecFile;
 import org.onap.dcaegen2.services.pmmapper.utils.MeasConverter;
-import org.onap.logging.ref.slf4j.ONAPLogAdapter;
 import org.powermock.reflect.Whitebox;
 import utils.EventUtils;
 
@@ -141,9 +137,9 @@ class MapperTest {
     void testMapEvents() throws IOException {
         List<Event> events = getValidEvents();
         List<Event> expectedEvents = objUnderTest.mapEvents(events);
-        expectedEvents.forEach(event->{
+        expectedEvents.forEach(event -> {
             when(converter.convert(any(MeasCollecFile.class))).thenReturn(event.getBody());
-            assertTrue(event.getVes() != null);
+            assertNotNull(event.getVes());
         });
     }
 
index 54c5091..5028464 100644 (file)
@@ -43,7 +43,7 @@ import io.undertow.server.HttpServerExchange;
 import utils.EventUtils;\r
 \r
 @ExtendWith(MockitoExtension.class)\r
-public class MeasSplitterTest {\r
+class MeasSplitterTest {\r
     private static final String baseDir = "src/test/resources/split_test/";\r
     private MeasSplitter objUnderTest;\r
     private MeasConverter converter;\r
@@ -57,33 +57,31 @@ public class MeasSplitterTest {
     MapperConfig config;\r
 \r
     @BeforeEach\r
-    public void setup() {\r
+    void setup() {\r
         converter =  new MeasConverter();\r
         objUnderTest = new MeasSplitter(converter);\r
     }\r
 \r
-    public void setupBaseEvent() {\r
+    void setupBaseEvent() {\r
         Mockito.when(event.getHttpServerExchange()).thenReturn(exchange);\r
         Mockito.when(event.getMetadata()).thenReturn(meta);\r
-        Mockito.when(event.getMdc()).thenReturn(new HashMap<String, String>());\r
+        Mockito.when(event.getMdc()).thenReturn(new HashMap<>());\r
         Mockito.when(event.getMetadata()).thenReturn(meta);\r
         Mockito.when(event.getPublishIdentity()).thenReturn("");\r
     }\r
 \r
 \r
     @Test\r
-    public void no_measData() {\r
+    void no_measData() {\r
         String inputPath = baseDir + "no_measdata";\r
         String inputXml = EventUtils.fileContentsToString(Paths.get(inputPath + ".xml"));\r
         Mockito.when(event.getBody()).thenReturn(inputXml);\r
 \r
-        Assertions.assertThrows(NoSuchElementException.class, ()->{\r
-            objUnderTest.split(event);\r
-        });\r
+        Assertions.assertThrows(NoSuchElementException.class, () -> objUnderTest.split(event));\r
     }\r
 \r
     @Test\r
-    public void typeA_returns_only_one_event() throws JAXBException {\r
+    void typeA_returns_only_one_event() throws JAXBException {\r
         String inputPath = baseDir + "meas_results_typeA";\r
         String inputXml = EventUtils.fileContentsToString(Paths.get(inputPath + ".xml"));\r
         MeasCollecFile measToBeSplit = converter.convert(inputXml);\r
@@ -97,7 +95,7 @@ public class MeasSplitterTest {
     }\r
 \r
     @Test\r
-    public void typeC_returns_multiple_events() throws JAXBException {\r
+    void typeC_returns_multiple_events() throws JAXBException {\r
         String inputPath = baseDir + "meas_results_typeC";\r
         String inputXml = EventUtils.fileContentsToString(Paths.get(inputPath + ".xml"));\r
         setupBaseEvent();\r
@@ -111,7 +109,7 @@ public class MeasSplitterTest {
         for (int i = 0; i < splitEvents.size(); i++) {\r
           String measInfoId = splitEvents.get(i).getMeasCollecFile()\r
                   .getMeasData().get(0).getMeasInfo().get(0).getMeasInfoId();\r
-          Assertions.assertTrue(measInfoId.equals("measInfoId"+(i+1)));\r
+            Assertions.assertEquals(measInfoId, "measInfoId" + (i + 1));\r
         }\r
     }\r
 }\r
index 34a2277..c9f2998 100644 (file)
@@ -70,7 +70,6 @@ public class RequestSenderTests {
         String uuidRegex = "^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$";
         ListAppender<ILoggingEvent> logAppender = LoggingUtils.getLogListAppender(RequestSender.class);
         HttpRequest req = HttpRequest.request();
-
         client.when(req
                 .withHeader(ONAPLogConstants.Headers.REQUEST_ID, uuidRegex)
                 .withHeader(ONAPLogConstants.Headers.INVOCATION_ID, uuidRegex))
index f14e080..0051629 100644 (file)
@@ -32,7 +32,6 @@ import java.nio.file.Path;
 import java.util.HashMap;
 import java.util.List;
 import java.util.stream.Collectors;
-import java.util.stream.Stream;
 
 import org.onap.dcaegen2.services.pmmapper.model.Event;
 import org.onap.dcaegen2.services.pmmapper.model.EventMetadata;
index 1b5a362..f2146f7 100644 (file)
@@ -9,7 +9,6 @@
             <job jobId="jobId"/>\r
             <granPeriod duration="PT900S" endTime="2018-10-02T12:15:00Z"/>\r
             <repPeriod duration="PT900S"/>\r
-            <measTypes></measTypes>\r
             <measType p="1">a</measType>\r
             <measType p="3">b</measType>\r
             <measValue measObjLdn="some measObjLdn">\r
index db50fca..b517a7d 100644 (file)
@@ -9,7 +9,6 @@
             <job jobId="jobId"/>\r
             <granPeriod duration="PT900S" endTime="2018-10-02T12:15:00Z"/>\r
             <repPeriod duration="PT900S"/>\r
-            <measTypes></measTypes>\r
             <measType p="1">a</measType>\r
             <measType p="3">b</measType>\r
             <measValue measObjLdn="some measObjLdn">\r
@@ -22,7 +21,6 @@
             <job jobId="jobId"/>\r
             <granPeriod duration="PT900S" endTime="2018-10-02T12:15:00Z"/>\r
             <repPeriod duration="PT900S"/>\r
-            <measTypes></measTypes>\r
             <measType p="1">a</measType>\r
             <measType p="3">b</measType>\r
             <measValue measObjLdn="some measObjLdn">\r