* ================================================================================
* 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
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;
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;
@Override
public void migrate(Connection connection) throws Exception {
- LOGGER.debug("Starting migration for CloudConfig");
+ logger.debug("Starting migration for CloudConfig");
CloudConfig cloudConfig = null;
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())) {
}
if (cloudConfig == null) {
- LOGGER.debug("No CloudConfig defined in " + getApplicationYamlName());
+ logger.debug("No CloudConfig defined in {}", getApplicationYamlName());
}
}
}
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 (?,?,?,?,?,?,?,?,?,?);";
}
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 (?,?,?,?,?,?,?,?,?);";
* ================================================================================
* 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
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;
@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;
* ================================================================================
* 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
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;
@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";
@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())
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");
}
}
}
@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);
}
String modelCustId = "1a61be4b-3378-4c9a-91c8-c919519b2d01";
CollectionNetworkResourceCustomization collectionNetworkCust = client.getCollectionNetworkResourceCustomizationByID(modelCustId);
assertNotNull(collectionNetworkCust);
- msoLogger.debug(collectionNetworkCust.getModelCustomizationUUID());
+ logger.debug(collectionNetworkCust.getModelCustomizationUUID());
}
}