aboutsummaryrefslogtreecommitdiffstats
path: root/adapters
diff options
context:
space:
mode:
Diffstat (limited to 'adapters')
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkRequestCommon.java11
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkResponseCommon.java12
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCEvent.java9
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCRequestCommon.java13
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCResponseCommon.java12
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantRequestCommon.java12
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVfModuleResponse.java8
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVolumeGroupResponse.java9
-rw-r--r--adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfResponseCommon.java12
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/db/migration/R__CloudConfigMigration.java19
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CvnfcCatalogDbQueryTest.java7
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/NetworkCollectionCatalogDbQueryTest.java35
-rw-r--r--adapters/mso-requests-db-adapter/src/main/resources/db/migration/V5.3.1__Watchdog_Lock_Version_Column.sql3
-rw-r--r--adapters/mso-requests-db-adapter/src/test/resources/db/migration/afterMigrate.sql8
14 files changed, 99 insertions, 71 deletions
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkRequestCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkRequestCommon.java
index 3d66da3a2d..5e4e015556 100644
--- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkRequestCommon.java
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkRequestCommon.java
@@ -4,6 +4,7 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
+ * Modifications Copyright (c) 2019 Samsung
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,19 +30,19 @@ import java.io.Serializable;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Marshaller;
-import org.onap.so.logger.MsoLogger;
-
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* Everything that is common between all Network Requests.
*/
public abstract class NetworkRequestCommon implements Serializable {
private static final long serialVersionUID = -6732431343649282079L;
- private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, NetworkRequestCommon.class);
+ private static final Logger logger = LoggerFactory.getLogger(NetworkRequestCommon.class);
private Boolean skipAAI = false;
private String messageId;
private String notificationUrl;
@@ -88,7 +89,7 @@ public abstract class NetworkRequestCommon implements Serializable {
mapper.enable(SerializationFeature.WRAP_ROOT_VALUE);
jsonString = mapper.writeValueAsString(this);
} catch (Exception e) {
- LOGGER.debug("Exception:", e);
+ logger.debug("Exception:", e);
}
return jsonString;
}
@@ -102,7 +103,7 @@ public abstract class NetworkRequestCommon implements Serializable {
marshaller.marshal(this, bs);
return bs.toString();
} catch (Exception e) {
- LOGGER.debug("Exception:", e);
+ logger.debug("Exception:", e);
return "";
}
}
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkResponseCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkResponseCommon.java
index d626f26aa6..d1907a237e 100644
--- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkResponseCommon.java
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/nwrest/NetworkResponseCommon.java
@@ -4,6 +4,7 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
+ * Modifications Copyright (c) 2019 Samsung
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,10 +30,11 @@ import java.io.Serializable;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Marshaller;
-import org.onap.so.logger.MsoLogger;
-
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* Everything that is common between all Volume Group Responses, except for QueryVolumeGroupResponse.
*/
@@ -40,7 +42,7 @@ public abstract class NetworkResponseCommon implements Serializable {
private static final long serialVersionUID = 1233520856935129726L;
private String messageId;
- private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, NetworkResponseCommon.class);
+ private static final Logger logger = LoggerFactory.getLogger(NetworkResponseCommon.class);
public NetworkResponseCommon() {
messageId = null;
@@ -65,7 +67,7 @@ public abstract class NetworkResponseCommon implements Serializable {
mapper.enable(SerializationFeature.WRAP_ROOT_VALUE);
jsonString = mapper.writeValueAsString(this);
} catch (Exception e) {
- LOGGER.debug("Exception:", e);
+ logger.debug("Exception:", e);
}
return jsonString;
}
@@ -79,7 +81,7 @@ public abstract class NetworkResponseCommon implements Serializable {
marshaller.marshal(this, bs);
return bs.toString();
} catch (Exception e) {
- LOGGER.debug("Exception:", e);
+ logger.debug("Exception:", e);
return "";
}
}
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCEvent.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCEvent.java
index 7d6aebdf16..f577fa9b59 100644
--- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCEvent.java
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCEvent.java
@@ -4,6 +4,7 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
+ * Modifications Copyright (c) 2019 Samsung
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,14 +30,14 @@ import java.util.Map;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
-import org.onap.so.logger.MsoLogger;
-
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
// NOTE: the JAXB (XML) annotations are required with JBoss AS7 and RESTEasy,
// even though we are using JSON exclusively. The @NoJackson annotation
@@ -53,7 +54,7 @@ import com.fasterxml.jackson.databind.SerializationFeature;
public class SDNCEvent implements Serializable {
private static final long serialVersionUID = 1L;
- private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, SDNCEvent.class);
+ private static final Logger logger = LoggerFactory.getLogger(SDNCEvent.class);
// Event type
private String eventType;
@@ -134,7 +135,7 @@ public class SDNCEvent implements Serializable {
mapper.setSerializationInclusion(Include.NON_NULL);
return mapper.writeValueAsString(this);
} catch (IOException e) {
- LOGGER.debug("Exception:", e);
+ logger.debug("Exception:", e);
throw new UnsupportedOperationException("Cannot convert "
+ getClass().getSimpleName() + " to JSON", e);
}
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCRequestCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCRequestCommon.java
index 9ddf55cc21..4080705551 100644
--- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCRequestCommon.java
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCRequestCommon.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -25,21 +27,22 @@ import java.io.Serializable;
import javax.xml.bind.annotation.XmlElement;
-import org.onap.so.logger.MsoLogger;
-
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* Base class for all SDNC adapter requests.
*/
public abstract class SDNCRequestCommon implements Serializable {
private static final long serialVersionUID = 1L;
- private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, SDNCRequestCommon.class);
+ private static final Logger logger = LoggerFactory.getLogger(SDNCRequestCommon.class);
// Endpoint on which BPMN can receive notifications from the SDNC adapter.
private String bpNotificationUrl;
@@ -107,9 +110,9 @@ public abstract class SDNCRequestCommon implements Serializable {
mapper.setSerializationInclusion(Include.NON_NULL);
return mapper.writeValueAsString(this);
} catch (IOException e) {
- LOGGER.debug("Exception:", e);
+ logger.debug("Exception:", e);
throw new UnsupportedOperationException("Cannot convert "
+ getClass().getSimpleName() + " to JSON", e);
}
}
-} \ No newline at end of file
+}
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCResponseCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCResponseCommon.java
index 2da94017ca..a7d14cce69 100644
--- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCResponseCommon.java
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/sdncrest/SDNCResponseCommon.java
@@ -4,6 +4,7 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
+ * Modifications Copyright (c) 2019 Samsung
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,20 +27,21 @@ import java.io.Serializable;
import javax.xml.bind.annotation.XmlElement;
-import org.onap.so.logger.MsoLogger;
-
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* Base class for all SDNC adapter responses, including errors.
*/
public abstract class SDNCResponseCommon implements Serializable {
private static final long serialVersionUID = 1L;
- private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, SDNCResponseCommon.class);
+ private static final Logger logger = LoggerFactory.getLogger(SDNCResponseCommon.class);
// Identifies the MSO transaction with SDNC.
private String sdncRequestId;
@@ -116,9 +118,9 @@ public abstract class SDNCResponseCommon implements Serializable {
mapper.setSerializationInclusion(Include.NON_NULL);
return mapper.writeValueAsString(this);
} catch (IOException e) {
- LOGGER.debug("Exception:", e);
+ logger.debug("Exception:", e);
throw new UnsupportedOperationException("Cannot convert "
+ getClass().getSimpleName() + " to JSON", e);
}
}
-} \ No newline at end of file
+}
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantRequestCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantRequestCommon.java
index 168200e477..7d629cb554 100644
--- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantRequestCommon.java
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/tenantrest/TenantRequestCommon.java
@@ -4,6 +4,7 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
+ * Modifications Copyright (c) 2019 Samsung
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,15 +29,16 @@ import java.io.Serializable;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Marshaller;
-import org.onap.so.logger.MsoLogger;
-
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
public abstract class TenantRequestCommon implements Serializable {
private static final long serialVersionUID = 1486834308868170854L;
- private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, TenantRequestCommon.class);
+ private static Logger logger = LoggerFactory.getLogger(TenantRequestCommon.class);
public String toJsonString() {
try {
String jsonString;
@@ -45,7 +47,7 @@ public abstract class TenantRequestCommon implements Serializable {
jsonString = mapper.writeValueAsString(this);
return jsonString;
} catch (Exception e) {
- LOGGER.debug("Exception :",e);
+ logger.debug("Exception :", e);
return "";
}
}
@@ -59,7 +61,7 @@ public abstract class TenantRequestCommon implements Serializable {
marshaller.marshal(this, bs);
return bs.toString();
} catch (Exception e) {
- LOGGER.debug("Exception :",e);
+ logger.debug("Exception :", e);
return "";
}
}
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVfModuleResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVfModuleResponse.java
index 0214d15ee8..3b480d8ea9 100644
--- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVfModuleResponse.java
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVfModuleResponse.java
@@ -4,6 +4,7 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
+ * Modifications Copyright (c) 2019 Samsung
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,16 +25,15 @@ package org.onap.so.adapters.vnfrest;
import java.util.Map;
import javax.xml.bind.annotation.XmlRootElement;
-
-import org.onap.so.logger.MsoLogger;
import org.onap.so.openstack.beans.VnfStatus;
-
import com.fasterxml.jackson.annotation.JsonRootName;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
@JsonRootName("queryVfModuleResponse")
@XmlRootElement(name = "queryVfModuleResponse")
public class QueryVfModuleResponse extends VfResponseCommon{
- private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, QueryVfModuleResponse.class);
+ private static final Logger logger = LoggerFactory.getLogger(QueryVfModuleResponse.class);
private String vnfId;
private String vfModuleId;
private String vfModuleStackId;
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVolumeGroupResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVolumeGroupResponse.java
index 6e8027c689..f15c62493a 100644
--- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVolumeGroupResponse.java
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/QueryVolumeGroupResponse.java
@@ -4,6 +4,7 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
+ * Modifications Copyright (c) 2019 Samsung
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,15 +27,17 @@ import java.util.Map;
import javax.xml.bind.annotation.XmlRootElement;
-import org.onap.so.logger.MsoLogger;
import org.onap.so.openstack.beans.VnfStatus;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
@XmlRootElement(name = "queryVolumeGroupResponse")
public class QueryVolumeGroupResponse {
- private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, QueryVolumeGroupResponse.class);
+ private static final Logger logger = LoggerFactory.getLogger(QueryVolumeGroupResponse.class);
private String volumeGroupId;
private String volumeGroupStackId;
private VnfStatus volumeGroupStatus;
@@ -96,7 +99,7 @@ public class QueryVolumeGroupResponse {
jsonString = mapper.writeValueAsString(this);
}
catch (Exception e) {
- LOGGER.debug("Exception :",e);
+ logger.debug("Exception :", e);
}
return jsonString;
}
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfResponseCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfResponseCommon.java
index 2828ac3d43..73414a370a 100644
--- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfResponseCommon.java
+++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/adapters/vnfrest/VfResponseCommon.java
@@ -4,6 +4,7 @@
* ================================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
* Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.
+ * Modifications Copyright (c) 2019 Samsung
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,17 +28,18 @@ import java.io.ByteArrayOutputStream;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Marshaller;
-import org.onap.so.logger.MsoLogger;
-
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
/**
* Everything that is common between all VfModule and VolumeGroup Responses,
* except for QueryVfModuleResponse and QueryVolumeGroupResponse.
*/
public abstract class VfResponseCommon {
- private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, VfResponseCommon.class);
+ private static final Logger logger = LoggerFactory.getLogger(VfResponseCommon.class);
private String messageId;
public VfResponseCommon() {
@@ -64,7 +66,7 @@ public abstract class VfResponseCommon {
jsonString = mapper.writeValueAsString(this);
return jsonString;
} catch (Exception e) {
- LOGGER.debug("Exception :",e);
+ logger.debug("Exception :",e);
return "";
}
}
@@ -78,7 +80,7 @@ public abstract class VfResponseCommon {
marshaller.marshal(this, bs);
return bs.toString();
} catch (Exception e) {
- LOGGER.debug("Exception :",e);
+ logger.debug("Exception :",e);
return "";
}
}
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/db/migration/R__CloudConfigMigration.java b/adapters/mso-catalog-db-adapter/src/main/java/db/migration/R__CloudConfigMigration.java
index 5acd8359ec..c20acaf967 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/db/migration/R__CloudConfigMigration.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/db/migration/R__CloudConfigMigration.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -31,7 +33,8 @@ import org.flywaydb.core.api.migration.jdbc.JdbcMigration;
import org.onap.so.db.catalog.beans.CloudIdentity;
import org.onap.so.db.catalog.beans.CloudSite;
import org.onap.so.db.catalog.beans.CloudifyManager;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.FileInputStream;
import java.io.IOException;
@@ -51,7 +54,7 @@ import java.util.Collection;
public class R__CloudConfigMigration implements JdbcMigration , MigrationInfoProvider, MigrationChecksumProvider {
public static final String FLYWAY = "FLYWAY";
- private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA, R__CloudConfigMigration.class);
+ private static final Logger logger = LoggerFactory.getLogger(R__CloudConfigMigration.class);
@JsonProperty("cloud_config")
private CloudConfig cloudConfig;
@@ -62,7 +65,7 @@ public class R__CloudConfigMigration implements JdbcMigration , MigrationInfoPro
@Override
public void migrate(Connection connection) throws Exception {
- LOGGER.debug("Starting migration for CloudConfig");
+ logger.debug("Starting migration for CloudConfig");
CloudConfig cloudConfig = null;
@@ -87,12 +90,12 @@ public class R__CloudConfigMigration implements JdbcMigration , MigrationInfoPro
try (InputStream stream = new FileInputStream(Paths.get(configLocation).normalize().toString())) {
cloudConfig = loadCloudConfig(stream);
}catch(Exception e){
- LOGGER.warnSimple("Error Loading override.yaml",e);
+ logger.warn("Error Loading override.yaml", e);
}
}
if (cloudConfig == null) {
- LOGGER.debug("No CloudConfig defined in " + configLocation);
+ logger.debug("No CloudConfig defined in {}", configLocation);
// Try the application.yaml file
try (InputStream stream = R__CloudConfigMigration.class.getResourceAsStream(getApplicationYamlName())) {
@@ -100,7 +103,7 @@ public class R__CloudConfigMigration implements JdbcMigration , MigrationInfoPro
}
if (cloudConfig == null) {
- LOGGER.debug("No CloudConfig defined in " + getApplicationYamlName());
+ logger.debug("No CloudConfig defined in {}", getApplicationYamlName());
}
}
@@ -138,7 +141,7 @@ public class R__CloudConfigMigration implements JdbcMigration , MigrationInfoPro
}
private void migrateCloudIdentity(Collection<CloudIdentity> entities, Connection connection) throws SQLException {
- LOGGER.debug("Starting migration for CloudConfig-->IdentityService");
+ logger.debug("Starting migration for CloudConfig-->IdentityService");
String insert = "INSERT INTO `identity_services` (`ID`, `IDENTITY_URL`, `MSO_ID`, `MSO_PASS`, `ADMIN_TENANT`, `MEMBER_ROLE`, `TENANT_METADATA`, `IDENTITY_SERVER_TYPE`, `IDENTITY_AUTHENTICATION_TYPE`, `LAST_UPDATED_BY`) " +
"VALUES (?,?,?,?,?,?,?,?,?,?);";
@@ -168,7 +171,7 @@ public class R__CloudConfigMigration implements JdbcMigration , MigrationInfoPro
}
private void migrateCloudSite(Collection<CloudSite> entities, Connection connection) throws SQLException {
- LOGGER.debug("Starting migration for CloudConfig-->CloudSite");
+ logger.debug("Starting migration for CloudConfig-->CloudSite");
String insert = "INSERT INTO `cloud_sites` (`ID`, `REGION_ID`, `IDENTITY_SERVICE_ID`, `CLOUD_VERSION`, `CLLI`, `CLOUDIFY_ID`, `PLATFORM`, `ORCHESTRATOR`, `LAST_UPDATED_BY`) " +
"VALUES (?,?,?,?,?,?,?,?,?);";
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CvnfcCatalogDbQueryTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CvnfcCatalogDbQueryTest.java
index aeee279002..b08b93eb87 100644
--- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CvnfcCatalogDbQueryTest.java
+++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CvnfcCatalogDbQueryTest.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -44,7 +46,8 @@ import org.onap.so.db.catalog.beans.VnfVfmoduleCvnfcConfigurationCustomization;
import org.onap.so.db.catalog.beans.VnfcCustomization;
import org.onap.so.db.catalog.client.CatalogDbClientPortChanger;
import org.onap.so.db.catalog.data.repository.CvnfcCustomizationRepository;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
@@ -61,7 +64,7 @@ public class CvnfcCatalogDbQueryTest {
@Autowired
private CvnfcCustomizationRepository cvnfcCustomizationRepository;
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, CvnfcCatalogDbQueryTest.class);
+ private static final Logger logger = LoggerFactory.getLogger(CvnfcCatalogDbQueryTest.class);
@LocalServerPort
private int port;
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/NetworkCollectionCatalogDbQueryTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/NetworkCollectionCatalogDbQueryTest.java
index 3154603292..89a7ba3d17 100644
--- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/NetworkCollectionCatalogDbQueryTest.java
+++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/NetworkCollectionCatalogDbQueryTest.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -40,7 +42,8 @@ import org.onap.so.db.catalog.beans.CollectionResourceInstanceGroupCustomization
import org.onap.so.db.catalog.beans.InstanceGroup;
import org.onap.so.db.catalog.beans.NetworkCollectionResourceCustomization;
import org.onap.so.db.catalog.client.CatalogDbClientPortChanger;
-import org.onap.so.logger.MsoLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
@@ -52,7 +55,7 @@ import org.springframework.test.context.junit4.SpringRunner;
@ActiveProfiles("test")
public class NetworkCollectionCatalogDbQueryTest {
- private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, NetworkCollectionCatalogDbQueryTest.class);
+ private static final Logger logger = LoggerFactory.getLogger(NetworkCollectionCatalogDbQueryTest.class);
private static final String NETWORKCOLLECTION = "NetworkCollection";
private final String serviceUUID = "5df8b6de-2083-11e7-93ae-92361f002671";
@@ -72,19 +75,19 @@ public class NetworkCollectionCatalogDbQueryTest {
@Test
@Transactional
public void networkCollectionTest() {
- msoLogger.debug("TEST IS STARTING UP...");
+ logger.debug("TEST IS STARTING UP...");
String modelUUID = "4694a55f-58b3-4f17-92a5-796d6f5ffd0d";
boolean found = false;
- msoLogger.debug(Integer.toString(port));
+ logger.debug(Integer.toString(port));
InstanceGroup instanceGroup = null;
List<CollectionResourceInstanceGroupCustomization> collectionInstanceGroupList = null;
org.onap.so.db.catalog.beans.Service service = client.getServiceByID(modelUUID);
if (service == null) {
- msoLogger.debug("null");
+ logger.debug("null");
} else {
List<CollectionResourceCustomization> customizations = service.getCollectionResourceCustomizations();
if (customizations.isEmpty()) {
- msoLogger.debug("No Network Collection found. CollectionResourceCustomizations is empty");
+ logger.debug("No Network Collection found. CollectionResourceCustomizations is empty");
}
for (CollectionResourceCustomization crc : customizations) {
if(client.getNetworkCollectionResourceCustomizationByID(crc.getModelCustomizationUUID())
@@ -95,25 +98,25 @@ public class NetworkCollectionCatalogDbQueryTest {
String toscaNodeType = crc.getCollectionResource()
.getToscaNodeType();
if (toscaNodeType.contains(NETWORKCOLLECTION)) {
- msoLogger.debug("Found a network collection");
+ logger.debug("Found a network collection");
instanceGroup = crc.getCollectionResource().getInstanceGroup();
collectionInstanceGroupList =
instanceGroup.getCollectionInstanceGroupCustomizations();
CollectionNetworkResourceCustomization collectionNetworkCust = instanceGroup.getCollectionNetworkResourceCustomizations().get(0);
- msoLogger.debug("Found Collection Network Resource Customization: " + collectionNetworkCust.getModelCustomizationUUID());
+ logger.debug("Found Collection Network Resource Customization: " + collectionNetworkCust.getModelCustomizationUUID());
} else {
- msoLogger.debug(
+ logger.debug(
"No Network Collection found. toscaNodeType does not contain NetworkCollection");
}
} else {
- msoLogger.debug("No Network Collection found. toscaNodeType is null");
+ logger.debug("No Network Collection found. toscaNodeType is null");
}
} else {
- msoLogger.debug("No Network Collection found. collectionResource is null");
+ logger.debug("No Network Collection found. collectionResource is null");
}
found = true;
} else {
- msoLogger.debug("Not a Network Collection Resource Customization Instance");
+ logger.debug("Not a Network Collection Resource Customization Instance");
}
}
}
@@ -124,11 +127,11 @@ public class NetworkCollectionCatalogDbQueryTest {
@Test
public void buildingBlockDetailTest() {
- msoLogger.debug("TEST IS STARTING UP...");
- msoLogger.debug(Integer.toString(port));
+ logger.debug("TEST IS STARTING UP...");
+ logger.debug(Integer.toString(port));
String buildingBlockFlowName = "CreateNetworkCollectionBB";
BuildingBlockDetail buildingBlockDetail = client.getBuildingBlockDetail(buildingBlockFlowName);
- msoLogger.debug("" + buildingBlockDetail.getResourceType());
+ logger.debug("" + buildingBlockDetail.getResourceType());
assertNotNull(buildingBlockDetail);
}
@@ -148,6 +151,6 @@ public class NetworkCollectionCatalogDbQueryTest {
String modelCustId = "1a61be4b-3378-4c9a-91c8-c919519b2d01";
CollectionNetworkResourceCustomization collectionNetworkCust = client.getCollectionNetworkResourceCustomizationByID(modelCustId);
assertNotNull(collectionNetworkCust);
- msoLogger.debug(collectionNetworkCust.getModelCustomizationUUID());
+ logger.debug(collectionNetworkCust.getModelCustomizationUUID());
}
}
diff --git a/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V5.3.1__Watchdog_Lock_Version_Column.sql b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V5.3.1__Watchdog_Lock_Version_Column.sql
new file mode 100644
index 0000000000..6379bc6015
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V5.3.1__Watchdog_Lock_Version_Column.sql
@@ -0,0 +1,3 @@
+use requestdb;
+
+ALTER TABLE watchdog_distributionid_status ADD LOCK_VERSION int NOT NULL;
diff --git a/adapters/mso-requests-db-adapter/src/test/resources/db/migration/afterMigrate.sql b/adapters/mso-requests-db-adapter/src/test/resources/db/migration/afterMigrate.sql
index adfc7314be..de1ae85cc6 100644
--- a/adapters/mso-requests-db-adapter/src/test/resources/db/migration/afterMigrate.sql
+++ b/adapters/mso-requests-db-adapter/src/test/resources/db/migration/afterMigrate.sql
@@ -12,10 +12,10 @@ insert into infra_active_requests(request_id, client_request_id, action, request
('00173cc9-5ce2-4673-a810-f87fefb2829e', null, 'createInstance', 'FAILED', 'Error parsing request. No valid instanceName is specified', '100', '2017-04-14 21:08:46', '2017-04-14 21:08:46', 'VID', null, null, null, null, null, 'a259ae7b7c3f493cb3d91f95a7c18149', null, null, null, '{"requestDetails":{"modelInfo":{"modelInvariantId":"ff6163d4-7214-459e-9f76-507b4eb00f51","modelType":"service","modelName":"ConstraintsSrvcVID","modelVersion":"2.0","modelVersionId":"722d256c-a374-4fba-a14f-a59b76bb7656"},"requestInfo":{"productFamilyId":"LRSI-OSPF","source":"VID","requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"},"cloudConfiguration":{"tenantId":"a259ae7b7c3f493cb3d91f95a7c18149","lcpCloudRegionId":"mtn16"},"requestParameters":{"subscriptionServiceType":"Mobility","userParams":[{"name":"neutronport6_name","value":"8"},{"name":"neutronnet5_network_name","value":"8"},{"name":"contrailv2vlansubinterface3_name","value":"false"}]}}}', null, 'APIH', '2016-12-22 19:00:28', null, null, null, null, null, null, null, 'mtn16', null, null, null, null, null, 'service', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
('0017f68c-eb2d-45bb-b7c7-ec31b37dc349', null, 'activateInstance', 'UNLOCKED', null, '20', '2017-09-26 16:09:29', '2017-09-28 12:45:53', 'VID', null, null, null, null, null, null, null, null, null, '{"requestDetails":{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"1587cf0e-f12f-478d-8530-5c55ac578c39","modelType":"configuration","modelNameVersionId":null,"modelName":null,"modelVersion":null,"modelCustomizationUuid":null,"modelVersionId":"36a3a8ea-49a6-4ac8-b06c-89a545444455","modelCustomizationId":"68dc9a92-214c-11e7-93ae-92361f002671","modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":null,"suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":[{"relatedInstance":{"instanceName":null,"instanceId":"9e15a443-af65-4f05-9000-47ae495e937d","modelInfo":{"modelCustomizationName":null,"modelInvariantId":"de19ae10-9a25-11e7-abc4-cec278b6b50a","modelType":"service","modelNameVersionId":null,"modelName":"MSOTADevInfra_Configuration_Service","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"ee938612-9a25-11e7-abc4-cec278b6b50a","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"instanceDirection":null}}],"subscriberInfo":null,"cloudConfiguration":{"aicNodeClli":null,"tenantId":null,"lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":null,"userParams":[],"aLaCarte":false,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarte":false},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}}', null, 'APIH', '2017-09-26 16:09:29', null, null, null, null, null, null, null, 'mtn6', null, null, null, null, null, 'configuration', 'activateInstance', '9e15a443-af65-4f05-9000-47ae495e937d', null, 'xxxxxx', '26ef7f15-57bb-48df-8170-e59edc26234c', null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances');
-insert into watchdog_distributionid_status(distribution_id, distribution_id_status, create_time, modify_time) values
-('1533c4bd-a3e3-493f-a16d-28c20614415e', '', '2017-11-30 15:48:09', '2017-11-30 15:48:09'),
-('55429711-809b-4a3b-9ee5-5120d46d9de0', '', '2017-11-30 16:35:36', '2017-11-30 16:35:36'),
-('67f0b2d1-9013-4b2b-9914-bbe2288284fb', '', '2017-11-30 15:54:39', '2017-11-30 15:54:39');
+insert into watchdog_distributionid_status(distribution_id, distribution_id_status, lock_version, create_time, modify_time) values
+('1533c4bd-a3e3-493f-a16d-28c20614415e', '', 0, '2017-11-30 15:48:09', '2017-11-30 15:48:09'),
+('55429711-809b-4a3b-9ee5-5120d46d9de0', '', 0, '2017-11-30 16:35:36', '2017-11-30 16:35:36'),
+('67f0b2d1-9013-4b2b-9914-bbe2288284fb', '', 0, '2017-11-30 15:54:39', '2017-11-30 15:54:39');
insert into watchdog_per_component_distribution_status(distribution_id, component_name, component_distribution_status, create_time, modify_time) values
('1533c4bd-a3e3-493f-a16d-28c20614415e', 'MSO', 'COMPONENT_DONE_OK', '2017-11-30 15:48:09', '2017-11-30 15:48:09'),