diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/factory/NetworkElementFactory.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/factory/NetworkElementFactory.java
index 08fe56f..4b3881e 100644
--- a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/factory/NetworkElementFactory.java
+++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/factory/NetworkElementFactory.java
@@ -26,6 +26,7 @@
 
 public interface NetworkElementFactory {
 
-    Optional<NetworkElement> create(@NonNull NetconfAccessor acessor, @NonNull DeviceManagerServiceProvider serviceProvider);
+    Optional<NetworkElement> create(@NonNull NetconfAccessor acessor,
+            @NonNull DeviceManagerServiceProvider serviceProvider);
 
 }
diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/DeviceMonitoredNe.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/DeviceMonitoredNe.java
index 5d47c0c..e86559c 100644
--- a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/DeviceMonitoredNe.java
+++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/DeviceMonitoredNe.java
@@ -33,12 +33,14 @@
 
     /**
      * Test connection to mediator, by getting data that have to be called from NE
+     * 
      * @return true if connection working, false if not
      */
     public boolean checkIfConnectionToMediatorIsOk();
 
     /**
      * Test connection to NE via mediator, by getting data that have to be called from NE
+     * 
      * @return true if connection working, false if not
      */
     public boolean checkIfConnectionToNeIsOk();
diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/InventoryProvider.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/InventoryProvider.java
index d6dea7d..27c2e3b 100644
--- a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/InventoryProvider.java
+++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/InventoryProvider.java
@@ -21,6 +21,7 @@
 
 /**
  * Provide Inventory information
+ * 
  * @author herbert
  *
  */
diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/NetworkElement.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/NetworkElement.java
index e6ebfdc..7c3841e 100644
--- a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/NetworkElement.java
+++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/ne/service/NetworkElement.java
@@ -39,10 +39,8 @@
     /** self selected device type **/
     NetworkElementDeviceType getDeviceType();
 
-    /** Provide optional service interface.
-     * Services:
-     *     InventoryProvider.class
-     *     DeviceMonitoredNe.class
+    /**
+     * Provide optional service interface. Services: InventoryProvider.class DeviceMonitoredNe.class
      **/
     <L extends NetworkElementService> Optional<L> getService(Class<L> clazz);
 
diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/DeviceManagerServiceProvider.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/DeviceManagerServiceProvider.java
index efccdf0..741123b 100644
--- a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/DeviceManagerServiceProvider.java
+++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/DeviceManagerServiceProvider.java
@@ -23,23 +23,29 @@
 
 public interface DeviceManagerServiceProvider {
 
-    /** @return Get a dataprovider**/
-    @NonNull DataProvider getDataProvider();
+    /** @return Get a dataprovider **/
+    @NonNull
+    DataProvider getDataProvider();
 
     /** @return Get notification service **/
-    @NonNull NotificationService getNotificationService();
+    @NonNull
+    NotificationService getNotificationService();
 
     /** @return Get service for handling fault **/
-    @NonNull FaultService getFaultService();
+    @NonNull
+    FaultService getFaultService();
 
     /** @return Get service for handling fault **/
-    @NonNull EquipmentService getEquipmentService();
+    @NonNull
+    EquipmentService getEquipmentService();
 
     /** @return Get Active and available inventory service */
-    @NonNull AaiService getAaiService();
+    @NonNull
+    AaiService getAaiService();
 
     /** @return MaintenanceService object for maintenance service */
-    @NonNull MaintenanceService getMaintenanceService();
+    @NonNull
+    MaintenanceService getMaintenanceService();
 
     /** @return related service instance */
     @NonNull
@@ -50,5 +56,6 @@
     EventHandlingService getEventHandlingService();
 
     /** @return Get configuration descriptor */
-    @NonNull ConfigurationFileRepresentation getConfigurationFileRepresentation();
+    @NonNull
+    ConfigurationFileRepresentation getConfigurationFileRepresentation();
 }
diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/EquipmentService.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/EquipmentService.java
index a809e67..10a3aa6 100644
--- a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/EquipmentService.java
+++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/EquipmentService.java
@@ -30,6 +30,7 @@
 
     /**
      * Write equipment to database
+     * 
      * @param equipment with all equipment entities (card, subrack) of device
      */
     void writeEquipment(@NonNull EquipmentData equipment);
diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/FaultService.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/FaultService.java
index dc2ce93..d8a1750 100644
--- a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/FaultService.java
+++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/FaultService.java
@@ -30,13 +30,16 @@
  */
 public interface FaultService extends DeviceManagerService {
 
-    /** Notify fault information to devicemanager
+    /**
+     * Notify fault information to devicemanager
+     * 
      * @param faultNotification to send
      */
     void faultNotification(@NonNull FaultlogEntity faultNotification);
 
     /**
      * Fault notification
+     * 
      * @param nodeId of node
      * @param counter provided
      * @param timeStamp provided
@@ -44,11 +47,12 @@
      * @param problem provided
      * @param severity provided
      */
-    void faultNotification(@NonNull NodeId nodeId, @Nullable Integer counter, @Nullable DateAndTime timeStamp, @Nullable String objectId,
-            @Nullable String problem, @Nullable SeverityType severity);
+    void faultNotification(@NonNull NodeId nodeId, @Nullable Integer counter, @Nullable DateAndTime timeStamp,
+            @Nullable String objectId, @Nullable String problem, @Nullable SeverityType severity);
 
     /**
      * Remove current problems of node
+     * 
      * @param nodeId of node
      * @return number of removed entries
      */
@@ -56,6 +60,7 @@
 
     /**
      * Write initial list of problems of node
+     * 
      * @param nodeId of node
      * @param resultList
      */
diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/MaintenanceService.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/MaintenanceService.java
index d0eab35..8a2ffd8 100644
--- a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/MaintenanceService.java
+++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/MaintenanceService.java
@@ -20,9 +20,9 @@
 public interface MaintenanceService extends DeviceManagerService {
 
     /**
-     * Verify maintenance state of given object according to the filter settings.
-     * The object is specified by the criteria provided in the parameters.
-     * The data _id (uuid) is equal to the mountpointReference.
+     * Verify maintenance state of given object according to the filter settings. The object is specified by the
+     * criteria provided in the parameters. The data _id (uuid) is equal to the mountpointReference.
+     * 
      * @param mountpointReference used as reference, to query the data from database.
      * @param objectIdRef first level id in onf core model, delivered by notification objectid
      * @param problem problem name of device, delivered in problem notification
diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/NetconfNetworkElementService.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/NetconfNetworkElementService.java
index d2d4cd5..80a7e2f 100644
--- a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/NetconfNetworkElementService.java
+++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/NetconfNetworkElementService.java
@@ -25,7 +25,8 @@
 public interface NetconfNetworkElementService extends Registration, DeviceManagerService {
 
     /** Register factory class for network-element handler **/
-    @NonNull <L extends NetworkElementFactory> FactoryRegistration<L> registerNetworkElementFactory(@NonNull L factory);
+    @NonNull
+    <L extends NetworkElementFactory> FactoryRegistration<L> registerNetworkElementFactory(@NonNull L factory);
 
     /** Get Devicemanager service **/
     DeviceManagerServiceProvider getServiceProvider();
diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/NotificationService.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/NotificationService.java
index f3f82ca..3e1589a 100644
--- a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/NotificationService.java
+++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/service/NotificationService.java
@@ -33,13 +33,16 @@
     void eventNotification(@NonNull EventlogEntity eventNotification);
 
     /** create notification for an object **/
-    void creationNotification(NodeId nodeId, @Nullable Integer counter, @Nullable DateAndTime timeStamp, @Nullable String objectId);
+    void creationNotification(NodeId nodeId, @Nullable Integer counter, @Nullable DateAndTime timeStamp,
+            @Nullable String objectId);
 
     /** create notification of object **/
     void deletionNotification(NodeId nodeId, @Nullable Integer counter, @Nullable DateAndTime timeStamp,
             @Nullable String objectId);
 
-    /** change notification of attribute of object
+    /**
+     * change notification of attribute of object
+     * 
      * @param nodeId of device
      * @param counter provided
      * @param timeStamp provided
diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/EquipmentData.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/EquipmentData.java
index cb251cb..f4ae48f 100644
--- a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/EquipmentData.java
+++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/EquipmentData.java
@@ -62,6 +62,7 @@
 
     /**
      * Get list with all equipment
+     * 
      * @return list with equipment
      */
     public List<Inventory> getList() {
diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/FaultData.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/FaultData.java
index c2c1706..51cf268 100644
--- a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/FaultData.java
+++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/FaultData.java
@@ -79,8 +79,7 @@
     /**
      *
      */
-    public void clear() {
-    }
+    public void clear() {}
 
     /**
      * @param idx of element to get
@@ -92,6 +91,7 @@
 
     /**
      * Provide list with all problems of node
+     * 
      * @return list
      */
     public List<Faultlog> getProblemList() {
diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/FaultNotificationBuilder2.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/FaultNotificationBuilder2.java
index 62ba644..facf142 100644
--- a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/FaultNotificationBuilder2.java
+++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/FaultNotificationBuilder2.java
@@ -30,7 +30,8 @@
 public class FaultNotificationBuilder2 extends FaultlogBuilder {
 
     public FaultNotificationBuilder2(NodeId nodeId, @Nullable Integer counter, @Nullable DateAndTime timeStamp,
-            @Nullable String objectId, @Nullable String problem, @Nullable SeverityType severity, SourceType sourceType) {
+            @Nullable String objectId, @Nullable String problem, @Nullable SeverityType severity,
+            SourceType sourceType) {
 
         setNodeId(nodeId.getValue());
         if (counter != null) {
diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/InternalConnectionStatus.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/InternalConnectionStatus.java
index bc6f3c5..ae1b5c8 100644
--- a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/InternalConnectionStatus.java
+++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/InternalConnectionStatus.java
@@ -22,16 +22,16 @@
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ConnectionLogStatus;
 
 public class InternalConnectionStatus {
-	public static ConnectionLogStatus statusFromNodeStatus(ConnectionStatus nodeStatus) {
-		switch(nodeStatus) {
-		case Connected:
-			return ConnectionLogStatus.Connected;
-		case Connecting:
-			return ConnectionLogStatus.Connecting;
-		case UnableToConnect:
-			return ConnectionLogStatus.UnableToConnect;
-		default:
-			return ConnectionLogStatus.Undefined;
-		}
-	}
+    public static ConnectionLogStatus statusFromNodeStatus(ConnectionStatus nodeStatus) {
+        switch (nodeStatus) {
+            case Connected:
+                return ConnectionLogStatus.Connected;
+            case Connecting:
+                return ConnectionLogStatus.Connecting;
+            case UnableToConnect:
+                return ConnectionLogStatus.UnableToConnect;
+            default:
+                return ConnectionLogStatus.Undefined;
+        }
+    }
 }
diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/InventoryInformationDcae.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/InventoryInformationDcae.java
index 7e25f60..cf43a57 100644
--- a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/InventoryInformationDcae.java
+++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/types/InventoryInformationDcae.java
@@ -36,28 +36,26 @@
     private String deviceIpv6;
     private List<String> interfaceUuidList;
 
-    public InventoryInformationDcae()
-    {
-        this.type=UNKNOWN;
-        this.model=UNKNOWN;
-        this.vendor=UNKNOWN;
-        this.deviceIpv4=UNKNOWN;
-        this.deviceIpv6=UNKNOWN;
-        this.interfaceUuidList=EMPTY;
+    public InventoryInformationDcae() {
+        this.type = UNKNOWN;
+        this.model = UNKNOWN;
+        this.vendor = UNKNOWN;
+        this.deviceIpv4 = UNKNOWN;
+        this.deviceIpv6 = UNKNOWN;
+        this.interfaceUuidList = EMPTY;
     }
 
     public InventoryInformationDcae(InventoryInformationDcae inventoryInformation) {
-        this.type=inventoryInformation.type;
-        this.model=inventoryInformation.model;
-        this.vendor=inventoryInformation.vendor;
-        this.deviceIpv4=inventoryInformation.deviceIpv4;
-        this.deviceIpv6=inventoryInformation.deviceIpv6;
-        this.interfaceUuidList=new ArrayList<>(inventoryInformation.interfaceUuidList);
+        this.type = inventoryInformation.type;
+        this.model = inventoryInformation.model;
+        this.vendor = inventoryInformation.vendor;
+        this.deviceIpv4 = inventoryInformation.deviceIpv4;
+        this.deviceIpv6 = inventoryInformation.deviceIpv6;
+        this.interfaceUuidList = new ArrayList<>(inventoryInformation.interfaceUuidList);
     }
 
-    public InventoryInformationDcae(
-                String type, String model, String vendor, String deviceIpv4,
-                String deviceIpv6, List<String> interfaceUuidList) {
+    public InventoryInformationDcae(String type, String model, String vendor, String deviceIpv4, String deviceIpv6,
+            List<String> interfaceUuidList) {
         setType(type);
         setModel(model);
         setVendor(vendor);
@@ -111,7 +109,7 @@
     }
 
     public InventoryInformationDcae setDeviceIpv6(String deviceIpv6) {
-        this.deviceIpv6 = deviceIpv6 != null ? deviceIpv6 : UNKNOWN ;
+        this.deviceIpv6 = deviceIpv6 != null ? deviceIpv6 : UNKNOWN;
         return this;
     }
 
diff --git a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/util/UnkownDevicemanagerServiceException.java b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/util/UnkownDevicemanagerServiceException.java
index d479616..b519368 100644
--- a/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/util/UnkownDevicemanagerServiceException.java
+++ b/sdnr/wt/devicemanager/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/util/UnkownDevicemanagerServiceException.java
@@ -22,7 +22,7 @@
     private static final long serialVersionUID = 1L;
 
     public UnkownDevicemanagerServiceException(String string, Class<?> serviceInterface) {
-        super(string+" "+serviceInterface.getName());
+        super(string + " " + serviceInterface.getName());
     }
 
 
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/aaiconnector/impl/AaiWebApiClient.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/aaiconnector/impl/AaiWebApiClient.java
index 9b38c11..44a5c96 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/aaiconnector/impl/AaiWebApiClient.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/aaiconnector/impl/AaiWebApiClient.java
@@ -77,6 +77,7 @@
 
     /**
      * Create and specify defition parametrs of pnf
+     * 
      * @param pnfId name
      * @param type type
      * @param model model
@@ -94,6 +95,7 @@
 
     /**
      * Unregister
+     * 
      * @param pnfId name
      * @return true if http response code was 200 or false if not.
      */
@@ -104,6 +106,7 @@
 
     /**
      * Send registration request
+     * 
      * @param pnfId name
      * @return error accoring to http response code or -1
      */
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/aaiconnector/impl/config/AaiClientPropertiesFile.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/aaiconnector/impl/config/AaiClientPropertiesFile.java
index ee48717..8329ec0 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/aaiconnector/impl/config/AaiClientPropertiesFile.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/aaiconnector/impl/config/AaiClientPropertiesFile.java
@@ -33,59 +33,59 @@
     private int mConnectionTimeout;
     private int mReadTimeout;
 
-	public String getFilename() {
-		return this.mFile.getAbsolutePath();
-	}
+    public String getFilename() {
+        return this.mFile.getAbsolutePath();
+    }
 
-	public String getPCKS12CertFilename() {
-		return this.mPCKS12CertFilename;
-	}
+    public String getPCKS12CertFilename() {
+        return this.mPCKS12CertFilename;
+    }
 
-	public String getPCKS12Passphrase() {
-		return this.mPCKS12Passphrase;
-	}
+    public String getPCKS12Passphrase() {
+        return this.mPCKS12Passphrase;
+    }
 
-	public boolean trustInsecureSSL() {
-		return this.mTrustInsecureSSL;
-	}
+    public boolean trustInsecureSSL() {
+        return this.mTrustInsecureSSL;
+    }
 
-	public String getApplicationIdentifier() {
-		return this.mApplicationIdentifier;
-	}
+    public String getApplicationIdentifier() {
+        return this.mApplicationIdentifier;
+    }
 
-	public String getRemoteUrl() {
-		return this.mRemoteUrl;
-	}
+    public String getRemoteUrl() {
+        return this.mRemoteUrl;
+    }
 
-	public int getConnectionTimeout() {
-		return this.mConnectionTimeout;
-	}
+    public int getConnectionTimeout() {
+        return this.mConnectionTimeout;
+    }
 
-	public int getReadTimeout() {
-		return this.mReadTimeout;
-	}
+    public int getReadTimeout() {
+        return this.mReadTimeout;
+    }
 
-	public boolean exists() {
-		return this.mFile.exists();
-	}
+    public boolean exists() {
+        return this.mFile.exists();
+    }
 
-	public AaiClientPropertiesFile(String filename) {
-		this.mFile = new File(filename);
-	}
+    public AaiClientPropertiesFile(String filename) {
+        this.mFile = new File(filename);
+    }
 
-	public void load() throws IOException, NumberFormatException {
-		Properties defaultProps = new Properties();
-		FileInputStream in = new FileInputStream(this.mFile);
-		defaultProps.load(in);
-		this.mPCKS12CertFilename = defaultProps.getProperty("org.onap.ccsdk.sli.adaptors.aai.ssl.key", null);
-		this.mPCKS12Passphrase = defaultProps.getProperty("org.onap.ccsdk.sli.adaptors.aai.ssl.key.psswd", null);
-		this.mTrustInsecureSSL = defaultProps
-				.getProperty("org.onap.ccsdk.sli.adaptors.aai.host.certificate.ignore", "false").equals("true");
-		this.mApplicationIdentifier = defaultProps.getProperty("org.onap.ccsdk.sli.adaptors.aai.application", null);
-		this.mRemoteUrl = defaultProps.getProperty("org.onap.ccsdk.sli.adaptors.aai.uri", null);
-		this.mConnectionTimeout = Integer.parseInt(defaultProps.getProperty("connection.timeout", "60000"));
-		this.mReadTimeout = Integer.parseInt(defaultProps.getProperty("read.timeout", "60000"));
-		in.close();
-	}
+    public void load() throws IOException, NumberFormatException {
+        Properties defaultProps = new Properties();
+        FileInputStream in = new FileInputStream(this.mFile);
+        defaultProps.load(in);
+        this.mPCKS12CertFilename = defaultProps.getProperty("org.onap.ccsdk.sli.adaptors.aai.ssl.key", null);
+        this.mPCKS12Passphrase = defaultProps.getProperty("org.onap.ccsdk.sli.adaptors.aai.ssl.key.psswd", null);
+        this.mTrustInsecureSSL = defaultProps
+                .getProperty("org.onap.ccsdk.sli.adaptors.aai.host.certificate.ignore", "false").equals("true");
+        this.mApplicationIdentifier = defaultProps.getProperty("org.onap.ccsdk.sli.adaptors.aai.application", null);
+        this.mRemoteUrl = defaultProps.getProperty("org.onap.ccsdk.sli.adaptors.aai.uri", null);
+        this.mConnectionTimeout = Integer.parseInt(defaultProps.getProperty("connection.timeout", "60000"));
+        this.mReadTimeout = Integer.parseInt(defaultProps.getProperty("read.timeout", "60000"));
+        in.close();
+    }
 
 }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/aaiconnector/impl/config/AaiConfig.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/aaiconnector/impl/config/AaiConfig.java
index ed88f89..e590d7f 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/aaiconnector/impl/config/AaiConfig.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/aaiconnector/impl/config/AaiConfig.java
@@ -36,242 +36,246 @@
 
 public class AaiConfig implements Configuration {
 
-	private static Logger LOG = LoggerFactory.getLogger(AaiConfig.class);
+    private static Logger LOG = LoggerFactory.getLogger(AaiConfig.class);
 
-	private static final String SECTION_MARKER_AAI = "aai";
+    private static final String SECTION_MARKER_AAI = "aai";
 
-	private enum Config {
-		AAIPROP_FILE("aaiPropertiesFile", "null"), BASEURL("aaiUrl", "off", "org.onap.ccsdk.sli.adaptors.aai.uri"),
-		USERCREDENTIALS("aaiUserCredentials", ""), HEADERS("aaiHeaders", "[\"X-TransactionId: 9999\"]"),
-		DELETEONMOUNTPOINTREMOVED("aaiDeleteOnMountpointRemove", false),
-		TRUSTALLCERTS("aaiTrustAllCerts", false, "org.onap.ccsdk.sli.adaptors.aai.host.certificate.ignore"),
-		APIVERSION("aaiApiVersion", "aai/v13"),
-		PCKS12CERTFILENAME("aaiPcks12ClientCertFile", "", "org.onap.ccsdk.sli.adaptors.aai.ssl.key"),
-		PCKS12PASSPHRASE("aaiPcks12ClientCertPassphrase", "", "org.onap.ccsdk.sli.adaptors.aai.ssl.key.psswd"),
-		CONNECTIONTIMEOUT("aaiClientConnectionTimeout", String.valueOf(DEFAULT_VALUE_CONNECTION_TIMEOUT),
-				"connection.timeout"), //in ms;
-		APPLICATIONID("aaiApplicationId", "SDNR", "org.onap.ccsdk.sli.adaptors.aai.application"),
-		HTTPREADTIMEOUT("aaiReadTimeout", "60000", "read.timeout");
+    private enum Config {
+        // @formatter:off
+        AAIPROP_FILE("aaiPropertiesFile", "null"),
+        BASEURL("aaiUrl", "off", "org.onap.ccsdk.sli.adaptors.aai.uri"),
+        USERCREDENTIALS("aaiUserCredentials", ""),
+        HEADERS("aaiHeaders", "[\"X-TransactionId: 9999\"]"),
+        DELETEONMOUNTPOINTREMOVED("aaiDeleteOnMountpointRemove", false),
+        TRUSTALLCERTS("aaiTrustAllCerts", false, "org.onap.ccsdk.sli.adaptors.aai.host.certificate.ignore"),
+        APIVERSION("aaiApiVersion", "aai/v13"),
+        PCKS12CERTFILENAME("aaiPcks12ClientCertFile", "", "org.onap.ccsdk.sli.adaptors.aai.ssl.key"),
+        PCKS12PASSPHRASE("aaiPcks12ClientCertPassphrase", "", "org.onap.ccsdk.sli.adaptors.aai.ssl.key.psswd"),
+        CONNECTIONTIMEOUT("aaiClientConnectionTimeout",
+                String.valueOf(DEFAULT_VALUE_CONNECTION_TIMEOUT), "connection.timeout"), //in ms;
+        APPLICATIONID("aaiApplicationId", "SDNR", "org.onap.ccsdk.sli.adaptors.aai.application"),
+        HTTPREADTIMEOUT("aaiReadTimeout", "60000", "read.timeout");
+        // @formatter:on
 
-		private String propertyKey;
-		private String propertyValue;
-		private Optional<String> propertyKeySecondFile;
+        private String propertyKey;
+        private String propertyValue;
+        private Optional<String> propertyKeySecondFile;
 
-		Config(String propertyKey, Object propertyValue) {
-			this.propertyKey = propertyKey;
-			this.propertyValue = propertyValue.toString();
-			this.propertyKeySecondFile = Optional.empty();
-		}
+        Config(String propertyKey, Object propertyValue) {
+            this.propertyKey = propertyKey;
+            this.propertyValue = propertyValue.toString();
+            this.propertyKeySecondFile = Optional.empty();
+        }
 
-		Config(String propertyKey, Object propertyValue, String propertyKeySecondFile) {
-			this(propertyKey, propertyValue);
-			this.propertyKeySecondFile = Optional.of(propertyKeySecondFile);
-		}
-	}
+        Config(String propertyKey, Object propertyValue, String propertyKeySecondFile) {
+            this(propertyKey, propertyValue);
+            this.propertyKeySecondFile = Optional.of(propertyKeySecondFile);
+        }
+    }
 
-	private static final long DEFAULT_VALUE_CONNECTION_TIMEOUT = 30000; //in ms
-	private static final String HEADER_KEY_APPLICATION = "X-FromAppId";
+    private static final long DEFAULT_VALUE_CONNECTION_TIMEOUT = 30000; //in ms
+    private static final String HEADER_KEY_APPLICATION = "X-FromAppId";
 
-	private final ConfigurationFileRepresentation configuration;
+    private final ConfigurationFileRepresentation configuration;
 
-	public AaiConfig(ConfigurationFileRepresentation configuration) {
-		HtAssert.nonnull(configuration);
-		this.configuration = configuration;
-		this.configuration.addSection(SECTION_MARKER_AAI);
-		defaults();
-	}
+    public AaiConfig(ConfigurationFileRepresentation configuration) {
+        HtAssert.nonnull(configuration);
+        this.configuration = configuration;
+        this.configuration.addSection(SECTION_MARKER_AAI);
+        defaults();
+    }
 
-	/*
-	 * Getter
-	 */
+    /*
+     * Getter
+     */
 
-	public boolean doDeleteOnMountPointRemoved() {
-		return configuration.getPropertyBoolean(SECTION_MARKER_AAI, Config.DELETEONMOUNTPOINTREMOVED.propertyKey);
-	}
+    public boolean doDeleteOnMountPointRemoved() {
+        return configuration.getPropertyBoolean(SECTION_MARKER_AAI, Config.DELETEONMOUNTPOINTREMOVED.propertyKey);
+    }
 
-	public boolean getTrustAll() {
-		return configuration.getPropertyBoolean(SECTION_MARKER_AAI, Config.TRUSTALLCERTS.propertyKey);
-	}
+    public boolean getTrustAll() {
+        return configuration.getPropertyBoolean(SECTION_MARKER_AAI, Config.TRUSTALLCERTS.propertyKey);
+    }
 
-	public String getPcks12CertificateFilename() {
-		return configuration.getProperty(SECTION_MARKER_AAI, Config.PCKS12CERTFILENAME.propertyKey);
-	}
+    public String getPcks12CertificateFilename() {
+        return configuration.getProperty(SECTION_MARKER_AAI, Config.PCKS12CERTFILENAME.propertyKey);
+    }
 
-	public String getPcks12CertificatePassphrase() {
-		return configuration.getProperty(SECTION_MARKER_AAI, Config.PCKS12PASSPHRASE.propertyKey);
-	}
+    public String getPcks12CertificatePassphrase() {
+        return configuration.getProperty(SECTION_MARKER_AAI, Config.PCKS12PASSPHRASE.propertyKey);
+    }
 
-	public int getConnectionTimeout() {
-		long res = configuration.getPropertyLong(SECTION_MARKER_AAI, Config.CONNECTIONTIMEOUT.propertyKey)
-				.orElse(DEFAULT_VALUE_CONNECTION_TIMEOUT);
-		return (int) res;
-	}
+    public int getConnectionTimeout() {
+        long res = configuration.getPropertyLong(SECTION_MARKER_AAI, Config.CONNECTIONTIMEOUT.propertyKey)
+                .orElse(DEFAULT_VALUE_CONNECTION_TIMEOUT);
+        return (int) res;
+    }
 
-	public boolean isOff() {
-		return configuration.getProperty(SECTION_MARKER_AAI, Config.BASEURL.propertyKey).equalsIgnoreCase("off");
-	}
+    public boolean isOff() {
+        return configuration.getProperty(SECTION_MARKER_AAI, Config.BASEURL.propertyKey).equalsIgnoreCase("off");
+    }
 
-	public String getBaseUri() {
-		String res = configuration.getProperty(SECTION_MARKER_AAI, Config.APIVERSION.propertyKey);
-		if (!res.startsWith("/")) {
-			res = "/" + res;
-		}
-		return res;
-	}
+    public String getBaseUri() {
+        String res = configuration.getProperty(SECTION_MARKER_AAI, Config.APIVERSION.propertyKey);
+        if (!res.startsWith("/")) {
+            res = "/" + res;
+        }
+        return res;
+    }
 
-	public String getBaseUrl() {
-		if (isOff()) {
-			return "";
-		}
+    public String getBaseUrl() {
+        if (isOff()) {
+            return "";
+        }
 
-		String url = configuration.getProperty(SECTION_MARKER_AAI, Config.BASEURL.propertyKey);
-		if (!url.endsWith("/")) {
-			url += "/";
-		}
-		String apiVersion = configuration.getProperty(SECTION_MARKER_AAI, Config.APIVERSION.propertyKey);
-		if (apiVersion.startsWith("/")) {
-			apiVersion = apiVersion.substring(1);
-		}
-		return url + apiVersion;
+        String url = configuration.getProperty(SECTION_MARKER_AAI, Config.BASEURL.propertyKey);
+        if (!url.endsWith("/")) {
+            url += "/";
+        }
+        String apiVersion = configuration.getProperty(SECTION_MARKER_AAI, Config.APIVERSION.propertyKey);
+        if (apiVersion.startsWith("/")) {
+            apiVersion = apiVersion.substring(1);
+        }
+        return url + apiVersion;
 
-	}
+    }
 
-	public Map<String, String> getHeaders() {
+    public Map<String, String> getHeaders() {
 
-		Map<String, String> headers = _parseHeadersMap(
-				configuration.getProperty(SECTION_MARKER_AAI, Config.HEADERS.propertyKey));
-		headers.put(HEADER_KEY_APPLICATION,
-				configuration.getProperty(SECTION_MARKER_AAI, Config.APPLICATIONID.propertyKey));
+        Map<String, String> headers =
+                _parseHeadersMap(configuration.getProperty(SECTION_MARKER_AAI, Config.HEADERS.propertyKey));
+        headers.put(HEADER_KEY_APPLICATION,
+                configuration.getProperty(SECTION_MARKER_AAI, Config.APPLICATIONID.propertyKey));
 
-		String credentials = configuration.getProperty(SECTION_MARKER_AAI, Config.USERCREDENTIALS.propertyKey);
-		if (!nullorempty(credentials)) {
-			String credentialParts[] = credentials.split(":");
-			if (credentialParts.length == 2) {
-				// 0:username 1:password
-				String s = headers.getOrDefault("Authorization", null);
-				if (nullorempty(s) && !nullorempty(credentialParts[0]) && !nullorempty(credentialParts[1])) {
-					headers.put("Authorization",
-							"Basic " + new String(Base64.getEncoder().encode(credentials.getBytes())));
-				}
-			}
-		}
-		return headers;
-	}
+        String credentials = configuration.getProperty(SECTION_MARKER_AAI, Config.USERCREDENTIALS.propertyKey);
+        if (!nullorempty(credentials)) {
+            String credentialParts[] = credentials.split(":");
+            if (credentialParts.length == 2) {
+                // 0:username 1:password
+                String s = headers.getOrDefault("Authorization", null);
+                if (nullorempty(s) && !nullorempty(credentialParts[0]) && !nullorempty(credentialParts[1])) {
+                    headers.put("Authorization",
+                            "Basic " + new String(Base64.getEncoder().encode(credentials.getBytes())));
+                }
+            }
+        }
+        return headers;
+    }
 
-	@Override
-	public String getSectionName() {
-		return SECTION_MARKER_AAI;
-	}
+    @Override
+    public String getSectionName() {
+        return SECTION_MARKER_AAI;
+    }
 
-	@Override
-	public void defaults() {
-		for (Config conf : Config.values()) {
-			configuration.setPropertyIfNotAvailable(SECTION_MARKER_AAI, conf.propertyKey, conf.propertyValue);
-		}
-		// If file is available, the content is assigned to related parameters.
-		getAaiPropertiesFile();
-	}
+    @Override
+    public void defaults() {
+        for (Config conf : Config.values()) {
+            configuration.setPropertyIfNotAvailable(SECTION_MARKER_AAI, conf.propertyKey, conf.propertyValue);
+        }
+        // If file is available, the content is assigned to related parameters.
+        getAaiPropertiesFile();
+    }
 
-	@Override
-	public String toString() {
-		return "AaiConfig [doDeleteOnMountPointRemoved()=" + doDeleteOnMountPointRemoved() + ", getTrustAll()="
-				+ getTrustAll() + ", getPcks12CertificateFilename()=" + getPcks12CertificateFilename()
-				+ ", getPcks12CertificatePassphrase()=" + getPcks12CertificatePassphrase() + ", getConnectionTimeout()="
-				+ getConnectionTimeout() + ", isOff()=" + isOff() + ", getBaseUri()=" + getBaseUri() + ", getBaseUrl()="
-				+ getBaseUrl() + ", getHeaders()=" + getHeaders() + ", getSectionName()=" + getSectionName() + "]";
-	}
+    @Override
+    public String toString() {
+        return "AaiConfig [doDeleteOnMountPointRemoved()=" + doDeleteOnMountPointRemoved() + ", getTrustAll()="
+                + getTrustAll() + ", getPcks12CertificateFilename()=" + getPcks12CertificateFilename()
+                + ", getPcks12CertificatePassphrase()=" + getPcks12CertificatePassphrase() + ", getConnectionTimeout()="
+                + getConnectionTimeout() + ", isOff()=" + isOff() + ", getBaseUri()=" + getBaseUri() + ", getBaseUrl()="
+                + getBaseUrl() + ", getHeaders()=" + getHeaders() + ", getSectionName()=" + getSectionName() + "]";
+    }
 
-	/*
-	 * Private
-	 */
+    /*
+     * Private
+     */
 
-	private boolean nullorempty(String s) {
-		return s == null || s.isEmpty();
-	}
+    private boolean nullorempty(String s) {
+        return s == null || s.isEmpty();
+    }
 
-	/**
-	 * Convert headers to configuration string.
-	 * @param headers
-	 * @return
-	 */
-	@SuppressWarnings("unused")
-	private static String _printHeadersMap(Map<String, String> headers) {
-		String r = "[";
-		if (headers != null) {
-			int i = 0;
-			for (Entry<String, String> entry : headers.entrySet()) {
-				if (i > 0) {
-					r += ",";
-				}
-				r += "\"" + entry.getKey() + ":" + entry.getValue() + "\"";
-				i++;
-			}
-		}
-		r += "]";
-		return r;
-	}
+    /**
+     * Convert headers to configuration string.
+     *
+     * @param headers
+     * @return
+     */
+    @SuppressWarnings("unused")
+    private static String _printHeadersMap(Map<String, String> headers) {
+        String r = "[";
+        if (headers != null) {
+            int i = 0;
+            for (Entry<String, String> entry : headers.entrySet()) {
+                if (i > 0) {
+                    r += ",";
+                }
+                r += "\"" + entry.getKey() + ":" + entry.getValue() + "\"";
+                i++;
+            }
+        }
+        r += "]";
+        return r;
+    }
 
-	private static Map<String, String> _parseHeadersMap(String s) {
+    private static Map<String, String> _parseHeadersMap(String s) {
 
-		LOG.info("Parse: '{}'", s);
-		Map<String, String> r = new HashMap<>();
-		if (s != null) {
-			s = s.trim();
-			if (!s.isEmpty()) {
-				JSONArray a;
-				try {
-					a = new JSONArray(s);
-					if (a.length() > 0) {
-						for (int i = 0; i < a.length(); i++) {
-							String item = a.getString(i);
-							String[] hlp = item.split(":");
-							if (hlp.length > 1) {
-								r.put(hlp[0], hlp[1]);
-							}
-						}
-					}
-				} catch (Exception e) {
-					LOG.debug("Unparsable '{}'", s);
-				}
-			}
-		}
-		return r;
-	}
+        LOG.info("Parse: '{}'", s);
+        Map<String, String> r = new HashMap<>();
+        if (s != null) {
+            s = s.trim();
+            if (!s.isEmpty()) {
+                JSONArray a;
+                try {
+                    a = new JSONArray(s);
+                    if (a.length() > 0) {
+                        for (int i = 0; i < a.length(); i++) {
+                            String item = a.getString(i);
+                            String[] hlp = item.split(":");
+                            if (hlp.length > 1) {
+                                r.put(hlp[0], hlp[1]);
+                            }
+                        }
+                    }
+                } catch (Exception e) {
+                    LOG.debug("Unparsable '{}'", s);
+                }
+            }
+        }
+        return r;
+    }
 
-	/**
-	 * Read file if available and assign to configuration
-	 */
-	private void getAaiPropertiesFile() {
-		String aaiPropertiesFileName = configuration.getProperty(SECTION_MARKER_AAI, Config.AAIPROP_FILE.propertyKey);
-		File f = new File(aaiPropertiesFileName);
-		if (f.exists()) {
-			InputStream in = null;
-			try {
-				in = new FileInputStream(f);
-				Properties defaultProps = new Properties();
-				defaultProps.load(in);
+    /**
+     * Read file if available and assign to configuration
+     */
+    private void getAaiPropertiesFile() {
+        String aaiPropertiesFileName = configuration.getProperty(SECTION_MARKER_AAI, Config.AAIPROP_FILE.propertyKey);
+        File f = new File(aaiPropertiesFileName);
+        if (f.exists()) {
+            InputStream in = null;
+            try {
+                in = new FileInputStream(f);
+                Properties defaultProps = new Properties();
+                defaultProps.load(in);
 
-				for (Config conf : Config.values()) {
-					if (conf.propertyKeySecondFile.isPresent()) {
-						String config = defaultProps.getProperty(conf.propertyKeySecondFile.get(),
-								conf.propertyValue);
-						LOG.debug("Property file assign  {} = {} ", conf.propertyKey, config);
-						configuration.setProperty(SECTION_MARKER_AAI, conf.propertyKey, config);
-					}
-				}
+                for (Config conf : Config.values()) {
+                    if (conf.propertyKeySecondFile.isPresent()) {
+                        String config = defaultProps.getProperty(conf.propertyKeySecondFile.get(), conf.propertyValue);
+                        LOG.debug("Property file assign  {} = {} ", conf.propertyKey, config);
+                        configuration.setProperty(SECTION_MARKER_AAI, conf.propertyKey, config);
+                    }
+                }
 
-			} catch (IOException e) {
-				LOG.warn("Problem during file read {} {}", f.getAbsoluteFile(), e);
-			} finally {
-				if (in != null) {
-					try {
-						in.close();
-					} catch (IOException e) {
-						LOG.warn("problem closing file string for {}: {}",f.getAbsoluteFile(),e);
-					}
-				}
-			}
-		}
-	}
+            } catch (IOException e) {
+                LOG.warn("Problem during file read {} {}", f.getAbsoluteFile(), e);
+            } finally {
+                if (in != null) {
+                    try {
+                        in.close();
+                    } catch (IOException e) {
+                        LOG.warn("problem closing file string for {}: {}", f.getAbsoluteFile(), e);
+                    }
+                }
+            }
+        }
+    }
 
 }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/archiveservice/ArchiveCleanService.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/archiveservice/ArchiveCleanService.java
index e79f0ed..88848a5 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/archiveservice/ArchiveCleanService.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/archiveservice/ArchiveCleanService.java
@@ -36,10 +36,11 @@
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 
-public class ArchiveCleanService implements AutoCloseable, IConfigChangedListener, Runnable,ClusterSingletonService {
+public class ArchiveCleanService implements AutoCloseable, IConfigChangedListener, Runnable, ClusterSingletonService {
 
     private static final Logger LOG = LoggerFactory.getLogger(ArchiveCleanService.class);
-    private static final ServiceGroupIdentifier IDENT = ServiceGroupIdentifier.create("ElasticSearchArchiveCleanService");
+    private static final ServiceGroupIdentifier IDENT =
+            ServiceGroupIdentifier.create("ElasticSearchArchiveCleanService");
 
     private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
     private final ArchiveCleanProvider[] indexCleanList;
@@ -65,17 +66,16 @@
         if (taskReference != null) {
             taskReference.cancel(false);
         }
-        if(this.isMaster) {
-        if (this.esConfig.getArchiveCheckIntervalSeconds() > 0) {
-            LOG.info("DBCleanService is turned on for entries older than {} seconds",
-                    this.esConfig.getArchiveLifetimeSeconds());
-            taskReference = this.scheduler.scheduleAtFixedRate(doClean, 0,
-                    this.esConfig.getArchiveCheckIntervalSeconds(), TimeUnit.SECONDS);
+        if (this.isMaster) {
+            if (this.esConfig.getArchiveCheckIntervalSeconds() > 0) {
+                LOG.info("DBCleanService is turned on for entries older than {} seconds",
+                        this.esConfig.getArchiveLifetimeSeconds());
+                taskReference = this.scheduler.scheduleAtFixedRate(doClean, 0,
+                        this.esConfig.getArchiveCheckIntervalSeconds(), TimeUnit.SECONDS);
+            } else {
+                LOG.info("DBCleanService is turned off");
+            }
         } else {
-            LOG.info("DBCleanService is turned off");
-        }
-        }
-        else {
             LOG.info("service is inactive on this node. active on another node.");
         }
     }
@@ -109,7 +109,7 @@
                 }
             }
             if (removed > 0) {
-                LOG.trace("Removed elements: {}",removed);
+                LOG.trace("Removed elements: {}", removed);
             }
         } catch (Exception e) {
             LOG.warn("problem executing dbclean", e);
@@ -136,20 +136,20 @@
     @SuppressWarnings("null")
     @Override
     public @NonNull ServiceGroupIdentifier getIdentifier() {
-         return IDENT;
+        return IDENT;
     }
 
     @Override
     public void instantiateServiceInstance() {
         LOG.info("We take Leadership");
-        this.isMaster=true;
+        this.isMaster = true;
         this.reinit();
     }
 
     @Override
     public ListenableFuture<? extends Object> closeServiceInstance() {
         LOG.info("We lost Leadership");
-        this.isMaster=false;
+        this.isMaster = false;
         this.reinit();
         return Futures.immediateFuture(null);
     }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/dcaeconnector/impl/DcaeForwarderImpl.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/dcaeconnector/impl/DcaeForwarderImpl.java
index 32e7e3c..8e091be 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/dcaeconnector/impl/DcaeForwarderImpl.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/dcaeconnector/impl/DcaeForwarderImpl.java
@@ -57,8 +57,8 @@
                 this.aotsmClient.sendProblemNotification(nodeId, notificationXml);
             }
         } else {
-            LOG.debug("Notification will not be sent to external services. Device " + nodeId
-                    + " is in maintenance mode");
+            LOG.debug(
+                    "Notification will not be sent to external services. Device " + nodeId + " is in maintenance mode");
         }
     }
 
@@ -66,17 +66,16 @@
     public void sendProblemNotification(String nodeId, ProblemNotificationXml notificationXml) {
         //to prevent push alarms on reconnect
         //=> only pushed alarms are forwared to dcae
-    	if(dcaeProvider!=null) {
-    		dcaeProvider.sendProblemNotification(nodeId, notificationXml);
-    	}
-    	if(aotsmClient!=null) {
+        if (dcaeProvider != null) {
+            dcaeProvider.sendProblemNotification(nodeId, notificationXml);
+        }
+        if (aotsmClient != null) {
             aotsmClient.sendProblemNotification(nodeId, notificationXml);
         }
 
     }
 
     @Override
-    public void close() throws Exception {
-    }
+    public void close() throws Exception {}
 
 }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/dcaeconnector/impl/DcaeMessages.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/dcaeconnector/impl/DcaeMessages.java
index 9933487..a79e4ad 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/dcaeconnector/impl/DcaeMessages.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/dcaeconnector/impl/DcaeMessages.java
@@ -48,11 +48,11 @@
 
     private static final Logger LOG = LoggerFactory.getLogger(DcaeSenderImpl.class);
 
-    private static final String DCAE_NORMAL =  "NORMAL";
-    private static final String DCAE_MINOR =  "MINOR";
-    private static final String DCAE_WARNING =  "WARNING";
-    private static final String DCAE_CRITICAL =  "CRITICAL";
-    private static final String DCAE_MAJOR =  "MAJOR";
+    private static final String DCAE_NORMAL = "NORMAL";
+    private static final String DCAE_MINOR = "MINOR";
+    private static final String DCAE_WARNING = "WARNING";
+    private static final String DCAE_CRITICAL = "CRITICAL";
+    private static final String DCAE_MAJOR = "MAJOR";
 
     private static final String eventNamePrefix = "fault_Microwave_Radio_Alarms";
     private static final String eventType = "Microwave_Radio_Alarms";
@@ -75,7 +75,8 @@
     //Variables
     private int heartbeatsequence = 0;
 
-    public DcaeMessages(DcaeSender ecompSender, String entityName, Integer heartbeatIntervallSeconds, DeviceManagerImpl deviceManager) {
+    public DcaeMessages(DcaeSender ecompSender, String entityName, Integer heartbeatIntervallSeconds,
+            DeviceManagerImpl deviceManager) {
         this.dcaeSender = ecompSender;
         this.entityName = entityName;
         this.deviceManager = deviceManager;
@@ -84,19 +85,19 @@
 
     /**
      * Create a heartbeat message.
+     *
      * @return Result string with answer from server
      */
     public String postHeartBeat() {
         String epochTimeMicrosecondsString = getEpochTimeMicroseconds();
-        String body = assembleHeartbeatFromTemplate(null,
-                epochTimeMicrosecondsString,
-                heartbeatsequence++,
+        String body = assembleHeartbeatFromTemplate(null, epochTimeMicrosecondsString, heartbeatsequence++,
                 NETCONFTIME_CONVERTER.getTimeStampAsNetconfString()).toString();
-        return dcaeSender.sendDcaePost( body);
+        return dcaeSender.sendDcaePost(body);
     }
 
     /**
      * ONF 1.2 Problem Notification
+     *
      * @param mountPointName self-explaining
      * @param notification Notification input
      * @return String with answer
@@ -107,18 +108,18 @@
         String problemName = notification.getProblem();
         String sequence = notification.getCounter();
         String objId = notification.getObjectId();
-        String severity = convert( notification.getSeverity());
-        String timeStamp = convert( notification.getTimeStamp() );
+        String severity = convert(notification.getSeverity());
+        String timeStamp = convert(notification.getTimeStamp());
 
-        String body = assembleEventNotificationFromTemplate(null,
-                timeStamp, sequence,
-                mountPointName, objId, problemName, severity, notification.getTimeStamp() ).toString();
+        String body = assembleEventNotificationFromTemplate(null, timeStamp, sequence, mountPointName, objId,
+                problemName, severity, notification.getTimeStamp()).toString();
 
-        return dcaeSender.sendDcaePost( body);
+        return dcaeSender.sendDcaePost(body);
     }
 
     /**
      * Setup a connection to URL with authorisation header
+     *
      * @param url e.g. "https://plan.fritz.box:9092/ux/#" or "
      * @param basicAuth authorisation header like "Basic SGVyYmVydDpIZXJiZXJ0"
      * @param insertContentHeader
@@ -126,7 +127,8 @@
      * @throws IOException
      * @throws MalformedURLException
      */
-    static @Nullable HttpURLConnection openConnection( URL url, String basicAuth, boolean insertContentHeader, @Nullable SSLContext sc) throws MalformedURLException, IOException {
+    static @Nullable HttpURLConnection openConnection(URL url, String basicAuth, boolean insertContentHeader,
+            @Nullable SSLContext sc) throws MalformedURLException, IOException {
 
         //Prepare the connection
         HttpURLConnection newHttpConnection = null;
@@ -135,7 +137,7 @@
             if (newConnection instanceof HttpURLConnection) {
                 LOG.debug("Setup connection to {} ", url.toString());
 
-                newHttpConnection = (HttpURLConnection)newConnection;
+                newHttpConnection = (HttpURLConnection) newConnection;
 
                 newHttpConnection.setDoOutput(true); // Triggers POST.
                 newHttpConnection.setRequestProperty("Accept-Charset", charset);
@@ -148,7 +150,7 @@
 
                 if (newHttpConnection instanceof HttpsURLConnection) {
                     LOG.debug("SSL connection setup with trust all.");
-                    HttpsURLConnection newHttpsConnection = (HttpsURLConnection)newHttpConnection;
+                    HttpsURLConnection newHttpsConnection = (HttpsURLConnection) newHttpConnection;
                     if (sc != null) {
                         newHttpsConnection.setSSLSocketFactory(sc.getSocketFactory());
                     } else {
@@ -169,6 +171,7 @@
 
     /**
      * Get actual microseconds
+     *
      * @return String
      */
     private String getEpochTimeMicroseconds() {
@@ -178,57 +181,57 @@
 
     /**
      * Assemble heartbeat message
+     *
      * @param sb StringBuffer to be used or null to allocate
      * @param epochTimeMicrosecondsString Text with time stamp
      * @param sequence integer sequence number
      * @param eventTimeValueNetconfFormatString like this: 2018-05-14T05:32:17.292Z
      * @return StringBuffer with result
      */
-    private StringBuffer assembleHeartbeatFromTemplate(
-                 StringBuffer sb,
-                 String epochTimeMicrosecondsString,
-                 int sequence,
-                 String eventTimeValueNetconfFormatString) {
+    private StringBuffer assembleHeartbeatFromTemplate(StringBuffer sb, String epochTimeMicrosecondsString,
+            int sequence, String eventTimeValueNetconfFormatString) {
 
         if (sb == null) {
-          sb = new StringBuffer();
+            sb = new StringBuffer();
         }
-        sb.append("{\n" +
-                "    \"event\": {\n" +
-                "        \"commonEventHeader\": {\n" +
-                "            \"domain\": \"heartbeat\",\n" +
-                "            \"eventId\": \"testpattern-ab305d54-85b4-a31b-7db2-fb6b9e546015\",\n" +
-                "            \"eventName\": \"heartbeat_Controller\",\n" +
-                "            \"eventType\": \"Controller\",\n" +
-                "            \"priority\": \"Low\",\n" +
-                "            \"reportingEntityId\": \"\",\n" +
-                "            \"reportingEntityName\": \""+entityName+"\",\n" +
-                "            \"sequence\": "+String.valueOf(sequence)+",\n" +
-                "            \"sourceId\": \"\",\n" +
-                "            \"sourceName\": \""+entityName+"\",\n" +
-                "            \"startEpochMicrosec\": "+epochTimeMicrosecondsString+",\n" +
-                "            \"lastEpochMicrosec\": "+epochTimeMicrosecondsString+",\n" +
-                "            \"version\": 3.0\n" +
-                "        },\n" +
-                "        \"heartbeatFields\": {\n" +
-                "            \"additionalFields\": [\n" +
-                "                 {\n" +
-                "                   \"name\": \"eventTime\",\n" +
-                "                   \"value\": \""+eventTimeValueNetconfFormatString+"\"\n" +
-                "                 }\n" +
-                "            ],\n" +
-                "            \"heartbeatFieldsVersion\": 1.0,\n" +
-                "            \"heartbeatInterval\": "+heartbeatIntervallSeconds+"\n" +
-                "        }\n" +
-                "    }\n" +
-                "}\n"
-        );
+        // @formatter:off
+        sb.append("{\n"
+                + "    \"event\": {\n"
+                + "        \"commonEventHeader\": {\n"
+                + "            \"domain\": \"heartbeat\",\n"
+                + "            \"eventId\": \"testpattern-ab305d54-85b4-a31b-7db2-fb6b9e546015\",\n"
+                + "            \"eventName\": \"heartbeat_Controller\",\n"
+                + "            \"eventType\": \"Controller\",\n"
+                + "            \"priority\": \"Low\",\n"
+                + "            \"reportingEntityId\": \"\",\n"
+                + "            \"reportingEntityName\": \"" + entityName + "\",\n"
+                + "            \"sequence\": " + String.valueOf(sequence) + ",\n"
+                + "            \"sourceId\": \"\",\n"
+                + "            \"sourceName\": \"" + entityName + "\",\n"
+                + "            \"startEpochMicrosec\": " + epochTimeMicrosecondsString + ",\n"
+                + "            \"lastEpochMicrosec\": " + epochTimeMicrosecondsString + ",\n"
+                + "            \"version\": 3.0\n"
+                + "        },\n"
+                + "        \"heartbeatFields\": {\n"
+                + "            \"additionalFields\": [\n"
+                + "                 {\n"
+                + "                   \"name\": \"eventTime\",\n"
+                + "                   \"value\": \"" + eventTimeValueNetconfFormatString + "\"\n"
+                + "                 }\n"
+                + "            ],\n"
+                + "            \"heartbeatFieldsVersion\": 1.0,\n"
+                + "            \"heartbeatInterval\": " + heartbeatIntervallSeconds + "\n"
+                + "        }\n"
+                + "    }\n"
+                + "}\n");
+        // @formatter:on
 
         return sb;
     }
 
     /**
      * Assemble notification message
+     *
      * @param sb StringBuffer to be used or null to allocate
      * @param epochTimeMicrosecondsString Text with time stamp
      * @param sequence integer sequence number
@@ -239,16 +242,16 @@
      * @return StringBuffer with result
      */
 
-    private StringBuffer assembleEventNotificationFromTemplate(StringBuffer sb,
-            String epochTimeMicrosecondsString, String sequence,
-            String mountpointName, String objId, String problemName, String severity, String eventTimeValueNetconfFormatString
-            ) {
+    private StringBuffer assembleEventNotificationFromTemplate(StringBuffer sb, String epochTimeMicrosecondsString,
+            String sequence, String mountpointName, String objId, String problemName, String severity,
+            String eventTimeValueNetconfFormatString) {
 
         if (sb == null) {
             sb = new StringBuffer();
         }
 
-        NetworkElement optionalNe = deviceManager != null ? deviceManager.getNeByMountpoint(mountpointName) : null;
+        NetworkElement optionalNe =
+                deviceManager != null ? deviceManager.getNeByMountpoint(mountpointName) : null;
         InventoryInformationDcae neInventory = InventoryInformationDcae.getDefault();
         if (optionalNe != null) {
             Optional<InventoryProvider> inventoryProvider = optionalNe.getService(InventoryProvider.class);
@@ -257,53 +260,53 @@
             }
         }
 
-        sb.append("{\n" +
-                "    \"event\": {\n" +
-                "        \"commonEventHeader\": {\n" +
-                "            \"domain\": \"fault\",\n" +
-                "            \"eventId\": \""+mountpointName+"_"+objId+"_"+problemName+"\",\n" +
-                "            \"eventName\": \""+eventNamePrefix+"_"+problemName+"\",\n" +
-                "            \"eventType\": \""+eventType+"\",\n" +
-                "            \"sequence\": "+sequence+",\n" +
-                "            \"priority\": \"High\",\n" +
-                "            \"reportingEntityId\": \"\",\n" +
-                "            \"reportingEntityName\": \""+entityName+"\",\n" +
-                "            \"sourceId\": \"\",\n" +
-                "            \"sourceName\": \""+mountpointName+"\",\n" +
-                "            \"startEpochMicrosec\": "+epochTimeMicrosecondsString+",\n" +
-                "            \"lastEpochMicrosec\": "+epochTimeMicrosecondsString+",\n" +
-                "            \"version\": 3.0\n" +
-                "        },\n" +
-                "        \"faultFields\": {\n" +
-                "            \"alarmAdditionalInformation\": [\n" +
-                "                 {\n" +
-                "                   \"name\": \"eventTime\",\n" +
-                "                   \"value\": \""+eventTimeValueNetconfFormatString+"\"\n" +
-                "                 },\n" +
-                "                 {\n" +
-                "                   \"name\": \"equipType\",\n" +
-                "                   \"value\": \""+neInventory.getType()+"\"\n" +
-                "                 },\n" +
-                "                 {\n" +
-                "                   \"name\": \"vendor\",\n" +
-                "                   \"value\": \""+neInventory.getVendor()+"\"\n" +
-                "                 },\n" +
-                "                 {\n" +
-                "                   \"name\": \"model\",\n" +
-                "                   \"value\": \""+neInventory.getModel()+"\"\n" +
-                "                 }\n" +
-                "            ],\n" +
-                "            \"faultFieldsVersion\":2.0,\n" +
-                "            \"eventSourceType\": \""+eventSourceType+"\",\n" +
-                "            \"alarmCondition\": \""+problemName+"\",\n" +
-                "            \"alarmInterfaceA\": \""+objId+"\",\n" +
-                "            \"specificProblem\": \""+problemName+"\",\n" +
-                "            \"eventSeverity\": \""+severity+"\",\n" +
-                "            \"vfStatus\": \"Active\"\n" +
-                "        }\n" +
-                "    }\n" +
-                "}\n"
-                );
+        // @formatter:off
+        sb.append("{\n"
+                + "    \"event\": {\n"
+                + "        \"commonEventHeader\": {\n"
+                + "            \"domain\": \"fault\",\n"
+                + "            \"eventId\": \"" + mountpointName + "_" + objId + "_" + problemName + "\",\n"
+                + "            \"eventName\": \"" + eventNamePrefix + "_" + problemName + "\",\n"
+                + "            \"eventType\": \"" + eventType + "\",\n"
+                + "            \"sequence\": " + sequence + ",\n"
+                + "            \"priority\": \"High\",\n"
+                + "            \"reportingEntityId\": \"\",\n"
+                + "            \"reportingEntityName\": \"" + entityName + "\",\n"
+                + "            \"sourceId\": \"\",\n"
+                + "            \"sourceName\": \"" + mountpointName + "\",\n"
+                + "            \"startEpochMicrosec\": " + epochTimeMicrosecondsString + ",\n"
+                + "            \"lastEpochMicrosec\": " + epochTimeMicrosecondsString + ",\n"
+                + "            \"version\": 3.0\n"
+                + "        },\n"
+                + "        \"faultFields\": {\n"
+                + "            \"alarmAdditionalInformation\": [\n"
+                + "                 {\n"
+                + "                   \"name\": \"eventTime\",\n"
+                + "                   \"value\": \"" + eventTimeValueNetconfFormatString + "\"\n"
+                + "                 },\n"
+                + "                 {\n"
+                + "                   \"name\": \"equipType\",\n"
+                + "                   \"value\": \"" + neInventory.getType() + "\"\n"
+                + "                 },\n"
+                + "                 {\n"
+                + "                   \"name\": \"vendor\",\n"
+                + "                   \"value\": \"" + neInventory.getVendor() + "\"\n"
+                + "                 },\n" + "                 {\n"
+                + "                   \"name\": \"model\",\n"
+                + "                   \"value\": \"" + neInventory.getModel() + "\"\n"
+                + "                 }\n"
+                + "            ],\n"
+                + "            \"faultFieldsVersion\":2.0,\n"
+                + "            \"eventSourceType\": \"" + eventSourceType  + "\",\n"
+                + "            \"alarmCondition\": \"" + problemName + "\",\n"
+                + "            \"alarmInterfaceA\": \"" + objId + "\",\n"
+                + "            \"specificProblem\": \"" + problemName + "\",\n"
+                + "            \"eventSeverity\": \"" + severity + "\",\n"
+                + "            \"vfStatus\": \"Active\"\n"
+                + "        }\n"
+                + "    }\n"
+                + "}\n");
+        // @formatter:on
 
         return sb;
     }
@@ -312,8 +315,8 @@
      * Convert internal type formats into the Ecomp format
      */
 
-    private String convert(InternalSeverity severity ) {
-         switch( severity ) {
+    private String convert(InternalSeverity severity) {
+        switch (severity) {
             case NonAlarmed:
                 break;
             case Warning:
@@ -331,6 +334,7 @@
 
     /**
      * Time has to be converted into milliseconds
+     *
      * @param timeAsString time as string
      * @return as string
      */
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/dcaeconnector/impl/DcaeProviderClient.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/dcaeconnector/impl/DcaeProviderClient.java
index fcc8f6f..7ceafcb 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/dcaeconnector/impl/DcaeProviderClient.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/dcaeconnector/impl/DcaeProviderClient.java
@@ -40,36 +40,37 @@
 
     public DcaeProviderClient(ConfigurationFileRepresentation cfg, String entityName, DeviceManagerImpl deviceManager) {
         LOG.info("Create");
-        this.htConfig=cfg;
+        this.htConfig = cfg;
         this.config = new DcaeConfig(cfg);
         worker = new DcaeProviderWorker(config, entityName, deviceManager);
         this.configChangedListener = () -> {
             LOG.info("Configuration change. Worker exchanged");
-            synchronized(lock) {
+            synchronized (lock) {
                 worker.close();
                 worker = new DcaeProviderWorker(this.config, entityName, deviceManager);
             }
         };
-        this.htConfig.registerConfigChangedListener(configChangedListener );
+        this.htConfig.registerConfigChangedListener(configChangedListener);
 
     }
 
     @Override
     public void sendProblemNotification(String mountPointName, ProblemNotificationXml notification) {
-        synchronized(lock) {
+        synchronized (lock) {
             worker.sendProblemNotification(mountPointName, notification);
         }
     }
 
     @Override
-    public void sendProblemNotification(String mountPointName, ProblemNotificationXml notification, boolean neDeviceAlarm) {
+    public void sendProblemNotification(String mountPointName, ProblemNotificationXml notification,
+            boolean neDeviceAlarm) {
         sendProblemNotification(mountPointName, notification);
     }
 
     @Override
     public void close() {
         this.htConfig.unregisterConfigChangedListener(configChangedListener);
-        synchronized(lock) {
+        synchronized (lock) {
             worker.close();
         }
     }
@@ -81,4 +82,3 @@
 }
 
 
-
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/dcaeconnector/impl/DcaeProviderTask.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/dcaeconnector/impl/DcaeProviderTask.java
index f596701..18a36f7 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/dcaeconnector/impl/DcaeProviderTask.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/dcaeconnector/impl/DcaeProviderTask.java
@@ -26,7 +26,7 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-class DcaeProviderTask  implements Runnable {
+class DcaeProviderTask implements Runnable {
 
     private static final Logger LOG = LoggerFactory.getLogger(DcaeProviderTask.class);
 
@@ -39,7 +39,7 @@
     }
 
     private void sendHeartbeat() {
-         dcaeMessages.postHeartBeat();
+        dcaeMessages.postHeartBeat();
     }
 
     @Override
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/dcaeconnector/impl/DcaeProviderWorker.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/dcaeconnector/impl/DcaeProviderWorker.java
index 02ce79a..1ef50c3 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/dcaeconnector/impl/DcaeProviderWorker.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/dcaeconnector/impl/DcaeProviderWorker.java
@@ -42,11 +42,11 @@
     public DcaeProviderWorker(DcaeConfig configuration, String entityName, DeviceManagerImpl deviceManager) {
 
         //Start services
-        LOG.info("Configuration: "+configuration);
+        LOG.info("Configuration: " + configuration);
         int heartbeatSeconds = configuration.getTimerPeriodSeconds();
-        if ( heartbeatSeconds < MIN_HEARTBEAT_TIME_SECONDS ) {
+        if (heartbeatSeconds < MIN_HEARTBEAT_TIME_SECONDS) {
             heartbeatSeconds = MIN_HEARTBEAT_TIME_SECONDS;
-            LOG.info("Adjust heartbeat intervall to minimum of { } seconds.",heartbeatSeconds);
+            LOG.info("Adjust heartbeat intervall to minimum of { } seconds.", heartbeatSeconds);
         }
 
         dcaepClient = new DcaeSenderImpl(configuration.getEventReveicerUrl(), configuration.getUserCredentials());
@@ -57,7 +57,7 @@
         this.scheduler = Executors.newSingleThreadScheduledExecutor();
         Runnable task = new DcaeProviderTask(dcaeMessages);
 
-        LOG.info("Fault task created with "+heartbeatSeconds+" Seconds");
+        LOG.info("Fault task created with " + heartbeatSeconds + " Seconds");
         this.taskReference = this.scheduler.scheduleAtFixedRate(task, 0, heartbeatSeconds, TimeUnit.SECONDS);
         LOG.info("Fault task scheduled");
     }
@@ -73,7 +73,7 @@
             this.scheduler.shutdown();
             this.scheduler.awaitTermination(5, TimeUnit.SECONDS);
         } catch (InterruptedException | SecurityException e) {
-            LOG.debug("Schedler shutdown interrupted with exception: ",e);
+            LOG.debug("Schedler shutdown interrupted with exception: ", e);
             if (e instanceof InterruptedException) {
                 Thread.currentThread().interrupt();
             }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/dcaeconnector/impl/config/DcaeConfig.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/dcaeconnector/impl/config/DcaeConfig.java
index 714e855..883c743 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/dcaeconnector/impl/config/DcaeConfig.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/dcaeconnector/impl/config/DcaeConfig.java
@@ -32,12 +32,12 @@
     private static final String DEFAULT_VALUE_USERCREDENTIALS = "admin:admin";
     private static final long DEFAULT_VALUE_TIMERPERIOD = 120;
 
-	private final ConfigurationFileRepresentation configuration;
+    private final ConfigurationFileRepresentation configuration;
 
-	public DcaeConfig(ConfigurationFileRepresentation configuration) {
-		this.configuration = configuration;
-    	this.configuration.addSection(SECTION_MARKER_DCAE);
-		defaults();
+    public DcaeConfig(ConfigurationFileRepresentation configuration) {
+        this.configuration = configuration;
+        this.configuration.addSection(SECTION_MARKER_DCAE);
+        defaults();
     }
 
     /* ***********************
@@ -45,35 +45,39 @@
      */
 
     public String getEventReveicerUrl() {
-		return configuration.getProperty(SECTION_MARKER_DCAE, PROPERTY_KEY_EVENTRECEIVERURL);
+        return configuration.getProperty(SECTION_MARKER_DCAE, PROPERTY_KEY_EVENTRECEIVERURL);
     }
 
     public String getUserCredentials() {
-		return configuration.getProperty(SECTION_MARKER_DCAE, PROPERTY_KEY_USERCREDENTIALS);
+        return configuration.getProperty(SECTION_MARKER_DCAE, PROPERTY_KEY_USERCREDENTIALS);
     }
 
     public Integer getTimerPeriodSeconds() {
-    	long res = configuration.getPropertyLong(SECTION_MARKER_DCAE, PROPERTY_KEY_TIMERPERIOD).orElse(DEFAULT_VALUE_TIMERPERIOD);
-		return (int)res;
+        long res = configuration.getPropertyLong(SECTION_MARKER_DCAE, PROPERTY_KEY_TIMERPERIOD)
+                .orElse(DEFAULT_VALUE_TIMERPERIOD);
+        return (int) res;
     }
 
 
-	@Override
-	public String getSectionName() {
-		return SECTION_MARKER_DCAE;
-	}
+    @Override
+    public String getSectionName() {
+        return SECTION_MARKER_DCAE;
+    }
 
-	@Override
-	public void defaults() {
-		this.configuration.setPropertyIfNotAvailable(SECTION_MARKER_DCAE, PROPERTY_KEY_EVENTRECEIVERURL, DEFAULT_VALUE_EVENTRECEIVERURL);
-		this.configuration.setPropertyIfNotAvailable(SECTION_MARKER_DCAE, PROPERTY_KEY_USERCREDENTIALS, DEFAULT_VALUE_USERCREDENTIALS);
-		this.configuration.setPropertyIfNotAvailable(SECTION_MARKER_DCAE, PROPERTY_KEY_TIMERPERIOD, DEFAULT_VALUE_TIMERPERIOD);
-	}
+    @Override
+    public void defaults() {
+        this.configuration.setPropertyIfNotAvailable(SECTION_MARKER_DCAE, PROPERTY_KEY_EVENTRECEIVERURL,
+                DEFAULT_VALUE_EVENTRECEIVERURL);
+        this.configuration.setPropertyIfNotAvailable(SECTION_MARKER_DCAE, PROPERTY_KEY_USERCREDENTIALS,
+                DEFAULT_VALUE_USERCREDENTIALS);
+        this.configuration.setPropertyIfNotAvailable(SECTION_MARKER_DCAE, PROPERTY_KEY_TIMERPERIOD,
+                DEFAULT_VALUE_TIMERPERIOD);
+    }
 
-	@Override
-	public String toString() {
-		return "DcaeConfig [getEventReveicerUrl()=" + getEventReveicerUrl() + ", getUserCredentials()="
-				+ getUserCredentials() + ", getTimerPeriodSeconds()=" + getTimerPeriodSeconds() + ", getSectionName()="
-				+ getSectionName() + "]";
-	}
+    @Override
+    public String toString() {
+        return "DcaeConfig [getEventReveicerUrl()=" + getEventReveicerUrl() + ", getUserCredentials()="
+                + getUserCredentials() + ", getTimerPeriodSeconds()=" + getTimerPeriodSeconds() + ", getSectionName()="
+                + getSectionName() + "]";
+    }
 }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/Checker.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/Checker.java
index f673643..9d64a3b 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/Checker.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/Checker.java
@@ -33,12 +33,14 @@
 
     /**
      * Check action.
+     * 
      * @return true if reachable, false if not
      */
     abstract boolean isReachableOnce();
 
     /**
      * Procedure to check the connection of one mountpoint
+     * 
      * @return true if reachable, false if not
      */
     boolean isConnected() {
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/DeviceMonitor.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/DeviceMonitor.java
index ecfab4d..18fcba7 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/DeviceMonitor.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/DeviceMonitor.java
@@ -29,19 +29,21 @@
 
     /**
      * removeMountpointIndication deregisters a mountpoint for registration services
+     * 
      * @param mountPointNodeName to deregister
      */
     void removeMountpointIndication(String mountPointNodeName);
 
-       /**
-        * Notify of device state change to "disconnected"
-        * Mount point supervision
-        * @param mountPointNodeName to deregister
-        */
+    /**
+     * Notify of device state change to "disconnected" Mount point supervision
+     * 
+     * @param mountPointNodeName to deregister
+     */
     void deviceDisconnectIndication(String mountPointNodeName);
 
     /**
      * Notify of device state changes to "connected"
+     * 
      * @param mountPointNodeName name of mount point
      * @param ne to monitor
      */
@@ -49,6 +51,7 @@
 
     /**
      * Notify of device state changes to "connected"
+     * 
      * @param mountPointNodeName name of mount point
      * @param ne to monitor
      */
@@ -56,6 +59,7 @@
 
     /**
      * Notify of device state changes to "connected" for slave nodes
+     * 
      * @param mountPointNodeName name of mount point
      */
     void deviceConnectSlaveIndication(String mountPointNodeName);
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/DeviceMonitorEmptyImpl.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/DeviceMonitorEmptyImpl.java
index 5615ef9..2b9a18c 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/DeviceMonitorEmptyImpl.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/DeviceMonitorEmptyImpl.java
@@ -23,32 +23,25 @@
 public class DeviceMonitorEmptyImpl implements DeviceMonitor {
 
     @Override
-    public void refreshAlarmsInDb() {
-    }
+    public void refreshAlarmsInDb() {}
 
     @Override
-    public void removeMountpointIndication(String mountPointNodeName) {
-    }
+    public void removeMountpointIndication(String mountPointNodeName) {}
 
     @Override
-    public void deviceConnectMasterIndication(String mountPointNodeName, DeviceMonitoredNe ne) {
-    }
+    public void deviceConnectMasterIndication(String mountPointNodeName, DeviceMonitoredNe ne) {}
 
     @Override
-    public void deviceDisconnectIndication(String mountPointNodeName) {
-    }
+    public void deviceDisconnectIndication(String mountPointNodeName) {}
 
     @Override
-    public void deviceConnectSlaveIndication(String mountPointNodeName) {
-    }
+    public void deviceConnectSlaveIndication(String mountPointNodeName) {}
 
     @Override
-    public void close() throws Exception {
-    }
+    public void close() throws Exception {}
 
     @Override
-    public void deviceConnectMasterIndication(String mountPointNodeName, NetworkElement ne) {
-    }
+    public void deviceConnectMasterIndication(String mountPointNodeName, NetworkElement ne) {}
 
 
 }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/DeviceMonitorImpl.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/DeviceMonitorImpl.java
index d6714b8..3f5fdac 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/DeviceMonitorImpl.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/DeviceMonitorImpl.java
@@ -38,33 +38,34 @@
 import org.slf4j.LoggerFactory;
 
 /**
- *  Implementation of concept "Active monitoring" of a device.<br>
- *    <br>
- *  For each existing mountpoint a task runs with 120s cycle time. Every 120 seconds the check actions are performed.
- *  The request is handled by the NETCONF layer with a (default)configured time-out of 60 seconds.<br>
- *  Generated alarms, by the object/node "SDN-Controller" are (enum DeviceMonitorProblems):<br>
- *      - notConnected(InternalSeverity.Warning)<br>
- *      - noConnectionMediator(InternalSeverity.Minor)<br>
- *      - noConnectionNe(InternalSeverity.Critical)<br>
- *    <br>
- *  1. Mountpoint does not exist<br>
- *  If the mountpoint does not exists there are no related current alarms in the database.<br>
- *    <br>
- *  2. Created mountpoint with state "Connecting" or "UnableToConnect"<br>
- *  If the Mountpoint is created and connection status is "Connecting" or "UnableToConnect".<br>
- *  - After about 2..4 Minutes ... raise alarm "notConnected" with severity warning<br>
- *    <br>
- *  3. Created mountpoint with state "Connection"<br>
- *  There are two monitor activities.<br>
- *      3a. Check of Mediator connection by requesting (typical) cached data.<br>
- *          - After about 60 seconds raise alarm: connection-loss-mediator with severity minor<br>
- *          - Request from Mediator: network-element<br>
- *    <br>
- *      3b. Check connection to NEby requesting (typical) non-cached data.<br>
- *          - Only if AirInterface available. The first one is used.<br>
- *          - Requested are the currentAlarms<br>
- *          - After about 60 seconds raise alarm: connection-loss-network-element with severity critical<br>
- *    <br>
+ * Implementation of concept "Active monitoring" of a device.<br>
+ * <br>
+ * For each existing mountpoint a task runs with 120s cycle time. Every 120 seconds the check actions are performed. The
+ * request is handled by the NETCONF layer with a (default)configured time-out of 60 seconds.<br>
+ * Generated alarms, by the object/node "SDN-Controller" are (enum DeviceMonitorProblems):<br>
+ * - notConnected(InternalSeverity.Warning)<br>
+ * - noConnectionMediator(InternalSeverity.Minor)<br>
+ * - noConnectionNe(InternalSeverity.Critical)<br>
+ * <br>
+ * 1. Mountpoint does not exist<br>
+ * If the mountpoint does not exists there are no related current alarms in the database.<br>
+ * <br>
+ * 2. Created mountpoint with state "Connecting" or "UnableToConnect"<br>
+ * If the Mountpoint is created and connection status is "Connecting" or "UnableToConnect".<br>
+ * - After about 2..4 Minutes ... raise alarm "notConnected" with severity warning<br>
+ * <br>
+ * 3. Created mountpoint with state "Connection"<br>
+ * There are two monitor activities.<br>
+ * 3a. Check of Mediator connection by requesting (typical) cached data.<br>
+ * - After about 60 seconds raise alarm: connection-loss-mediator with severity minor<br>
+ * - Request from Mediator: network-element<br>
+ * <br>
+ * 3b. Check connection to NEby requesting (typical) non-cached data.<br>
+ * - Only if AirInterface available. The first one is used.<br>
+ * - Requested are the currentAlarms<br>
+ * - After about 60 seconds raise alarm: connection-loss-network-element with severity critical<br>
+ * <br>
+ * 
  * @author herbert
  */
 
@@ -86,9 +87,11 @@
 
     /**
      * Basic implementation of devicemonitoring
+     * 
      * @param odlEventListener as destination for problems
      */
-    public DeviceMonitorImpl(DataBroker dataBroker, ODLEventListenerHandler odlEventListener, ConfigurationFileRepresentation htconfig) {
+    public DeviceMonitorImpl(DataBroker dataBroker, ODLEventListenerHandler odlEventListener,
+            ConfigurationFileRepresentation htconfig) {
         LOG.info("Construct {}", this.getClass().getSimpleName());
 
         this.odlEventListener = odlEventListener;
@@ -135,57 +138,62 @@
 
     /**
      * Notify of device state changes to "connected" for slave nodes
+     * 
      * @param mountPointNodeName name of mount point
      */
     @Override
     synchronized public void deviceConnectSlaveIndication(String mountPointNodeName) {
-        deviceConnectMasterIndication(mountPointNodeName, (DeviceMonitoredNe)null);
+        deviceConnectMasterIndication(mountPointNodeName, (DeviceMonitoredNe) null);
     }
 
     @Override
     public void deviceConnectMasterIndication(String mountPointNodeName, NetworkElement networkElement) {
         Optional<DeviceMonitoredNe> monitoredNe = networkElement.getService(DeviceMonitoredNe.class);
-           deviceConnectMasterIndication(mountPointNodeName, monitoredNe.isPresent() ? monitoredNe.get() : dummyNe);
+        deviceConnectMasterIndication(mountPointNodeName, monitoredNe.isPresent() ? monitoredNe.get() : dummyNe);
     }
 
     /**
      * Notify of device state changes to "connected"
+     * 
      * @param mountPointNodeName name of mount point
      * @param ne to monitor
      */
     @Override
     synchronized public void deviceConnectMasterIndication(String mountPointNodeName, DeviceMonitoredNe ne) {
 
-        LOG.debug("ne changes to connected state {}",mountPointNodeName);
+        LOG.debug("ne changes to connected state {}", mountPointNodeName);
         createMonitoringTask(mountPointNodeName);
         if (queue.containsKey(mountPointNodeName)) {
             DeviceMonitorTask task = queue.get(mountPointNodeName);
             task.deviceConnectIndication(ne);
         } else {
-            LOG.warn("Monitoring task not in queue: {} {} {}", mountPointNodeName, mountPointNodeName.hashCode(), queue.size());
+            LOG.warn("Monitoring task not in queue: {} {} {}", mountPointNodeName, mountPointNodeName.hashCode(),
+                    queue.size());
         }
     }
 
-   /**
-    * Notify of device state change to "disconnected"
-    * Mount point supervision
-    * @param mountPointNodeName to deregister
-    */
+    /**
+     * Notify of device state change to "disconnected" Mount point supervision
+     * 
+     * @param mountPointNodeName to deregister
+     */
     @Override
     synchronized public void deviceDisconnectIndication(String mountPointNodeName) {
 
-        LOG.debug("State changes to not connected state {}",mountPointNodeName);
+        LOG.debug("State changes to not connected state {}", mountPointNodeName);
         createMonitoringTask(mountPointNodeName);
         if (queue.containsKey(mountPointNodeName)) {
             DeviceMonitorTask task = queue.get(mountPointNodeName);
             task.deviceDisconnectIndication();
         } else {
-            LOG.warn("Monitoring task not in queue: {} {} {}", mountPointNodeName, mountPointNodeName.hashCode(), queue.size());
+            LOG.warn("Monitoring task not in queue: {} {} {}", mountPointNodeName, mountPointNodeName.hashCode(),
+                    queue.size());
         }
     }
 
     /**
      * removeMountpointIndication deregisters a mountpoint for registration services
+     * 
      * @param mountPointNodeName to deregister
      */
     @Override
@@ -208,7 +216,7 @@
      */
     @Override
     public void refreshAlarmsInDb() {
-        synchronized(queue) {
+        synchronized (queue) {
             for (DeviceMonitorTask task : queue.values()) {
                 task.refreshAlarms();
             }
@@ -219,7 +227,7 @@
      * For test run the tasks
      */
     public void taskTestRun() {
-        synchronized(queue) {
+        synchronized (queue) {
             for (DeviceMonitorTask task : queue.values()) {
                 task.run();
             }
@@ -232,12 +240,13 @@
 
     /**
      * createMountpoint registers a new mountpoint monitoring service
+     * 
      * @param mountPointNodeName name of mountpoint
      */
     synchronized private DeviceMonitorTask createMonitoringTask(String mountPointNodeName) {
 
         DeviceMonitorTask task;
-        LOG.debug("Register for monitoring {} {}",mountPointNodeName, mountPointNodeName.hashCode());
+        LOG.debug("Register for monitoring {} {}", mountPointNodeName, mountPointNodeName.hashCode());
 
         if (queue.containsKey(mountPointNodeName)) {
             LOG.info("Monitoring task exists");
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/DeviceMonitorProblems.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/DeviceMonitorProblems.java
index 646b30b..ecc62cf 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/DeviceMonitorProblems.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/DeviceMonitorProblems.java
@@ -36,13 +36,13 @@
     connectionLossOAM(InternalSeverity.Major),
 
     /**
-     * Mountpoint is connected via Netconf to Mediator, but mediator is not responding.
-     * Connection state to NE is unknown.
+     * Mountpoint is connected via Netconf to Mediator, but mediator is not responding. Connection state to NE is
+     * unknown.
      */
     connectionLossMediator(InternalSeverity.Major),
 
-    /** Mountpoint is connected via Netconf to Mediator.
-     * This connection is OK, but mediator <-> NE Connection is not OK
+    /**
+     * Mountpoint is connected via Netconf to Mediator. This connection is OK, but mediator <-> NE Connection is not OK
      */
     connectionLossNeOAM(InternalSeverity.Major);
 
@@ -61,7 +61,7 @@
 
     public void setSeverity(InternalSeverity severity) {
         LOG.info("Change severity for {} from {} to {}", name(), this.severity, severity);
-        this.severity=severity;
+        this.severity = severity;
     }
 
 }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/DeviceMonitorTask.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/DeviceMonitorTask.java
index 73ce1b4..e967317 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/DeviceMonitorTask.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/DeviceMonitorTask.java
@@ -51,7 +51,7 @@
     private int tickCounter; //Added for each tick. Not relevant for internal status
 
     private ScheduledFuture<?> taskHandle;
-    private final Object lockNe = new Object();    //USe top lock access to member ne
+    private final Object lockNe = new Object(); //USe top lock access to member ne
     private @Nullable DeviceMonitoredNe ne; //Indication if in status connect or disconnect
     private @NonNull Boolean mountpointConnectingStateSupervision; //Indication of mountpoint supervision
 
@@ -65,6 +65,7 @@
 
     /**
      * Setup monitoring task
+     * 
      * @param mountPointName to monitor
      * @param odlEventListener to forward problems to
      */
@@ -77,7 +78,7 @@
         this.checkConnectionToMediator = new Checker() {
             @Override
             boolean isReachableOnce() {
-                synchronized(lockNe) {
+                synchronized (lockNe) {
                     //mountpoint state "Connected"
                     //If for any reason the mountpoint is Connected, but Notconf messages are not received
                     return ne == null ? true : ne.checkIfConnectionToMediatorIsOk();
@@ -87,7 +88,7 @@
         this.checkConnectionToNe = new Checker() {
             @Override
             boolean isReachableOnce() {
-                synchronized(lockNe) {
+                synchronized (lockNe) {
                     //mountpoint state "Connected"
                     //If netconf mediator (netconf application software for NE) has connection loss to managed device.
                     //The networkelement object is available, but there is no interfacepack available.
@@ -111,6 +112,7 @@
 
     /**
      * Start for each object an own instance of the thread.
+     * 
      * @param scheduler for all the threads.
      */
     public void start(ScheduledExecutorService scheduler) {
@@ -125,15 +127,15 @@
     }
 
     /**
-     * Call after NE change state to connected.
-     * Mountpoint exists. Status is Connecting.
+     * Call after NE change state to connected. Mountpoint exists. Status is Connecting.
+     * 
      * @param neParam that connected
      */
 
     public void deviceConnectIndication(DeviceMonitoredNe neParam) {
         LOG.info("{} {} Connect {} and stop.", LOGMARKER, tickCounter, mountPointName);
         clear(DeviceMonitorProblems.connectionLossOAM);
-        synchronized(lockNe) {
+        synchronized (lockNe) {
             this.ne = neParam;
             this.mountpointConnectingStateSupervision = false;
         }
@@ -141,14 +143,13 @@
     }
 
     /**
-     * If ne is disconnected do the related actions.
-     * - Mountpoint exists. Status is Connecting or UnableToConnect
+     * If ne is disconnected do the related actions. - Mountpoint exists. Status is Connecting or UnableToConnect
      */
 
     public void deviceDisconnectIndication() {
         LOG.info("{} {} Disconnect {} and start.", LOGMARKER, tickCounter, mountPointName);
         clear(DeviceMonitorProblems.connectionLossOAM);
-        synchronized(lockNe) {
+        synchronized (lockNe) {
             this.ne = null;
             this.mountpointConnectingStateSupervision = true;
         }
@@ -156,36 +157,36 @@
     }
 
     /**
-     * Do all actions to clean up the log if mountpoint has been deleted.
-     * - Mountpoint removed
-     * Prepare cancellation of the task and cancel task
+     * Do all actions to clean up the log if mountpoint has been deleted. - Mountpoint removed Prepare cancellation of
+     * the task and cancel task
      */
 
     public void removeMountpointIndication() {
-         for (DeviceMonitorProblems problem : DeviceMonitorProblems.values()) {
+        for (DeviceMonitorProblems problem : DeviceMonitorProblems.values()) {
             clear(problem);
         }
-         //Cancel the task
-         if (this.taskHandle != null) {
-             this.taskHandle.cancel(false);
-             LOG.info("{} {} DeviceMonitor task canceled for {}", LOGMARKER, tickCounter, mountPointName);
-         } else {
-             LOG.error("{} {} Task already stopped", LOGMARKER, tickCounter);
-         }
+        //Cancel the task
+        if (this.taskHandle != null) {
+            this.taskHandle.cancel(false);
+            LOG.info("{} {} DeviceMonitor task canceled for {}", LOGMARKER, tickCounter, mountPointName);
+        } else {
+            LOG.error("{} {} Task already stopped", LOGMARKER, tickCounter);
+        }
     }
 
     /**
      * Referesh Alarms
      */
     public void refreshAlarms() {
-        LOG.debug("{} Start refresh of all problems",LOGMARKER);
-        synchronized(currentProblems) {
-            for (DeviceMonitorProblems problem :    currentProblems) {
-                LOG.debug("{} Refresh problem {} Raised-status {}",LOGMARKER, problem.name(), currentProblems.contains(problem));
+        LOG.debug("{} Start refresh of all problems", LOGMARKER);
+        synchronized (currentProblems) {
+            for (DeviceMonitorProblems problem : currentProblems) {
+                LOG.debug("{} Refresh problem {} Raised-status {}", LOGMARKER, problem.name(),
+                        currentProblems.contains(problem));
                 odlEventListener.onProblemNotification(mountPointName, problem.name(), problem.getSeverity());
             }
         }
-        LOG.debug("{} Finish refresh of all problems",LOGMARKER);
+        LOG.debug("{} Finish refresh of all problems", LOGMARKER);
     }
 
     /*------------------------------------------------------------
@@ -194,12 +195,13 @@
 
     /**
      * Raise a problem, but only once
+     * 
      * @param problem
      */
     private void raise(DeviceMonitorProblems problem) {
-        LOG.debug("{} Raise problem {} Raised-status {}",LOGMARKER, problem.name(), currentProblems.contains(problem));
-        synchronized(currentProblems) {
-            if (! currentProblems.contains(problem)) {
+        LOG.debug("{} Raise problem {} Raised-status {}", LOGMARKER, problem.name(), currentProblems.contains(problem));
+        synchronized (currentProblems) {
+            if (!currentProblems.contains(problem)) {
                 currentProblems.add(problem);
                 odlEventListener.onProblemNotification(mountPointName, problem.name(), problem.getSeverity());
             }
@@ -208,11 +210,12 @@
 
     /**
      * Raise a problem, but only once
+     * 
      * @param problem
      */
     private void clear(DeviceMonitorProblems problem) {
-        LOG.debug("{} Clear problem {} Raised-status {}",LOGMARKER, problem.name(), currentProblems.contains(problem));
-        synchronized(currentProblems) {
+        LOG.debug("{} Clear problem {} Raised-status {}", LOGMARKER, problem.name(), currentProblems.contains(problem));
+        synchronized (currentProblems) {
             if (currentProblems.contains(problem)) {
                 currentProblems.remove(problem);
                 odlEventListener.onProblemNotification(mountPointName, problem.name(), InternalSeverity.NonAlarmed);
@@ -222,17 +225,20 @@
 
     /**
      * Process problem notification cascade
+     * 
      * @param isReachable
      * @param problem
      */
     private void clearRaiseIfConnected(Checker checker, DeviceMonitorProblems problem) {
-        LOG.debug("{} check start {} problem {} Raised-status {}",LOGMARKER, tickCounter, problem.name(), currentProblems.contains(problem));
+        LOG.debug("{} check start {} problem {} Raised-status {}", LOGMARKER, tickCounter, problem.name(),
+                currentProblems.contains(problem));
         if (checker.isConnected()) {
             clear(problem);
         } else {
             raise(problem);
         }
-        LOG.debug("{} check end {} problem {} Raised-status {}",LOGMARKER, tickCounter, problem.name(), currentProblems.contains(problem));
+        LOG.debug("{} check end {} problem {} Raised-status {}", LOGMARKER, tickCounter, problem.name(),
+                currentProblems.contains(problem));
     }
 
     /*------------------------------------------------------------
@@ -240,19 +246,19 @@
      */
 
     private void startDisconnectSupervision() {
-        synchronized(lockDisconnectSupervisionTickout) {
+        synchronized (lockDisconnectSupervisionTickout) {
             this.disconnectSupervisionTickout = 2;
         }
     }
 
     private void stopDisconnectSupervision() {
-        synchronized(lockDisconnectSupervisionTickout) {
+        synchronized (lockDisconnectSupervisionTickout) {
             this.disconnectSupervisionTickout = 0;
         }
     }
 
     private boolean processDisconnectSupervisionAndCheckExceeded() {
-        synchronized(lockDisconnectSupervisionTickout) {
+        synchronized (lockDisconnectSupervisionTickout) {
             if (disconnectSupervisionTickout == 0) {
                 return true;
             } else if (disconnectSupervisionTickout > 0) {
@@ -267,53 +273,48 @@
      */
 
     /**
-     * Task to monitor connectivity to Network Elements.
-     * Connectivity problems lead to alarm indication.
+     * Task to monitor connectivity to Network Elements. Connectivity problems lead to alarm indication.
      */
     @Override
     public void run() {
 
         try {
-            LOG.debug("{} UTCTime {} START mountpoint {} tick {} connecting supervision {} tickout {}",
-                    LOGMARKER,
-                    NETCONFTIME_CONVERTER.getTimeStamp(),
-                    mountPointName,
-                    tickCounter,
-                    mountpointConnectingStateSupervision,
-                    disconnectSupervisionTickout);
+            LOG.debug("{} UTCTime {} START mountpoint {} tick {} connecting supervision {} tickout {}", LOGMARKER,
+                    NETCONFTIME_CONVERTER.getTimeStamp(), mountPointName, tickCounter,
+                    mountpointConnectingStateSupervision, disconnectSupervisionTickout);
 
-               if (mountpointConnectingStateSupervision) {
-                   LOG.debug("{} {} Mountpoint supervision {}", LOGMARKER, tickCounter, mountPointName);
-                   if (processDisconnectSupervisionAndCheckExceeded()) {
-                       raise(DeviceMonitorProblems.connectionLossOAM);
-                   }
+            if (mountpointConnectingStateSupervision) {
+                LOG.debug("{} {} Mountpoint supervision {}", LOGMARKER, tickCounter, mountPointName);
+                if (processDisconnectSupervisionAndCheckExceeded()) {
+                    raise(DeviceMonitorProblems.connectionLossOAM);
+                }
 
-               } else {
+            } else {
                 synchronized (lockNe) {
-                       if (ne != null) {
-                           //checks during "Connected"
-                           clear(DeviceMonitorProblems.connectionLossOAM); //Always cleared never raised
-                           LOG.debug("{} {} Prepare check", LOGMARKER, tickCounter);
-                           ne.prepareCheck();  // Prepare ne check
-                           // Mediator check
-                           LOG.debug("{} {} Mediator check", LOGMARKER, tickCounter);
-                           clearRaiseIfConnected(checkConnectionToMediator, DeviceMonitorProblems.connectionLossMediator);
+                    if (ne != null) {
+                        //checks during "Connected"
+                        clear(DeviceMonitorProblems.connectionLossOAM); //Always cleared never raised
+                        LOG.debug("{} {} Prepare check", LOGMARKER, tickCounter);
+                        ne.prepareCheck(); // Prepare ne check
+                        // Mediator check
+                        LOG.debug("{} {} Mediator check", LOGMARKER, tickCounter);
+                        clearRaiseIfConnected(checkConnectionToMediator, DeviceMonitorProblems.connectionLossMediator);
 
-                           // NE check
-                           LOG.debug("{} {} Ne check", LOGMARKER, tickCounter);
-                           clearRaiseIfConnected(checkConnectionToNe, DeviceMonitorProblems.connectionLossNeOAM);
-                       } else {
-                           //Monitor switch off.
-                           LOG.debug("{} {} Monitor switch off state", LOGMARKER, tickCounter);
-                           clear(DeviceMonitorProblems.connectionLossOAM); //Always cleared never raised
-                           clear(DeviceMonitorProblems.connectionLossMediator); //Always cleared never raised
-                           clear(DeviceMonitorProblems.connectionLossNeOAM); //Always cleared never raised
-                       }
-                   }
+                        // NE check
+                        LOG.debug("{} {} Ne check", LOGMARKER, tickCounter);
+                        clearRaiseIfConnected(checkConnectionToNe, DeviceMonitorProblems.connectionLossNeOAM);
+                    } else {
+                        //Monitor switch off.
+                        LOG.debug("{} {} Monitor switch off state", LOGMARKER, tickCounter);
+                        clear(DeviceMonitorProblems.connectionLossOAM); //Always cleared never raised
+                        clear(DeviceMonitorProblems.connectionLossMediator); //Always cleared never raised
+                        clear(DeviceMonitorProblems.connectionLossNeOAM); //Always cleared never raised
+                    }
+                }
             }
         } catch (Exception e) {
             //Prevent stopping the task
-            LOG.warn("{} {} During DeviceMontoring task",LOGMARKER, tickCounter, e);
+            LOG.warn("{} {} During DeviceMontoring task", LOGMARKER, tickCounter, e);
         }
         LOG.debug("{} {} END", LOGMARKER, tickCounter++);
 
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/config/DmConfig.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/config/DmConfig.java
index 84474b5..80e8659 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/config/DmConfig.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/devicemonitor/impl/config/DmConfig.java
@@ -23,10 +23,8 @@
 import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.util.InternalSeverity;
 
 /**
- * Configuration of devicemonitor, section [devicemonitor]
- *   SeverityConnectionlossNeOAM=minor
- *   SeverityConnectionlossOAM=major
- *   SeverityConnectionlossMediator=critical
+ * Configuration of devicemonitor, section [devicemonitor] SeverityConnectionlossNeOAM=minor
+ * SeverityConnectionlossOAM=major SeverityConnectionlossMediator=critical
  */
 public class DmConfig implements Configuration {
 
@@ -34,34 +32,35 @@
 
     private static final String PROPERTY_KEY_PREFIX_Severity = "Severity";
 
-	private final ConfigurationFileRepresentation configuration;
+    private final ConfigurationFileRepresentation configuration;
 
-	public DmConfig(ConfigurationFileRepresentation configuration) {
-		this.configuration = configuration;
-    	this.configuration.addSection(SECTION_MARKER_TA);
-		defaults();
-	}
+    public DmConfig(ConfigurationFileRepresentation configuration) {
+        this.configuration = configuration;
+        this.configuration.addSection(SECTION_MARKER_TA);
+        defaults();
+    }
 
-	public InternalSeverity getSeverity(DeviceMonitorProblems problem) {
-		String severityString = configuration.getProperty(SECTION_MARKER_TA, getPropertyName(problem));
-		InternalSeverity result = InternalSeverity.valueOfString(severityString);
-		return result != null ? result : InternalSeverity.Major;
-	}
+    public InternalSeverity getSeverity(DeviceMonitorProblems problem) {
+        String severityString = configuration.getProperty(SECTION_MARKER_TA, getPropertyName(problem));
+        InternalSeverity result = InternalSeverity.valueOfString(severityString);
+        return result != null ? result : InternalSeverity.Major;
+    }
 
-	@Override
-	public String getSectionName() {
-		return SECTION_MARKER_TA;
-	}
+    @Override
+    public String getSectionName() {
+        return SECTION_MARKER_TA;
+    }
 
-	@Override
-	public void defaults() {
+    @Override
+    public void defaults() {
         for (DeviceMonitorProblems problem : DeviceMonitorProblems.values()) {
-    		configuration.setPropertyIfNotAvailable(SECTION_MARKER_TA, getPropertyName(problem), problem.getSeverity().name());
+            configuration.setPropertyIfNotAvailable(SECTION_MARKER_TA, getPropertyName(problem),
+                    problem.getSeverity().name());
         }
-	}
+    }
 
-	private String getPropertyName(DeviceMonitorProblems problem) {
-		return PROPERTY_KEY_PREFIX_Severity+problem.name();
-	}
+    private String getPropertyName(DeviceMonitorProblems problem) {
+        return PROPERTY_KEY_PREFIX_Severity + problem.name();
+    }
 
 }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/eventdatahandler/DeviceManagerDatabaseNotificationService.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/eventdatahandler/DeviceManagerDatabaseNotificationService.java
index 2cccd39..e4a7829 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/eventdatahandler/DeviceManagerDatabaseNotificationService.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/eventdatahandler/DeviceManagerDatabaseNotificationService.java
@@ -52,32 +52,32 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class DeviceManagerDatabaseNotificationService implements NotificationService, EquipmentService, FaultService,NotificationDelayedListener<ProblemNotificationXml> {
+public class DeviceManagerDatabaseNotificationService implements NotificationService, EquipmentService, FaultService,
+        NotificationDelayedListener<ProblemNotificationXml> {
 
-	private static final Logger LOG = LoggerFactory.getLogger(DeviceManagerDatabaseNotificationService.class);
+    private static final Logger LOG = LoggerFactory.getLogger(DeviceManagerDatabaseNotificationService.class);
 
-	private final @NonNull DataProvider databaseService;
+    private final @NonNull DataProvider databaseService;
     private final @NonNull WebSocketServiceClientInternal webSocketService;
-    private @NonNull
-    final DevicemanagerNotificationDelayService notificationDelayService;
-    private @NonNull
-    final DcaeForwarderInternal aotsDcaeForwarder;
+    private @NonNull final DevicemanagerNotificationDelayService notificationDelayService;
+    private @NonNull final DcaeForwarderInternal aotsDcaeForwarder;
 
-	private final @NonNull MaintenanceServiceImpl maintenanceService;
+    private final @NonNull MaintenanceServiceImpl maintenanceService;
 
     /**
-     * @param databaseService  to access database
+     * @param databaseService to access database
      * @param maintenanceService
      * @param webSocketService to send notifications
      * @param notificationDelayService filter to prevent toggle alarms
      * @param aotsDcaeForwarder
      */
     public DeviceManagerDatabaseNotificationService(@NonNull DataProvider databaseService,
-            @NonNull MaintenanceServiceImpl maintenanceService, @NonNull WebSocketServiceClientInternal webSocketService,
+            @NonNull MaintenanceServiceImpl maintenanceService,
+            @NonNull WebSocketServiceClientInternal webSocketService,
             @NonNull DevicemanagerNotificationDelayService notificationDelayService,
             @NonNull DcaeForwarderInternal aotsDcaeForwarder) {
         super();
-        HtAssert.nonnull(databaseService, maintenanceService,webSocketService, notificationDelayService);
+        HtAssert.nonnull(databaseService, maintenanceService, webSocketService, notificationDelayService);
 
         this.databaseService = databaseService;
         this.maintenanceService = maintenanceService;
@@ -99,7 +99,8 @@
     @Override
     public void changeNotification(NodeId nodeId, @Nullable Integer counter, @Nullable DateAndTime timeStamp,
             @Nullable String objectId, @Nullable String attributeName, @Nullable String newValue) {
-        EventlogEntity eventlogEntity = new EventlogNotificationBuilder(nodeId, counter, timeStamp, objectId, attributeName, newValue).build();
+        EventlogEntity eventlogEntity =
+                new EventlogNotificationBuilder(nodeId, counter, timeStamp, objectId, attributeName, newValue).build();
         databaseService.writeEventLog(eventlogEntity);
         webSocketService.sendViaWebsockets(nodeId.getValue(), new AttributeValueChangedNotificationXml(eventlogEntity));
     }
@@ -107,7 +108,8 @@
     @Override
     public void creationNotification(NodeId nodeId, @Nullable Integer counter, @Nullable DateAndTime timeStamp,
             @Nullable String objectId) {
-        EventlogEntity eventlogEntity = new EventlogNotificationBuilder(nodeId, counter, timeStamp, objectId, "creation", null).build();
+        EventlogEntity eventlogEntity =
+                new EventlogNotificationBuilder(nodeId, counter, timeStamp, objectId, "creation", null).build();
         databaseService.writeEventLog(eventlogEntity);
         webSocketService.sendViaWebsockets(nodeId.getValue(), new ObjectCreationNotificationXml(eventlogEntity));
     }
@@ -116,7 +118,8 @@
     @Override
     public void deletionNotification(NodeId nodeId, @Nullable Integer counter, @Nullable DateAndTime timeStamp,
             @Nullable String objectId) {
-        EventlogEntity eventlogEntity = new EventlogNotificationBuilder(nodeId, counter, timeStamp, objectId, "deletion", null).build();
+        EventlogEntity eventlogEntity =
+                new EventlogNotificationBuilder(nodeId, counter, timeStamp, objectId, "deletion", null).build();
         databaseService.writeEventLog(eventlogEntity);
         webSocketService.sendViaWebsockets(nodeId.getValue(), new ObjectDeletionNotificationXml(eventlogEntity));
     }
@@ -139,44 +142,42 @@
 
         ProblemNotificationXml notificationXml = new ProblemNotificationXml(faultNotification);
         String nodeName = faultNotification.getNodeId();
-        if(NotificationDelayFilter.isEnabled())
-        {
-            if(notificationXml.getSeverity() == InternalSeverity.NonAlarmed) {
+        if (NotificationDelayFilter.isEnabled()) {
+            if (notificationXml.getSeverity() == InternalSeverity.NonAlarmed) {
                 this.notificationDelayService.getInstance(nodeName, this).clearAlarmNotification(notificationXml);
             } else {
-            	this.notificationDelayService.getInstance(nodeName, this).pushAlarmNotification(notificationXml);
+                this.notificationDelayService.getInstance(nodeName, this).pushAlarmNotification(notificationXml);
             }
-        }
-        else
-        {
-             this.pushAlarmIfNotInMaintenance(nodeName,notificationXml);
+        } else {
+            this.pushAlarmIfNotInMaintenance(nodeName, notificationXml);
         }
         // ToggleAlarmFilter functionality
-//        if (notificationDelayService.processNotification(notificationXml.getSeverity() == InternalSeverity.NonAlarmed,
-//                notificationXml.getProblem(), notificationXml)) {
-//	        if (notificationDelayService.processNotification(notificationXml)) {
-//	            aotsDcaeForwarder.sendProblemNotificationUsingMaintenanceFilter(nodeName, notificationXml);
-//	        }
-//        }
+        //        if (notificationDelayService.processNotification(notificationXml.getSeverity() == InternalSeverity.NonAlarmed,
+        //                notificationXml.getProblem(), notificationXml)) {
+        //	        if (notificationDelayService.processNotification(notificationXml)) {
+        //	            aotsDcaeForwarder.sendProblemNotificationUsingMaintenanceFilter(nodeName, notificationXml);
+        //	        }
+        //        }
         // end of ToggleAlarmFilter
 
         this.webSocketService.sendViaWebsockets(nodeName, notificationXml);
     }
-    private void pushAlarmIfNotInMaintenance(String nodeName,ProblemNotificationXml notificationXml)
-    {
-         if(!this.maintenanceService.isONFObjectInMaintenance(nodeName, notificationXml.getObjectId(), notificationXml.getProblem()))
-         {
-             this.aotsDcaeForwarder.sendProblemNotification(nodeName, notificationXml);
-         }
-         else
-         {
-             LOG.debug("Notification will not be sent to external services. Device "+nodeName+" is in maintenance mode");
-         }
+
+    private void pushAlarmIfNotInMaintenance(String nodeName, ProblemNotificationXml notificationXml) {
+        if (!this.maintenanceService.isONFObjectInMaintenance(nodeName, notificationXml.getObjectId(),
+                notificationXml.getProblem())) {
+            this.aotsDcaeForwarder.sendProblemNotification(nodeName, notificationXml);
+        } else {
+            LOG.debug("Notification will not be sent to external services. Device " + nodeName
+                    + " is in maintenance mode");
+        }
     }
+
     @Override
     public void faultNotification(@NonNull NodeId nodeId, @Nullable Integer counter, @Nullable DateAndTime timeStamp,
             @Nullable String objectId, @Nullable String problem, @Nullable SeverityType severity) {
-        FaultNotificationBuilder2 bFaultlog = new FaultNotificationBuilder2(nodeId, counter, timeStamp, objectId, problem, severity, SourceType.Netconf);
+        FaultNotificationBuilder2 bFaultlog = new FaultNotificationBuilder2(nodeId, counter, timeStamp, objectId,
+                problem, severity, SourceType.Netconf);
         faultNotification(bFaultlog.build());
 
     }
@@ -193,7 +194,7 @@
             FaultcurrentBuilder bFaultcurrent = new FaultcurrentBuilder();
             bFaultcurrent.fieldsFrom(problem);
             databaseService.updateFaultCurrent(bFaultcurrent.build());
-            });
+        });
     }
 
     @Override
@@ -209,9 +210,9 @@
 
     }
 
-	@Override
-	public void onNotificationDelay(String nodeName,ProblemNotificationXml notification) {
-		LOG.debug("Got delayed event of type :: {}", ProblemNotificationXml.class.getSimpleName());
-        this.pushAlarmIfNotInMaintenance(nodeName,notification);
-	}
+    @Override
+    public void onNotificationDelay(String nodeName, ProblemNotificationXml notification) {
+        LOG.debug("Got delayed event of type :: {}", ProblemNotificationXml.class.getSimpleName());
+        this.pushAlarmIfNotInMaintenance(nodeName, notification);
+    }
 }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/eventdatahandler/ODLEventListenerHandler.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/eventdatahandler/ODLEventListenerHandler.java
index 9f1b2b2..68177d3 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/eventdatahandler/ODLEventListenerHandler.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/eventdatahandler/ODLEventListenerHandler.java
@@ -41,10 +41,9 @@
 import org.slf4j.LoggerFactory;
 
 /**
- * Responsible class for documenting changes in the ODL itself. The occurence of such an event is
- * documented in the database and to clients. Specific example here is the registration or
- * deregistration of a netconf device. This service has an own eventcounter to apply to the ONF
- * Coremodel netconf behaviour.
+ * Responsible class for documenting changes in the ODL itself. The occurence of such an event is documented in the
+ * database and to clients. Specific example here is the registration or deregistration of a netconf device. This
+ * service has an own eventcounter to apply to the ONF Coremodel netconf behaviour.
  *
  * Important: Websocket notification must be the last action.
  *
@@ -96,16 +95,17 @@
 
     /**
      * A registration of a mountpoint occured, that is in connect state
+     * 
      * @param registrationName of device (mountpoint name)
      * @param nNode with mountpoint data
      */
     @Override
     public void registration(String registrationName, NetconfNode nNode) {
 
-        ObjectCreationNotificationXml cNotificationXml =
-                new ObjectCreationNotificationXml(ownKeyName, popEvntNumber(),
-                        InternalDateAndTime.valueOf(NETCONFTIME_CONVERTER.getTimeStamp()), registrationName);
-        NetworkElementConnectionEntity e = NetworkElementConnectionEntitiyUtil.getNetworkConnection(registrationName, nNode);
+        ObjectCreationNotificationXml cNotificationXml = new ObjectCreationNotificationXml(ownKeyName, popEvntNumber(),
+                InternalDateAndTime.valueOf(NETCONFTIME_CONVERTER.getTimeStamp()), registrationName);
+        NetworkElementConnectionEntity e =
+                NetworkElementConnectionEntitiyUtil.getNetworkConnection(registrationName, nNode);
         LOG.debug("registration networkelement-connection for {} with status {}", registrationName, e.getStatus());
 
         // Write first to prevent missing entries
@@ -116,15 +116,18 @@
 
     /**
      * mountpoint created, connection state not connected
-	 * @param mountpointNodeName uuid that is nodeId or mountpointId
-	 * @param netconfNode
-	 */
-	public void mountpointCreatedIndication(String mountpointNodeName, NetconfNode netconfNode) {
-		LOG.debug("mountpoint create indication for {}", mountpointNodeName);
-		this.registration(mountpointNodeName, netconfNode);
-	}
+     * 
+     * @param mountpointNodeName uuid that is nodeId or mountpointId
+     * @param netconfNode
+     */
+    public void mountpointCreatedIndication(String mountpointNodeName, NetconfNode netconfNode) {
+        LOG.debug("mountpoint create indication for {}", mountpointNodeName);
+        this.registration(mountpointNodeName, netconfNode);
+    }
+
     /**
      * After registration
+     * 
      * @param mountpointNodeName uuid that is nodeId or mountpointId
      * @param deviceType according to assessement
      */
@@ -132,38 +135,41 @@
     public void connectIndication(String mountpointNodeName, NetworkElementDeviceType deviceType) {
 
         // Write first to prevent missing entries
-        LOG.debug("updating networkelement-connection devicetype for {} with {}",mountpointNodeName, deviceType);
-        NetworkElementConnectionEntity e = NetworkElementConnectionEntitiyUtil.getNetworkConnectionDeviceTpe(deviceType);
+        LOG.debug("updating networkelement-connection devicetype for {} with {}", mountpointNodeName, deviceType);
+        NetworkElementConnectionEntity e =
+                NetworkElementConnectionEntitiyUtil.getNetworkConnectionDeviceTpe(deviceType);
         databaseService.updateNetworkConnectionDeviceType(e, mountpointNodeName);
 
         AttributeValueChangedNotificationXml notificationXml = new AttributeValueChangedNotificationXml(ownKeyName,
-                popEvntNumber(), InternalDateAndTime.valueOf(NETCONFTIME_CONVERTER.getTimeStamp()),
-                mountpointNodeName, "deviceType", deviceType.name());
+                popEvntNumber(), InternalDateAndTime.valueOf(NETCONFTIME_CONVERTER.getTimeStamp()), mountpointNodeName,
+                "deviceType", deviceType.name());
         webSocketService.sendViaWebsockets(mountpointNodeName, notificationXml);
     }
 
     /**
      * mountpoint state changed
-	 * @param mountpointNodeName
-	 * @param netconfNode
-	 */
-	public void onStateChangeIndication(String mountpointNodeName, NetconfNode netconfNode) {
-		LOG.debug("mountpoint state changed indication for {}", mountpointNodeName);
-		ConnectionStatus csts = netconfNode.getConnectionStatus();
-		this.updateRegistration(mountpointNodeName, ConnectionStatus.class.getSimpleName(),
+     * 
+     * @param mountpointNodeName
+     * @param netconfNode
+     */
+    public void onStateChangeIndication(String mountpointNodeName, NetconfNode netconfNode) {
+        LOG.debug("mountpoint state changed indication for {}", mountpointNodeName);
+        ConnectionStatus csts = netconfNode.getConnectionStatus();
+        this.updateRegistration(mountpointNodeName, ConnectionStatus.class.getSimpleName(),
                 csts != null ? csts.getName() : "null", netconfNode);
-		
-	}
+
+    }
+
     /**
      * A deregistration of a mountpoint occured.
+     * 
      * @param registrationName Name of the event that is used as key in the database.
      */
     @Override
     public void deRegistration(String registrationName) {
 
-        ObjectDeletionNotificationXml dNotificationXml =
-                new ObjectDeletionNotificationXml(ownKeyName, popEvntNumber(),
-                        InternalDateAndTime.valueOf(NETCONFTIME_CONVERTER.getTimeStamp()), registrationName);
+        ObjectDeletionNotificationXml dNotificationXml = new ObjectDeletionNotificationXml(ownKeyName, popEvntNumber(),
+                InternalDateAndTime.valueOf(NETCONFTIME_CONVERTER.getTimeStamp()), registrationName);
 
         // Write first to prevent missing entries
         databaseService.removeNetworkConnection(registrationName);
@@ -174,14 +180,17 @@
 
     /**
      * Mountpoint state changed .. from connected -> connecting or unable-to-connect or vis-e-versa.
+     * 
      * @param registrationName Name of the event that is used as key in the database.
      */
     @Override
-    public void updateRegistration(String registrationName, String attribute, String attributeNewValue, NetconfNode nNode) {
+    public void updateRegistration(String registrationName, String attribute, String attributeNewValue,
+            NetconfNode nNode) {
         AttributeValueChangedNotificationXml notificationXml = new AttributeValueChangedNotificationXml(ownKeyName,
-                popEvntNumber(), InternalDateAndTime.valueOf(NETCONFTIME_CONVERTER.getTimeStamp()),
-                registrationName, attribute, attributeNewValue);
-        NetworkElementConnectionEntity e = NetworkElementConnectionEntitiyUtil.getNetworkConnection(registrationName, nNode);
+                popEvntNumber(), InternalDateAndTime.valueOf(NETCONFTIME_CONVERTER.getTimeStamp()), registrationName,
+                attribute, attributeNewValue);
+        NetworkElementConnectionEntity e =
+                NetworkElementConnectionEntitiyUtil.getNetworkConnection(registrationName, nNode);
         LOG.debug("updating networkelement-connection for {} with status {}", registrationName, e.getStatus());
 
         databaseService.updateNetworkConnection22(e, registrationName);
@@ -220,8 +229,8 @@
         LOG.debug("Got startComplete");
         EventlogBuilder eventlogBuilder = new EventlogBuilder();
         eventlogBuilder.setNodeId(ownKeyName).setTimestamp(new DateAndTime(NETCONFTIME_CONVERTER.getTimeStamp()))
-        .setObjectId(objectId).setAttributeName(msg).setNewValue(value).setCounter(popEvntNumber())
-        .setSourceType(SourceType.Controller);
+                .setObjectId(objectId).setAttributeName(msg).setNewValue(value).setCounter(popEvntNumber())
+                .setSourceType(SourceType.Controller);
         databaseService.writeEventLog(eventlogBuilder.build());
 
     }
@@ -258,8 +267,6 @@
         return eventNumber++;
     }
 
-	
 
-	
 
 }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/housekeeping/ConnectionStatusHousekeepingService.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/housekeeping/ConnectionStatusHousekeepingService.java
index d63ff5d..0761299 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/housekeeping/ConnectionStatusHousekeepingService.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/housekeeping/ConnectionStatusHousekeepingService.java
@@ -60,15 +60,16 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class ConnectionStatusHousekeepingService implements ClusterSingletonService,AutoCloseable {
+public class ConnectionStatusHousekeepingService implements ClusterSingletonService, AutoCloseable {
 
     private static final Logger LOG = LoggerFactory.getLogger(ConnectionStatusHousekeepingService.class);
 
     private static final long INTERVAL_SECONDS = 30;
-    private static final InstanceIdentifier<Topology> NETCONF_TOPO_IID = InstanceIdentifier
-            .create(NetworkTopology.class)
-            .child(Topology.class, new TopologyKey(new TopologyId(TopologyNetconf.QNAME.getLocalName())));
-    private static final ServiceGroupIdentifier IDENT = ServiceGroupIdentifier.create("ConnectionStatusHousekeepingService");
+    private static final InstanceIdentifier<Topology> NETCONF_TOPO_IID =
+            InstanceIdentifier.create(NetworkTopology.class).child(Topology.class,
+                    new TopologyKey(new TopologyId(TopologyNetconf.QNAME.getLocalName())));
+    private static final ServiceGroupIdentifier IDENT =
+            ServiceGroupIdentifier.create("ConnectionStatusHousekeepingService");
 
     private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(3);
     private final DataBroker dataBroker;
@@ -88,13 +89,13 @@
         if (taskReference != null) {
             taskReference.cancel(false);
         }
-        if(!isMaster) {
+        if (!isMaster) {
             LOG.info("do not start. not the master node");
             return;
         }
         LOG.info("starting scheduler with interval {}", INTERVAL_SECONDS);
-        this.taskReference = this.scheduler.scheduleAtFixedRate(runner, INTERVAL_SECONDS, INTERVAL_SECONDS,
-                TimeUnit.SECONDS);
+        this.taskReference =
+                this.scheduler.scheduleAtFixedRate(runner, INTERVAL_SECONDS, INTERVAL_SECONDS, TimeUnit.SECONDS);
     }
 
     private void doClean() {
@@ -108,102 +109,103 @@
             String nodeId;
             if (list == null || list.size() <= 0) {
                 LOG.trace("no items in list.");
-            }
-            else {
-	            //check all db entries and sync connection status
-	            for (NetworkElementConnectionEntity item : list) {
-	
-	                // compare with MD-SAL
-	                nodeId = item.getNodeId();
-	                LOG.trace("check status of {}", nodeId);
-	                dbStatus = item.getStatus();
-	                mdsalStatus = this.getMDSalConnectionStatus(nodeId);
-	                if (mdsalStatus == null) {
-	                    LOG.trace("unable to get connection status. jump over");
-	                    continue;
-	                }
-	                // if different then update db
-	                if (dbStatus != mdsalStatus) {
-	                    LOG.trace("status is inconsistent db={}, mdsal={}. updating db", dbStatus, mdsalStatus);
-	                    if((item.isIsRequired()==null || item.isIsRequired()==false) && mdsalStatus==ConnectionLogStatus.Disconnected) {
-	                    	LOG.info("removing entry for node {} ({}) from database due missing MD-SAL entry",item.getNodeId(),mdsalStatus);
-	                        this.dataProvider.removeNetworkConnection(nodeId);
-	                    }
-	                    else {
-	                    this.dataProvider.updateNetworkConnectionDeviceType(
-	                            new NetworkElementConnectionBuilder().setStatus(mdsalStatus).build(), nodeId);
-	                    }
-	                } else {
-	                    LOG.trace("no difference");
-	                }
-	
-	            }
-            }
-			//check all md-sal entries and add non-existing to db
-//			List<Node> mdsalNodes = this.getMDSalNodes();
-//			NodeId nid;
-//			for (Node mdsalNode : mdsalNodes) {
-//				nid = mdsalNode.getNodeId();
-//				if (nid == null) {
-//					continue;
-//				}
-//				nodeId = nid.getValue();
-//				if (nodeId == null) {
-//					continue;
-//				}
-//				if (contains(list, nodeId)) {
-//					LOG.debug("found mountpoint for {} without db entry. creating.",nodeId);
-//					this.dataProvider.updateNetworkConnection22(NetworkElementConnectionEntitiyUtil
-//							.getNetworkConnection(nodeId, mdsalNode.augmentation(NetconfNode.class)), nodeId);
-//				}
-//			}
+            } else {
+                //check all db entries and sync connection status
+                for (NetworkElementConnectionEntity item : list) {
 
-		} catch (Exception e) {
+                    // compare with MD-SAL
+                    nodeId = item.getNodeId();
+                    LOG.trace("check status of {}", nodeId);
+                    dbStatus = item.getStatus();
+                    mdsalStatus = this.getMDSalConnectionStatus(nodeId);
+                    if (mdsalStatus == null) {
+                        LOG.trace("unable to get connection status. jump over");
+                        continue;
+                    }
+                    // if different then update db
+                    if (dbStatus != mdsalStatus) {
+                        LOG.trace("status is inconsistent db={}, mdsal={}. updating db", dbStatus, mdsalStatus);
+                        if ((item.isIsRequired() == null || item.isIsRequired() == false)
+                                && mdsalStatus == ConnectionLogStatus.Disconnected) {
+                            LOG.info("removing entry for node {} ({}) from database due missing MD-SAL entry",
+                                    item.getNodeId(), mdsalStatus);
+                            this.dataProvider.removeNetworkConnection(nodeId);
+                        } else {
+                            this.dataProvider.updateNetworkConnectionDeviceType(
+                                    new NetworkElementConnectionBuilder().setStatus(mdsalStatus).build(), nodeId);
+                        }
+                    } else {
+                        LOG.trace("no difference");
+                    }
+
+                }
+            }
+            //check all md-sal entries and add non-existing to db
+            //			List<Node> mdsalNodes = this.getMDSalNodes();
+            //			NodeId nid;
+            //			for (Node mdsalNode : mdsalNodes) {
+            //				nid = mdsalNode.getNodeId();
+            //				if (nid == null) {
+            //					continue;
+            //				}
+            //				nodeId = nid.getValue();
+            //				if (nodeId == null) {
+            //					continue;
+            //				}
+            //				if (contains(list, nodeId)) {
+            //					LOG.debug("found mountpoint for {} without db entry. creating.",nodeId);
+            //					this.dataProvider.updateNetworkConnection22(NetworkElementConnectionEntitiyUtil
+            //							.getNetworkConnection(nodeId, mdsalNode.augmentation(NetconfNode.class)), nodeId);
+            //				}
+            //			}
+
+        } catch (Exception e) {
             LOG.warn("problem executing housekeeping task: {}", e);
         }
         LOG.debug("finish housekeeping");
     }
 
-	/**
-	 * @param list
-	 * @param nodeId
-	 * @return
-	 */
-//	private boolean contains(List<NetworkElementConnectionEntity> list, @NonNull String nodeId) {
-//		if(list==null || list.size()<=0) {
-//			return false;
-//		}
-//		for(NetworkElementConnectionEntity item:list) {
-//			if(item!=null && nodeId.equals(item.getNodeId())) {
-//				return true;
-//			}
-//		}
-//		return false;
-//	}
-//
-//	private List<Node> getMDSalNodes(){
-//    	ReadTransaction trans = this.dataBroker.newReadOnlyTransaction();
-//        FluentFuture<Optional<Topology>> optionalTopology =trans.read(LogicalDatastoreType.OPERATIONAL, NETCONF_TOPO_IID);
-//        List<Node> nodes = new ArrayList<>();
-//        try {
-//        	Topology topo = optionalTopology.get(20, TimeUnit.SECONDS).get();
-//        	List<Node> topoNodes=topo.getNode();
-//        	if(topoNodes!=null){
-//        		nodes.addAll(topoNodes);
-//        	}
-//        }
-//        catch(Exception e) {
-//        	LOG.warn("unable to read netconf topology for housekeeping: {}",e);
-//        }
-//        return nodes;
-//    }
+    /**
+     * @param list
+     * @param nodeId
+     * @return
+     */
+    //	private boolean contains(List<NetworkElementConnectionEntity> list, @NonNull String nodeId) {
+    //		if(list==null || list.size()<=0) {
+    //			return false;
+    //		}
+    //		for(NetworkElementConnectionEntity item:list) {
+    //			if(item!=null && nodeId.equals(item.getNodeId())) {
+    //				return true;
+    //			}
+    //		}
+    //		return false;
+    //	}
+    //
+    //	private List<Node> getMDSalNodes(){
+    //    	ReadTransaction trans = this.dataBroker.newReadOnlyTransaction();
+    //        FluentFuture<Optional<Topology>> optionalTopology =trans.read(LogicalDatastoreType.OPERATIONAL, NETCONF_TOPO_IID);
+    //        List<Node> nodes = new ArrayList<>();
+    //        try {
+    //        	Topology topo = optionalTopology.get(20, TimeUnit.SECONDS).get();
+    //        	List<Node> topoNodes=topo.getNode();
+    //        	if(topoNodes!=null){
+    //        		nodes.addAll(topoNodes);
+    //        	}
+    //        }
+    //        catch(Exception e) {
+    //        	LOG.warn("unable to read netconf topology for housekeeping: {}",e);
+    //        }
+    //        return nodes;
+    //    }
     private ConnectionLogStatus getMDSalConnectionStatus(String nodeId) {
 
         @SuppressWarnings("null")
-        @NonNull InstanceIdentifier<Node> instanceIdentifier = NETCONF_TOPO_IID.child(Node.class,
-                new NodeKey(new NodeId(nodeId)));
-       ReadTransaction trans = this.dataBroker.newReadOnlyTransaction();
-       FluentFuture<Optional<Node>> optionalNode =trans.read(LogicalDatastoreType.OPERATIONAL, instanceIdentifier);
+        @NonNull
+        InstanceIdentifier<Node> instanceIdentifier =
+                NETCONF_TOPO_IID.child(Node.class, new NodeKey(new NodeId(nodeId)));
+        ReadTransaction trans = this.dataBroker.newReadOnlyTransaction();
+        FluentFuture<Optional<Node>> optionalNode = trans.read(LogicalDatastoreType.OPERATIONAL, instanceIdentifier);
         try {
             Node node = optionalNode.get(5, TimeUnit.SECONDS).get();
             LOG.debug("node is {}", node);
@@ -216,9 +218,8 @@
             return ConnectionLogStatus.Disconnected;
         } catch (ExecutionException | InterruptedException | TimeoutException e) {
             LOG.warn("unable to get node info: {}", e);
-        }
-        finally {
-        	trans.close();
+        } finally {
+            trans.close();
         }
 
         return null;
@@ -232,24 +233,24 @@
         this.scheduler.shutdown();
     }
 
-	@SuppressWarnings("null")
-	@Override
-	public @NonNull ServiceGroupIdentifier getIdentifier() {
-		return IDENT;
-	}
+    @SuppressWarnings("null")
+    @Override
+    public @NonNull ServiceGroupIdentifier getIdentifier() {
+        return IDENT;
+    }
 
-	@Override
-	public void instantiateServiceInstance() {
-		LOG.info("We take Leadership");
-		this.isMaster = true;
-		this.start();
-	}
+    @Override
+    public void instantiateServiceInstance() {
+        LOG.info("We take Leadership");
+        this.isMaster = true;
+        this.start();
+    }
 
-	@Override
-	public ListenableFuture<? extends Object> closeServiceInstance() {
-		LOG.info("We lost Leadership");
-		this.isMaster = false;
-		this.start();
-		return Futures.immediateFuture(null);
-	}
+    @Override
+    public ListenableFuture<? extends Object> closeServiceInstance() {
+        LOG.info("We lost Leadership");
+        this.isMaster = false;
+        this.start();
+        return Futures.immediateFuture(null);
+    }
 }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/housekeeping/ResyncNetworkElementHouskeepingService.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/housekeeping/ResyncNetworkElementHouskeepingService.java
index 9636930..4b9c320 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/housekeeping/ResyncNetworkElementHouskeepingService.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/housekeeping/ResyncNetworkElementHouskeepingService.java
@@ -71,10 +71,9 @@
      * @param databaseClientEvents database to clean
      * @param deviceMonitor devicemonitor
      */
-    public ResyncNetworkElementHouskeepingService(
-            DeviceManagerImpl deviceManager,
-            MountPointService mountPointService, ODLEventListenerHandler odlEventListenerHandler,
-            DataProvider databaseClientEvents, DeviceMonitor deviceMonitor) {
+    public ResyncNetworkElementHouskeepingService(DeviceManagerImpl deviceManager, MountPointService mountPointService,
+            ODLEventListenerHandler odlEventListenerHandler, DataProvider databaseClientEvents,
+            DeviceMonitor deviceMonitor) {
         super();
         this.deviceManager = deviceManager;
         this.mountPointService = mountPointService;
@@ -103,8 +102,8 @@
             if (nodeNames == null || nodeNames.size() <= 0) {
                 nodeNamesInput = this.databaseClientEvents.getAllNodesWithCurrentAlarms();
             } else {
-				nodeNamesInput = nodeNames;
-			}
+                nodeNamesInput = nodeNames;
+            }
 
             // Filter all mountpoints from input that were found and are known to this Cluster-node instance of
             // DeviceManager
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/housekeeping/ResyncNetworkElementsListener.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/housekeeping/ResyncNetworkElementsListener.java
index cb6845a..652d543 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/housekeeping/ResyncNetworkElementsListener.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/housekeeping/ResyncNetworkElementsListener.java
@@ -22,14 +22,15 @@
 import org.eclipse.jdt.annotation.Nullable;
 
 
-public interface ResyncNetworkElementsListener
-{
+public interface ResyncNetworkElementsListener {
     /**
-     * Handle API Request and clean up current alarms according to the list of mountpoint id's/devices
-     * Implement RPC function "clear-current-fault-by-nodename"
+     * Handle API Request and clean up current alarms according to the list of mountpoint id's/devices Implement RPC
+     * function "clear-current-fault-by-nodename"
+     * 
      * @return List with
      * @throws IllegalStateException Illegal state exception
      */
-    public @NonNull List<String> doClearCurrentFaultByNodename(@Nullable List<String> nodeNamesInput) throws IllegalStateException;
+    public @NonNull List<String> doClearCurrentFaultByNodename(@Nullable List<String> nodeNamesInput)
+            throws IllegalStateException;
 
 }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerApiServiceImpl.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerApiServiceImpl.java
index 218eba0..266bb04 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerApiServiceImpl.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerApiServiceImpl.java
@@ -60,12 +60,9 @@
     private static final Logger LOG = LoggerFactory.getLogger(DevicemanagerService.class);
 
     private final ObjectRegistration<DevicemanagerService> rpcReg;
-    private @Nullable
-    final MaintenanceRPCServiceAPI maintenanceService;
-    private @Nullable
-    final PushNotifications pushNotificationsListener;
-    private @Nullable
-    final ResyncNetworkElementsListener resyncCallbackListener;
+    private @Nullable final MaintenanceRPCServiceAPI maintenanceService;
+    private @Nullable final PushNotifications pushNotificationsListener;
+    private @Nullable final ResyncNetworkElementsListener resyncCallbackListener;
 
     public DeviceManagerApiServiceImpl(final RpcProviderService rpcProviderRegistry,
             MaintenanceServiceImpl maintenanceService, ResyncNetworkElementsListener listener,
@@ -75,7 +72,7 @@
         this.resyncCallbackListener = listener;
 
         // Register ourselves as the REST API RPC implementation
-        LOG.info("Register RPC Service "+DevicemanagerService.class.getSimpleName());
+        LOG.info("Register RPC Service " + DevicemanagerService.class.getSimpleName());
         this.rpcReg = rpcProviderRegistry.registerRpcImplementation(DevicemanagerService.class, this);
     }
 
@@ -103,8 +100,9 @@
         LOG.info("RPC Request: getRequiredNetworkElementKeys");
         RpcResultBuilder<GetRequiredNetworkElementKeysOutput> result;
         try {
-            GetRequiredNetworkElementKeysOutputBuilder outputBuilder = maintenanceService.getRequiredNetworkElementKeys();
-            result =  RpcResultBuilder.success(outputBuilder);
+            GetRequiredNetworkElementKeysOutputBuilder outputBuilder =
+                    maintenanceService.getRequiredNetworkElementKeys();
+            result = RpcResultBuilder.success(outputBuilder);
         } catch (Exception e) {
             result = RpcResultBuilder.failed();
             result.withError(ErrorType.APPLICATION, "Exception", e);
@@ -120,8 +118,9 @@
         RpcResultBuilder<ShowRequiredNetworkElementOutput> result;
 
         try {
-            ShowRequiredNetworkElementOutputBuilder outputBuilder = maintenanceService.showRequiredNetworkElement(input);
-            result =  RpcResultBuilder.success(outputBuilder);
+            ShowRequiredNetworkElementOutputBuilder outputBuilder =
+                    maintenanceService.showRequiredNetworkElement(input);
+            result = RpcResultBuilder.success(outputBuilder);
         } catch (Exception e) {
             result = RpcResultBuilder.failed();
             result.withError(ErrorType.APPLICATION, "Exception", e);
@@ -137,7 +136,7 @@
 
         try {
             SetMaintenanceModeOutputBuilder outputBuilder = maintenanceService.setMaintenanceMode(input);
-            result =  RpcResultBuilder.success(outputBuilder);
+            result = RpcResultBuilder.success(outputBuilder);
         } catch (Exception e) {
             result = RpcResultBuilder.failed();
             result.withError(ErrorType.APPLICATION, "Exception", e);
@@ -156,7 +155,7 @@
 
         try {
             GetMaintenanceModeOutputBuilder outputBuilder = maintenanceService.getMaintenanceMode(input);
-            result =  RpcResultBuilder.success(outputBuilder);
+            result = RpcResultBuilder.success(outputBuilder);
         } catch (Exception e) {
             result = RpcResultBuilder.failed();
             result.withError(ErrorType.APPLICATION, "Exception", e);
@@ -172,7 +171,7 @@
 
         try {
             TestMaintenanceModeOutputBuilder outputBuilder = maintenanceService.testMaintenanceMode(input);
-            result =  RpcResultBuilder.success(outputBuilder);
+            result = RpcResultBuilder.success(outputBuilder);
         } catch (Exception e) {
             result = RpcResultBuilder.failed();
             result.withError(ErrorType.APPLICATION, "Exception", e);
@@ -188,16 +187,17 @@
         LOG.info("RPC Request: clearNetworkElementAlarms input: {}", input.getNodenames());
         RpcResultBuilder<ClearCurrentFaultByNodenameOutput> result;
         try {
-            if(this.resyncCallbackListener!=null) {
-                List<String> nodeNames= this.resyncCallbackListener.doClearCurrentFaultByNodename(input.getNodenames());
+            if (this.resyncCallbackListener != null) {
+                List<String> nodeNames =
+                        this.resyncCallbackListener.doClearCurrentFaultByNodename(input.getNodenames());
                 ClearCurrentFaultByNodenameOutputBuilder outputBuilder = new ClearCurrentFaultByNodenameOutputBuilder();
                 outputBuilder.setNodenames(nodeNames);
-                result =  RpcResultBuilder.success(outputBuilder);
+                result = RpcResultBuilder.success(outputBuilder);
             } else {
                 result = RpcResultBuilder.failed();
-                result.withError(ErrorType.APPLICATION, "Startup running" );
+                result.withError(ErrorType.APPLICATION, "Startup running");
             }
-        } catch(Exception e) {
+        } catch (Exception e) {
             result = RpcResultBuilder.failed();
             result.withError(ErrorType.APPLICATION, "Exception", e);
         }
@@ -211,7 +211,7 @@
         RpcResultBuilder<PushFaultNotificationOutput> result;
         try {
             pushNotificationsListener.pushFaultNotification(input);
-            result =  RpcResultBuilder.success();
+            result = RpcResultBuilder.success();
         } catch (Exception e) {
             result = RpcResultBuilder.failed();
             result.withError(ErrorType.APPLICATION, "Exception", e);
@@ -226,7 +226,7 @@
         RpcResultBuilder<PushAttributeChangeNotificationOutput> result;
         try {
             pushNotificationsListener.pushAttributeChangeNotification(input);
-            result =  RpcResultBuilder.success();
+            result = RpcResultBuilder.success();
         } catch (Exception e) {
             result = RpcResultBuilder.failed();
             result.withError(ErrorType.APPLICATION, "Exception", e);
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerImpl.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerImpl.java
index 86cbe52..53ba09a 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerImpl.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerImpl.java
@@ -87,9 +87,8 @@
 import org.slf4j.LoggerFactory;
 
 /**
- * Devicemanager
- * - Handles startup and closedown of network element handlers for netconf session
- * - Provide common services for network element specific components
+ * Devicemanager - Handles startup and closedown of network element handlers for netconf session - Provide common
+ * services for network element specific components
  */
 public class DeviceManagerImpl implements NetconfNetworkElementService, DeviceManagerServiceProvider, AutoCloseable {
 
@@ -97,7 +96,7 @@
     private static final String APPLICATION_NAME = "DeviceManager";
     private static final String MYDBKEYNAMEBASE = "SDN-Controller";
     private static final String CONFIGURATIONFILE = "etc/devicemanager.properties";
-    public static final long DATABASE_TIMEOUT_MS = 120*1000L;
+    public static final long DATABASE_TIMEOUT_MS = 120 * 1000L;
 
     @SuppressWarnings("unused")
     private static final String STARTUPLOG_FILENAME = "etc/devicemanager.startup.log";
@@ -166,21 +165,24 @@
         this.rpcProviderRegistry = rpcProviderRegistry;
     }
 
-    public void setNotificationPublishService(NotificationPublishService notificationPublishService) {
-    }
+    public void setNotificationPublishService(NotificationPublishService notificationPublishService) {}
 
     public void setMountPointService(MountPointService mountPointService) {
         this.mountPointService = mountPointService;
     }
+
     public void setClusterSingletonService(ClusterSingletonServiceProvider clusterSingletonService) {
         this.clusterSingletonServiceProvider = clusterSingletonService;
     }
+
     public void setNetconfNodeStateService(NetconfNodeStateService netconfNodeStateService) {
         this.netconfNodeStateService = netconfNodeStateService;
     }
+
     public void setWebsocketmanagerService(WebsocketmanagerService websocketmanagerService) {
         this.websocketmanagerService = websocketmanagerService;
     }
+
     public void setEntityDataProvider(IEntityDataProvider iEntityDataProvider) {
         this.iEntityDataProvider = iEntityDataProvider;
     }
@@ -217,17 +219,16 @@
         this.deviceManagerDatabaseAndNotificationService = new DeviceManagerDatabaseNotificationService(dataProvider,
                 maintenanceService, webSocketService, notificationDelayService, aotsDcaeForwarder);
 
-        RpcPushNotificationsHandler rpcPushNotificationsHandler = new RpcPushNotificationsHandler(webSocketService,
-                dataProvider, aotsDcaeForwarder);
-        this.odlEventListenerHandler = new ODLEventListenerHandler(myDbKeyNameExtended, webSocketService,
-                dataProvider, aotsDcaeForwarder);
+        RpcPushNotificationsHandler rpcPushNotificationsHandler =
+                new RpcPushNotificationsHandler(webSocketService, dataProvider, aotsDcaeForwarder);
+        this.odlEventListenerHandler =
+                new ODLEventListenerHandler(myDbKeyNameExtended, webSocketService, dataProvider, aotsDcaeForwarder);
         this.archiveCleanService = new ArchiveCleanService(iEntityDataProvider.getEsConfig(), dataProvider);
-        this.housekeepingService = new ConnectionStatusHousekeepingService(this.dataBroker,
-                dataProvider);
-        this.cssRegistration = this.clusterSingletonServiceProvider
-                .registerClusterSingletonService(this.archiveCleanService);
-        this.cssRegistration2 = this.clusterSingletonServiceProvider
-                .registerClusterSingletonService(this.housekeepingService);
+        this.housekeepingService = new ConnectionStatusHousekeepingService(this.dataBroker, dataProvider);
+        this.cssRegistration =
+                this.clusterSingletonServiceProvider.registerClusterSingletonService(this.archiveCleanService);
+        this.cssRegistration2 =
+                this.clusterSingletonServiceProvider.registerClusterSingletonService(this.housekeepingService);
         // PM
         this.performanceManager = new PerformanceManagerImpl(60, this, dataProvider, config);
         // DM
@@ -237,9 +238,8 @@
         this.deviceMonitor = new DeviceMonitorImpl(dataBroker, odlEventListenerHandler, config);
 
         // ResyncNetworkElementHouskeepingService
-        this.resyncNetworkElementHouskeepingService = new ResyncNetworkElementHouskeepingService(
-                this, mountPointService, odlEventListenerHandler,
-                dataProvider, deviceMonitor);
+        this.resyncNetworkElementHouskeepingService = new ResyncNetworkElementHouskeepingService(this,
+                mountPointService, odlEventListenerHandler, dataProvider, deviceMonitor);
 
         // RPC Service for specific services
         // Start RPC Service
@@ -281,7 +281,8 @@
     }
 
     @Override
-    public @NonNull <L extends NetworkElementFactory> FactoryRegistration<L> registerNetworkElementFactory(@NonNull L factory) {
+    public @NonNull <L extends NetworkElementFactory> FactoryRegistration<L> registerNetworkElementFactory(
+            @NonNull L factory) {
         LOG.info("Factory registration {}", factory.getClass().getName());
 
         factoryList.add(factory);
@@ -358,6 +359,7 @@
 
     /**
      * Used to close all Services, that should support AutoCloseable Pattern
+     * 
      * @param toClose
      */
     private void close(AutoCloseable... toCloseList) {
@@ -391,6 +393,7 @@
 
     /**
      * Indication if init() of devicemanager successfully done.
+     * 
      * @return true if init() was sucessfull. False if not done or not successfull.
      */
     public boolean isDevicemanagerInitializationOk() {
@@ -399,6 +402,7 @@
 
     /**
      * Get NE object. Used by DCAE Service
+     * 
      * @param mountpoint mount point name
      * @return null or NE specific data
      */
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerNetconfConnectHandler.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerNetconfConnectHandler.java
index 5f9911b..fbcded8 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerNetconfConnectHandler.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerNetconfConnectHandler.java
@@ -56,8 +56,7 @@
 
     public DeviceManagerNetconfConnectHandler(@NonNull NetconfNodeStateService netconfNodeStateService,
             @NonNull ODLEventListenerHandler odlEventListenerHandler, @NonNull DeviceMonitor deviceMonitor,
-            @NonNull DeviceManagerServiceProvider serviceProvider,
-            @NonNull List<NetworkElementFactory> factoryList) {
+            @NonNull DeviceManagerServiceProvider serviceProvider, @NonNull List<NetworkElementFactory> factoryList) {
 
         HtAssert.nonnull(netconfNodeStateService, this.odlEventListenerHandler = odlEventListenerHandler,
                 this.deviceMonitor = deviceMonitor, this.serviceProvider = serviceProvider,
@@ -95,7 +94,7 @@
         NetconfNode netconfNode = acessor.getNetconfNode();
         sendUpdateNotification(mountPointNodeName, netconfNode.getConnectionStatus(), netconfNode);
 
-        for ( NetworkElementFactory f : factoryList) {
+        for (NetworkElementFactory f : factoryList) {
             Optional<NetworkElement> optionalNe = f.create(acessor, serviceProvider);
             if (optionalNe.isPresent()) {
                 // sendUpdateNotification(mountPointNodeName, nNode.getConnectionStatus(), nNode);
@@ -131,13 +130,13 @@
     public void onCreated(NodeId nNodeId, NetconfNode netconfNode) {
         LOG.info("onCreated {}", nNodeId);
         odlEventListenerHandler.mountpointCreatedIndication(nNodeId.getValue(), netconfNode);
-        
+
     }
 
     @Override
     public void onStateChange(NodeId nNodeId, NetconfNode netconfNode) {
         LOG.info("onStateChange {}", nNodeId);
-        odlEventListenerHandler.onStateChangeIndication(nNodeId.getValue(),netconfNode);
+        odlEventListenerHandler.onStateChangeIndication(nNodeId.getValue(), netconfNode);
     }
 
     @Override
@@ -166,10 +165,11 @@
 
     /**
      * Do all tasks necessary to move from mountpoint state connected -> connecting
+     * 
      * @param mountPointNodeName provided
      * @param ne representing the device connected to mountpoint
      */
-    private void stopListenerOnNodeForConnectedState( String mountPointNodeName) {
+    private void stopListenerOnNodeForConnectedState(String mountPointNodeName) {
         NetworkElement ne = networkElementRepresentations.remove(mountPointNodeName);
         if (ne != null) {
             ne.deregister();
@@ -184,7 +184,7 @@
         if (result != null) {
             LOG.warn("NE list was not empty as expected, but contained {} ", result.getNodeId());
         } else {
-        	LOG.debug("refresh necon entry for {} with type {}",mountPointNodeName,ne.getDeviceType());
+            LOG.debug("refresh necon entry for {} with type {}", mountPointNodeName, ne.getDeviceType());
             odlEventListenerHandler.connectIndication(mountPointNodeName, ne.getDeviceType());
         }
     }
@@ -192,7 +192,7 @@
     private void sendUpdateNotification(String mountPointNodeName, ConnectionStatus csts, NetconfNode nNode) {
         LOG.info("update ConnectedState for device :: Name : {} ConnectionStatus {}", mountPointNodeName, csts);
         odlEventListenerHandler.updateRegistration(mountPointNodeName, ConnectionStatus.class.getSimpleName(),
-                    csts != null ? csts.getName() : "null", nNode);
+                csts != null ? csts.getName() : "null", nNode);
     }
 
 }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/NetconfNodeService.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/NetconfNodeService.java
index 9c10ac0..cc73fc7 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/NetconfNodeService.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/NetconfNodeService.java
@@ -16,23 +16,23 @@
  * ============LICENSE_END==========================================================================
  */
 package org.onap.ccsdk.features.sdnr.wt.devicemanager.impl;
+
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
 
 public interface NetconfNodeService {
 
     public enum Action {
-        CREATE,
-        REMOVE,
-        UPDATE
+        CREATE, REMOVE, UPDATE
     }
 
     /**
      * MountpointChangeHandler, called to indicate change to DeviceManager
+     * 
      * @param action provided
      * @param csts provided
      * @param nodeId provided
      * @param nnode provided
      */
-	void netconfNodeChangeHandler(Action action, NodeId nodeId, NetconfNode nnode);
+    void netconfNodeChangeHandler(Action action, NodeId nodeId, NetconfNode nnode);
 }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/ProviderClient.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/ProviderClient.java
index 0086bc7..82519e4 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/ProviderClient.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/ProviderClient.java
@@ -21,19 +21,22 @@
 
 public interface ProviderClient extends AutoCloseable {
 
-	/**
-	 * Send out problem notification, that was created by a device/ or NE
-	 * @param mountPointName related
-	 * @param notification xml description
-	 */
+    /**
+     * Send out problem notification, that was created by a device/ or NE
+     * 
+     * @param mountPointName related
+     * @param notification xml description
+     */
     public void sendProblemNotification(String mountPointName, ProblemNotificationXml notification);
 
-	/**
-	 * Send out problem notification
-	 * @param mountPointName related
-	 * @param notification xml description
-	 * @param neDeviceAlarm  true indicates an NE originated alarm, false an sdncontroller generated alarm
-	 */
-	public void sendProblemNotification(String mountPointName, ProblemNotificationXml notification, boolean neDeviceAlarm);
+    /**
+     * Send out problem notification
+     * 
+     * @param mountPointName related
+     * @param notification xml description
+     * @param neDeviceAlarm true indicates an NE originated alarm, false an sdncontroller generated alarm
+     */
+    public void sendProblemNotification(String mountPointName, ProblemNotificationXml notification,
+            boolean neDeviceAlarm);
 
 }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/PushNotifications.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/PushNotifications.java
index 545d974..f424878 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/PushNotifications.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/PushNotifications.java
@@ -23,8 +23,8 @@
 
 public interface PushNotifications {
 
-	void pushAttributeChangeNotification(PushAttributeChangeNotificationInput input);
+    void pushAttributeChangeNotification(PushAttributeChangeNotificationInput input);
 
-	void pushFaultNotification(PushFaultNotificationInput input);
+    void pushFaultNotification(PushFaultNotificationInput input);
 
 }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/util/InternalDateAndTime.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/util/InternalDateAndTime.java
index a99f5cd..3a5224b 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/util/InternalDateAndTime.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/util/InternalDateAndTime.java
@@ -23,8 +23,7 @@
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
 
 /**
- * Converts time stamps into internal format according to ONF1.2 and ISO 8601.
- * To be replaced by NetconfTimeStampImpl
+ * Converts time stamps into internal format according to ONF1.2 and ISO 8601. To be replaced by NetconfTimeStampImpl
  */
 @Deprecated
 public class InternalDateAndTime {
@@ -42,16 +41,18 @@
 
     /**
      * Static builder ONF1.0
+     * 
      * @param time in ONF1.0 yang format
-     * @return  InternalDateAndTime
+     * @return InternalDateAndTime
      */
 
-    public static InternalDateAndTime valueOf(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime time) {
+    public static InternalDateAndTime valueOf(
+            org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime time) {
         return new InternalDateAndTime(time);
     }
 
     /**
-     * @return     Getter with String representation
+     * @return Getter with String representation
      */
     public String getValue() {
         return internalDateAndTime;
@@ -59,6 +60,7 @@
 
     /**
      * Get a testpattern
+     * 
      * @return testpattern
      */
     public static InternalDateAndTime getTestpattern() {
@@ -78,9 +80,11 @@
 
     /**
      * Convert ONF 1.2 DateAndTime to String
+     * 
      * @param time as input
      */
-    private InternalDateAndTime(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime time) {
+    private InternalDateAndTime(
+            org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime time) {
         if (time != null) {
             internalDateAndTime = NETCONFTIME_CONVERTER.getTimeStampFromNetconf(time.getValue());
         } else {
@@ -90,6 +94,7 @@
 
     /**
      * Setup static TEST
+     * 
      * @param internalDateAndTime
      */
     private InternalDateAndTime(String internalDateAndTime) {
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/util/InternalSeverity.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/util/InternalSeverity.java
index 72ffd96..bbc9805 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/util/InternalSeverity.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/util/InternalSeverity.java
@@ -27,11 +27,7 @@
 
 public enum InternalSeverity {
 
-        NonAlarmed,
-        Warning,
-        Minor,
-        Major,
-        Critical;
+    NonAlarmed, Warning, Minor, Major, Critical;
 
     public boolean isNoAlarmIndication() {
         return this == NonAlarmed;
@@ -48,117 +44,118 @@
 
     public String toNetconfString() {
         switch (this) {
-        case NonAlarmed:
-            return "non-alarmed";
-        case Warning:
-            return "warning";
-        case Minor:
-            return "minor";
-        case Major:
-            return "major";
-        case Critical:
-            return "critical";
+            case NonAlarmed:
+                return "non-alarmed";
+            case Warning:
+                return "warning";
+            case Minor:
+                return "minor";
+            case Major:
+                return "major";
+            case Critical:
+                return "critical";
         }
         return "not-specified";
     }
 
     public SeverityType toDataProviderSeverityType() {
         switch (this) {
-        case NonAlarmed:
-            return SeverityType.NonAlarmed;
-        case Warning:
-            return SeverityType.Warning;
-        case Minor:
-            return SeverityType.Minor;
-        case Major:
-            return SeverityType.Major;
-        case Critical:
-            return SeverityType.Critical;
+            case NonAlarmed:
+                return SeverityType.NonAlarmed;
+            case Warning:
+                return SeverityType.Warning;
+            case Minor:
+                return SeverityType.Minor;
+            case Major:
+                return SeverityType.Major;
+            case Critical:
+                return SeverityType.Critical;
         }
         return null; //Should never happen
     }
 
-//    /**
-//     * convert ONF 1.2 Severity
-//     * @param severity as input
-//     * @return String with related output
-//     */
-//    public static InternalSeverity valueOf(org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.SeverityType severity ) {
-//        switch( severity ) {
-//            case NonAlarmed:
-//                return InternalSeverity.NonAlarmed;
-//            case Warning:
-//                return InternalSeverity.Warning;
-//            case Minor:
-//                return InternalSeverity.Minor;
-//            case Major:
-//                return InternalSeverity.Major;
-//            case Critical:
-//                return InternalSeverity.Critical;
-//        }
-//        return null;
-//    }
-//
-//    /**
-//     * convert ONF 1.2.1.1 Severity
-//     * @param severity as input
-//     * @return String with related output
-//     */
-//    public static InternalSeverity valueOf(org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.SeverityType severity ) {
-//        switch( severity ) {
-//            case NonAlarmed:
-//                return InternalSeverity.NonAlarmed;
-//            case Warning:
-//                return InternalSeverity.Warning;
-//            case Minor:
-//                return InternalSeverity.Minor;
-//            case Major:
-//                return InternalSeverity.Major;
-//            case Critical:
-//                return InternalSeverity.Critical;
-//        }
-//        return null;
-//    }
-//
-//    /**
-//     * convert ONF 1.2.1.1p Severity
-//     * @param severity as input
-//     * @return String with related output
-//     */
-//    public static InternalSeverity valueOf(org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.SeverityType severity ) {
-//        switch( severity ) {
-//            case NonAlarmed:
-//                return InternalSeverity.NonAlarmed;
-//            case Warning:
-//                return InternalSeverity.Warning;
-//            case Minor:
-//                return InternalSeverity.Minor;
-//            case Major:
-//                return InternalSeverity.Major;
-//            case Critical:
-//                return InternalSeverity.Critical;
-//        }
-//        return null;
-//    }
+    //    /**
+    //     * convert ONF 1.2 Severity
+    //     * @param severity as input
+    //     * @return String with related output
+    //     */
+    //    public static InternalSeverity valueOf(org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev170324.SeverityType severity ) {
+    //        switch( severity ) {
+    //            case NonAlarmed:
+    //                return InternalSeverity.NonAlarmed;
+    //            case Warning:
+    //                return InternalSeverity.Warning;
+    //            case Minor:
+    //                return InternalSeverity.Minor;
+    //            case Major:
+    //                return InternalSeverity.Major;
+    //            case Critical:
+    //                return InternalSeverity.Critical;
+    //        }
+    //        return null;
+    //    }
+    //
+    //    /**
+    //     * convert ONF 1.2.1.1 Severity
+    //     * @param severity as input
+    //     * @return String with related output
+    //     */
+    //    public static InternalSeverity valueOf(org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev180907.SeverityType severity ) {
+    //        switch( severity ) {
+    //            case NonAlarmed:
+    //                return InternalSeverity.NonAlarmed;
+    //            case Warning:
+    //                return InternalSeverity.Warning;
+    //            case Minor:
+    //                return InternalSeverity.Minor;
+    //            case Major:
+    //                return InternalSeverity.Major;
+    //            case Critical:
+    //                return InternalSeverity.Critical;
+    //        }
+    //        return null;
+    //    }
+    //
+    //    /**
+    //     * convert ONF 1.2.1.1p Severity
+    //     * @param severity as input
+    //     * @return String with related output
+    //     */
+    //    public static InternalSeverity valueOf(org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.microwave.model.rev181010.SeverityType severity ) {
+    //        switch( severity ) {
+    //            case NonAlarmed:
+    //                return InternalSeverity.NonAlarmed;
+    //            case Warning:
+    //                return InternalSeverity.Warning;
+    //            case Minor:
+    //                return InternalSeverity.Minor;
+    //            case Major:
+    //                return InternalSeverity.Major;
+    //            case Critical:
+    //                return InternalSeverity.Critical;
+    //        }
+    //        return null;
+    //    }
 
 
 
     /**
      * convert a text string into Severity
-     * @param severityString with textes: warning minor major critical  non[-]alarmed. (Capital or lowercase)
+     * 
+     * @param severityString with textes: warning minor major critical non[-]alarmed. (Capital or lowercase)
      * @return related enum. Unknown oe illegal are converted to NonAlarm
      */
     public static @Nullable InternalSeverity valueOfString(String severityString) {
 
-        switch( severityString.toLowerCase().trim() ) {
-        case "warning":
-            return InternalSeverity.Warning;
-        case "minor":
-            return InternalSeverity.Minor;
-        case "major":
-            return InternalSeverity.Major;
-        case "critical":
-            return InternalSeverity.Critical;
+        switch (severityString.toLowerCase().trim()) {
+            case "warning":
+                return InternalSeverity.Warning;
+            case "minor":
+                return InternalSeverity.Minor;
+            case "major":
+                return InternalSeverity.Major;
+            case "critical":
+                return InternalSeverity.Critical;
         }
         return InternalSeverity.NonAlarmed;
 
@@ -166,22 +163,23 @@
 
     /**
      * Convert to InternalSeverity
+     * 
      * @param severity to be converted
      * @return InternalSeverity, null converted to NonAlarmed
      */
     public static InternalSeverity valueOf(@org.eclipse.jdt.annotation.Nullable SeverityType severity) {
         if (severity != null) {
             switch (severity) {
-            case NonAlarmed:
-                return InternalSeverity.NonAlarmed;
-            case Warning:
-                return InternalSeverity.Warning;
-            case Minor:
-                return InternalSeverity.Minor;
-            case Major:
-                return InternalSeverity.Major;
-            case Critical:
-                return InternalSeverity.Critical;
+                case NonAlarmed:
+                    return InternalSeverity.NonAlarmed;
+                case Warning:
+                    return InternalSeverity.Warning;
+                case Minor:
+                    return InternalSeverity.Minor;
+                case Major:
+                    return InternalSeverity.Major;
+                case Critical:
+                    return InternalSeverity.Critical;
             }
         }
         return InternalSeverity.NonAlarmed;
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/util/NetworkElementConnectionEntitiyUtil.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/util/NetworkElementConnectionEntitiyUtil.java
index e535620..61ab2df 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/util/NetworkElementConnectionEntitiyUtil.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/util/NetworkElementConnectionEntitiyUtil.java
@@ -42,11 +42,13 @@
 
     private static final Logger LOG = LoggerFactory.getLogger(NetworkElementConnectionEntitiyUtil.class);
 
-    private static final QName QNAME_COREMODEL = QName.create("urn:onf:params:xml:ns:yang:core-model", "2017-03-20", "core-model").intern();
+    private static final QName QNAME_COREMODEL =
+            QName.create("urn:onf:params:xml:ns:yang:core-model", "2017-03-20", "core-model").intern();
 
 
     /**
      * Update devicetype and let all other field empty
+     * 
      * @param deviceType that should be updated
      * @return NetworkElementConnectionEntity with related parameter
      */
@@ -58,6 +60,7 @@
 
     /**
      * Provide device specific data
+     * 
      * @param nodeId mountpoint id
      * @param nNode data
      * @return NetworkElementConnectionEntity specific information
@@ -78,9 +81,9 @@
 
         eb.setCoreModelCapability(availableCapabilities.getRevisionForNamespace(QNAME_COREMODEL));
 
-        NodeDetailsBuilder nodeDetails = new NodeDetailsBuilder()
-                .setAvailableCapabilities(availableCapabilities.getCapabilities())
-                .setUnavailableCapabilities(unAvailableCapabilities.getCapabilities());
+        NodeDetailsBuilder nodeDetails =
+                new NodeDetailsBuilder().setAvailableCapabilities(availableCapabilities.getCapabilities())
+                        .setUnavailableCapabilities(unAvailableCapabilities.getCapabilities());
         eb.setNodeDetails(nodeDetails.build());
         // -- host information
         Host host = nNode.getHost();
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/AttributeValueChangedNotificationXml.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/AttributeValueChangedNotificationXml.java
index 5951266..f316686 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/AttributeValueChangedNotificationXml.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/AttributeValueChangedNotificationXml.java
@@ -28,7 +28,7 @@
 @XmlRootElement(name = "AttributeValueChangedNotification")
 public class AttributeValueChangedNotificationXml extends MwtNotificationBase implements GetEventType {
 
-    private static String EVENTTYPE =  "AttributeValueChangedNotification";
+    private static String EVENTTYPE = "AttributeValueChangedNotification";
 
     @XmlElement(name = "attributeName")
     private String attributeName;
@@ -42,6 +42,7 @@
 
     /**
      * Normalized notification
+     * 
      * @param nodeName name of mountpoint
      * @param counter of notification
      * @param timeStamp from ne
@@ -49,8 +50,8 @@
      * @param attributeName from ne
      * @param newValue from ne
      */
-    public AttributeValueChangedNotificationXml(String nodeName, Integer counter, InternalDateAndTime timeStamp, String objectIdRef,
-            String attributeName, String newValue) {
+    public AttributeValueChangedNotificationXml(String nodeName, Integer counter, InternalDateAndTime timeStamp,
+            String objectIdRef, String attributeName, String newValue) {
         super(nodeName, counter, timeStamp, objectIdRef);
         this.attributeName = attributeName;
         this.newValue = newValue;
@@ -78,9 +79,9 @@
 
     public EventlogEntity getEventlogEntity() {
         return new EventlogBuilder().setAttributeName(attributeName).setNewValue(newValue)
-                .setCounter(Integer.valueOf(this.getCounter()))
-                .setNodeId(this.getNodeName()).setObjectId(this.getObjectId())
-                .setTimestamp(new DateAndTime(this.getTimeStamp())).setSourceType(SourceType.Netconf).build();
+                .setCounter(Integer.valueOf(this.getCounter())).setNodeId(this.getNodeName())
+                .setObjectId(this.getObjectId()).setTimestamp(new DateAndTime(this.getTimeStamp()))
+                .setSourceType(SourceType.Netconf).build();
     }
 
 }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/FaultEntityManager.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/FaultEntityManager.java
index 25ac8ae..d6ce625 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/FaultEntityManager.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/FaultEntityManager.java
@@ -28,18 +28,18 @@
     private static final Pattern pattern = Pattern.compile(".*\\[layerProtocol=(.*)\\]");
 
     /**
-     * The leading indication for notification or events that are not in the
-     * currentProblem data of the ONF Coremodel
+     * The leading indication for notification or events that are not in the currentProblem data of the ONF Coremodel
      */
     private static final String NOCURRENTPROBLEMINDICATION = "#";
 
     /**
      * Specific problems are not moving into current problem list
+     * 
      * @param problemName to be verified
      * @return true if problem is current
      */
     public static boolean isManagedAsCurrentProblem(String problemName) {
-        return ! problemName.startsWith(NOCURRENTPROBLEMINDICATION);
+        return !problemName.startsWith(NOCURRENTPROBLEMINDICATION);
     }
 
     public static boolean isManagedAsCurrentProblem(Fault problem) {
@@ -48,6 +48,7 @@
 
     /**
      * Specific problems are not moving into current problem list
+     * 
      * @param fault to be verified
      * @return true if cleared indication
      */
@@ -58,9 +59,10 @@
 
     /**
      * Create a specific ES id for the current log.
+     * 
      * @return a string with the generated ES Id
      */
-     public static String genSpecificEsId(String nodeName, String objectId, String problemName) {
+    public static String genSpecificEsId(String nodeName, String objectId, String problemName) {
 
         String uuId;
 
@@ -82,6 +84,7 @@
 
     /**
      * Create Es id
+     * 
      * @param fault used to create uuid for faultcurrent
      * @return String with Id
      */
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/MwtNotificationBase.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/MwtNotificationBase.java
index 9982196..e3923c9 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/MwtNotificationBase.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/MwtNotificationBase.java
@@ -38,7 +38,7 @@
 
     public MwtNotificationBase() {
         // For Jaxb
-    	this.objectId = EMPTY;
+        this.objectId = EMPTY;
     }
 
     public MwtNotificationBase(String nodeName, Integer counter, InternalDateAndTime timeStamp, String objectId) {
@@ -73,19 +73,18 @@
 
     /**
      * Provide ConnectionlogEntity type
+     * 
      * @return ConnectionlogEntity
      */
     public ConnectionlogEntity getConnectionlogEntity() {
-        return new ConnectionlogBuilder()
-                .setNodeId(objectId)
-                .setStatus(getStatus())
-                .setTimestamp(new DateAndTime(timeStamp))
-                .build();
+        return new ConnectionlogBuilder().setNodeId(objectId).setStatus(getStatus())
+                .setTimestamp(new DateAndTime(timeStamp)).build();
     }
 
     /**
-     * Provide connection status for mountpoint log.
-     * TODO Add status disconnected if mountpoint is required, but does not exists.
+     * Provide connection status for mountpoint log. TODO Add status disconnected if mountpoint is required, but does
+     * not exists.
+     * 
      * @return
      */
     private ConnectionLogStatus getStatus() {
@@ -97,7 +96,7 @@
             return ConnectionLogStatus.Unmounted;
 
         } else if (this instanceof AttributeValueChangedNotificationXml) {
-            String pnx = ((AttributeValueChangedNotificationXml)this).getNewValue();
+            String pnx = ((AttributeValueChangedNotificationXml) this).getNewValue();
             if (pnx.equals(ConnectionStatus.Connected.getName())) {
                 return ConnectionLogStatus.Connected;
 
@@ -113,6 +112,7 @@
 
     /**
      * Type for the Database to document the the same name that is used in the websockets.
+     * 
      * @return String with type name of child class
      */
     @JsonProperty("type")
@@ -122,8 +122,8 @@
 
     @Override
     public String toString() {
-        return "MwtNotificationBase [getType()="+ getType() + ", nodeName=" + nodeName + ", counter=" + counter + ", timeStamp=" + timeStamp
-                + ", objectId=" + objectId + "]";
+        return "MwtNotificationBase [getType()=" + getType() + ", nodeName=" + nodeName + ", counter=" + counter
+                + ", timeStamp=" + timeStamp + ", objectId=" + objectId + "]";
     }
 
 
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/ObjectCreationNotificationXml.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/ObjectCreationNotificationXml.java
index 1787b45..e901e3b 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/ObjectCreationNotificationXml.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/ObjectCreationNotificationXml.java
@@ -27,7 +27,7 @@
 @XmlRootElement(name = "ObjectCreationNotification")
 public class ObjectCreationNotificationXml extends MwtNotificationBase implements GetEventType {
 
-    private static String EVENTTYPE =  "ObjectCreationNotification";
+    private static String EVENTTYPE = "ObjectCreationNotification";
     private static String ACTION = "creation";
 
     public ObjectCreationNotificationXml() {
@@ -36,13 +36,15 @@
 
     /**
      * Normalized notification
+     * 
      * @param nodeName name of mountpoint or instance that owns the problem
      * @param counter of notification
      * @param timeStamp from ne
      * @param objectIdRef from ne
      */
-    public ObjectCreationNotificationXml(String nodeName, Integer counter, InternalDateAndTime timeStamp, String objectIdRef) {
-        super(nodeName, counter, timeStamp,  objectIdRef);
+    public ObjectCreationNotificationXml(String nodeName, Integer counter, InternalDateAndTime timeStamp,
+            String objectIdRef) {
+        super(nodeName, counter, timeStamp, objectIdRef);
     }
 
     public ObjectCreationNotificationXml(EventlogEntity el) {
@@ -56,9 +58,9 @@
 
     public EventlogEntity getEventlogEntity() {
         return new EventlogBuilder().setAttributeName(ACTION).setNewValue(ACTION)
-                .setCounter(Integer.valueOf(this.getCounter()))
-                .setNodeId(this.getNodeName()).setObjectId(this.getObjectId())
-                .setTimestamp(new DateAndTime(this.getTimeStamp())).setSourceType(SourceType.Netconf).build();
+                .setCounter(Integer.valueOf(this.getCounter())).setNodeId(this.getNodeName())
+                .setObjectId(this.getObjectId()).setTimestamp(new DateAndTime(this.getTimeStamp()))
+                .setSourceType(SourceType.Netconf).build();
     }
 
 
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/ObjectDeletionNotificationXml.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/ObjectDeletionNotificationXml.java
index 934a65c..4115016 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/ObjectDeletionNotificationXml.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/ObjectDeletionNotificationXml.java
@@ -27,7 +27,7 @@
 @XmlRootElement(name = "ObjectDeletionNotification")
 public class ObjectDeletionNotificationXml extends MwtNotificationBase implements GetEventType {
 
-    private static String EVENTTYPE =  "ObjectDeletionNotification";
+    private static String EVENTTYPE = "ObjectDeletionNotification";
     private static String ACTION = "deletion";
 
     public ObjectDeletionNotificationXml() {
@@ -36,13 +36,15 @@
 
     /**
      * Normalized notification
+     * 
      * @param nodeName name of mountpoint or instance that owns the problem
      * @param counter of notification
      * @param timeStamp from ne
      * @param objectIdRef from ne
      */
-    public ObjectDeletionNotificationXml(String nodeName, Integer counter, InternalDateAndTime timeStamp, String objectIdRef) {
-        super(nodeName, counter, timeStamp,  objectIdRef);
+    public ObjectDeletionNotificationXml(String nodeName, Integer counter, InternalDateAndTime timeStamp,
+            String objectIdRef) {
+        super(nodeName, counter, timeStamp, objectIdRef);
     }
 
     public ObjectDeletionNotificationXml(EventlogEntity el) {
@@ -56,9 +58,9 @@
 
     public EventlogEntity getEventlogEntity() {
         return new EventlogBuilder().setAttributeName(ACTION).setNewValue(ACTION)
-                .setCounter(Integer.valueOf(this.getCounter()))
-                .setNodeId(this.getNodeName()).setObjectId(this.getObjectId())
-                .setTimestamp(new DateAndTime(this.getTimeStamp())).setSourceType(SourceType.Netconf).build();
+                .setCounter(Integer.valueOf(this.getCounter())).setNodeId(this.getNodeName())
+                .setObjectId(this.getObjectId()).setTimestamp(new DateAndTime(this.getTimeStamp()))
+                .setSourceType(SourceType.Netconf).build();
     }
 
 }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/ProblemNotificationXml.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/ProblemNotificationXml.java
index 98a0f9d..5eeb70b 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/ProblemNotificationXml.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/ProblemNotificationXml.java
@@ -49,14 +49,13 @@
     }
 
     /**
-     * Generic Problem. All the parameters are of type Strings according to YANG
-     * specification.
+     * Generic Problem. All the parameters are of type Strings according to YANG specification.
      *
-     * @param nodeName                Name of mountpoint
-     * @param uuId                    Name of Interface Pac
-     * @param problemNameString       Name of the problem
-     * @param problemSeverityString   Severitycode of the problem
-     * @param counter                 Counter from device
+     * @param nodeName Name of mountpoint
+     * @param uuId Name of Interface Pac
+     * @param problemNameString Name of the problem
+     * @param problemSeverityString Severitycode of the problem
+     * @param counter Counter from device
      * @param internaltimeStampString Timestamp according to internal format.
      */
     public ProblemNotificationXml(String nodeName, String uuId, String problemNameString,
@@ -80,7 +79,7 @@
     }
 
     public boolean isNotManagedAsCurrentProblem() {
-        return ! FaultEntityManager.isManagedAsCurrentProblem(getProblem());
+        return !FaultEntityManager.isManagedAsCurrentProblem(getProblem());
     }
 
     public boolean isNoAlarmIndication() {
@@ -100,6 +99,7 @@
 
     /**
      * Create a specific ES id for the current log.
+     * 
      * @return a string with the generated ES Id
      */
     @JsonIgnore
@@ -137,6 +137,7 @@
 
     /**
      * LOG the newly added problems of the interface pac
+     * 
      * @param log of logger
      * @param uuid as log info
      * @param resultList with all problems
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/WebSocketServiceClientDummyImpl.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/WebSocketServiceClientDummyImpl.java
index 747c800..d927b89 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/WebSocketServiceClientDummyImpl.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/WebSocketServiceClientDummyImpl.java
@@ -29,16 +29,16 @@
 
     private static final Logger LOG = LoggerFactory.getLogger(ODLEventListenerHandler.class);
 
-    public WebSocketServiceClientDummyImpl() {
+    public WebSocketServiceClientDummyImpl() {}
+
+    @Override
+    public <T extends MwtNotificationBase & GetEventType> void sendViaWebsockets(@NonNull String nodeName,
+            @NonNull T notificationXml) {
+        LOG.info("Dummy to send websocket event {} for mountpoint {}", notificationXml.getClass().getSimpleName(),
+                nodeName);
     }
 
     @Override
-    public <T extends MwtNotificationBase & GetEventType> void sendViaWebsockets(@NonNull String nodeName, @NonNull T notificationXml) {
-        LOG.info("Dummy to send websocket event {} for mountpoint {}", notificationXml.getClass().getSimpleName(), nodeName);
-    }
-
-    @Override
-    public void close() throws Exception {
-    }
+    public void close() throws Exception {}
 
 }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/WebSocketServiceClientImpl2.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/WebSocketServiceClientImpl2.java
index eec63e9..878e226 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/WebSocketServiceClientImpl2.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/WebSocketServiceClientImpl2.java
@@ -30,8 +30,7 @@
 import org.slf4j.LoggerFactory;
 
 /**
- * Wrapper for forwarding web-socket notifications to the web-socket service, that is running as
- * bundle.
+ * Wrapper for forwarding web-socket notifications to the web-socket service, that is running as bundle.
  */
 @SuppressWarnings("deprecation")
 public class WebSocketServiceClientImpl2 implements WebSocketServiceClientInternal {
@@ -43,6 +42,7 @@
 
     /**
      * Implementation of Websocket notification processor.
+     * 
      * @param rpcProviderRegistry to get MDSAL services.
      */
     @Deprecated
@@ -54,6 +54,7 @@
 
     /**
      * New: Implementation of Websocket notification processor.
+     * 
      * @param websocketmanagerService2 to be used
      */
     public WebSocketServiceClientImpl2(WebsocketmanagerService websocketmanagerService2) {
@@ -63,7 +64,8 @@
     }
 
     @Override
-    public <T extends MwtNotificationBase & GetEventType> void sendViaWebsockets(@NonNull String nodeName, @NonNull T notificationXml) {
+    public <T extends MwtNotificationBase & GetEventType> void sendViaWebsockets(@NonNull String nodeName,
+            @NonNull T notificationXml) {
         LOG.info("Send websocket event {} for mountpoint {}", notificationXml.getClass().getSimpleName(), nodeName);
 
         try {
@@ -80,7 +82,6 @@
     }
 
     @Override
-    public void close() throws Exception {
-    }
+    public void close() throws Exception {}
 
 }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/WebSocketServiceClientInternal.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/WebSocketServiceClientInternal.java
index a1b8054..1af2d89 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/WebSocketServiceClientInternal.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/WebSocketServiceClientInternal.java
@@ -24,10 +24,12 @@
 
 /**
  * Wrapper for forwarding websocket notifications to the websocket service, that is running as container.
+ * 
  * @author herbert
  */
 public interface WebSocketServiceClientInternal extends AutoCloseable {
 
-    public <T extends MwtNotificationBase & GetEventType> void sendViaWebsockets(@NonNull String nodeName, @NonNull T notificationXml);
+    public <T extends MwtNotificationBase & GetEventType> void sendViaWebsockets(@NonNull String nodeName,
+            @NonNull T notificationXml);
 
 }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/maintenance/impl/MaintenanceCalculator.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/maintenance/impl/MaintenanceCalculator.java
index bce8f52..db21855 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/maintenance/impl/MaintenanceCalculator.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/maintenance/impl/MaintenanceCalculator.java
@@ -33,114 +33,117 @@
 
 public class MaintenanceCalculator {
 
-	private static final Logger LOG = LoggerFactory.getLogger(MaintenanceCalculator.class);
+    private static final Logger LOG = LoggerFactory.getLogger(MaintenanceCalculator.class);
 
-	private static ZoneId EsMaintenanceFilterTimeZone = ZoneId.of("UTC");
-	//private static DateTimeFormatter FORMAT = DateTimeFormatter.ISO_DATE_TIME;       // "1986-04-08T12:30:00"
-	private static DateTimeFormatter FORMAT = DateTimeFormatter.ISO_OFFSET_DATE_TIME; // 2011-12-03T10:15:30+01:00
-	private static ZonedDateTime EMPTYDATETIME = ZonedDateTime.ofInstant(Instant.EPOCH, EsMaintenanceFilterTimeZone);
+    private static ZoneId EsMaintenanceFilterTimeZone = ZoneId.of("UTC");
+    //private static DateTimeFormatter FORMAT = DateTimeFormatter.ISO_DATE_TIME;       // "1986-04-08T12:30:00"
+    private static DateTimeFormatter FORMAT = DateTimeFormatter.ISO_OFFSET_DATE_TIME; // 2011-12-03T10:15:30+01:00
+    private static ZonedDateTime EMPTYDATETIME = ZonedDateTime.ofInstant(Instant.EPOCH, EsMaintenanceFilterTimeZone);
 
-	/** Intended to be used static **/
-	private MaintenanceCalculator() {
-	}
+    /** Intended to be used static **/
+    private MaintenanceCalculator() {}
 
-	/**
-	 * Verify maintenance status
-	 * @param maintenance if null false, else according to settings
-	 * @param objectIdRef NETCONF object id
-	 * @param problem     name that was provided
-	 * @param now         time to verify with
-	 * @return true if in maintenance status
-	 */
-	public static boolean isONFObjectInMaintenance(MaintenanceEntity maintenance, String objectIdRef, String problem,
-			ZonedDateTime now) {
+    /**
+     * Verify maintenance status
+     * 
+     * @param maintenance if null false, else according to settings
+     * @param objectIdRef NETCONF object id
+     * @param problem name that was provided
+     * @param now time to verify with
+     * @return true if in maintenance status
+     */
+    public static boolean isONFObjectInMaintenance(MaintenanceEntity maintenance, String objectIdRef, String problem,
+            ZonedDateTime now) {
 
-		if (maintenance != null) {
-			Boolean isActive = maintenance.isActive();
-			if (isActive != null && isActive && isInMaintenance(maintenance, objectIdRef, problem, now)) {
-				return true;
-			}
+        if (maintenance != null) {
+            Boolean isActive = maintenance.isActive();
+            if (isActive != null && isActive && isInMaintenance(maintenance, objectIdRef, problem, now)) {
+                return true;
+            }
 
-		}
-		return false;
-	}
+        }
+        return false;
+    }
 
-	/** Shortcut **/
-	public static boolean isONFObjectInMaintenance(MaintenanceEntity maintenance, String objectIdRef, String problem) {
-		return isONFObjectInMaintenance(maintenance, objectIdRef, problem, getNow());
-	}
+    /** Shortcut **/
+    public static boolean isONFObjectInMaintenance(MaintenanceEntity maintenance, String objectIdRef, String problem) {
+        return isONFObjectInMaintenance(maintenance, objectIdRef, problem, getNow());
+    }
 
-	/*---------------------------------------------
-	 * private static helper functions to verify
-	 */
+    /*---------------------------------------------
+     * private static helper functions to verify
+     */
 
-	/**
-	 * Get the actual time in the Filter time zone.
-	 * @return actual Time
-	 */
-	private static ZonedDateTime getNow() {
-		return ZonedDateTime.now(EsMaintenanceFilterTimeZone);
-	}
+    /**
+     * Get the actual time in the Filter time zone.
+     * 
+     * @return actual Time
+     */
+    private static ZonedDateTime getNow() {
+        return ZonedDateTime.now(EsMaintenanceFilterTimeZone);
+    }
 
-	/**
-	 * Verify if the filter is active for an object
-	 *
-	 * @param now point of time to verify
-	 * @return if the object is covered by filter and now within point of time
-	 */
-	private static boolean isInMaintenance(MaintenanceEntity maintenance, String objectIdRef, String problem,
-			ZonedDateTime now) {
-		return appliesToObjectReference(maintenance, objectIdRef, problem)
-				&& isInPeriod(maintenance.getStart(), maintenance.getEnd(), now);
-	}
+    /**
+     * Verify if the filter is active for an object
+     *
+     * @param now point of time to verify
+     * @return if the object is covered by filter and now within point of time
+     */
+    private static boolean isInMaintenance(MaintenanceEntity maintenance, String objectIdRef, String problem,
+            ZonedDateTime now) {
+        return appliesToObjectReference(maintenance, objectIdRef, problem)
+                && isInPeriod(maintenance.getStart(), maintenance.getEnd(), now);
+    }
 
-	/**
-	 * Compare the if probe is within the range of start and end.
-	 *
-	 * @param start of range
-	 * @param end   of range
-	 * @param probe time to verify
-	 * @return boolean result true if (start <= probe <= end)
-	 */
-	public static boolean isInPeriod(DateAndTime start, DateAndTime end, ZonedDateTime probe) {
-		HtAssert.nonnull(start,end,probe);
-		ZonedDateTime startZT = valueOf(start.getValue());
-		ZonedDateTime endZT = valueOf(end.getValue());
-		return startZT.compareTo(endZT) < 0 && startZT.compareTo(probe) <= 0 && endZT.compareTo(probe) >= 0;
-	}
+    /**
+     * Compare the if probe is within the range of start and end.
+     *
+     * @param start of range
+     * @param end of range
+     * @param probe time to verify
+     * @return boolean result true if (start <= probe <= end)
+     */
+    public static boolean isInPeriod(DateAndTime start, DateAndTime end, ZonedDateTime probe) {
+        HtAssert.nonnull(start, end, probe);
+        ZonedDateTime startZT = valueOf(start.getValue());
+        ZonedDateTime endZT = valueOf(end.getValue());
+        return startZT.compareTo(endZT) < 0 && startZT.compareTo(probe) <= 0 && endZT.compareTo(probe) >= 0;
+    }
 
-	/**
-	 * Verify if the definied object is matching to the referenced object
-	 * @param definition definition with parameters
-	 * @param pObjectIdRef object-id-ref of fault notification
-	 * @param pProblem problem of fault notification
-	 * @return true if if referenced
-	 */
-	private static boolean appliesToObjectReference(@Nonnull MaintenanceEntity definition, @Nonnull String pObjectIdRef,
-			@Nonnull String pProblem) {
-		HtAssert.nonnull(definition,pObjectIdRef,pProblem);
-		boolean res = (definition.getObjectIdRef()==null ||  pObjectIdRef.contains(definition.getObjectIdRef()))
-				&& (definition.getProblem()==null || pProblem.contains(definition.getProblem()));
-		LOG.debug("Check result applies {}: {} {} against: {}", res, pObjectIdRef, pProblem, definition);
-		return res;
-	}
+    /**
+     * Verify if the definied object is matching to the referenced object
+     * 
+     * @param definition definition with parameters
+     * @param pObjectIdRef object-id-ref of fault notification
+     * @param pProblem problem of fault notification
+     * @return true if if referenced
+     */
+    private static boolean appliesToObjectReference(@Nonnull MaintenanceEntity definition, @Nonnull String pObjectIdRef,
+            @Nonnull String pProblem) {
+        HtAssert.nonnull(definition, pObjectIdRef, pProblem);
+        boolean res = (definition.getObjectIdRef() == null || pObjectIdRef.contains(definition.getObjectIdRef()))
+                && (definition.getProblem() == null || pProblem.contains(definition.getProblem()));
+        LOG.debug("Check result applies {}: {} {} against: {}", res, pObjectIdRef, pProblem, definition);
+        return res;
+    }
 
-	/**
-	 * Convert String to time value
-	 * @param zoneTimeString with time
-	 * @return ZonedDateTime string
-	 */
-	public static ZonedDateTime valueOf(String zoneTimeString) {
-		if (zoneTimeString == null || zoneTimeString.isEmpty()) {
-			LOG.warn("Null or empty zoneTimeString");
-			return EMPTYDATETIME;
-		}
-		try {
-			return ZonedDateTime.parse(zoneTimeString, FORMAT);
-		} catch (DateTimeParseException e) {
-			LOG.warn("Can not parse zoneTimeString '{}'", zoneTimeString);
-			return EMPTYDATETIME;
-		}
-	}
+    /**
+     * Convert String to time value
+     * 
+     * @param zoneTimeString with time
+     * @return ZonedDateTime string
+     */
+    public static ZonedDateTime valueOf(String zoneTimeString) {
+        if (zoneTimeString == null || zoneTimeString.isEmpty()) {
+            LOG.warn("Null or empty zoneTimeString");
+            return EMPTYDATETIME;
+        }
+        try {
+            return ZonedDateTime.parse(zoneTimeString, FORMAT);
+        } catch (DateTimeParseException e) {
+            LOG.warn("Can not parse zoneTimeString '{}'", zoneTimeString);
+            return EMPTYDATETIME;
+        }
+    }
 
 }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/maintenance/impl/MaintenanceServiceImpl.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/maintenance/impl/MaintenanceServiceImpl.java
index 03584b2..55d94c9 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/maintenance/impl/MaintenanceServiceImpl.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/maintenance/impl/MaintenanceServiceImpl.java
@@ -48,7 +48,8 @@
 
         LOG.info("Create {} start", MaintenanceServiceImpl.class);
         database = client;
-        LOG.info("Create {} finished. DB Service {} started.", MaintenanceServiceImpl.class,  client != null ? "sucessfully" : "not" );
+        LOG.info("Create {} finished. DB Service {} started.", MaintenanceServiceImpl.class,
+                client != null ? "sucessfully" : "not");
 
     }
 
@@ -67,8 +68,7 @@
      */
 
     @Override
-    public void close() throws Exception {
-    }
+    public void close() throws Exception {}
 
     /*-------------------------------------------------
      * Interface MaintenanceRPCServiceAPI
@@ -96,11 +96,12 @@
             RequiredNetworkElementBuilder valueBuilder = new RequiredNetworkElementBuilder();
 
             valueBuilder.setMountpointName(maintenanceMode.getNodeId());
-            valueBuilder.setStatus(String.valueOf(MaintenanceCalculator.isONFObjectInMaintenance(maintenanceMode, "","")));
+            valueBuilder
+                    .setStatus(String.valueOf(MaintenanceCalculator.isONFObjectInMaintenance(maintenanceMode, "", "")));
             valueBuilder.setDescription("Pretty description here");
             outputBuilder.setRequiredNetworkElement(valueBuilder.build());
         } else {
-            LOG.warn("No info in database for {}",input.getMountpointName());
+            LOG.warn("No info in database for {}", input.getMountpointName());
         }
         return outputBuilder;
     }
@@ -113,7 +114,7 @@
         if (maintenanceMode != null) {
             outputBuilder = new GetMaintenanceModeOutputBuilder(maintenanceMode);
         } else {
-            throw new IllegalArgumentException("No info in database for "+input.getMountpointName());
+            throw new IllegalArgumentException("No info in database for " + input.getMountpointName());
         }
         return outputBuilder;
     }
@@ -145,9 +146,9 @@
                 input.getProblemName(), now));
         resultString.append(" at Timestamp: ");
         resultString.append(now);
-        TestMaintenanceModeOutputBuilder outputBuilder = maintenanceMode != null
-                ? new TestMaintenanceModeOutputBuilder(maintenanceMode)
-                : new TestMaintenanceModeOutputBuilder();
+        TestMaintenanceModeOutputBuilder outputBuilder =
+                maintenanceMode != null ? new TestMaintenanceModeOutputBuilder(maintenanceMode)
+                        : new TestMaintenanceModeOutputBuilder();
         outputBuilder.setResultString(resultString.toString());
         return outputBuilder;
 
@@ -161,7 +162,8 @@
     public boolean isONFObjectInMaintenance(String mountpointReference, String objectIdRef, String problem) {
         MaintenanceEntity maintenanceMode = database.getMaintenance(mountpointReference);
         boolean res = MaintenanceCalculator.isONFObjectInMaintenance(maintenanceMode, objectIdRef, problem);
-        LOG.debug("inMaintenance={} for mountpoint/id/problem:{} {} {} Definition: {}",res, mountpointReference, objectIdRef, problem, this );
+        LOG.debug("inMaintenance={} for mountpoint/id/problem:{} {} {} Definition: {}", res, mountpointReference,
+                objectIdRef, problem, this);
         return res;
     }
 
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/performancemanager/impl/PerformanceManagerImpl.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/performancemanager/impl/PerformanceManagerImpl.java
index e36dd34..2209867 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/performancemanager/impl/PerformanceManagerImpl.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/performancemanager/impl/PerformanceManagerImpl.java
@@ -33,8 +33,7 @@
     private PerformanceManagerTask task;
 
     public PerformanceManagerImpl(long seconds, NetconfNetworkElementService netconfNetworkElementService,
-            DataProvider microwaveHistoricalPerformanceWriterService,
-            ConfigurationFileRepresentation config) {
+            DataProvider microwaveHistoricalPerformanceWriterService, ConfigurationFileRepresentation config) {
 
         LOG.info("Construct {}", PerformanceManagerImpl.class.getSimpleName());
 
@@ -48,7 +47,8 @@
         } else {
             LOG.info("{} Seconds", seconds);
             LOG.info("Start of PM task");
-            task = new PerformanceManagerTask(seconds, microwaveHistoricalPerformanceWriterService, netconfNetworkElementService);
+            task = new PerformanceManagerTask(seconds, microwaveHistoricalPerformanceWriterService,
+                    netconfNetworkElementService);
             task.start();
             LOG.info("PM task scheduled");
         }
@@ -66,7 +66,7 @@
 
     @Override
     public void registration(String mountPointNodeName, NetworkElement ne) {
-        LOG.debug("Register {}",mountPointNodeName);
+        LOG.debug("Register {}", mountPointNodeName);
         if (task != null) {
             task.registration(mountPointNodeName, ne);
         }
@@ -74,7 +74,7 @@
 
     @Override
     public void deRegistration(String mountPointNodeName) {
-        LOG.debug("Deregister {}",mountPointNodeName);
+        LOG.debug("Deregister {}", mountPointNodeName);
         if (task != null) {
             task.deRegistration(mountPointNodeName);
         }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/performancemanager/impl/PerformanceManagerTask.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/performancemanager/impl/PerformanceManagerTask.java
index a85df63..8fe6b95 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/performancemanager/impl/PerformanceManagerTask.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/performancemanager/impl/PerformanceManagerTask.java
@@ -51,13 +51,13 @@
 
     /**
      * Constructor of PM Task
+     * 
      * @param seconds seconds to call PM Task
      * @param microwaveHistoricalPerformanceWriterService DB Service to load PM data to
      * @param netconfNetworkElementService to write into log
      */
 
-    public PerformanceManagerTask(long seconds,
-            DataProvider microwaveHistoricalPerformanceWriterService,
+    public PerformanceManagerTask(long seconds, DataProvider microwaveHistoricalPerformanceWriterService,
             NetconfNetworkElementService netconfNetworkElementService) {
 
         LOG.debug("Init task {}", PerformanceManagerTask.class.getSimpleName());
@@ -86,16 +86,17 @@
             taskHandle.cancel(true);
             try {
                 scheduler.awaitTermination(10, TimeUnit.SECONDS);
-             } catch (InterruptedException e) {
-                 LOG.debug("Schdule stopped.",e);
-                 // Restore interrupted state...
-                 Thread.currentThread().interrupt();
-             }
+            } catch (InterruptedException e) {
+                LOG.debug("Schdule stopped.", e);
+                // Restore interrupted state...
+                Thread.currentThread().interrupt();
+            }
         }
     }
 
     /**
      * Add NE/Mountpoint to PM Processig
+     * 
      * @param mountPointNodeName to be added
      * @param ne that is connected to the mountpoint
      */
@@ -109,14 +110,15 @@
 
     /**
      * Remove mountpoint/NE from PM process
+     * 
      * @param mountPointNodeName that has to be removed
      */
     public void deRegistration(String mountPointNodeName) {
-        LOG.debug("Deregister {}",mountPointNodeName);
+        LOG.debug("Deregister {}", mountPointNodeName);
         PerformanceDataProvider removedNE = queue.remove(mountPointNodeName);
 
-        if ( removedNE == null) {
-            LOG.warn("Couldn't delete {}",mountPointNodeName);
+        if (removedNE == null) {
+            LOG.warn("Couldn't delete {}", mountPointNodeName);
         }
     }
 
@@ -126,8 +128,8 @@
      */
 
     /**
-     * Task runner to read all performance data from Network Elements.
-     * Catch exceptions to make sure, that the Task is not stopped.
+     * Task runner to read all performance data from Network Elements. Catch exceptions to make sure, that the Task is
+     * not stopped.
      */
     @Override
     public void run() {
@@ -136,7 +138,7 @@
         if (actualNE != null && actualNE.getAcessor().isPresent()) {
             mountpointName = actualNE.getAcessor().get().getNodeId().getValue();
         }
-        LOG.debug("{} start {} Start with mountpoint {}",LOGMARKER, tickCounter, mountpointName);
+        LOG.debug("{} start {} Start with mountpoint {}", LOGMARKER, tickCounter, mountpointName);
 
         //Proceed to next NE/Interface
         getNextInterface(mountpointName);
@@ -166,7 +168,7 @@
             }
         }
 
-        LOG.debug("{} end {}",LOGMARKER, tickCounter);
+        LOG.debug("{} end {}", LOGMARKER, tickCounter);
         tickCounter++;
     }
 
@@ -179,10 +181,8 @@
     }
 
     /**
-     * Get then next interface in the list.
-     * First try to find a next on the actual NE.
-     * If not available search next interface at a NE
-     * Special Situations to handle: Empty queue, NEs, but no interfaces
+     * Get then next interface in the list. First try to find a next on the actual NE. If not available search next
+     * interface at a NE Special Situations to handle: Empty queue, NEs, but no interfaces
      */
     private void getNextInterface(String mountpointName) {
         boolean started = false;
@@ -191,7 +191,7 @@
         LOG.debug("{} {} getNextInterface enter. Queue size {} ", LOGMARKER, tickCounter, queue.size());
 
         if (actualNE != null && !queue.containsValue(actualNE)) {
-            LOG.debug("{} {} NE Removed duringprocessing A",LOGMARKER, tickCounter);
+            LOG.debug("{} {} NE Removed duringprocessing A", LOGMARKER, tickCounter);
             resetQueue();
         }
 
@@ -203,17 +203,13 @@
                 break;
             }
 
-            LOG.debug("{} {} Loop ne {}:neiterator {}:Interfaceiterator:{} Loop:{}",
-                    LOGMARKER,
-                    tickCounter,
-                    actualNE == null? "null" : mountpointName,
-                    neIterator == null ? "null" : neIterator.hasNext(),
-                    actualNE == null ? "null" : actualNE.hasNext(),
-                    loopCounter);
+            LOG.debug("{} {} Loop ne {}:neiterator {}:Interfaceiterator:{} Loop:{}", LOGMARKER, tickCounter,
+                    actualNE == null ? "null" : mountpointName, neIterator == null ? "null" : neIterator.hasNext(),
+                    actualNE == null ? "null" : actualNE.hasNext(), loopCounter);
 
             if (actualNE != null && actualNE.hasNext()) {
                 // Yes, there is an interface, deliver back
-                LOG.debug("{} {} getNextInterface yes A",LOGMARKER, tickCounter);
+                LOG.debug("{} {} getNextInterface yes A", LOGMARKER, tickCounter);
                 actualNE.next();
                 break;
 
@@ -221,24 +217,24 @@
                 // No element in neInterfaceInterator .. get next NE and try
                 if (neIterator != null && neIterator.hasNext()) {
                     // Set a new NE
-                    LOG.debug("{} {} Next NE A",LOGMARKER, tickCounter);
+                    LOG.debug("{} {} Next NE A", LOGMARKER, tickCounter);
                     actualNE = neIterator.next();
                     actualNE.resetPMIterator();
 
                 } else {
                     // Goto start condition 1) first entry 2) end of queue reached
-                    LOG.debug("{} {} Reset",LOGMARKER, tickCounter);
+                    LOG.debug("{} {} Reset", LOGMARKER, tickCounter);
                     resetQueue();
 
                     if (queue.isEmpty()) {
-                        LOG.debug("{} {} no nextInterfac. queue empty",LOGMARKER, tickCounter);
+                        LOG.debug("{} {} no nextInterfac. queue empty", LOGMARKER, tickCounter);
                         break;
-                    } else if (!started){
-                        LOG.debug("{} {} getNextInterface start condition. Get interator.",LOGMARKER, tickCounter);
+                    } else if (!started) {
+                        LOG.debug("{} {} getNextInterface start condition. Get interator.", LOGMARKER, tickCounter);
                         neIterator = queue.values().iterator();
                         started = true;
                     } else {
-                        LOG.debug("{} {} no nextInterface",LOGMARKER, tickCounter);
+                        LOG.debug("{} {} no nextInterface", LOGMARKER, tickCounter);
                         break;
                     }
                 }
@@ -246,7 +242,7 @@
         } //while
 
         if (actualNE != null && !queue.containsValue(actualNE)) {
-            LOG.debug("{} {} NE Removed duringprocessing B",LOGMARKER, tickCounter);
+            LOG.debug("{} {} NE Removed duringprocessing B", LOGMARKER, tickCounter);
             resetQueue();
         }
 
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/performancemanager/impl/config/PmConfig.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/performancemanager/impl/config/PmConfig.java
index 18d24fe..bbe8543 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/performancemanager/impl/config/PmConfig.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/performancemanager/impl/config/PmConfig.java
@@ -28,27 +28,27 @@
     private static final String DEFAULT_VALUE_ENABLED = String.valueOf(true);
 
 
-	private final ConfigurationFileRepresentation configuration;
+    private final ConfigurationFileRepresentation configuration;
 
-	public PmConfig(ConfigurationFileRepresentation configuration) {
-		this.configuration = configuration;
-		this.configuration.addSection(SECTION_MARKER_PM);
-		defaults();
-	}
+    public PmConfig(ConfigurationFileRepresentation configuration) {
+        this.configuration = configuration;
+        this.configuration.addSection(SECTION_MARKER_PM);
+        defaults();
+    }
 
     public boolean isPerformanceManagerEnabled() {
         return configuration.getPropertyBoolean(SECTION_MARKER_PM, PROPERTY_KEY_ENABLED);
     }
 
-	@Override
-	public String getSectionName() {
-		return SECTION_MARKER_PM;
-	}
+    @Override
+    public String getSectionName() {
+        return SECTION_MARKER_PM;
+    }
 
-	@Override
-	public void defaults() {
-		//Add default if not available
-		configuration.setPropertyIfNotAvailable(SECTION_MARKER_PM, PROPERTY_KEY_ENABLED, DEFAULT_VALUE_ENABLED);
-	}
+    @Override
+    public void defaults() {
+        //Add default if not available
+        configuration.setPropertyIfNotAvailable(SECTION_MARKER_PM, PROPERTY_KEY_ENABLED, DEFAULT_VALUE_ENABLED);
+    }
 
 }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/DevicemanagerNotificationDelayService.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/DevicemanagerNotificationDelayService.java
index 3e464f4..5157aad 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/DevicemanagerNotificationDelayService.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/DevicemanagerNotificationDelayService.java
@@ -24,7 +24,8 @@
 /**
  * Devicemanager service
  */
-public class DevicemanagerNotificationDelayService extends NotificationDelayService<ProblemNotificationXml> implements DeviceManagerService {
+public class DevicemanagerNotificationDelayService extends NotificationDelayService<ProblemNotificationXml>
+        implements DeviceManagerService {
 
     public DevicemanagerNotificationDelayService(ConfigurationFileRepresentation htconfig) {
         super(htconfig);
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/NotificationDelayFilter.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/NotificationDelayFilter.java
index be3b615..fd288c3 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/NotificationDelayFilter.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/NotificationDelayFilter.java
@@ -33,8 +33,8 @@
     private static long delay;
     private static boolean enabled;
 
-    private final ConcurrentHashMap <String, NotificationWithServerTimeStamp<T>> problemItems;
-//    private final HashMap<String, NotificationWithServerTimeStamp<T>> nonProblemItems;
+    private final ConcurrentHashMap<String, NotificationWithServerTimeStamp<T>> problemItems;
+    //    private final HashMap<String, NotificationWithServerTimeStamp<T>> nonProblemItems;
     private final NotificationDelayedListener<T> timeoutListener;
 
     private final ScheduledExecutorService scheduler;
@@ -44,7 +44,7 @@
     public NotificationDelayFilter(String nodeName, NotificationDelayedListener<T> timeoutListener) {
         this.nodeName = nodeName;
         this.timeoutListener = timeoutListener;
-        this.problemItems = new ConcurrentHashMap <>();
+        this.problemItems = new ConcurrentHashMap<>();
         this.scheduler = Executors.newScheduledThreadPool(1);
         this.startTimer();
     }
@@ -67,6 +67,7 @@
 
     /**
      * If process the notification
+     * 
      * @return true if other processing is required, false if not
      */
     public boolean processNotification(@NonNull T notificationXml) {
@@ -86,6 +87,7 @@
 
     /**
      * Push notification with a specific severity (everything except non-alarmed)
+     * 
      * @param notification related notification
      */
     public void pushAlarmNotification(@NonNull T notification) {
@@ -94,13 +96,12 @@
             boolean cp = this.problemItems.containsKey(problemName);
             if (!cp) {
                 // no alarm in entries => create entry and push the alarm currently
-                NotificationWithServerTimeStamp<T> item = new NotificationWithServerTimeStamp<>(
-                        notification);
+                NotificationWithServerTimeStamp<T> item = new NotificationWithServerTimeStamp<>(notification);
                 LOG.debug("add event into list for node " + this.nodeName + " for alarm " + problemName + ": "
                         + item.toString());
                 this.problemItems.put(problemName, item);
                 if (this.timeoutListener != null) {
-                    this.timeoutListener.onNotificationDelay(this.nodeName,notification);
+                    this.timeoutListener.onNotificationDelay(this.nodeName, notification);
                 }
             } else {
                 LOG.debug("clear contra event for node " + this.nodeName + " for alarm " + problemName);
@@ -112,6 +113,7 @@
 
     /**
      * Push notification with severity non-alarmed
+     * 
      * @param notification related notification
      */
     public void clearAlarmNotification(@NonNull T notification) {
@@ -124,7 +126,7 @@
             } else {
                 // not in list => push directly through
                 if (this.timeoutListener != null) {
-                    this.timeoutListener.onNotificationDelay(this.nodeName,notification);
+                    this.timeoutListener.onNotificationDelay(this.nodeName, notification);
                 }
             }
         }
@@ -147,18 +149,18 @@
 
             synchronized (problemItems) {
 
-                for (Entry<String, NotificationWithServerTimeStamp<T>> entry : problemItems
-                        .entrySet()) {
+                for (Entry<String, NotificationWithServerTimeStamp<T>> entry : problemItems.entrySet()) {
                     NotificationWithServerTimeStamp<T> value = entry.getValue();
                     if (value.isStable(now)) {
                         // send contra Alarm if exists
                         if (value.getContraAlarmNotification() != null) {
                             if (this.timeoutListener != null) {
-                                this.timeoutListener.onNotificationDelay(this.nodeName,value.getContraAlarmNotification());
+                                this.timeoutListener.onNotificationDelay(this.nodeName,
+                                        value.getContraAlarmNotification());
                             }
                         }
                         problemItems.remove(entry.getKey());
-                        LOG.debug("removing entry for "+this.nodeName+" for alarm " + entry.getKey());
+                        LOG.debug("removing entry for " + this.nodeName + " for alarm " + entry.getKey());
                     } else {
                         LOG.trace("currently state is still unstable for alarm " + entry.getKey());
                     }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/NotificationDelayService.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/NotificationDelayService.java
index 1cbc8c2..ce92da0 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/NotificationDelayService.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/NotificationDelayService.java
@@ -26,7 +26,8 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class NotificationDelayService<T extends ToggleAlarmFilterable> implements DeviceManagerService, AutoCloseable, IConfigChangedListener {
+public class NotificationDelayService<T extends ToggleAlarmFilterable>
+        implements DeviceManagerService, AutoCloseable, IConfigChangedListener {
     private static final Logger LOG = LoggerFactory.getLogger(NotificationDelayService.class);
 
     private final HashMap<String, NotificationDelayFilter<T>> filters;
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/NotificationDelayedListener.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/NotificationDelayedListener.java
index a64a3b9..26402b2 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/NotificationDelayedListener.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/NotificationDelayedListener.java
@@ -19,7 +19,7 @@
 
 public interface NotificationDelayedListener<T> {
 
-	public void onNotificationDelay(String nodeName,T notification);
+    public void onNotificationDelay(String nodeName, T notification);
 
 }
 
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/NotificationWithServerTimeStamp.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/NotificationWithServerTimeStamp.java
index b3c8fb1..8e1bf91 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/NotificationWithServerTimeStamp.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/NotificationWithServerTimeStamp.java
@@ -31,13 +31,14 @@
         this.alarmNotification = n;
         this.contraAlarmNotification = null;
         this.timestamp = ts;
-        this.timestampStart=ts;
+        this.timestampStart = ts;
     }
 
     @SuppressWarnings("unused")
     public long getStartTime() {
         return this.timestampStart;
     }
+
     public void refresh() {
         this.refresh(System.currentTimeMillis());
     }
@@ -71,8 +72,7 @@
 
     @Override
     public String toString() {
-        return "NotificationWithServerTimeStamp [alarmNotification=" + alarmNotification
-                + ", contraAlarmNotification=" + contraAlarmNotification + ", timestampStart=" + timestampStart
-                + ", timestamp=" + timestamp + "]";
+        return "NotificationWithServerTimeStamp [alarmNotification=" + alarmNotification + ", contraAlarmNotification="
+                + contraAlarmNotification + ", timestampStart=" + timestampStart + ", timestamp=" + timestamp + "]";
     }
 }
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/ToggleAlarmFilterable.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/ToggleAlarmFilterable.java
index 9a865f0..0231201 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/ToggleAlarmFilterable.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/ToggleAlarmFilterable.java
@@ -24,8 +24,9 @@
 public interface ToggleAlarmFilterable {
 
 
-    /** Provide id for toggle alarm filter that is unique for the mountpoint/nodeId**/
+    /** Provide id for toggle alarm filter that is unique for the mountpoint/nodeId **/
     String getUuidForMountpoint();
+
     /** Provide indication if cleared **/
     boolean isCleared();
 
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/conf/ToggleAlarmConfig.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/conf/ToggleAlarmConfig.java
index 1bf59b6..3450e8c 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/conf/ToggleAlarmConfig.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/toggleAlarmFilter/conf/ToggleAlarmConfig.java
@@ -28,32 +28,33 @@
     private static final String PROPERTY_KEY_DELAY = "taDelay";
 
     private static final boolean DEFAULT_VALUE_ENABLED = true;
-    private static final long DEFAULT_VALUE_DELAY = 3000;  //in ms
+    private static final long DEFAULT_VALUE_DELAY = 3000; //in ms
 
-	private final ConfigurationFileRepresentation configuration;
+    private final ConfigurationFileRepresentation configuration;
 
     public ToggleAlarmConfig(ConfigurationFileRepresentation configuration) {
-		this.configuration = configuration;
-		this.configuration.addSection(SECTION_MARKER_TA);
-		defaults();
+        this.configuration = configuration;
+        this.configuration.addSection(SECTION_MARKER_TA);
+        defaults();
     }
 
     public boolean isEnabled() {
         return configuration.getPropertyBoolean(SECTION_MARKER_TA, PROPERTY_KEY_ENABLED);
     }
+
     public long getDelay() {
         return configuration.getPropertyLong(SECTION_MARKER_TA, PROPERTY_KEY_DELAY).orElse(DEFAULT_VALUE_DELAY);
     }
 
-	@Override
-	public String getSectionName() {
-		return SECTION_MARKER_TA;
-	}
+    @Override
+    public String getSectionName() {
+        return SECTION_MARKER_TA;
+    }
 
-	@Override
-	public void defaults() {
-		//Add default if not available
-		configuration.setPropertyIfNotAvailable(SECTION_MARKER_TA, PROPERTY_KEY_ENABLED, DEFAULT_VALUE_ENABLED);
-		configuration.setPropertyIfNotAvailable(SECTION_MARKER_TA, PROPERTY_KEY_DELAY, DEFAULT_VALUE_DELAY);
-	}
+    @Override
+    public void defaults() {
+        //Add default if not available
+        configuration.setPropertyIfNotAvailable(SECTION_MARKER_TA, PROPERTY_KEY_ENABLED, DEFAULT_VALUE_ENABLED);
+        configuration.setPropertyIfNotAvailable(SECTION_MARKER_TA, PROPERTY_KEY_DELAY, DEFAULT_VALUE_DELAY);
+    }
 }
diff --git a/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestAai.java b/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestAai.java
index 5528e1c..cc49ea9 100644
--- a/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestAai.java
+++ b/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestAai.java
@@ -50,228 +50,228 @@
 
 public class TestAai {
 
-	private static final String CONFIGURATIONTESTFILE = "test.properties"; // for
-	private static final String ENABLEDAAI_TESTCONFIG_FILENAME = "test2.properties";
-	private static final File ENABLEDAAI_TESTCONFIG_FILE = new File(ENABLEDAAI_TESTCONFIG_FILENAME);
-	private static final int AAI_SERVER_PORT = 45454;
-	private static final String TESTCONFIG_CONTENT = "[dcae]\n" + "dcaeUserCredentials=admin:admin\n" + "dcaeUrl=off\n"
-			+ "dcaeHeartbeatPeriodSeconds=120\n" + "dcaeTestCollector=no\n" + "\n" + "[aots]\n"
-			+ "userPassword=passwd\n" + "soapurladd=off\n" + "soapaddtimeout=10\n" + "soapinqtimeout=20\n"
-			+ "userName=user\n" + "inqtemplate=inqreq.tmpl.xml\n" + "assignedto=userid\n"
-			+ "addtemplate=addreq.tmpl.xml\n" + "severitypassthrough=critical,major,minor,warning\n"
-			+ "systemuser=user\n" + "prt-offset=1200\n" + "soapurlinq=off\n" + "#smtpHost=\n" + "#smtpPort=\n"
-			+ "#smtpUsername=\n" + "#smtpPassword=\n" + "#smtpSender=\n" + "#smtpReceivers=\n" + "\n" + "[es]\n"
-			+ "esCluster=sendateodl5\n" + "\n" + "[aai]\n" + "#keep comment\n"
-			+ "aaiHeaders=[\"X-TransactionId: 9999\"]\n" + "aaiUrl=http://localhost:" + AAI_SERVER_PORT + "\n"
-			+ "aaiUserCredentials=AAI:AAI\n" + "aaiDeleteOnMountpointRemove=true\n" + "aaiTrustAllCerts=false\n"
-			+ "aaiApiVersion=aai/v13\n" + "aaiPropertiesFile=aaiclient.properties\n" + "aaiApplicationId=SDNR\n"
-			+ "aaiPcks12ClientCertFile=/opt/logs/externals/data/stores/keystore.client.p12\n"
-			+ "aaiPcks12ClientCertPassphrase=adminadmin\n" + "aaiClientConnectionTimeout=30000\n" + "\n" + "[pm]\n"
-			+ "pmCluster=sendateodl5\n" + "pmEnabled=true\n" + "\n" + "";
-	
-	private static final String EXT_TEST_URL="https://testaai.onap.org:8443";
-	private static final String EXT_TEST_KEY="test.key";
-	private static final String EXT_TEST_PASSWD="test123";
-	private static final String EXT_TEST_APPLICATIONID="SDNC";
-	private static final long EXT_TEST_CONN_TIMEOUT=6000;
-	
-	
-	private static final CharSequence TESTCONFIG_CONTENT_EXT = "[aai]\n" + "#keep comment\n"
-			+ "aaiHeaders=[\"X-TransactionId: 9999\"]\n" + "aaiUrl=http://localhost:" + AAI_SERVER_PORT + "\n"
-			+ "aaiUserCredentials=AAI:AAI\n" + "aaiDeleteOnMountpointRemove=true\n" + "aaiTrustAllCerts=false\n"
-			+ "aaiApiVersion=aai/v13\n" + "aaiPropertiesFile=aaiclient.properties\n" +
-			//            "aaiApplicationId=SDNR\n" +
-			//            "aaiPcks12ClientCertFile=/opt/logs/externals/data/stores/keystore.client.p12\n" +
-			//            "aaiPcks12ClientCertPassphrase=adminadmin\n" +
-			//            "aaiClientConnectionTimeout=30000\n" +
-			"\n";
-	private static final CharSequence TESTCONFIG_CONTENT_EXT2 = "org.onap.ccsdk.sli.adaptors.aai.ssl.key="+EXT_TEST_KEY+"\n"
-			+ "org.onap.ccsdk.sli.adaptors.aai.ssl.key.psswd="+EXT_TEST_PASSWD+"\n"
-			+ "org.onap.ccsdk.sli.adaptors.aai.host.certificate.ignore=false\n"
-			+ "org.onap.ccsdk.sli.adaptors.aai.application="+EXT_TEST_APPLICATIONID+"\n"
-			+ "org.onap.ccsdk.sli.adaptors.aai.uri="+EXT_TEST_URL+"\n" 
-			+ "connection.timeout="+EXT_TEST_CONN_TIMEOUT+"\n";
-	private static HttpServer server;
-	private static ExecutorService httpThreadPool;
-	private static ConfigurationFileRepresentation globalCfg;
+    private static final String CONFIGURATIONTESTFILE = "test.properties"; // for
+    private static final String ENABLEDAAI_TESTCONFIG_FILENAME = "test2.properties";
+    private static final File ENABLEDAAI_TESTCONFIG_FILE = new File(ENABLEDAAI_TESTCONFIG_FILENAME);
+    private static final int AAI_SERVER_PORT = 45454;
+    private static final String TESTCONFIG_CONTENT = "[dcae]\n" + "dcaeUserCredentials=admin:admin\n" + "dcaeUrl=off\n"
+            + "dcaeHeartbeatPeriodSeconds=120\n" + "dcaeTestCollector=no\n" + "\n" + "[aots]\n"
+            + "userPassword=passwd\n" + "soapurladd=off\n" + "soapaddtimeout=10\n" + "soapinqtimeout=20\n"
+            + "userName=user\n" + "inqtemplate=inqreq.tmpl.xml\n" + "assignedto=userid\n"
+            + "addtemplate=addreq.tmpl.xml\n" + "severitypassthrough=critical,major,minor,warning\n"
+            + "systemuser=user\n" + "prt-offset=1200\n" + "soapurlinq=off\n" + "#smtpHost=\n" + "#smtpPort=\n"
+            + "#smtpUsername=\n" + "#smtpPassword=\n" + "#smtpSender=\n" + "#smtpReceivers=\n" + "\n" + "[es]\n"
+            + "esCluster=sendateodl5\n" + "\n" + "[aai]\n" + "#keep comment\n"
+            + "aaiHeaders=[\"X-TransactionId: 9999\"]\n" + "aaiUrl=http://localhost:" + AAI_SERVER_PORT + "\n"
+            + "aaiUserCredentials=AAI:AAI\n" + "aaiDeleteOnMountpointRemove=true\n" + "aaiTrustAllCerts=false\n"
+            + "aaiApiVersion=aai/v13\n" + "aaiPropertiesFile=aaiclient.properties\n" + "aaiApplicationId=SDNR\n"
+            + "aaiPcks12ClientCertFile=/opt/logs/externals/data/stores/keystore.client.p12\n"
+            + "aaiPcks12ClientCertPassphrase=adminadmin\n" + "aaiClientConnectionTimeout=30000\n" + "\n" + "[pm]\n"
+            + "pmCluster=sendateodl5\n" + "pmEnabled=true\n" + "\n" + "";
 
-	@Test
-	public void test() {
+    private static final String EXT_TEST_URL = "https://testaai.onap.org:8443";
+    private static final String EXT_TEST_KEY = "test.key";
+    private static final String EXT_TEST_PASSWD = "test123";
+    private static final String EXT_TEST_APPLICATIONID = "SDNC";
+    private static final long EXT_TEST_CONN_TIMEOUT = 6000;
 
-		String testConfigurationFileName = ResourceFileLoader.getFile(this, CONFIGURATIONTESTFILE).getAbsolutePath();
-		ConfigurationFileRepresentation cfg = new ConfigurationFileRepresentation(testConfigurationFileName);
 
-		AaiProviderClient provider = new AaiProviderClient(cfg, null);
+    private static final CharSequence TESTCONFIG_CONTENT_EXT = "[aai]\n" + "#keep comment\n"
+            + "aaiHeaders=[\"X-TransactionId: 9999\"]\n" + "aaiUrl=http://localhost:" + AAI_SERVER_PORT + "\n"
+            + "aaiUserCredentials=AAI:AAI\n" + "aaiDeleteOnMountpointRemove=true\n" + "aaiTrustAllCerts=false\n"
+            + "aaiApiVersion=aai/v13\n" + "aaiPropertiesFile=aaiclient.properties\n" +
+            //            "aaiApplicationId=SDNR\n" +
+            //            "aaiPcks12ClientCertFile=/opt/logs/externals/data/stores/keystore.client.p12\n" +
+            //            "aaiPcks12ClientCertPassphrase=adminadmin\n" +
+            //            "aaiClientConnectionTimeout=30000\n" +
+            "\n";
+    private static final CharSequence TESTCONFIG_CONTENT_EXT2 = "org.onap.ccsdk.sli.adaptors.aai.ssl.key="
+            + EXT_TEST_KEY + "\n" + "org.onap.ccsdk.sli.adaptors.aai.ssl.key.psswd=" + EXT_TEST_PASSWD + "\n"
+            + "org.onap.ccsdk.sli.adaptors.aai.host.certificate.ignore=false\n"
+            + "org.onap.ccsdk.sli.adaptors.aai.application=" + EXT_TEST_APPLICATIONID + "\n"
+            + "org.onap.ccsdk.sli.adaptors.aai.uri=" + EXT_TEST_URL + "\n" + "connection.timeout="
+            + EXT_TEST_CONN_TIMEOUT + "\n";
+    private static HttpServer server;
+    private static ExecutorService httpThreadPool;
+    private static ConfigurationFileRepresentation globalCfg;
 
-		String mountPointName = "testDevice 01";
-		String type = "Unit";
-		String model = "Horizon Compact+";
-		String vendor = "DragonWave-X";
-		String ipv4 = "127.0.0.1";
-		String ipv6 = "::1";
-		List<String> ifInfos = new ArrayList<>();
-		ifInfos.add("LP-MWPS-RADIO");
-		InventoryInformationDcae ii = new InventoryInformationDcae(type, model, vendor, ipv4, ipv6, ifInfos);
-		System.out.println("registering device");
-		provider.onDeviceRegistered(mountPointName, ii);
-		try {
-			Thread.sleep(5000);
-		} catch (InterruptedException e) {
-			e.printStackTrace();
-		}
-		System.out.println("unregistering device");
-		provider.onDeviceUnregistered(mountPointName);
-		System.out.println("finished");
-		try {
-			provider.close();
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
+    @Test
+    public void test() {
 
-	@Test
-	public void test2() {
-		try {
-			Thread.sleep(3000);
-		} catch (InterruptedException e1) {
-			e1.printStackTrace();
-		}
-		AaiProviderClient provider = new AaiProviderClient(globalCfg, null);
+        String testConfigurationFileName = ResourceFileLoader.getFile(this, CONFIGURATIONTESTFILE).getAbsolutePath();
+        ConfigurationFileRepresentation cfg = new ConfigurationFileRepresentation(testConfigurationFileName);
 
-		String mountPointName = "testDevice 01";
-		String type = "Unit";
-		String model = "Horizon Compact+";
-		String vendor = "DragonWave-X";
-		String ipv4 = "127.0.0.1";
-		String ipv6 = "::1";
-		List<String> ifInfos = new ArrayList<>();
-		ifInfos.add("LP-MWPS-RADIO");
-		InventoryInformationDcae ii = new InventoryInformationDcae(type, model, vendor, ipv4, ipv6, ifInfos);
-		System.out.println("registering device");
-		provider.onDeviceRegistered(mountPointName);
-		provider.onDeviceRegistered(mountPointName, ii);
-		try {
-			Thread.sleep(5000);
-		} catch (InterruptedException e) {
-			e.printStackTrace();
-		}
-		System.out.println("unregistering device");
-		provider.onDeviceUnregistered(mountPointName);
-		System.out.println("finished");
-		try {
-			provider.close();
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
+        AaiProviderClient provider = new AaiProviderClient(cfg, null);
 
-	@Test
-	public void testExtendedProperties() {
-		File testConfigurationFileName = new File("abbsads.properties");
-		File extfile = new File("aaiclient.properties");
-		if (testConfigurationFileName.exists()) {
-			testConfigurationFileName.delete();
-		}
-		if (extfile.exists()) {
-			extfile.delete();
-		}
-		try {
-			Files.asCharSink(testConfigurationFileName, StandardCharsets.UTF_8).write(TESTCONFIG_CONTENT_EXT);
-		} catch (IOException e) {
-			e.printStackTrace();
-			fail("problem writing a test config file: " + e.getMessage());
-		}
-		try {
-			Files.asCharSink(extfile, StandardCharsets.UTF_8).write(TESTCONFIG_CONTENT_EXT2);
-		} catch (IOException e) {
-			e.printStackTrace();
-			fail("problem writing a second test config file: " + e.getMessage());
-		}
+        String mountPointName = "testDevice 01";
+        String type = "Unit";
+        String model = "Horizon Compact+";
+        String vendor = "DragonWave-X";
+        String ipv4 = "127.0.0.1";
+        String ipv6 = "::1";
+        List<String> ifInfos = new ArrayList<>();
+        ifInfos.add("LP-MWPS-RADIO");
+        InventoryInformationDcae ii = new InventoryInformationDcae(type, model, vendor, ipv4, ipv6, ifInfos);
+        System.out.println("registering device");
+        provider.onDeviceRegistered(mountPointName, ii);
+        try {
+            Thread.sleep(5000);
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+        System.out.println("unregistering device");
+        provider.onDeviceUnregistered(mountPointName);
+        System.out.println("finished");
+        try {
+            provider.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
 
-		ConfigurationFileRepresentation cfg = new ConfigurationFileRepresentation(testConfigurationFileName);
-		AaiConfig config = new AaiConfig(cfg);
-		System.out.println(config.toString());
+    @Test
+    public void test2() {
+        try {
+            Thread.sleep(3000);
+        } catch (InterruptedException e1) {
+            e1.printStackTrace();
+        }
+        AaiProviderClient provider = new AaiProviderClient(globalCfg, null);
 
-		assertTrue(config.getBaseUrl().startsWith(EXT_TEST_URL));
-		assertEquals(EXT_TEST_KEY,config.getPcks12CertificateFilename());
-		assertEquals(EXT_TEST_PASSWD,config.getPcks12CertificatePassphrase());
-		assertEquals(EXT_TEST_APPLICATIONID,config.getHeaders().get("X-FromAppId"));
-		assertEquals(EXT_TEST_CONN_TIMEOUT,config.getConnectionTimeout());
-		
-		if (testConfigurationFileName.exists()) {
-			testConfigurationFileName.delete();
-		}
-		if (extfile.exists()) {
-			extfile.delete();
-		}
+        String mountPointName = "testDevice 01";
+        String type = "Unit";
+        String model = "Horizon Compact+";
+        String vendor = "DragonWave-X";
+        String ipv4 = "127.0.0.1";
+        String ipv6 = "::1";
+        List<String> ifInfos = new ArrayList<>();
+        ifInfos.add("LP-MWPS-RADIO");
+        InventoryInformationDcae ii = new InventoryInformationDcae(type, model, vendor, ipv4, ipv6, ifInfos);
+        System.out.println("registering device");
+        provider.onDeviceRegistered(mountPointName);
+        provider.onDeviceRegistered(mountPointName, ii);
+        try {
+            Thread.sleep(5000);
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+        System.out.println("unregistering device");
+        provider.onDeviceUnregistered(mountPointName);
+        System.out.println("finished");
+        try {
+            provider.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
 
-	}
+    @Test
+    public void testExtendedProperties() {
+        File testConfigurationFileName = new File("abbsads.properties");
+        File extfile = new File("aaiclient.properties");
+        if (testConfigurationFileName.exists()) {
+            testConfigurationFileName.delete();
+        }
+        if (extfile.exists()) {
+            extfile.delete();
+        }
+        try {
+            Files.asCharSink(testConfigurationFileName, StandardCharsets.UTF_8).write(TESTCONFIG_CONTENT_EXT);
+        } catch (IOException e) {
+            e.printStackTrace();
+            fail("problem writing a test config file: " + e.getMessage());
+        }
+        try {
+            Files.asCharSink(extfile, StandardCharsets.UTF_8).write(TESTCONFIG_CONTENT_EXT2);
+        } catch (IOException e) {
+            e.printStackTrace();
+            fail("problem writing a second test config file: " + e.getMessage());
+        }
 
-	@BeforeClass
-	public static void initAaiTestWebserver() throws IOException {
-		try {
-			Files.asCharSink(ENABLEDAAI_TESTCONFIG_FILE, StandardCharsets.UTF_8).write(TESTCONFIG_CONTENT);
-		} catch (IOException e1) {
-			fail(e1.getMessage());
-		}
-		//globalCfg=HtDevicemanagerConfiguration.getTestConfiguration(ENABLEDAAI_TESTCONFIG_FILENAME,true);
-		globalCfg = new ConfigurationFileRepresentation(ENABLEDAAI_TESTCONFIG_FILENAME);
-		server = HttpServer.create(new InetSocketAddress(AAI_SERVER_PORT), 0);
-		httpThreadPool = Executors.newFixedThreadPool(5);
-		server.setExecutor(httpThreadPool);
-		AaiConfig config = new AaiConfig(globalCfg);
-		server.createContext(config.getBaseUri(), new MyHandler());
-		//server.createContext("/", new MyRootHandler());
-		server.setExecutor(null); // creates a default executor
-		server.start();
-		System.out.println("http server started");
-	}
+        ConfigurationFileRepresentation cfg = new ConfigurationFileRepresentation(testConfigurationFileName);
+        AaiConfig config = new AaiConfig(cfg);
+        System.out.println(config.toString());
 
-	@AfterClass
-	public static void stopTestWebserver() {
-		if (server != null) {
-			server.stop(0);
-			httpThreadPool.shutdownNow();
-			System.out.println("http server stopped");
-		}
-		if (ENABLEDAAI_TESTCONFIG_FILE.exists()) {
-			ENABLEDAAI_TESTCONFIG_FILE.delete();
-		}
+        assertTrue(config.getBaseUrl().startsWith(EXT_TEST_URL));
+        assertEquals(EXT_TEST_KEY, config.getPcks12CertificateFilename());
+        assertEquals(EXT_TEST_PASSWD, config.getPcks12CertificatePassphrase());
+        assertEquals(EXT_TEST_APPLICATIONID, config.getHeaders().get("X-FromAppId"));
+        assertEquals(EXT_TEST_CONN_TIMEOUT, config.getConnectionTimeout());
 
-	}
+        if (testConfigurationFileName.exists()) {
+            testConfigurationFileName.delete();
+        }
+        if (extfile.exists()) {
+            extfile.delete();
+        }
 
-	static class MyHandler implements HttpHandler {
-		@Override
-		public void handle(HttpExchange t) throws IOException {
-			String method = t.getRequestMethod();
-			System.out.println("req method: " + method);
-			OutputStream os = null;
-			try {
-				String res = "";
-				if (method.equals("GET")) {
-					t.sendResponseHeaders(404, res.length());
-					os = t.getResponseBody();
-					os.write(res.getBytes());
-				} else if (method.equals("DELETE")) {
-					t.sendResponseHeaders(200, res.length());
-					os = t.getResponseBody();
-					os.write(res.getBytes());
-				} else if (method.equals("PUT")) {
-					t.sendResponseHeaders(200, res.length());
-					os = t.getResponseBody();
-					os.write(res.getBytes());
-				} else {
-					t.sendResponseHeaders(404, 0);
-				}
-				System.out.println("req handled successful");
+    }
 
-			} catch (Exception e) {
-				System.out.println(e.getMessage());
-			} finally {
-				if (os != null) {
-					os.close();
-				}
-			}
-		}
-	}
+    @BeforeClass
+    public static void initAaiTestWebserver() throws IOException {
+        try {
+            Files.asCharSink(ENABLEDAAI_TESTCONFIG_FILE, StandardCharsets.UTF_8).write(TESTCONFIG_CONTENT);
+        } catch (IOException e1) {
+            fail(e1.getMessage());
+        }
+        //globalCfg=HtDevicemanagerConfiguration.getTestConfiguration(ENABLEDAAI_TESTCONFIG_FILENAME,true);
+        globalCfg = new ConfigurationFileRepresentation(ENABLEDAAI_TESTCONFIG_FILENAME);
+        server = HttpServer.create(new InetSocketAddress(AAI_SERVER_PORT), 0);
+        httpThreadPool = Executors.newFixedThreadPool(5);
+        server.setExecutor(httpThreadPool);
+        AaiConfig config = new AaiConfig(globalCfg);
+        server.createContext(config.getBaseUri(), new MyHandler());
+        //server.createContext("/", new MyRootHandler());
+        server.setExecutor(null); // creates a default executor
+        server.start();
+        System.out.println("http server started");
+    }
+
+    @AfterClass
+    public static void stopTestWebserver() {
+        if (server != null) {
+            server.stop(0);
+            httpThreadPool.shutdownNow();
+            System.out.println("http server stopped");
+        }
+        if (ENABLEDAAI_TESTCONFIG_FILE.exists()) {
+            ENABLEDAAI_TESTCONFIG_FILE.delete();
+        }
+
+    }
+
+    static class MyHandler implements HttpHandler {
+        @Override
+        public void handle(HttpExchange t) throws IOException {
+            String method = t.getRequestMethod();
+            System.out.println("req method: " + method);
+            OutputStream os = null;
+            try {
+                String res = "";
+                if (method.equals("GET")) {
+                    t.sendResponseHeaders(404, res.length());
+                    os = t.getResponseBody();
+                    os.write(res.getBytes());
+                } else if (method.equals("DELETE")) {
+                    t.sendResponseHeaders(200, res.length());
+                    os = t.getResponseBody();
+                    os.write(res.getBytes());
+                } else if (method.equals("PUT")) {
+                    t.sendResponseHeaders(200, res.length());
+                    os = t.getResponseBody();
+                    os.write(res.getBytes());
+                } else {
+                    t.sendResponseHeaders(404, 0);
+                }
+                System.out.println("req handled successful");
+
+            } catch (Exception e) {
+                System.out.println(e.getMessage());
+            } finally {
+                if (os != null) {
+                    os.close();
+                }
+            }
+        }
+    }
 }
diff --git a/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestDcae.java b/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestDcae.java
index bba7d78..ff01f9a 100644
--- a/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestDcae.java
+++ b/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestDcae.java
@@ -51,56 +51,22 @@
 
     private static final String ENABLEDDCAE_TESTCONFIG_FILENAME = "test2.properties";
     private static final File ENABLEDDCAE_TESTCONFIG_FILE = new File(ENABLEDDCAE_TESTCONFIG_FILENAME);
-    private static final int DCAE_SERVER_PORT=45451;
+    private static final int DCAE_SERVER_PORT = 45451;
     private static final String URI = "/abc";
-    private static final String TESTCONFIG_CONTENT="[dcae]\n" +
-            "dcaeUserCredentials=admin:admin\n" +
-            "dcaeUrl=http://localhost:"+DCAE_SERVER_PORT+URI+"\n" +
-            "dcaeHeartbeatPeriodSeconds=120\n" +
-            "dcaeTestCollector=no\n" +
-            "\n" +
-            "[aots]\n" +
-            "userPassword=passwd\n" +
-            "soapurladd=off\n" +
-            "soapaddtimeout=10\n" +
-            "soapinqtimeout=20\n" +
-            "userName=user\n" +
-            "inqtemplate=inqreq.tmpl.xml\n" +
-            "assignedto=userid\n" +
-            "addtemplate=addreq.tmpl.xml\n" +
-            "severitypassthrough=critical,major,minor,warning\n" +
-            "systemuser=user\n" +
-            "prt-offset=1200\n" +
-            "soapurlinq=off\n" +
-            "#smtpHost=\n" +
-            "#smtpPort=\n" +
-            "#smtpUsername=\n" +
-            "#smtpPassword=\n" +
-            "#smtpSender=\n" +
-            "#smtpReceivers=\n" +
-            "\n" +
-            "[es]\n" +
-            "esCluster=sendateodl5\n" +
-            "\n" +
-            "[aai]\n" +
-            "#keep comment\n" +
-            "aaiHeaders=[\"X-TransactionId: 9999\"]\n" +
-            "aaiUrl=off\n" +
-            "aaiUserCredentials=AAI:AAI\n" +
-            "aaiDeleteOnMountpointRemove=true\n" +
-            "aaiTrustAllCerts=false\n" +
-            "aaiApiVersion=aai/v13\n" +
-            "aaiPropertiesFile=aaiclient.properties\n" +
-            "aaiApplicationId=SDNR\n" +
-            "aaiPcks12ClientCertFile=/opt/logs/externals/data/stores/keystore.client.p12\n" +
-            "aaiPcks12ClientCertPassphrase=adminadmin\n" +
-            "aaiClientConnectionTimeout=30000\n" +
-            "\n" +
-            "[pm]\n" +
-            "pmCluster=sendateodl5\n" +
-            "pmEnabled=true\n" +
-            "\n" +
-            "";
+    private static final String TESTCONFIG_CONTENT = "[dcae]\n" + "dcaeUserCredentials=admin:admin\n"
+            + "dcaeUrl=http://localhost:" + DCAE_SERVER_PORT + URI + "\n" + "dcaeHeartbeatPeriodSeconds=120\n"
+            + "dcaeTestCollector=no\n" + "\n" + "[aots]\n" + "userPassword=passwd\n" + "soapurladd=off\n"
+            + "soapaddtimeout=10\n" + "soapinqtimeout=20\n" + "userName=user\n" + "inqtemplate=inqreq.tmpl.xml\n"
+            + "assignedto=userid\n" + "addtemplate=addreq.tmpl.xml\n"
+            + "severitypassthrough=critical,major,minor,warning\n" + "systemuser=user\n" + "prt-offset=1200\n"
+            + "soapurlinq=off\n" + "#smtpHost=\n" + "#smtpPort=\n" + "#smtpUsername=\n" + "#smtpPassword=\n"
+            + "#smtpSender=\n" + "#smtpReceivers=\n" + "\n" + "[es]\n" + "esCluster=sendateodl5\n" + "\n" + "[aai]\n"
+            + "#keep comment\n" + "aaiHeaders=[\"X-TransactionId: 9999\"]\n" + "aaiUrl=off\n"
+            + "aaiUserCredentials=AAI:AAI\n" + "aaiDeleteOnMountpointRemove=true\n" + "aaiTrustAllCerts=false\n"
+            + "aaiApiVersion=aai/v13\n" + "aaiPropertiesFile=aaiclient.properties\n" + "aaiApplicationId=SDNR\n"
+            + "aaiPcks12ClientCertFile=/opt/logs/externals/data/stores/keystore.client.p12\n"
+            + "aaiPcks12ClientCertPassphrase=adminadmin\n" + "aaiClientConnectionTimeout=30000\n" + "\n" + "[pm]\n"
+            + "pmCluster=sendateodl5\n" + "pmEnabled=true\n" + "\n" + "";
     private HttpServer server;
     private ExecutorService httpThreadPool;
     private ConfigurationFileRepresentation cfg;
@@ -112,20 +78,21 @@
         } catch (InterruptedException e1) {
             e1.printStackTrace();
         }
-        DcaeProviderClient provider = new DcaeProviderClient(cfg,"mountpoint",null);
+        DcaeProviderClient provider = new DcaeProviderClient(cfg, "mountpoint", null);
 
         String mountPointName = "testDevice 01";
-        String type="Unit";
-        String model="Horizon Compact+";
-        String vendor="DragonWave-X";
-        String ipv4="127.0.0.1";
-        String ipv6="::1";
+        String type = "Unit";
+        String model = "Horizon Compact+";
+        String vendor = "DragonWave-X";
+        String ipv4 = "127.0.0.1";
+        String ipv6 = "::1";
         List<String> ifInfos = new ArrayList<>();
         ifInfos.add("LP-MWPS-RADIO");
         new InventoryInformationDcae(type, model, vendor, ipv4, ipv6, ifInfos);
         System.out.println("registering device");
         boolean neDeviceAlarm = false;
-        ProblemNotificationXml notification = new ProblemNotificationXml(mountPointName, "network-element", "problemName", InternalSeverity.Critical,123, InternalDateAndTime.getTestpattern());
+        ProblemNotificationXml notification = new ProblemNotificationXml(mountPointName, "network-element",
+                "problemName", InternalSeverity.Critical, 123, InternalDateAndTime.getTestpattern());
         provider.sendProblemNotification(mountPointName, notification, neDeviceAlarm);
 
         try {
diff --git a/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestDevMgrPropertiesFile.java b/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestDevMgrPropertiesFile.java
index ebcd513..9b533b5 100644
--- a/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestDevMgrPropertiesFile.java
+++ b/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestDevMgrPropertiesFile.java
@@ -23,11 +23,10 @@
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
-
+import com.google.common.io.Files;
 import java.io.File;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
-
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -40,14 +39,12 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.io.Files;
-
 public class TestDevMgrPropertiesFile {
 
     private static final Logger LOG = LoggerFactory.getLogger(ArchiveCleanService.class);
 
     private static final File FILENAME = new File("testdevmgrpropertiesfile.properties");
-    private static final File AAIPROP_FILE=new File("testdevmgrpropertiesfileaaiclient.properties");
+    private static final File AAIPROP_FILE = new File("testdevmgrpropertiesfileaaiclient.properties");
     private int hasChanged;
 
     @Before
@@ -55,6 +52,7 @@
         delete(FILENAME);
         delete(AAIPROP_FILE);
     }
+
     @After
     public void deinit() {
         this.init();
@@ -94,7 +92,7 @@
         hasChanged = 0;
         cfg2.registerConfigChangedListener(() -> {
             hasChanged++;
-            LOG.info("file changed listener triggered: {}",hasChanged);
+            LOG.info("file changed listener triggered: {}", hasChanged);
         });
 
         AaiConfig aaiConfig = new AaiConfig(cfg2);
@@ -106,17 +104,17 @@
         ToggleAlarmConfig toggleAlarmConfig = new ToggleAlarmConfig(cfg2);
         assertNotNull(toggleAlarmConfig);
 
-        LOG.info("Write new content. Changes {}",hasChanged);
+        LOG.info("Write new content. Changes {}", hasChanged);
         writeFile(FILENAME, this.getContent2());
 
-        int i=10;
-        while(hasChanged == 0 && i-- > 0) {
+        int i = 10;
+        while (hasChanged == 0 && i-- > 0) {
             LOG.info("Wait for Change indication.");
             sleep(1000);
         }
-        LOG.info("Changes {}",hasChanged);
+        LOG.info("Changes {}", hasChanged);
 
-        assertTrue("fileChanged counter "+hasChanged, hasChanged > 0);
+        assertTrue("fileChanged counter " + hasChanged, hasChanged > 0);
         LOG.info("Test done");
 
     }
@@ -130,22 +128,23 @@
     }
 
     public static void writeFile(File f, String content) {
-         try {
+        try {
             Files.asCharSink(f, StandardCharsets.UTF_8).write(content);
         } catch (IOException e) {
             fail(e.getMessage());
-        };
+        } ;
         sleep(500);
     }
 
     private void delete(File f) {
-        if(f.exists()) {
+        if (f.exists()) {
             f.delete();
         }
     }
 
 
     private String getContent2() {
+        // @formatter:off
         return "[dcae]\n" +
                 "dcaeUserCredentials=admin:admin\n" +
                 "dcaeUrl=http://localhost:45451/abc\n" +
@@ -196,9 +195,11 @@
                 "taEnabled=true\n" +
                 "taDelay=5555\n" +
                 "";
+        // @formatter:on
     }
 
     private String getContent1() {
+        // @formatter:off
         return "[dcae]\n" +
                 "dcaeUserCredentials=admin:admin\n" +
                 "dcaeUrl=http://localhost:45/abc\n" +
@@ -245,8 +246,11 @@
                 "taEnabled=false\n" +
                 "taDelay=5555\n" +
                 "";
+        // @formatter:on
     }
+
     private String getAaiPropertiesConfig() {
+        // @formatter:off
         return "org.onap.ccsdk.sli.adaptors.aai.ssl.key=keykey\"\"\n" +
                 "org.onap.ccsdk.sli.adaptors.aai.ssl.key.psswd=psswdpsswd\"\"\n" +
                 "org.onap.ccsdk.sli.adaptors.aai.host.certificate.ignore=\"false\"\n" +
@@ -254,6 +258,7 @@
                 "org.onap.ccsdk.sli.adaptors.aai.uri=uriu\"\"\n" +
                 "connection.timeout=60000\n" +
                 "read.timeout=60000";
+        // @formatter:on
     }
 
 }
diff --git a/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestDeviceMonitor.java b/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestDeviceMonitor.java
index fe0e37a..0dbac34 100644
--- a/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestDeviceMonitor.java
+++ b/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestDeviceMonitor.java
@@ -70,7 +70,7 @@
         deviceMonitor.close();
         File f = new File(CONFIGURATIONTESTFILE);
         if (f.exists())
-        	f.delete();
+            f.delete();
     }
 
 }
diff --git a/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestDevicemanager.java b/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestDevicemanager.java
index 03dfd76..33373fb 100644
--- a/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestDevicemanager.java
+++ b/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestDevicemanager.java
@@ -80,12 +80,14 @@
         @SuppressWarnings("unchecked")
         ListenerRegistration<NetconfNodeConnectListener> lr1 = mock(ListenerRegistration.class);
         //doNothing().when(lr1).close();
-        when(netconfNodeStateService.registerNetconfNodeConnectListener(mock(NetconfNodeConnectListener.class))).thenReturn(lr1);
+        when(netconfNodeStateService.registerNetconfNodeConnectListener(mock(NetconfNodeConnectListener.class)))
+                .thenReturn(lr1);
 
         @SuppressWarnings("unchecked")
         ListenerRegistration<NetconfNodeStateListener> lr2 = mock(ListenerRegistration.class);
         //doNothing().when(lr2).close();
-        when(netconfNodeStateService.registerNetconfNodeStateListener(mock(NetconfNodeStateListener.class))).thenReturn(lr2);
+        when(netconfNodeStateService.registerNetconfNodeStateListener(mock(NetconfNodeStateListener.class)))
+                .thenReturn(lr2);
 
         WebsocketmanagerService websocketmanagerService = mock(WebsocketmanagerService.class);
 
@@ -113,7 +115,7 @@
 
         deviceManager.init();
 
-        apiService  = rpcProviderRegistry.getDeviceManagerApiService();
+        apiService = rpcProviderRegistry.getDeviceManagerApiService();
 
     }
 
@@ -129,7 +131,8 @@
 
         n.creationNotification(new NodeId("NodeTest1"), 1, InternalDateAndTime.getTestpatternDateAndTime(), "ObjTest1");
 
-        n.changeNotification(new NodeId("NodeTest1"), 2, InternalDateAndTime.getTestpatternDateAndTime(), "ObjTest1", "AtrributeTest1", "NewTest1");
+        n.changeNotification(new NodeId("NodeTest1"), 2, InternalDateAndTime.getTestpatternDateAndTime(), "ObjTest1",
+                "AtrributeTest1", "NewTest1");
 
         n.deletionNotification(new NodeId("NodeTest1"), 3, InternalDateAndTime.getTestpatternDateAndTime(), "ObjTest1");
 
@@ -140,9 +143,7 @@
         log.info("testFaultNotification");
 
         MaintenanceBuilder mb = new MaintenanceBuilder();
-        when(htDataBaseMaintenance
-                .getMaintenance(""))
-                    .thenReturn(mb.build());
+        when(htDataBaseMaintenance.getMaintenance("")).thenReturn(mb.build());
 
         FaultService n = deviceManager.getFaultService();
         FaultlogBuilder faultLogEntityBuilder = new FaultlogBuilder();
diff --git a/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestMaintenanceTimeFilter.java b/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestMaintenanceTimeFilter.java
index 5bef21e..1102e91 100644
--- a/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestMaintenanceTimeFilter.java
+++ b/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestMaintenanceTimeFilter.java
@@ -30,8 +30,10 @@
 
 public class TestMaintenanceTimeFilter {
 
-    private static String DEFAULT1 = "EsMaintenanceFilter [start=1970-01-01T00:00Z[UTC], end=1970-01-01T00:00Z[UTC], definition=EsMaintenanceFilterDefinition [objectIdRef=, problem=], description=]";
-    private static String DEFAULT2 = "EsMaintenanceFilter [start=1970-01-01T00:00Z[UTC], end=2018-01-01T10:00+05:00, definition=EsMaintenanceFilterDefinition [objectIdRef=, problem=], description=]";
+    private static String DEFAULT1 =
+            "EsMaintenanceFilter [start=1970-01-01T00:00Z[UTC], end=1970-01-01T00:00Z[UTC], definition=EsMaintenanceFilterDefinition [objectIdRef=, problem=], description=]";
+    private static String DEFAULT2 =
+            "EsMaintenanceFilter [start=1970-01-01T00:00Z[UTC], end=2018-01-01T10:00+05:00, definition=EsMaintenanceFilterDefinition [objectIdRef=, problem=], description=]";
 
     @Test
     public void testBasic() {
@@ -50,7 +52,7 @@
         now = ZonedDateTime.parse("2018-05-01T10:00:00+05:00");
         res = MaintenanceCalculator.isInPeriod(start, end, now);
         System.out.println("Within: " + res);
-        assertTrue("within period",res);
+        assertTrue("within period", res);
 
         now = ZonedDateTime.parse("2019-05-01T10:00:00+05:00");
         res = MaintenanceCalculator.isInPeriod(start, end, now);
@@ -76,11 +78,11 @@
 
         now = MaintenanceCalculator.valueOf("2000-01-01T00:00Z");
         res = MaintenanceCalculator.isONFObjectInMaintenance(mb.build(), "Interface1", "Problem1", now);
-        assertTrue("within period",res);
+        assertTrue("within period", res);
 
         now = MaintenanceCalculator.valueOf("2002-01-01T00:00Z");
         res = MaintenanceCalculator.isONFObjectInMaintenance(mb.build(), "", "", now);
-        assertFalse("outside period",res);
+        assertFalse("outside period", res);
 
     }
 
diff --git a/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestNameSpace.java b/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestNameSpace.java
index f134012..bee1aca 100644
--- a/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestNameSpace.java
+++ b/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestNameSpace.java
@@ -28,18 +28,19 @@
 public class TestNameSpace {
 
     private static final String QNAME_COREMODEL_NAMESPACE = "urn:onf:params:xml:ns:yang:core-model";
-    private static final QName QNAME_COREMODEL = QName.create(QNAME_COREMODEL_NAMESPACE, "2017-03-20", "core-model").intern();
+    private static final QName QNAME_COREMODEL =
+            QName.create(QNAME_COREMODEL_NAMESPACE, "2017-03-20", "core-model").intern();
 
     @Test
     public void test() throws URISyntaxException {
 
         QName qname = QName.create("(urn:o-ran:hardware:1.0?revision=2019-03-28)o-ran-hardware");
 
-        System.out.println("QName getNamespace"+qname.getNamespace());
-        assertEquals(qname.getNamespace().toString(),"urn:o-ran:hardware:1.0");
+        System.out.println("QName getNamespace" + qname.getNamespace());
+        assertEquals(qname.getNamespace().toString(), "urn:o-ran:hardware:1.0");
 
-        System.out.println("QName getRevision"+qname.getRevision());
-        assertEquals(qname.getRevision().get().toString(),"2019-03-28");
+        System.out.println("QName getRevision" + qname.getRevision());
+        assertEquals(qname.getRevision().get().toString(), "2019-03-28");
 
         System.out.println(QNAME_COREMODEL.getNamespace().toString());
         assertEquals(QNAME_COREMODEL.getNamespace().toString(), QNAME_COREMODEL_NAMESPACE);
diff --git a/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestXmlNotification.java b/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestXmlNotification.java
index c900397..eab30a0 100644
--- a/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestXmlNotification.java
+++ b/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestXmlNotification.java
@@ -58,13 +58,13 @@
     public void testNoAlarm() {
 
         ProblemNotificationXml notification;
-        notification = new ProblemNotificationXml("TestMointpoint", "network-element",
-                "problemName", InternalSeverity.Critical, 123, InternalDateAndTime.getTestpattern());
+        notification = new ProblemNotificationXml("TestMointpoint", "network-element", "problemName",
+                InternalSeverity.Critical, 123, InternalDateAndTime.getTestpattern());
 
         assertFalse("Critical", notification.isNoAlarmIndication());
 
-        notification = new ProblemNotificationXml("TestMointpoint", "network-element",
-                "problemName", InternalSeverity.NonAlarmed, 123, InternalDateAndTime.getTestpattern());
+        notification = new ProblemNotificationXml("TestMointpoint", "network-element", "problemName",
+                InternalSeverity.NonAlarmed, 123, InternalDateAndTime.getTestpattern());
 
         assertTrue("NonAlarm", notification.isNoAlarmIndication());
 
@@ -74,7 +74,8 @@
     public void testObjectCreationNotification() {
 
         ObjectCreationNotificationXml notification;
-        notification = new ObjectCreationNotificationXml("TestMointpoint1", 1, InternalDateAndTime.getTestpattern(), "Id1");
+        notification =
+                new ObjectCreationNotificationXml("TestMointpoint1", 1, InternalDateAndTime.getTestpattern(), "Id1");
 
     }
 
@@ -82,7 +83,8 @@
     public void testDeletionCreationNotification() {
 
         ObjectDeletionNotificationXml notification;
-        notification = new ObjectDeletionNotificationXml("TestMointpoint2", 2, InternalDateAndTime.getTestpattern(), "Id2");
+        notification =
+                new ObjectDeletionNotificationXml("TestMointpoint2", 2, InternalDateAndTime.getTestpattern(), "Id2");
 
     }
 
diff --git a/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestsNectconfDateTime.java b/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestsNectconfDateTime.java
index 6cbb561..62f440a 100644
--- a/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestsNectconfDateTime.java
+++ b/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/TestsNectconfDateTime.java
@@ -31,19 +31,10 @@
 
 public class TestsNectconfDateTime {
 
-    private static String[] testPatterPostive = {
-            "2017-01-18T11:44:49.482-0500",
-            "2017-01-18T11:44:49.482-05:00",
-            "20170118114449.123Z",
-            "20170118114449.1Z",
-            "20170118114449.1-0500",
-            "2017-01-23T13:32:38-05:00",
-            "2017-01-23T13:32-05:00",
-            "2017-01-18T11:44:49Z"
-    };
-    private static String[] testPatterProblem = {
-            "2017-01-18T11:44:49"
-    };
+    private static String[] testPatterPostive = {"2017-01-18T11:44:49.482-0500", "2017-01-18T11:44:49.482-05:00",
+            "20170118114449.123Z", "20170118114449.1Z", "20170118114449.1-0500", "2017-01-23T13:32:38-05:00",
+            "2017-01-23T13:32-05:00", "2017-01-18T11:44:49Z"};
+    private static String[] testPatterProblem = {"2017-01-18T11:44:49"};
 
 
     private final static NetconfTimeStampOld netconfTimeConverterOld = NetconfTimeStampOld.getConverter();
@@ -58,24 +49,24 @@
             timeNew = netconfTimeConverterNew.getTimeStampFromNetconf(testTime);
             timeOld = netconfTimeConverterOld.getTimeStampFromNetconf(testTime);
 
-            System.out.println("No "+t+++" Pattern: "+testTime);
-            System.out.println(" to old "+timeOld);
-            System.out.println(" to new "+timeNew);
+            System.out.println("No " + t++ + " Pattern: " + testTime);
+            System.out.println(" to old " + timeOld);
+            System.out.println(" to new " + timeNew);
             System.out.println();
 
-            assertTrue("Old/New implementation not same "+timeOld+"/"+timeNew, timeOld.equals(timeNew));
+            assertTrue("Old/New implementation not same " + timeOld + "/" + timeNew, timeOld.equals(timeNew));
         }
 
         for (String testTime : testPatterProblem) {
             timeNew = netconfTimeConverterNew.getTimeStampFromNetconf(testTime);
             timeOld = netconfTimeConverterOld.getTimeStampFromNetconf(testTime);
 
-            System.out.println("No "+t+++" Pattern: "+testTime);
-            System.out.println(" to old "+timeOld);
-            System.out.println(" to new "+timeNew);
+            System.out.println("No " + t++ + " Pattern: " + testTime);
+            System.out.println(" to old " + timeOld);
+            System.out.println(" to new " + timeNew);
             System.out.println();
 
-            assertTrue("Old/New implementation not same "+timeOld+"/"+timeNew, timeOld.equals(timeNew));
+            assertTrue("Old/New implementation not same " + timeOld + "/" + timeNew, timeOld.equals(timeNew));
         }
     }
 
@@ -88,12 +79,12 @@
             timeNew = netconfTimeConverterNew.getTimeStampFromNetconfAsMilliseconds(testTime);
             timeOld = netconfTimeConverterOld.getTimeStampFromNetconfAsMilliseconds(testTime);
 
-            System.out.println("No "+t+++" Pattern: "+testTime);
-            System.out.println(" to old "+timeOld);
-            System.out.println(" to new "+timeNew);
+            System.out.println("No " + t++ + " Pattern: " + testTime);
+            System.out.println(" to old " + timeOld);
+            System.out.println(" to new " + timeNew);
             System.out.println();
 
-            assertTrue("Old/New implementation not same "+timeOld+"/"+timeNew, timeOld.equals(timeNew));
+            assertTrue("Old/New implementation not same " + timeOld + "/" + timeNew, timeOld.equals(timeNew));
         }
 
     }
@@ -106,9 +97,9 @@
         String timeNew = netconfTimeConverterNew.getTimeStampAsNetconfString(now);
         String timeOld = netconfTimeConverterOld.getTimeStampAsNetconfString(now);
 
-        System.out.println("Old/New: "+timeOld+"/"+timeNew);
+        System.out.println("Old/New: " + timeOld + "/" + timeNew);
 
-        assertTrue("Old/New implementation not same "+timeOld+"/"+timeNew, timeOld.equals(timeNew));
+        assertTrue("Old/New implementation not same " + timeOld + "/" + timeNew, timeOld.equals(timeNew));
 
 
     }
diff --git a/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/mock/RpcProviderServiceMock.java b/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/mock/RpcProviderServiceMock.java
index b05f776..14484d0 100644
--- a/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/mock/RpcProviderServiceMock.java
+++ b/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/mock/RpcProviderServiceMock.java
@@ -34,9 +34,9 @@
     @Override
     public <S extends RpcService, T extends S> ObjectRegistration<T> registerRpcImplementation(Class<S> type,
             T implementation) {
-        System.out.println("Register class "+implementation);
+        System.out.println("Register class " + implementation);
         if (implementation instanceof DevicemanagerService) {
-            deviceManagerApi = (DevicemanagerService)implementation;
+            deviceManagerApi = (DevicemanagerService) implementation;
         }
         return null;
     }
diff --git a/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/util/NetconfTimeStampOld.java b/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/util/NetconfTimeStampOld.java
index c2bd1fb..104ad03 100644
--- a/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/util/NetconfTimeStampOld.java
+++ b/sdnr/wt/devicemanager/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/test/util/NetconfTimeStampOld.java
@@ -37,32 +37,25 @@
  * Format2 NETCONF - pattern from ietf-yang-types "2013-07-15" Pattern:
  * "\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[\+\-](\d{2}):(\d{2}))"
  *
- * Format3 NETCONF DateAndTime CoreModel-CoreFoundationModule-TypeDefinitions vom
- * 2016-07-01 Example1: 20170118114449.1Z Example2: 20170118114449.1-0500 Pattern:
- * "\d{4}\d{2}\d{2}\d{2}\d{2}\d{2}.\d+?(Z|[\+\-](\d{2})(\d{2}))" typedef DateAndTime { description
- * "This primitive type defines the date and time according to the following structure:
- * 'yyyyMMddhhmmss.s[Z|{+|-}HHMm]' where: yyyy '0000'..'9999' year MM '01'..'12' month dd '01'..'31'
- * day hh '00'..'23' hour mm '00'..'59' minute ss '00'..'59' second s '.0'..'.9' tenth of second
- * (set to '.0' if EMS or NE cannot support this granularity) Z 'Z' indicates UTC (rather than local
- * time) {+|-} '+' or '-' delta from UTC HH '00'..'23' time zone difference in hours Mm '00'..'59'
- * time zone difference in minutes."; type string; } Format4 E/// specific Example1:
- * 2017-01-23T13:32:38-05:00 Example2: 2017-01-23T13:32-05:00
+ * Format3 NETCONF DateAndTime CoreModel-CoreFoundationModule-TypeDefinitions vom 2016-07-01 Example1: 20170118114449.1Z
+ * Example2: 20170118114449.1-0500 Pattern: "\d{4}\d{2}\d{2}\d{2}\d{2}\d{2}.\d+?(Z|[\+\-](\d{2})(\d{2}))" typedef
+ * DateAndTime { description "This primitive type defines the date and time according to the following structure:
+ * 'yyyyMMddhhmmss.s[Z|{+|-}HHMm]' where: yyyy '0000'..'9999' year MM '01'..'12' month dd '01'..'31' day hh '00'..'23'
+ * hour mm '00'..'59' minute ss '00'..'59' second s '.0'..'.9' tenth of second (set to '.0' if EMS or NE cannot support
+ * this granularity) Z 'Z' indicates UTC (rather than local time) {+|-} '+' or '-' delta from UTC HH '00'..'23' time
+ * zone difference in hours Mm '00'..'59' time zone difference in minutes."; type string; } Format4 E/// specific
+ * Example1: 2017-01-23T13:32:38-05:00 Example2: 2017-01-23T13:32-05:00
  *
  * Input formats netconfTime as String according the formats given above
  *
  * Return format is String in ISO8601 Format for database and presentation.
  *
- * Example formats:
- *    1) ISO8601. Example 2017-01-18T11:44:49.482-05:00
- *    2) Microwave ONF. Examples 20170118114449.1Z, 20170118114449.1-0500
- *    3.1) Ericson. Example: 2017-01-23T13:32:38-05:00
- *    3.2) Ericson. Example: 2017-01-23T13:32-05:00
- *          Always 10 Groups,
- *          1:Year 2:Month 3:day 4:Hour 5:minute 6:optional sec 7:optional ms 8:optional Z or 9:offset
- *           signedhour 10:min
+ * Example formats: 1) ISO8601. Example 2017-01-18T11:44:49.482-05:00 2) Microwave ONF. Examples 20170118114449.1Z,
+ * 20170118114449.1-0500 3.1) Ericson. Example: 2017-01-23T13:32:38-05:00 3.2) Ericson. Example: 2017-01-23T13:32-05:00
+ * Always 10 Groups, 1:Year 2:Month 3:day 4:Hour 5:minute 6:optional sec 7:optional ms 8:optional Z or 9:offset
+ * signedhour 10:min
  *
- * Template:
- *     private static final NetconfTimeStamp NETCONFTIME_CONVERTER = NetconfTimeStamp.getConverter();
+ * Template: private static final NetconfTimeStamp NETCONFTIME_CONVERTER = NetconfTimeStamp.getConverter();
  */
 
 public class NetconfTimeStampOld {
@@ -75,7 +68,7 @@
     private static int MILLISECONDSDIGITS = 3; // Digits of milliseconds in dateFormatResult
     private static String MILLISECONDZEROS = "000"; // String with zeros for milliseconds in dateFormatResult
     private static final Pattern dateNetconfPatter = Pattern.compile(
-        "(\\d{4})-?(\\d{2})-?(\\d{2})T?(\\d{2}):?(\\d{2})(?:(?::?)(\\d{2}))?(?:.(\\d+))?(?:(Z)|([+-]\\d{2}):?(\\d{2}))");
+            "(\\d{4})-?(\\d{2})-?(\\d{2})T?(\\d{2}):?(\\d{2})(?:(?::?)(\\d{2}))?(?:.(\\d+))?(?:(Z)|([+-]\\d{2}):?(\\d{2}))");
 
     /*
      * ------------------------------------ Public function
@@ -84,11 +77,11 @@
     /**
      * Use static access
      */
-    private NetconfTimeStampOld() {
-    }
+    private NetconfTimeStampOld() {}
 
     /**
      * Use this function to get the converter
+     * 
      * @return global converter
      */
     public static NetconfTimeStampOld getConverter() {
@@ -106,12 +99,13 @@
 
     /**
      * Get actual timestamp as NETCONF specific type NETCONF/YANG 1.0 Format
-
+     * 
      * @return String with Date in NETCONF/YANG Format Version 1.0.
      */
     public String getTimeStampAsNetconfString(Date date) {
         return getRightFormattedDate(date.getTime());
     }
+
     /**
      * Get actual timestamp as NETCONF specific type NETCONF/YANG 1.0 Format in GMT
      *
@@ -123,6 +117,7 @@
 
     /**
      * Get time from date as NETCONF specific type NETCONF/YANG 1.0 Format in GMT
+     * 
      * @param date specifying the date and time
      * @return DateAndTime Type 1.0. Date in NETCONF/YANG Format Version 1.0.
      */
@@ -139,22 +134,21 @@
      * @throws IllegalArgumentException In case of no compliant time format definition for the string
      * @throws ParseException Time parsing failed
      */
-    public long getTimeStampFromNetconfAsMilliseconds(String netconfTime)
-            throws IllegalArgumentException {
+    public long getTimeStampFromNetconfAsMilliseconds(String netconfTime) throws IllegalArgumentException {
         Matcher m = dateNetconfPatter.matcher(netconfTime);
         // According to specified matches there have to be 10 parameter
         if (m.matches() && m.groupCount() == 10) {
             // Convert now
-        	synchronized(dateFormatConvert) {
-        		long utcMillis;
-				try {
-					utcMillis = dateFormatConvert.parse(getTimeAsNormalizedString(m, m.group(6), m.group(7))).getTime()
-					    - getTimezoneOffsetMilliseconds(m.group(9), m.group(10));
-	        		return utcMillis;
-				} catch (ParseException e) {
-		            throw new IllegalArgumentException("Parse problem for NETCONF data string: " + netconfTime);
-				}
-        	}
+            synchronized (dateFormatConvert) {
+                long utcMillis;
+                try {
+                    utcMillis = dateFormatConvert.parse(getTimeAsNormalizedString(m, m.group(6), m.group(7))).getTime()
+                            - getTimezoneOffsetMilliseconds(m.group(9), m.group(10));
+                    return utcMillis;
+                } catch (ParseException e) {
+                    throw new IllegalArgumentException("Parse problem for NETCONF data string: " + netconfTime);
+                }
+            }
         } else {
             throw new IllegalArgumentException("No pattern for NETCONF data string: " + netconfTime);
         }
@@ -164,8 +158,8 @@
      * Deliver String result.
      *
      * @param netconfTime as String according the formats given above
-     * @return If successful: String in ISO8601 Format for database and presentation. If "wrong formed
-     *         input" the Input string with the prefix "Mailformed date" is delivered back.
+     * @return If successful: String in ISO8601 Format for database and presentation. If "wrong formed input" the Input
+     *         string with the prefix "Mailformed date" is delivered back.
      */
     public String getTimeStampFromNetconf(String netconfTime) {
         Matcher m = dateNetconfPatter.matcher(netconfTime);
@@ -173,11 +167,12 @@
         if (m.matches() && m.groupCount() == 10) {
             // Convert now
             try {
-            	synchronized(dateFormatConvert) {
-	                long utcMillis = dateFormatConvert.parse(getTimeAsNormalizedString(m, m.group(6), m.group(7))).getTime()
-	                        - getTimezoneOffsetMilliseconds(m.group(9), m.group(10));
-	                return getRightFormattedDate(utcMillis);
-            	}
+                synchronized (dateFormatConvert) {
+                    long utcMillis =
+                            dateFormatConvert.parse(getTimeAsNormalizedString(m, m.group(6), m.group(7))).getTime()
+                                    - getTimezoneOffsetMilliseconds(m.group(9), m.group(10));
+                    return getRightFormattedDate(utcMillis);
+                }
             } catch (ParseException e) {
                 LOG.info(e.getMessage());
             } catch (IllegalArgumentException e) {
@@ -261,8 +256,8 @@
         long tenthOfSeconds = dateMillis % 1000 / 100L; // Extract 100 milliseconds
         long base = dateMillis / 1000L * 1000L; // Cut milliseconds to 000
         Date newDate = new Date(base + tenthOfSeconds);
-        synchronized(dateFormatResult) {
-        	return dateFormatResult.format(newDate);
+        synchronized (dateFormatResult) {
+            return dateFormatResult.format(newDate);
         }
     }
 
