diff options
author | r.bogacki <r.bogacki@samsung.com> | 2019-03-01 09:09:30 +0100 |
---|---|---|
committer | r.bogacki <r.bogacki@samsung.com> | 2019-03-01 11:36:04 +0100 |
commit | a78cfaee6ba6e878860ae0b19987c925f29e8362 (patch) | |
tree | 525bb5c5e4dd861de2844e99f1281a105abad5ba /bpmn/so-bpmn-tasks/src/main/java | |
parent | ade5e9910524146f2257183909842263136698cc (diff) |
Removed MsoLogger from 'so-bpmn-tasks'
Replaced MsoLogger with plain slf4j.
Refactored login output.
Fixed imports.
Change-Id: I53895308cd3f9fb006738f7aa4d2ba5880ba3d85
Issue-ID: LOG-631
Signed-off-by: Robert Bogacki <r.bogacki@samsung.com>
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/main/java')
45 files changed, 395 insertions, 252 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java index cb893ce950..893c67d9df 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.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 @@ -67,7 +69,8 @@ import org.onap.so.client.sniro.beans.ServiceInfo; import org.onap.so.client.sniro.beans.SniroManagerRequest; import org.onap.so.client.sniro.beans.SubscriberInfo; import org.onap.so.db.catalog.beans.OrchestrationStatus; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; @@ -84,7 +87,7 @@ import org.springframework.web.util.UriUtils; @Component("SniroHoming") public class SniroHomingV2 { - private static final MsoLogger log = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SniroHomingV2.class); + private static final Logger logger = LoggerFactory.getLogger(SniroHomingV2.class); private JsonUtils jsonUtils = new JsonUtils(); @Autowired private Environment env; @@ -114,7 +117,7 @@ public class SniroHomingV2 { * @param execution */ public void callSniro(BuildingBlockExecution execution){ - log.debug("Started Sniro Homing Call Sniro"); + logger.debug("Started Sniro Homing Call Sniro"); try{ GeneralBuildingBlock bb = execution.getGeneralBuildingBlock(); @@ -153,7 +156,7 @@ public class SniroHomingV2 { if(placementDemands.size() > 0 || licenseDemands.size() > 0){ client.postDemands(request); }else{ - log.debug(SERVICE_MISSING_DATA + "resources eligible for homing or licensing"); + logger.debug(SERVICE_MISSING_DATA + "resources eligible for homing or licensing"); throw new BpmnError(UNPROCESSABLE, SERVICE_MISSING_DATA + "resources eligible for homing or licensing"); } @@ -162,15 +165,15 @@ public class SniroHomingV2 { execution.setVariable("asyncMessageType", "SNIROResponse"); execution.setVariable("asyncTimeout", timeout); - log.trace("Completed Sniro Homing Call Sniro"); + logger.trace("Completed Sniro Homing Call Sniro"); }catch(BpmnError e){ - log.error(e); + logger.error("Exception occurred", e); exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(e.getErrorCode()), e.getMessage()); }catch(BadResponseException e){ - log.error(e); + logger.error("Exception occurred", e); exceptionUtil.buildAndThrowWorkflowException(execution, 400, e.getMessage()); }catch(Exception e){ - log.error(e); + logger.error("Exception occurred", e); exceptionUtil.buildAndThrowWorkflowException(execution, INTERNAL, "Internal Error - occurred while preparing sniro request: " + e.getMessage()); } } @@ -183,13 +186,13 @@ public class SniroHomingV2 { * @param asyncResponse */ public void processSolution(BuildingBlockExecution execution, String asyncResponse){ - log.trace("Started Sniro Homing Process Solution"); + logger.trace("Started Sniro Homing Process Solution"); try{ //TODO improve handling multiple solutions but is dependent on sniro enhancing api + work with sniro conductor to improve "inventoryType" representation validateSolution(asyncResponse); ServiceInstance serviceInstance = execution.getGeneralBuildingBlock().getCustomer().getServiceSubscription().getServiceInstances().get(0); - log.debug("Processing sniro manager asyncronous response"); + logger.debug("Processing sniro manager asyncronous response"); JSONObject response = new JSONObject(asyncResponse); if(response.has(SOLUTIONS)){ JSONObject allSolutions = response.getJSONObject(SOLUTIONS); @@ -212,15 +215,15 @@ public class SniroHomingV2 { execution.setVariable("generalBuildingBlock", execution.getGeneralBuildingBlock()); - log.trace("Completed Sniro Homing Process Solution"); + logger.trace("Completed Sniro Homing Process Solution"); }catch(BpmnError e){ - log.error(e); + logger.error("Exception occurred", e); exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(e.getErrorCode()), e.getMessage()); }catch(BadResponseException e){ - log.error(e); + logger.error("Exception occurred", e); exceptionUtil.buildAndThrowWorkflowException(execution, 400, e.getMessage()); }catch(Exception e){ - log.error(e); + logger.error("Exception occurred", e); exceptionUtil.buildAndThrowWorkflowException(execution, INTERNAL, "Internal Error - occurred while processing sniro asynchronous response: " + e.getMessage()); } } @@ -231,7 +234,7 @@ public class SniroHomingV2 { * @throws Exception */ private RequestInfo buildRequestInfo(String requestId, String timeout) throws Exception{ - log.trace("Building request information"); + logger.trace("Building request information"); RequestInfo requestInfo = new RequestInfo(); if(requestId != null){ String host = env.getProperty("mso.workflow.message.endpoint"); @@ -256,7 +259,7 @@ public class SniroHomingV2 { * */ private ServiceInfo buildServiceInfo(ServiceInstance serviceInstance){ - log.trace("Building service information"); + logger.trace("Building service information"); ServiceInfo info = new ServiceInfo(); ModelInfoServiceInstance modelInfo = serviceInstance.getModelInfoServiceInstance(); if(isNotBlank(modelInfo.getModelInvariantUuid()) && isNotBlank(modelInfo.getModelUuid())){ @@ -281,14 +284,14 @@ public class SniroHomingV2 { private PlacementInfo buildPlacementInfo(Customer customer, RequestParameters requestParams){ PlacementInfo placementInfo = new PlacementInfo(); if(customer != null){ - log.debug("Adding subscriber to placement information"); + logger.debug("Adding subscriber to placement information"); SubscriberInfo subscriber = new SubscriberInfo(); subscriber.setGlobalSubscriberId(customer.getGlobalCustomerId()); subscriber.setSubscriberName(customer.getSubscriberName()); subscriber.setSubscriberCommonSiteId(customer.getSubscriberCommonSiteId()); placementInfo.setSubscriberInfo(subscriber); if(requestParams != null){ - log.debug("Adding request parameters to placement information"); + logger.debug("Adding request parameters to placement information"); placementInfo.setRequestParameters(requestParams.toJsonString()); } }else{ @@ -303,12 +306,12 @@ public class SniroHomingV2 { * */ private List<Demand> buildPlacementDemands(ServiceInstance serviceInstance){ - log.trace("Building placement information demands"); + logger.trace("Building placement information demands"); List<Demand> placementDemands = new ArrayList<Demand>(); List<AllottedResource> allottedResourceList = serviceInstance.getAllottedResources(); if(!allottedResourceList.isEmpty()){ - log.debug("Adding allotted resources to placement demands list"); + logger.debug("Adding allotted resources to placement demands list"); for(AllottedResource ar : allottedResourceList){ if(isBlank(ar.getId())){ ar.setId(UUID.randomUUID().toString()); @@ -320,7 +323,7 @@ public class SniroHomingV2 { } List<VpnBondingLink> vpnBondingLinkList = serviceInstance.getVpnBondingLinks(); if(!vpnBondingLinkList.isEmpty()){ - log.debug("Adding vpn bonding links to placement demands list"); + logger.debug("Adding vpn bonding links to placement demands list"); for(VpnBondingLink vbl:vpnBondingLinkList){ List<ServiceProxy> serviceProxyList = vbl.getServiceProxies(); for(ServiceProxy sp : serviceProxyList){ @@ -341,11 +344,11 @@ public class SniroHomingV2 { * */ private List<Demand> buildLicenseDemands(ServiceInstance serviceInstance){ - log.trace("Building license information"); + logger.trace("Building license information"); List<Demand> licenseDemands = new ArrayList<Demand>(); List<GenericVnf> vnfList = serviceInstance.getVnfs(); if(!vnfList.isEmpty()){ - log.debug("Adding vnfs to license demands list"); + logger.debug("Adding vnfs to license demands list"); for(GenericVnf vnf : vnfList){ Demand demand = buildDemand(vnf.getVnfId(), vnf.getModelInfoGenericVnf()); licenseDemands.add(demand); @@ -359,7 +362,7 @@ public class SniroHomingV2 { * */ private Demand buildDemand(String id, ModelInfoMetadata metadata){ - log.debug("Building demand for service or resource: " + id); + logger.debug("Building demand for service or resource: " + id); Demand demand = new Demand(); if(isNotBlank(id) && isNotBlank(metadata.getModelInstanceName())){ demand.setServiceResourceId(id); @@ -431,7 +434,7 @@ public class SniroHomingV2 { private void processLicenseSolution(ServiceInstance serviceInstance, JSONArray licenseSolutions){ List<GenericVnf> vnfs = serviceInstance.getVnfs(); - log.debug("Processing the license solution"); + logger.debug("Processing the license solution"); for(int i = 0; i < licenseSolutions.length(); i++){ JSONObject licenseSolution = licenseSolutions.getJSONObject(i); for(GenericVnf vnf:vnfs){ @@ -460,7 +463,7 @@ public class SniroHomingV2 { List<AllottedResource> allottes = serviceInstance.getAllottedResources(); List<GenericVnf> vnfs = serviceInstance.getVnfs(); - log.debug("Processing placement solution " + i+1); + logger.debug("Processing placement solution " + i+1); for(int p = 0; p < placements.length(); p++){ JSONObject placement = placements.getJSONObject(p); SolutionInfo solutionInfo = new SolutionInfo(); @@ -508,7 +511,7 @@ public class SniroHomingV2 { * */ private ServiceInstance setSolution(SolutionInfo solutionInfo, JSONObject placement){ - log.debug("Mapping placement solution"); + logger.debug("Mapping placement solution"); String invalidMessage = "Sniro Managers Response contains invalid: "; JSONObject solution = placement.getJSONObject("solution"); @@ -530,13 +533,13 @@ public class SniroHomingV2 { si.setOrchestrationStatus(OrchestrationStatus.CREATED); cloud.setLcpCloudRegionId(assignmentsMap.get("cloudRegionId")); if(assignmentsMap.containsKey("vnfHostName")){ - log.debug("Resources has been homed to a vnf"); + logger.debug("Resources has been homed to a vnf"); GenericVnf vnf = setVnf(assignmentsMap); vnf.setCloudRegion(cloud); si.getVnfs().add(vnf); }else if(assignmentsMap.containsKey("primaryPnfName")){ - log.debug("Resources has been homed to a pnf"); + logger.debug("Resources has been homed to a pnf"); Pnf priPnf = setPnf(assignmentsMap, "primary"); priPnf.setCloudRegion(cloud); si.getPnfs().add(priPnf); @@ -547,22 +550,22 @@ public class SniroHomingV2 { } } }else{ - log.debug(invalidMessage + IDENTIFIER_TYPE); + logger.debug(invalidMessage + IDENTIFIER_TYPE); throw new BpmnError(UNPROCESSABLE, invalidMessage + IDENTIFIER_TYPE); } }else if(type.equals("cloud")){ if(identifierType.equals(CandidateType.CLOUD_REGION_ID.toString())){ - log.debug("Resources has been homed to a cloud region"); + logger.debug("Resources has been homed to a cloud region"); cloud.setLcpCloudRegionId(identifierValue); solutionInfo.setHomed(false); solutionInfo.setTargetedCloudRegion(cloud); si.setOrchestrationStatus(OrchestrationStatus.PRECREATED); }else{ - log.debug(invalidMessage + IDENTIFIER_TYPE); + logger.debug(invalidMessage + IDENTIFIER_TYPE); throw new BpmnError(UNPROCESSABLE, invalidMessage + IDENTIFIER_TYPE); } }else{ - log.debug(invalidMessage + INVENTORY_TYPE); + logger.debug(invalidMessage + INVENTORY_TYPE); throw new BpmnError(UNPROCESSABLE, invalidMessage + INVENTORY_TYPE); } si.setSolutionInfo(solutionInfo); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java index f47781082d..8711f965fd 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAICreateTasks.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 @@ -70,9 +72,7 @@ import org.springframework.stereotype.Component; @Component public class AAICreateTasks { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AAICreateTasks.class); - private static final Logger logger = LoggerFactory.getLogger(AAICreateTasks.class.getName()); - + private static final Logger logger = LoggerFactory.getLogger(AAICreateTasks.class); private static final String networkTypeProvider = "PROVIDER"; private static String NETWORK_COLLECTION_NAME = "networkCollectionName"; private static String CONTRAIL_NETWORK_POLICY_FQDN_LIST = "contrailNetworkPolicyFqdnList"; @@ -117,9 +117,9 @@ public class AAICreateTasks { if (null == customer) { String errorMessage = "Exception in creating ServiceSubscription. Customer not present for ServiceInstanceID: " + serviceInstance.getServiceInstanceId(); - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, errorMessage, "BPMN", MsoLogger.getServiceName(), - MsoLogger.ErrorCode.UnknownError, errorMessage); - exceptionUtil.buildAndThrowWorkflowException(execution, 7000, errorMessage); + logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), errorMessage, "BPMN", + MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), errorMessage); + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, errorMessage); } aaiSIResources.createServiceSubscription(customer); } catch (BpmnError ex) { @@ -136,7 +136,7 @@ public class AAICreateTasks { Project project = serviceInstance.getProject(); if(project != null) { if (project.getProjectName() == null || "".equals(project.getProjectName())) { - msoLogger.info("ProjectName is null in input. Skipping create project..."); + logger.info("ProjectName is null in input. Skipping create project..."); } else { aaiSIResources.createProjectandConnectServiceInstance(project, serviceInstance); } @@ -162,14 +162,14 @@ public class AAICreateTasks { } else { if (owningEntityName == null || "".equals(owningEntityName)) { String msg = "Exception in AAICreateOwningEntity. Can't create an owningEntity with no owningEntityName."; - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, msg, "BPMN", MsoLogger.getServiceName(), - MsoLogger.ErrorCode.UnknownError, msg); + logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", + MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), msg); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg); } else { if(aaiSIResources.existsOwningEntityName(owningEntityName)){ String msg = "Exception in AAICreateOwningEntity. Can't create OwningEntity as name already exists in AAI associated with a different owning-entity-id (name must be unique)"; - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, msg, "BPMN", MsoLogger.getServiceName(), - MsoLogger.ErrorCode.UnknownError, msg); + logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", + MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), msg); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg); }else{ aaiSIResources.createOwningEntityandConnectServiceInstance(owningEntity, serviceInstance); @@ -199,7 +199,7 @@ public class AAICreateTasks { Platform platform = vnf.getPlatform(); if(platform != null) { if (platform.getPlatformName() == null || "".equals(platform.getPlatformName())) { - msoLogger.debug("PlatformName is null in input. Skipping create platform..."); + logger.debug("PlatformName is null in input. Skipping create platform..."); } else { aaiVnfResources.createPlatformandConnectVnf(platform,vnf); } @@ -216,7 +216,7 @@ public class AAICreateTasks { LineOfBusiness lineOfBusiness = vnf.getLineOfBusiness(); if(lineOfBusiness != null) { if (lineOfBusiness.getLineOfBusinessName() == null || "".equals(lineOfBusiness.getLineOfBusinessName())) { - msoLogger.info("lineOfBusiness is null in input. Skipping create lineOfBusiness..."); + logger.info("lineOfBusiness is null in input. Skipping create lineOfBusiness..."); } else { aaiVnfResources.createLineOfBusinessandConnectVnf(lineOfBusiness,vnf); } @@ -269,7 +269,7 @@ public class AAICreateTasks { try{ volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID, execution.getLookupMap().get(ResourceKey.VOLUME_GROUP_ID)); } catch (BBObjectNotFoundException e){ - msoLogger.info("VolumeGroup not found. Skipping Connect between VfModule and VolumeGroup"); + logger.info("VolumeGroup not found. Skipping Connect between VfModule and VolumeGroup"); } if (volumeGroup != null) { aaiVfModuleResources.connectVfModuleToVolumeGroup(vnf, vfModule, volumeGroup, execution.getGeneralBuildingBlock().getCloudRegion()); @@ -463,9 +463,9 @@ public class AAICreateTasks { uri.queryParam(NETWORK_POLICY_FQDN_PARAM, fqdn); Optional<org.onap.aai.domain.yang.NetworkPolicy> oNetPolicy = aaiNetworkResources.getNetworkPolicy(uri); if(!oNetPolicy.isPresent()) { - msoLogger.debug("This network policy FQDN is not in AAI yet: " + fqdn); + logger.debug("This network policy FQDN is not in AAI yet: {}", fqdn); String networkPolicyId = UUID.randomUUID().toString(); - msoLogger.debug("Adding network-policy with network-policy-id " + networkPolicyId); + logger.debug("Adding network-policy with network-policy-id {}", networkPolicyId); NetworkPolicy networkPolicy = new NetworkPolicy(); networkPolicy.setNetworkPolicyId(networkPolicyId); networkPolicy.setNetworkPolicyFqdn(fqdn); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.java index 0d9aeed1ae..4908cda26a 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.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 @@ -46,13 +48,14 @@ import org.onap.so.client.orchestration.AAIServiceInstanceResources; import org.onap.so.client.orchestration.AAIVfModuleResources; import org.onap.so.client.orchestration.AAIVnfResources; import org.onap.so.client.orchestration.AAIVolumeGroupResources; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class AAIDeleteTasks { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AAIDeleteTasks.class); + private static final Logger logger = LoggerFactory.getLogger(AAIDeleteTasks.class); private static String CONTRAIL_NETWORK_POLICY_FQDN_LIST = "contrailNetworkPolicyFqdnList"; private static String NETWORK_POLICY_FQDN_PARAM = "network-policy-fqdn"; @@ -177,7 +180,7 @@ public class AAIDeleteTasks { if (networkPolicyList != null && !networkPolicyList.isEmpty()) { NetworkPolicy networkPolicy = networkPolicyList.get(0); String networkPolicyId = networkPolicy.getNetworkPolicyId(); - msoLogger.debug("Deleting network-policy with network-policy-id " + networkPolicyId); + logger.debug("Deleting network-policy with network-policy-id {}", networkPolicyId); aaiNetworkResources.deleteNetworkPolicy(networkPolicyId); } } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIFlagTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIFlagTasks.java index 53d0e0a45c..94529f915b 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIFlagTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIFlagTasks.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,15 +27,15 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf; import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; import org.onap.so.client.exception.ExceptionBuilder; -import org.onap.so.client.orchestration.AAIVfModuleResources; import org.onap.so.client.orchestration.AAIVnfResources; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class AAIFlagTasks { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AAIFlagTasks.class); + private static final Logger logger = LoggerFactory.getLogger(AAIFlagTasks.class); @Autowired private AAIVnfResources aaiVnfResources; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIQueryTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIQueryTasks.java index 46ff8495f9..e89dffc6d9 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIQueryTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIQueryTasks.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 @@ -42,14 +44,15 @@ import org.onap.so.client.aai.entities.Relationships; import org.onap.so.client.aai.entities.uri.AAIResourceUri; import org.onap.so.client.exception.ExceptionBuilder; import org.onap.so.client.orchestration.AAINetworkResources; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class AAIQueryTasks { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AAIQueryTasks.class); + private static final Logger logger = LoggerFactory.getLogger(AAIQueryTasks.class); private static final String ERROR_MSG = "No relationships were returned from AAIResultWrapper.getRelationships()"; @Autowired private ExtractPojosForBB extractPojosForBB; @@ -116,7 +119,7 @@ public class AAIQueryTasks { .getRelatedAAIUris(AAIObjectType.VPN_BINDING); List<org.onap.so.openstack.beans.RouteTarget> routeTargets = new ArrayList<>(); for (AAIResourceUri netBindingUri : netBindingsUriList) { - msoLogger.info("Get Route Targests"); + logger.info("Get Route Targests"); Optional<VpnBinding> oVpnBinding = aaiNetworkResources.getVpnBinding(netBindingUri); if (oVpnBinding.isPresent()) { VpnBinding vpnBinding = oVpnBinding.get(); @@ -247,4 +250,4 @@ public class AAIQueryTasks { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } -}
\ No newline at end of file +} diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java index 5176bee0d6..37e1a93044 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.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 @@ -47,13 +49,14 @@ import org.onap.so.client.orchestration.AAIVfModuleResources; import org.onap.so.client.orchestration.AAIVnfResources; import org.onap.so.client.orchestration.AAIVolumeGroupResources; import org.onap.so.db.catalog.beans.OrchestrationStatus; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class AAIUpdateTasks { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AAIUpdateTasks.class); + private static final Logger logger = LoggerFactory.getLogger(AAIUpdateTasks.class); private static final String ALACARTE = "aLaCarte"; private static final String MULTI_STAGE_DESIGN_OFF = "false"; private static final String MULTI_STAGE_DESIGN_ON = "true"; @@ -498,4 +501,4 @@ public class AAIUpdateTasks { } } -}
\ No newline at end of file +} diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java index acef0cb354..1402cebfbc 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/activity/ExecuteActivity.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 @@ -38,6 +40,8 @@ import org.onap.so.logger.MessageEnum; import org.onap.so.logger.MsoLogger; import org.onap.so.serviceinstancebeans.RequestDetails; import org.onap.so.serviceinstancebeans.ServiceInstancesRequest; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -46,7 +50,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; @Component("ExecuteActivity") public class ExecuteActivity implements JavaDelegate { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, ExecuteActivity.class); + private static final Logger logger = LoggerFactory.getLogger(ExecuteActivity.class); private static final String G_BPMN_REQUEST = "bpmnRequest"; private static final String VNF_TYPE = "vnfType"; private static final String G_ACTION = "requestAction"; @@ -70,12 +74,12 @@ public class ExecuteActivity implements JavaDelegate { try { final String implementationString = execution.getBpmnModelElementInstance().getAttributeValue(SERVICE_TASK_IMPLEMENTATION_ATTRIBUTE); - msoLogger.debug("activity implementation String: " + implementationString); + logger.debug("activity implementation String: {}", implementationString); if (!implementationString.startsWith(ACTIVITY_PREFIX)) { buildAndThrowException(execution, "Implementation attribute has a wrong format"); } String activityName = implementationString.replaceFirst(ACTIVITY_PREFIX, ""); - msoLogger.info("activityName is: " + activityName); + logger.info("activityName is: {}", activityName); BuildingBlock buildingBlock = buildBuildingBlock(activityName); ExecuteBuildingBlock executeBuildingBlock = buildExecuteBuildingBlock(execution, requestId, buildingBlock); @@ -91,7 +95,7 @@ public class ExecuteActivity implements JavaDelegate { WorkflowException workflowException = (WorkflowException) variableMap.get("WorklfowException"); if (workflowException != null) { - msoLogger.error("Workflow exception is: " + workflowException.getErrorMessage()); + logger.error("Workflow exception is: {}", workflowException.getErrorMessage()); } execution.setVariable("WorkflowException", workflowException); } @@ -131,14 +135,14 @@ public class ExecuteActivity implements JavaDelegate { } protected void buildAndThrowException(DelegateExecution execution, String msg, Exception ex) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, msg, "BPMN", MsoLogger.getServiceName(), - MsoLogger.ErrorCode.UnknownError, msg, ex); + logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), msg, "BPMN", + MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), msg, ex); execution.setVariable("ExecuteActivityErrorMessage", msg); exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, msg); } protected void buildAndThrowException(DelegateExecution execution, String msg) { - msoLogger.error(msg); + logger.error(msg); execution.setVariable("ExecuteActuvityErrorMessage", msg); exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, msg); } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterUpdateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterUpdateTasks.java index ef2cf86f01..ee7f3697ae 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterUpdateTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterUpdateTasks.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,13 +33,14 @@ import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; import org.onap.so.client.exception.ExceptionBuilder; import org.onap.so.client.orchestration.NetworkAdapterResources; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class NetworkAdapterUpdateTasks { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, NetworkAdapterUpdateTasks.class); + private static final Logger logger = LoggerFactory.getLogger(NetworkAdapterUpdateTasks.class); @Autowired private ExtractPojosForBB extractPojosForBB; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java index 3456fa1c56..932558d8ad 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.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 @@ -37,13 +39,14 @@ import org.onap.so.client.exception.BBObjectNotFoundException; import org.onap.so.client.exception.ExceptionBuilder; import org.onap.so.client.orchestration.VnfAdapterVfModuleResources; import org.onap.so.client.orchestration.VnfAdapterVolumeGroupResources; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class VnfAdapterCreateTasks { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, VnfAdapterCreateTasks.class); + private static final Logger logger = LoggerFactory.getLogger(VnfAdapterCreateTasks.class); private static final String VNFREST_REQUEST = "VNFREST_Request"; @Autowired diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterDeleteTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterDeleteTasks.java index 48b4ebb982..759ec61878 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterDeleteTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterDeleteTasks.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 @@ -33,13 +35,14 @@ import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; import org.onap.so.client.exception.ExceptionBuilder; import org.onap.so.client.orchestration.VnfAdapterVfModuleResources; import org.onap.so.client.orchestration.VnfAdapterVolumeGroupResources; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class VnfAdapterDeleteTasks { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, VnfAdapterDeleteTasks.class); + private static final Logger logger = LoggerFactory.getLogger(VnfAdapterDeleteTasks.class); private static final String VNFREST_REQUEST = "VNFREST_Request"; @Autowired diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java index 0851dc9d95..47357d8ef3 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterImpl.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 @@ -37,6 +39,8 @@ import org.onap.so.client.exception.ExceptionBuilder; import org.onap.so.exceptions.MarshallerException; import org.onap.so.logger.MessageEnum; import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.xml.sax.InputSource; @@ -55,7 +59,7 @@ import java.util.Map; @Component public class VnfAdapterImpl { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, VnfAdapterImpl.class); + private static final Logger logger = LoggerFactory.getLogger(VnfAdapterImpl.class); private static final String CONTRAIL_SERVICE_INSTANCE_FQDN = "contrailServiceInstanceFqdn"; private static final String OAM_MANAGEMENT_V4_ADDRESS = "oamManagementV4Address"; private static final String OAM_MANAGEMENT_V6_ADDRESS = "oamManagementV6Address"; @@ -163,8 +167,9 @@ public class VnfAdapterImpl { SAXSource source = new SAXSource(xmlReader, inputSource); return jaxbUnmarshaller.unmarshal(source); } catch (Exception e) { - msoLogger.error(MessageEnum.GENERAL_EXCEPTION, "", "", "", MsoLogger.ErrorCode.SchemaError, e.getMessage(), e); - throw new MarshallerException("Error parsing VNF Adapter response. " + e.getMessage(), MsoLogger.ErrorCode.SchemaError.getValue(), e); + logger.error("{} {} {}", MessageEnum.GENERAL_EXCEPTION.toString(), MsoLogger.ErrorCode.SchemaError.getValue(), + e.getMessage(), e); + throw new MarshallerException("Error parsing VNF Adapter response. " + e.getMessage(), MsoLogger.ErrorCode.SchemaError.getValue(), e); } } @@ -181,24 +186,24 @@ public class VnfAdapterImpl { String key = keys.next(); if (key.equals("contrail-service-instance-fqdn")) { String contrailServiceInstanceFqdn = vfModuleOutputs.get(key); - msoLogger.debug("Obtained contrailServiceInstanceFqdn: " + contrailServiceInstanceFqdn); + logger.debug("Obtained contrailServiceInstanceFqdn: {}", contrailServiceInstanceFqdn); vfModule.setContrailServiceInstanceFqdn(contrailServiceInstanceFqdn); execution.setVariable(CONTRAIL_SERVICE_INSTANCE_FQDN, contrailServiceInstanceFqdn); } else if (key.endsWith("contrail_network_policy_fqdn")) { String contrailNetworkPolicyFqdn = vfModuleOutputs.get(key); - msoLogger.debug("Obtained contrailNetworkPolicyFqdn: " + contrailNetworkPolicyFqdn); + logger.debug("Obtained contrailNetworkPolicyFqdn: {}", contrailNetworkPolicyFqdn); contrailNetworkPolicyFqdnList.add(contrailNetworkPolicyFqdn); } else if (key.equals("oam_management_v4_address")) { String oamManagementV4Address = vfModuleOutputs.get(key); - msoLogger.debug("Obtained oamManagementV4Address: " + oamManagementV4Address); + logger.debug("Obtained oamManagementV4Address: {}", oamManagementV4Address); genericVnf.setIpv4OamAddress(oamManagementV4Address); execution.setVariable(OAM_MANAGEMENT_V4_ADDRESS, oamManagementV4Address); } else if (key.equals("oam_management_v6_address")) { String oamManagementV6Address = vfModuleOutputs.get(key); - msoLogger.debug("Obtained oamManagementV6Address: " + oamManagementV6Address); + logger.debug("Obtained oamManagementV6Address: {}", oamManagementV6Address); genericVnf.setManagementV6Address(oamManagementV6Address); execution.setVariable(OAM_MANAGEMENT_V6_ADDRESS, oamManagementV6Address); } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java index e0cbb82484..e0516ce9af 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/appc/tasks/AppcRunTasks.java @@ -39,12 +39,14 @@ import org.onap.so.db.catalog.beans.ControllerSelectionReference; import org.onap.so.db.catalog.client.CatalogDbClient; import org.onap.so.logger.MessageEnum; import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class AppcRunTasks { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AppcRunTasks.class); + private static final Logger logger = LoggerFactory.getLogger(AppcRunTasks.class); @Autowired private ExceptionBuilder exceptionUtil; @Autowired @@ -72,7 +74,7 @@ public class AppcRunTasks { } public void runAppcCommand(BuildingBlockExecution execution, Action action) { - msoLogger.trace("Start runAppcCommand "); + logger.trace("Start runAppcCommand "); String appcCode = "1002"; String appcMessage = ""; try { @@ -123,22 +125,24 @@ public class AppcRunTasks { if (pay != null) { payload = Optional.of(pay); } - } - msoLogger.debug("Running APP-C action: " + action.toString()); - msoLogger.debug("VNFID: " + vnfId); + } + logger.debug("Running APP-C action: {}", action.toString()); + logger.debug("VNFID: {}", vnfId); appCClient.runAppCCommand(action, msoRequestId, vnfId, payload, payloadInfo, controllerType); appcCode = appCClient.getErrorCode(); appcMessage = appCClient.getErrorMessage(); mapRollbackVariables(execution, action, appcCode); } catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION, "Caught exception in runAppcCommand", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "APPC Error", e); + logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), + "Caught exception in runAppcCommand", "BPMN", MsoLogger.getServiceName(), + MsoLogger.ErrorCode.UnknownError.getValue(), "APPC Error", e); appcMessage = e.getMessage(); } - msoLogger.error("Error Message: " + appcMessage); - msoLogger.error("ERROR CODE: " + appcCode); - msoLogger.trace("End of runAppCommand "); + logger.error("Error Message: {}", appcMessage); + logger.error("ERROR CODE: {}", appcCode); + logger.trace("End of runAppCommand "); if (appcCode != null && !appcCode.equals("0")) { exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(appcCode), appcMessage); } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/AssignNetwork.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/AssignNetwork.java index 7c9e000a44..753a29f208 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/AssignNetwork.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/AssignNetwork.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 @@ -24,15 +26,15 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network; import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; import org.onap.so.db.catalog.beans.OrchestrationStatus; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class AssignNetwork { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, - AssignNetwork.class); + private static final Logger logger = LoggerFactory.getLogger(AssignNetwork.class); @Autowired private ExtractPojosForBB extractPojosForBB; @@ -50,7 +52,7 @@ public class AssignNetwork { if (!OrchestrationStatus.PRECREATED.equals(l3network.getOrchestrationStatus())){ networkFound = true; - msoLogger.debug("network found in NOT PRECREATED status"); + logger.debug("network found in NOT PRECREATED status"); } } catch (Exception ex) { // return false if no network present diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/AssignNetworkBBUtils.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/AssignNetworkBBUtils.java index 6217f87420..df3f5465e6 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/AssignNetworkBBUtils.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/AssignNetworkBBUtils.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 @@ -27,15 +29,15 @@ import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; import org.onap.so.client.exception.ExceptionBuilder; import org.onap.so.client.orchestration.AAINetworkResources; import org.onap.so.client.orchestration.SDNCNetworkResources; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class AssignNetworkBBUtils { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, - AssignNetworkBBUtils.class); + private static final Logger logger = LoggerFactory.getLogger(AssignNetworkBBUtils.class); @Autowired private ExceptionBuilder exceptionUtil; @Autowired @@ -85,7 +87,7 @@ public class AssignNetworkBBUtils { */ public void processSilentSuccess(BuildingBlockExecution execution) { String msg = "Silent success processing network assign"; - msoLogger.info(msg); + logger.info(msg); } /** diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOut.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOut.java index 615b7279dc..ba04b16b14 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOut.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigurationScaleOut.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 @@ -39,6 +41,8 @@ import org.onap.so.db.catalog.beans.ControllerSelectionReference; import org.onap.so.db.catalog.client.CatalogDbClient; import org.onap.so.logger.MessageEnum; import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -48,7 +52,7 @@ import com.jayway.jsonpath.JsonPath; @Component public class ConfigurationScaleOut { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, ConfigurationScaleOut.class); + private static final Logger logger = LoggerFactory.getLogger(ConfigurationScaleOut.class); @Autowired private ExceptionBuilder exceptionUtil; @Autowired @@ -100,7 +104,7 @@ public class ConfigurationScaleOut { configScaleOutParam = JsonPath.parse(sdncVfModuleQueryResponse).read(paramValue); }catch(ClassCastException e){ configScaleOutParam = null; - msoLogger.warnSimple("Incorrect JSON path. Path points to object rather than value causing: ", e); + logger.warn("Incorrect JSON path. Path points to object rather than value causing: ", e); } paramsMap.put(key, configScaleOutParam); } @@ -125,7 +129,7 @@ public class ConfigurationScaleOut { } public void callAppcClient(BuildingBlockExecution execution) { - msoLogger.trace("Start runAppcCommand "); + logger.trace("Start runAppcCommand "); String appcCode = "1002"; String appcMessage = ""; try{ @@ -141,20 +145,22 @@ public class ConfigurationScaleOut { HashMap<String, String> payloadInfo = new HashMap<>(); payloadInfo.put(VNF_NAME, execution.getVariable(VNF_NAME)); payloadInfo.put(VFMODULE_ID,execution.getVariable(VFMODULE_ID)); - msoLogger.debug("Running APP-C action: " + commandAction.toString()); - msoLogger.debug("VNFID: " + vnfId); + logger.debug("Running APP-C action: {}", commandAction.toString()); + logger.debug("VNFID: {}", vnfId); //PayloadInfo contains extra information that adds on to payload before making request to appc appCClient.runAppCCommand(commandAction, msoRequestId, vnfId, payloadString, payloadInfo, controllerType); appcCode = appCClient.getErrorCode(); appcMessage = appCClient.getErrorMessage(); } catch (Exception e) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION, "Caught exception in runAppcCommand in ConfigurationScaleOut", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "APPC Error", e); + logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), + "Caught exception in runAppcCommand in ConfigurationScaleOut", "BPMN", + MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "APPC Error", e); appcMessage = e.getMessage(); } - msoLogger.error("Error Message: " + appcMessage); - msoLogger.error("ERROR CODE: " + appcCode); - msoLogger.trace("End of runAppCommand "); + logger.error("Error Message: " + appcMessage); + logger.error("ERROR CODE: " + appcCode); + logger.trace("End of runAppCommand "); if (appcCode != null && !appcCode.equals("0")) { exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(appcCode), appcMessage); } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetwork.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetwork.java index 08d5afcc44..962d4fa8c4 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetwork.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetwork.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 @@ -30,14 +32,15 @@ import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; import org.onap.so.client.adapter.network.mapper.NetworkAdapterObjectMapper; import org.onap.so.client.exception.ExceptionBuilder; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class CreateNetwork { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, CreateNetwork.class); + private static final Logger logger = LoggerFactory.getLogger(CreateNetwork.class); @Autowired private ExceptionBuilder exceptionUtil; @Autowired diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetworkCollection.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetworkCollection.java index c8c4d439bd..060775e1d7 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetworkCollection.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/CreateNetworkCollection.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 @@ -27,13 +29,14 @@ import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; import org.onap.so.client.exception.ExceptionBuilder; import org.onap.so.client.orchestration.AAINetworkResources; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class CreateNetworkCollection { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, CreateNetworkCollection.class); + private static final Logger logger = LoggerFactory.getLogger(CreateNetworkCollection.class); @Autowired private ExceptionBuilder exceptionUtil; @Autowired diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java index 4f2e2c98d2..bb33b521d6 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/GenericVnfHealthCheck.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 @@ -21,9 +23,6 @@ package org.onap.so.bpmn.infrastructure.flowspecific.tasks; import java.util.HashMap; import java.util.Optional; -import java.net.HttpURLConnection; -import java.net.SocketTimeoutException; -import org.apache.http.conn.ConnectTimeoutException; import org.camunda.bpm.engine.delegate.BpmnError; import org.onap.appc.client.lcm.model.Action; import org.onap.so.bpmn.common.BuildingBlockExecution; @@ -37,13 +36,15 @@ import org.onap.so.db.catalog.client.CatalogDbClient; import org.onap.so.db.catalog.beans.ControllerSelectionReference; import org.onap.so.logger.MessageEnum; import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class GenericVnfHealthCheck { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, GenericVnfHealthCheck.class); + private static final Logger logger = LoggerFactory.getLogger(GenericVnfHealthCheck.class); @Autowired private ExceptionBuilder exceptionUtil; @Autowired @@ -82,7 +83,7 @@ public class GenericVnfHealthCheck { } public void callAppcClient(BuildingBlockExecution execution) { - msoLogger.trace("Start runAppcCommand "); + logger.trace("Start runAppcCommand "); String appcCode = "1002"; String appcMessage = ""; try { @@ -102,32 +103,38 @@ public class GenericVnfHealthCheck { payloadInfo.put("oamIpAddress",execution.getVariable("oamIpAddress")); payloadInfo.put("vnfHostIpAddress",execution.getVariable("vnfHostIpAddress")); - msoLogger.debug("Running APP-C action: " + action.toString()); - msoLogger.debug("VNFID: " + vnfId); + logger.debug("Running APP-C action: {}", action.toString()); + logger.debug("VNFID: {}", vnfId); //PayloadInfo contains extra information that adds on to payload before making request to appc appCClient.runAppCCommand(action, msoRequestId, vnfId, payload, payloadInfo, controllerType); appcCode = appCClient.getErrorCode(); appcMessage = appCClient.getErrorMessage(); } catch (BpmnError ex) { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, "Caught exception in GenericVnfHealthCheck", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + ex); + logger.error("", MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(), "Caught exception in GenericVnfHealthCheck", "BPMN", + MsoLogger + .getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), ex); appcMessage = ex.getMessage(); exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(appcCode), appcMessage); } catch (Exception e) { if (e instanceof java.util.concurrent.TimeoutException ) { appcMessage = "Request to APPC timed out. "; - msoLogger.error(MessageEnum.RA_CONNECTION_EXCEPTION, "Caught timedOut exception in runAppcCommand in GenericVnfHealthCheck", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "APPC Error", e); + logger.error("{} {} {} {} {} {}", MessageEnum.RA_CONNECTION_EXCEPTION.toString(), + "Caught timedOut exception in runAppcCommand in GenericVnfHealthCheck", "BPMN", + MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), "APPC Error", e); throw e; } else { - msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION, "Caught exception in runAppcCommand in GenericVnfHealthCheck", "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "APPC Error", e); + logger.error("{} {} {} {} {} {}", MessageEnum.BPMN_GENERAL_EXCEPTION.toString(), + "Caught exception in runAppcCommand in GenericVnfHealthCheck", "BPMN", MsoLogger.getServiceName(), + MsoLogger.ErrorCode.UnknownError.getValue(), "APPC Error", e); appcMessage = e.getMessage(); exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(appcCode), appcMessage); } } - msoLogger.error("Error Message: " + appcMessage); - msoLogger.error("ERROR CODE: " + appcCode); - msoLogger.trace("End of runAppCommand "); + logger.error("Error Message: " + appcMessage); + logger.error("ERROR CODE: " + appcCode); + logger.trace("End of runAppCommand "); if (appcCode != null && !appcCode.equals("0")) { exceptionUtil.buildAndThrowWorkflowException(execution, Integer.parseInt(appcCode), appcMessage); } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBB.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBB.java index c45a47bc12..c7fd41c77a 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBB.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignNetworkBB.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 @@ -29,14 +31,15 @@ import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; import org.onap.so.client.aai.entities.AAIResultWrapper; import org.onap.so.client.exception.ExceptionBuilder; import org.onap.so.client.orchestration.AAINetworkResources; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class UnassignNetworkBB { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, UnassignNetworkBB.class); + private static final Logger logger = LoggerFactory.getLogger(UnassignNetworkBB.class); private static String MESSAGE_CANNOT_PERFORM_UNASSIGN = "Cannot perform Unassign Network. Network is still related to "; private static String MESSAGE_ERROR_ROLLBACK = " Rollback is not possible. Please restore data manually."; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java index 43ee71e676..3793adc5d0 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.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 @@ -41,13 +43,14 @@ import org.onap.so.client.orchestration.SDNCVfModuleResources; import org.onap.so.client.orchestration.SDNCVnfResources; import org.onap.so.client.sdnc.beans.SDNCRequest; import org.onap.so.client.sdnc.endpoint.SDNCTopology; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class SDNCActivateTasks { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SDNCActivateTasks.class); + private static final Logger logger = LoggerFactory.getLogger(SDNCActivateTasks.class); @Autowired private SDNCVnfResources sdncVnfResources; @Autowired diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java index 2695a170b4..715322bef3 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.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 @@ -44,13 +46,14 @@ import org.onap.so.client.orchestration.SDNCVfModuleResources; import org.onap.so.client.orchestration.SDNCVnfResources; import org.onap.so.client.sdnc.beans.SDNCRequest; import org.onap.so.client.sdnc.endpoint.SDNCTopology; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class SDNCAssignTasks { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SDNCAssignTasks.class); + private static final Logger logger = LoggerFactory.getLogger(SDNCAssignTasks.class); @Autowired private SDNCServiceInstanceResources sdncSIResources; @Autowired @@ -109,7 +112,7 @@ public class SDNCAssignTasks { try{ volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID, execution.getLookupMap().get(ResourceKey.VOLUME_GROUP_ID)); } catch (BBObjectNotFoundException e){ - msoLogger.info("No volume group was found."); + logger.info("No volume group was found."); } Customer customer = gBBInput.getCustomer(); CloudRegion cloudRegion = gBBInput.getCloudRegion(); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java index eb078e04b4..d7313ad9a4 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.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 @@ -42,14 +44,14 @@ import org.onap.so.client.orchestration.SDNCVfModuleResources; import org.onap.so.client.orchestration.SDNCVnfResources; import org.onap.so.client.sdnc.beans.SDNCRequest; import org.onap.so.client.sdnc.endpoint.SDNCTopology; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class SDNCDeactivateTasks { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, - SDNCDeactivateTasks.class); + private static final Logger logger = LoggerFactory.getLogger(SDNCDeactivateTasks.class); @Autowired private SDNCNetworkResources sdncNetworkResources; @Autowired diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java index 81ebfb1f41..b636fe1292 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.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 @@ -27,17 +29,17 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule; import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; import org.onap.so.client.exception.BBObjectNotFoundException; -import org.onap.so.client.exception.BadResponseException; import org.onap.so.client.exception.ExceptionBuilder; import org.onap.so.client.orchestration.SDNCVnfResources; import org.onap.so.client.orchestration.SDNCVfModuleResources; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class SDNCQueryTasks { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SDNCQueryTasks.class); + private static final Logger logger = LoggerFactory.getLogger(SDNCQueryTasks.class); @Autowired private SDNCVnfResources sdncVnfResources; @Autowired diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java index 960fb9988a..292f29c349 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.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 @@ -42,13 +44,14 @@ import org.onap.so.client.orchestration.SDNCVfModuleResources; import org.onap.so.client.orchestration.SDNCVnfResources; import org.onap.so.client.sdnc.beans.SDNCRequest; import org.onap.so.client.sdnc.endpoint.SDNCTopology; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class SDNCUnassignTasks { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SDNCUnassignTasks.class); + private static final Logger logger = LoggerFactory.getLogger(SDNCUnassignTasks.class); @Autowired private SDNCServiceInstanceResources sdncSIResources; @Autowired diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java index 2065dfb71e..75f293655f 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.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 @@ -33,13 +35,14 @@ import org.onap.so.db.catalog.beans.OrchestrationStatusStateTransitionDirective; import org.onap.so.db.catalog.beans.OrchestrationStatusValidationDirective; import org.onap.so.db.catalog.beans.ResourceType; import org.onap.so.db.catalog.client.CatalogDbClient; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class OrchestrationStatusValidator { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, OrchestrationStatusValidator.class); + private static final Logger logger = LoggerFactory.getLogger(OrchestrationStatusValidator.class); private static final String BUILDING_BLOCK_DETAIL_NOT_FOUND = "Building Block (%s) not set up in Orchestration_Status_Validation table in CatalogDB."; private static final String UNKNOWN_RESOURCE_TYPE = "Building Block (%s) not set up correctly in Orchestration_Status_Validation table in CatalogDB. ResourceType=(%s), TargetAction=(%s)"; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/sdno/tasks/SDNOHealthCheckTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/sdno/tasks/SDNOHealthCheckTasks.java index 9075fcc3cf..36162af740 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/sdno/tasks/SDNOHealthCheckTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/sdno/tasks/SDNOHealthCheckTasks.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 @@ -30,13 +32,14 @@ import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext; import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; import org.onap.so.client.exception.ExceptionBuilder; import org.onap.so.client.orchestration.SDNOHealthCheckResources; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class SDNOHealthCheckTasks { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SDNOHealthCheckTasks.class); + private static final Logger logger = LoggerFactory.getLogger(SDNOHealthCheckTasks.class); @Autowired private ExceptionBuilder exceptionUtil; @Autowired @@ -61,12 +64,12 @@ public class SDNOHealthCheckTasks { response = sdnoHealthCheckResources.healthCheck(vnf, requestContext); } catch (Exception ex) { - msoLogger.error(ex); + logger.error("Exception occurred", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex.getMessage()); } if (!response) { - msoLogger.error("SDNO Health Check failed"); + logger.error("SDNO Health Check failed"); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "SDNO Health Check failed"); } } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/namingservice/NamingClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/namingservice/NamingClient.java index 0419896444..9613fbdcf1 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/namingservice/NamingClient.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/namingservice/NamingClient.java @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2017 - 2019 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 @@ -29,7 +31,8 @@ import org.onap.namingservice.model.NameGenDeleteResponse; import org.onap.namingservice.model.NameGenRequest; import org.onap.namingservice.model.NameGenResponse; import org.onap.so.client.exception.BadResponseException; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.http.HttpEntity; @@ -45,7 +48,7 @@ import org.springframework.web.client.RestTemplate; @Component public class NamingClient{ - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, NamingClient.class); + private static final Logger logger = LoggerFactory.getLogger(NamingClient.class); private static final String ENDPOINT = "mso.naming.endpoint"; private static final String AUTH = "mso.naming.auth"; @@ -59,7 +62,7 @@ public class NamingClient{ public String postNameGenRequest(NameGenRequest request) throws BadResponseException, IOException { String targetUrl = env.getProperty(ENDPOINT); HttpHeaders headers = setHeaders(env.getProperty(AUTH)); - msoLogger.info("Sending postNameGenRequest to url: " + targetUrl); + logger.info("Sending postNameGenRequest to url: {}", targetUrl); HttpEntity<NameGenRequest> requestEntity = new HttpEntity<>(request, headers); ResponseEntity<NameGenResponse> response; try{ @@ -73,7 +76,7 @@ public class NamingClient{ public String deleteNameGenRequest(NameGenDeleteRequest request) throws BadResponseException, IOException { String targetUrl = env.getProperty(ENDPOINT); HttpHeaders headers = setHeaders(env.getProperty(AUTH)); - msoLogger.info("Sending deleteNameGenRequest to url: " + targetUrl); + logger.info("Sending deleteNameGenRequest to url: {}", targetUrl); HttpEntity<NameGenDeleteRequest> requestEntity = new HttpEntity<>(request, headers); ResponseEntity<NameGenDeleteResponse> response; try{ diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/namingservice/NamingClientResponseValidator.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/namingservice/NamingClientResponseValidator.java index 3dcafe0ff4..787b811501 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/namingservice/NamingClientResponseValidator.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/namingservice/NamingClientResponseValidator.java @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2017 - 2019 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,6 +33,8 @@ import org.onap.namingservice.model.Respelement; import org.onap.so.client.exception.BadResponseException; import org.onap.so.logger.MessageEnum; import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Component; import org.springframework.web.client.HttpStatusCodeException; @@ -39,7 +43,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; @Component public class NamingClientResponseValidator { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, NamingClientResponseValidator.class); + private static final Logger logger = LoggerFactory.getLogger(NamingClientResponseValidator.class); private static final String INSTANCE_GROUP_NAME = "instance-group-name"; private static final String NO_RESPONSE_FROM_NAMING_SERVICE = "Error did not receive a response from Naming Service."; private static final String NULL_RESPONSE_FROM_NAMING_SERVICE = "Error received a null response from Naming Service."; @@ -47,8 +51,9 @@ public class NamingClientResponseValidator { public String validateNameGenResponse(ResponseEntity<NameGenResponse> response) throws BadResponseException { if (response == null) { - msoLogger.error(MessageEnum.RA_GENERAL_EXCEPTION, NO_RESPONSE_FROM_NAMING_SERVICE, "BPMN", - MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, NO_RESPONSE_FROM_NAMING_SERVICE); + logger.error("{} {} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), NO_RESPONSE_FROM_NAMING_SERVICE, + "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), + NO_RESPONSE_FROM_NAMING_SERVICE); throw new BadResponseException(NO_RESPONSE_FROM_NAMING_SERVICE); } @@ -56,13 +61,14 @@ public class NamingClientResponseValidator { String generatedName = ""; NameGenResponse responseBody = response.getBody(); if (responseBody == null) { - msoLogger.error(MessageEnum.RA_GENERAL_EXCEPTION, NULL_RESPONSE_FROM_NAMING_SERVICE, "BPMN", - MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, NULL_RESPONSE_FROM_NAMING_SERVICE); + logger.error("{} {} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), NULL_RESPONSE_FROM_NAMING_SERVICE, + "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), + NULL_RESPONSE_FROM_NAMING_SERVICE); throw new BadResponseException(NULL_RESPONSE_FROM_NAMING_SERVICE); } if (isHttpCodeSuccess(responseCode)) { - msoLogger.info("Successful Response from Naming Service"); + logger.info("Successful Response from Naming Service"); List<Respelement> respList = responseBody.getElements(); if (respList != null) { @@ -85,16 +91,17 @@ public class NamingClientResponseValidator { errorMessageString = error.getMessage(); } String errorMessage = String.format(NAMING_SERVICE_ERROR, errorMessageString); - msoLogger.error(MessageEnum.RA_GENERAL_EXCEPTION, errorMessage, "BPMN", MsoLogger.getServiceName(), - MsoLogger.ErrorCode.DataError, errorMessage); + logger.error("{} {} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), errorMessage, "BPMN", + MsoLogger.getServiceName(), MsoLogger.ErrorCode.DataError.getValue(), errorMessage); throw new BadResponseException(errorMessage); } } public String validateNameGenDeleteResponse(ResponseEntity<NameGenDeleteResponse> response) throws BadResponseException { if (response == null) { - msoLogger.error(MessageEnum.RA_GENERAL_EXCEPTION, NO_RESPONSE_FROM_NAMING_SERVICE, "BPMN", - MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, NO_RESPONSE_FROM_NAMING_SERVICE); + logger.error("{} {} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), NO_RESPONSE_FROM_NAMING_SERVICE, + "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), + NO_RESPONSE_FROM_NAMING_SERVICE); throw new BadResponseException(NO_RESPONSE_FROM_NAMING_SERVICE); } @@ -102,20 +109,21 @@ public class NamingClientResponseValidator { String responseMessage = ""; NameGenDeleteResponse responseBody = response.getBody(); if (responseBody == null) { - msoLogger.error(MessageEnum.RA_GENERAL_EXCEPTION, NULL_RESPONSE_FROM_NAMING_SERVICE, "BPMN", - MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, NULL_RESPONSE_FROM_NAMING_SERVICE); + logger.error("{} {} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), NULL_RESPONSE_FROM_NAMING_SERVICE, + "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), + NULL_RESPONSE_FROM_NAMING_SERVICE); throw new BadResponseException(NULL_RESPONSE_FROM_NAMING_SERVICE); } if (isHttpCodeSuccess(responseCode)) { - msoLogger.info("Successful Response from Naming Service"); + logger.info("Successful Response from Naming Service"); return responseMessage; } else { String errorMessageString = NAMING_SERVICE_ERROR; String errorMessage = String.format(NAMING_SERVICE_ERROR, errorMessageString); - msoLogger.error(MessageEnum.RA_GENERAL_EXCEPTION, errorMessage, "BPMN", MsoLogger.getServiceName(), - MsoLogger.ErrorCode.DataError, errorMessage); + logger.error("{} {} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), errorMessage, "BPMN", MsoLogger.getServiceName(), + MsoLogger.ErrorCode.DataError.getValue(), errorMessage); throw new BadResponseException(errorMessage); } } @@ -134,8 +142,8 @@ public class NamingClientResponseValidator { errorMessageString = error.getMessage(); } String errorMessage = String.format(NAMING_SERVICE_ERROR, errorMessageString); - msoLogger.error(MessageEnum.RA_GENERAL_EXCEPTION, errorMessage, "BPMN", MsoLogger.getServiceName(), - MsoLogger.ErrorCode.DataError, errorMessage); + logger.error("{} {} {} {} {} {}", MessageEnum.RA_GENERAL_EXCEPTION.toString(), errorMessage, "BPMN", MsoLogger.getServiceName(), + MsoLogger.ErrorCode.DataError.getValue(), errorMessage); return errorMessage; } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIServiceInstanceResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIServiceInstanceResources.java index 86dd22b65c..3032b66e6d 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIServiceInstanceResources.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIServiceInstanceResources.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 @@ -34,13 +36,15 @@ import org.onap.so.client.aai.entities.uri.AAIResourceUri; import org.onap.so.client.aai.entities.uri.AAIUriFactory; import org.onap.so.client.aai.mapper.AAIObjectMapper; import org.onap.so.db.catalog.beans.OrchestrationStatus; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class AAIServiceInstanceResources { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AAIServiceInstanceResources.class); + private static final Logger logger = LoggerFactory.getLogger(AAIServiceInstanceResources + .class); @Autowired private InjectionHelper injectionHelper; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVfModuleResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVfModuleResources.java index ef61319eee..5fa73c85ff 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVfModuleResources.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVfModuleResources.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 @@ -32,13 +34,14 @@ import org.onap.so.client.aai.entities.uri.AAIResourceUri; import org.onap.so.client.aai.entities.uri.AAIUriFactory; import org.onap.so.client.aai.mapper.AAIObjectMapper; import org.onap.so.db.catalog.beans.OrchestrationStatus; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class AAIVfModuleResources { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AAIVfModuleResources.class); + private static final Logger logger = LoggerFactory.getLogger(AAIVfModuleResources.class); @Autowired private InjectionHelper injectionHelper; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java index a9a52bd115..0c65abfe0c 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVnfResources.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 @@ -27,21 +29,20 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion; import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf; import org.onap.so.bpmn.servicedecomposition.bbobjects.LineOfBusiness; import org.onap.so.bpmn.servicedecomposition.bbobjects.Platform; -import org.onap.so.bpmn.servicedecomposition.bbobjects.Project; import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance; -import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup; import org.onap.so.client.aai.AAIObjectType; import org.onap.so.client.aai.entities.uri.AAIResourceUri; import org.onap.so.client.aai.entities.uri.AAIUriFactory; import org.onap.so.client.aai.mapper.AAIObjectMapper; import org.onap.so.db.catalog.beans.OrchestrationStatus; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class AAIVnfResources { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AAIVnfResources.class); + private static final Logger logger = LoggerFactory.getLogger(AAIVnfResources.class); @Autowired private InjectionHelper injectionHelper; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVolumeGroupResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVolumeGroupResources.java index af97e55c14..7bb96ec2ed 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVolumeGroupResources.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/AAIVolumeGroupResources.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 @@ -29,13 +31,14 @@ import org.onap.so.client.aai.entities.uri.AAIResourceUri; import org.onap.so.client.aai.entities.uri.AAIUriFactory; import org.onap.so.client.aai.mapper.AAIObjectMapper; import org.onap.so.db.catalog.beans.OrchestrationStatus; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class AAIVolumeGroupResources { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, AAIVolumeGroupResources.class); + private static final Logger logger = LoggerFactory.getLogger(AAIVolumeGroupResources.class); @Autowired private InjectionHelper injectionHelper; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/NamingServiceResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/NamingServiceResources.java index d0bf6da6c9..2a25ec5ba1 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/NamingServiceResources.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/NamingServiceResources.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 @@ -30,13 +32,14 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.InstanceGroup; import org.onap.so.client.exception.BadResponseException; import org.onap.so.client.namingservice.NamingClient; import org.onap.so.client.namingservice.NamingRequestObjectBuilder; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class NamingServiceResources { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, NamingServiceResources.class); + private static final Logger logger = LoggerFactory.getLogger(NamingServiceResources.class); private static final String NAMING_TYPE = "instanceGroup"; @Autowired diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCNetworkResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCNetworkResources.java index 8b53c28547..fb828c1981 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCNetworkResources.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCNetworkResources.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 @@ -30,14 +32,14 @@ import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext; import org.onap.so.client.sdnc.beans.SDNCSvcAction; import org.onap.so.client.sdnc.beans.SDNCSvcOperation; import org.onap.so.client.sdnc.mapper.NetworkTopologyOperationRequestMapper; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class SDNCNetworkResources { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, - SDNCNetworkResources.class); + private static final Logger logger = LoggerFactory.getLogger(SDNCNetworkResources.class); @Autowired private NetworkTopologyOperationRequestMapper sdncRM; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVfModuleResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVfModuleResources.java index e7f0a40d2a..1e3d655298 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVfModuleResources.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVfModuleResources.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 @@ -34,14 +36,14 @@ import org.onap.so.client.sdnc.SDNCClient; import org.onap.so.client.sdnc.beans.SDNCSvcAction; import org.onap.so.client.sdnc.beans.SDNCSvcOperation; import org.onap.so.client.sdnc.mapper.VfModuleTopologyOperationRequestMapper; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class SDNCVfModuleResources { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, - SDNCVfModuleResources.class); + private static final Logger logger = LoggerFactory.getLogger(SDNCVfModuleResources.class); @Autowired private VfModuleTopologyOperationRequestMapper sdncRM; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java index e5194e3e37..d8f2e47224 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/SDNCVnfResources.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 @@ -33,13 +35,14 @@ import org.onap.so.client.sdnc.SDNCClient; import org.onap.so.client.sdnc.beans.SDNCSvcAction; import org.onap.so.client.sdnc.beans.SDNCSvcOperation; import org.onap.so.client.sdnc.mapper.VnfTopologyOperationRequestMapper; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class SDNCVnfResources { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SDNCVnfResources.class); + private static final Logger logger = LoggerFactory.getLogger(SDNCVnfResources.class); @Autowired private VnfTopologyOperationRequestMapper sdncRM; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.java index 2d9032c7c0..de59e6835e 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVfModuleResources.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 @@ -32,13 +34,14 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup; import org.onap.so.bpmn.servicedecomposition.generalobjects.OrchestrationContext; import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext; import org.onap.so.client.adapter.vnf.mapper.VnfAdapterVfModuleObjectMapper; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class VnfAdapterVfModuleResources { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, VnfAdapterVfModuleResources.class); + private static final Logger logger = LoggerFactory.getLogger(VnfAdapterVfModuleResources.class); @Autowired private VnfAdapterVfModuleObjectMapper vnfAdapterVfModuleObjectMapper; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVolumeGroupResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVolumeGroupResources.java index efbbeae737..737e9eeb37 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVolumeGroupResources.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/VnfAdapterVolumeGroupResources.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 @@ -30,13 +32,14 @@ import org.onap.so.bpmn.servicedecomposition.generalobjects.OrchestrationContext import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext; import org.onap.so.client.adapter.vnf.VnfVolumeAdapterClientImpl; import org.onap.so.client.adapter.vnf.mapper.VnfAdapterObjectMapper; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class VnfAdapterVolumeGroupResources { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, VnfAdapterVolumeGroupResources.class); + private static final Logger logger = LoggerFactory.getLogger(VnfAdapterVolumeGroupResources.class); @Autowired private VnfAdapterObjectMapper vnfAdapterObjectMapper; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java index 7ad2ef00b2..99d5fca31f 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.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 @@ -29,7 +31,8 @@ import org.onap.so.client.exception.BadResponseException; import org.onap.so.client.exception.MapperException; import org.onap.so.client.sdnc.beans.SDNCProperties; import org.onap.so.client.sdnc.endpoint.SDNCTopology; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.HttpHeaders; @@ -38,7 +41,7 @@ import org.springframework.stereotype.Component; @Component public class SDNCClient { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SDNCClient.class); + private static final Logger logger = LoggerFactory.getLogger(SDNCClient.class); private BaseClient<String, LinkedHashMap<String, Object>> STOClient = new BaseClient<>(); @Autowired diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java index 13ba107576..2f9c8da5f0 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SdnCommonTasks.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 @@ -30,6 +32,8 @@ import org.onap.so.client.exception.BadResponseException; import org.onap.so.client.exception.MapperException; import org.onap.so.logger.MessageEnum; import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.stereotype.Component; @@ -42,7 +46,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; @Component public class SdnCommonTasks { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SDNCClient.class); + private static final Logger logger = LoggerFactory.getLogger(SDNCClient.class); private static final String RESPONSE_CODE = "response-code"; private static final String RESPONSE_MESSAGE = "response-message"; private static final String NO_RESPONSE_FROM_SDNC = "Error did not receive a response from SDNC."; @@ -63,11 +67,13 @@ public class SdnCommonTasks { try { jsonRequest = objMapper.writerWithDefaultPrettyPrinter().writeValueAsString(request); } catch (JsonProcessingException e) { - msoLogger.error(MessageEnum.JAXB_EXCEPTION, COULD_NOT_CONVERT_SDNC_POJO_TO_JSON, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.DataError, e.getMessage()); + logger.error("{} {} {} {} {} {}", MessageEnum.JAXB_EXCEPTION.toString(), + COULD_NOT_CONVERT_SDNC_POJO_TO_JSON, + "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.DataError.getValue(), e.getMessage()); throw new MapperException(COULD_NOT_CONVERT_SDNC_POJO_TO_JSON); } jsonRequest = "{\"input\":" + jsonRequest + "}"; - msoLogger.info(jsonRequest); + logger.info(jsonRequest); return jsonRequest; } @@ -94,8 +100,8 @@ public class SdnCommonTasks { */ public String validateSDNResponse(LinkedHashMap<String, Object> output) throws BadResponseException { if (CollectionUtils.isEmpty(output)) { - msoLogger.error(MessageEnum.RA_RESPONSE_FROM_SDNC, NO_RESPONSE_FROM_SDNC, "BPMN", - MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, NO_RESPONSE_FROM_SDNC); + logger.error("{} {} {} {} {} {}", MessageEnum.RA_RESPONSE_FROM_SDNC.toString(), NO_RESPONSE_FROM_SDNC, "BPMN", + MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), NO_RESPONSE_FROM_SDNC); throw new BadResponseException(NO_RESPONSE_FROM_SDNC); } LinkedHashMap<String, Object> embeddedResponse =(LinkedHashMap<String, Object>) output.get("output"); @@ -109,21 +115,21 @@ public class SdnCommonTasks { String jsonResponse; try { jsonResponse = objMapper.writeValueAsString(output); - msoLogger.debug(jsonResponse); + logger.debug(jsonResponse); } catch (JsonProcessingException e) { - msoLogger.warnSimple("Could not convert SDNC Response to String", e); + logger.warn("Could not convert SDNC Response to String", e); jsonResponse = ""; } - msoLogger.info("ResponseCode: " + responseCode + " ResponseMessage: " + responseMessage); + logger.info("ResponseCode: {} ResponseMessage: {}", responseCode, responseMessage); int code = StringUtils.isNotEmpty(responseCode) ? Integer.parseInt(responseCode) : 0; if (isHttpCodeSuccess(code)) { - msoLogger.info("Successful Response from SDNC"); + logger.info("Successful Response from SDNC"); return jsonResponse; } else { String errorMessage = String.format(SDNC_CODE_NOT_0_OR_IN_200_299, responseMessage); - msoLogger.error(MessageEnum.RA_RESPONSE_FROM_SDNC, errorMessage, "BPMN", MsoLogger.getServiceName(), - MsoLogger.ErrorCode.DataError, errorMessage); - throw new BadResponseException(errorMessage); + logger.error("{} {} {} {} {} {}", MessageEnum.RA_RESPONSE_FROM_SDNC.toString(), errorMessage, "BPMN", + MsoLogger.getServiceName(), MsoLogger.ErrorCode.DataError.getValue(), errorMessage); + throw new BadResponseException(errorMessage); } } @@ -135,20 +141,23 @@ public class SdnCommonTasks { */ public String validateSDNGetResponse(LinkedHashMap<String, Object> output) throws BadResponseException { if (CollectionUtils.isEmpty(output)) { - msoLogger.error(MessageEnum.RA_RESPONSE_FROM_SDNC, NO_RESPONSE_FROM_SDNC, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, NO_RESPONSE_FROM_SDNC); + logger.error("{} {} {} {} {} {}", MessageEnum.RA_RESPONSE_FROM_SDNC.toString(), NO_RESPONSE_FROM_SDNC, "BPMN", + MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), NO_RESPONSE_FROM_SDNC); throw new BadResponseException(NO_RESPONSE_FROM_SDNC); } ObjectMapper objMapper = new ObjectMapper(); - msoLogger.debug("Using object mapper"); + logger.debug("Using object mapper"); String stringOutput = ""; try { stringOutput = objMapper.writeValueAsString(output); } catch (Exception e) { - msoLogger.error(MessageEnum.RA_RESPONSE_FROM_SDNC, BAD_RESPONSE_FROM_SDNC, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, BAD_RESPONSE_FROM_SDNC); + logger.error("{} {} {} {} {} {}", MessageEnum.RA_RESPONSE_FROM_SDNC.toString(), BAD_RESPONSE_FROM_SDNC, + "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), + BAD_RESPONSE_FROM_SDNC); throw new BadResponseException(BAD_RESPONSE_FROM_SDNC); } - msoLogger.debug("Received from GET request: " + stringOutput); + logger.debug("Received from GET request: {}", stringOutput); return stringOutput; } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java index b656579c69..8e0072b16c 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/mapper/VfModuleTopologyOperationRequestMapper.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 @@ -35,6 +37,8 @@ import org.onap.so.client.sdnc.beans.SDNCSvcAction; import org.onap.so.client.sdnc.beans.SDNCSvcOperation; import org.onap.so.logger.MessageEnum; import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import org.onap.sdnc.northbound.client.model.GenericResourceApiParam; @@ -54,7 +58,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; @Component public class VfModuleTopologyOperationRequestMapper { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, VfModuleTopologyOperationRequestMapper.class); + private static final Logger logger = LoggerFactory.getLogger(VfModuleTopologyOperationRequestMapper.class); static GeneralTopologyObjectMapper generalTopologyObjectMapper = new GeneralTopologyObjectMapper(); public GenericResourceApiVfModuleOperationInformation reqMapper(SDNCSvcOperation svcOperation, @@ -166,8 +170,9 @@ public class VfModuleTopologyOperationRequestMapper { try { GenericResourceApiVfModuleResponseInformation assignResponseInfo = mapper.readValue(sdncAssignResponse, GenericResourceApiVfModuleResponseInformation.class); objectPath = assignResponseInfo.getVfModuleResponseInformation().getObjectPath(); - } catch (Exception e) { - msoLogger.error(MessageEnum.RA_RESPONSE_FROM_SDNC, e.getMessage(), "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, e.getMessage()); + } catch (Exception e) { + logger.error("{} {} {} {} {} {}", MessageEnum.RA_RESPONSE_FROM_SDNC.toString(), e.getMessage(), "BPMN", + MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError.getValue(), e.getMessage()); } } return objectPath; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java index 7f09305d95..5a48a757bc 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.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 @@ -29,7 +31,8 @@ import org.onap.so.client.exception.BadResponseException; import org.onap.so.client.sniro.beans.ManagerProperties; import org.onap.so.client.sniro.beans.SniroConductorRequest; import org.onap.so.client.sniro.beans.SniroManagerRequest; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.HttpHeaders; @@ -42,7 +45,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; @Component public class SniroClient { - private static final MsoLogger log = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SniroClient.class); + private static final Logger logger = LoggerFactory.getLogger(SniroClient.class); @Autowired private ManagerProperties managerProperties; @@ -61,10 +64,10 @@ public class SniroClient { * @throws BpmnError */ public void postDemands(SniroManagerRequest homingRequest) throws BadResponseException, JsonProcessingException{ - log.trace("Started Sniro Client Post Demands"); + logger.trace("Started Sniro Client Post Demands"); String url = managerProperties.getHost() + managerProperties.getUri().get("v2"); - log.debug("Post demands url: " + url); - log.debug("Post demands payload: " + homingRequest.toJsonString()); + logger.debug("Post demands url: {}", url); + logger.debug("Post demands payload: {}", homingRequest.toJsonString()); HttpHeaders header = new HttpHeaders(); header.setContentType(MediaType.APPLICATION_JSON); @@ -79,7 +82,7 @@ public class SniroClient { LinkedHashMap<String, Object> response = baseClient.post(homingRequest.toJsonString(), new ParameterizedTypeReference<LinkedHashMap<String, Object>>() {}); validator.validateDemandsResponse(response); - log.trace("Completed Sniro Client Post Demands"); + logger.trace("Completed Sniro Client Post Demands"); } /** @@ -94,10 +97,10 @@ public class SniroClient { * @throws BadResponseException */ public void postRelease(SniroConductorRequest releaseRequest) throws BadResponseException { - log.trace("Started Sniro Client Post Release"); + logger.trace("Started Sniro Client Post Release"); String url = UrnPropertiesReader.getVariable("sniro.conductor.host") + UrnPropertiesReader.getVariable("sniro.conductor.uri"); - log.debug("Post release url: " + url); - log.debug("Post release payload: " + releaseRequest.toJsonString()); + logger.debug("Post release url: {}", url); + logger.debug("Post release payload: {}", releaseRequest.toJsonString()); HttpHeaders header = new HttpHeaders(); header.setContentType(MediaType.APPLICATION_JSON); @@ -110,7 +113,7 @@ public class SniroClient { LinkedHashMap<String, Object> response = baseClient.post(releaseRequest.toJsonString(), new ParameterizedTypeReference<LinkedHashMap<String, Object>>() {}); SniroValidator v = new SniroValidator(); v.validateReleaseResponse(response); - log.trace("Completed Sniro Client Post Release"); + logger.trace("Completed Sniro Client Post Release"); } } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroValidator.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroValidator.java index 0d0c1be5aa..dcccd319c6 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroValidator.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroValidator.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 @@ -28,7 +30,8 @@ import java.util.LinkedHashMap; import org.json.JSONObject; import org.onap.so.client.exception.BadResponseException; -import org.onap.so.logger.MsoLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; @@ -36,7 +39,7 @@ import org.springframework.stereotype.Component; @Component public class SniroValidator { - private static final MsoLogger log = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SniroValidator.class); + private static final Logger logger = LoggerFactory.getLogger(SniroValidator.class); /** * Validates the synchronous homing response from sniro manager @@ -44,29 +47,29 @@ public class SniroValidator { * @throws BadResponseException */ public void validateDemandsResponse(LinkedHashMap<String, Object> response) throws BadResponseException { - log.debug("Validating Sniro Managers synchronous response"); + logger.debug("Validating Sniro Managers synchronous response"); if(!response.isEmpty()){ JSONObject jsonResponse = new JSONObject(response); if(jsonResponse.has("requestStatus")){ String status = jsonResponse.getString("requestStatus"); if(status.equals("accepted")){ - log.debug("Sniro Managers synchronous response indicates accepted"); + logger.debug("Sniro Managers synchronous response indicates accepted"); }else{ String message = jsonResponse.getString("statusMessage"); if(isNotBlank(message)){ - log.debug("Sniro Managers response indicates failed: " + message); + logger.debug("Sniro Managers response indicates failed: " + message); }else{ - log.debug("Sniro Managers response indicates failed: no status message provided"); + logger.debug("Sniro Managers response indicates failed: no status message provided"); message = "error message not provided"; } throw new BadResponseException("Sniro Managers synchronous response indicates failed: " + message); } }else{ - log.debug("Sniro Managers synchronous response does not contain: request status"); + logger.debug("Sniro Managers synchronous response does not contain: request status"); throw new BadResponseException("Sniro Managers synchronous response does not contain: request status"); } }else{ - log.debug("Sniro Managers synchronous response is empty"); + logger.debug("Sniro Managers synchronous response is empty"); throw new BadResponseException("Sniro Managers synchronous response i is empty"); } } @@ -78,23 +81,23 @@ public class SniroValidator { * @throws BadResponseException */ public static void validateSolution(String response) throws BadResponseException{ - log.debug("Validating Sniro Managers asynchronous callback response"); + logger.debug("Validating Sniro Managers asynchronous callback response"); if(isNotBlank(response)) { JSONObject jsonResponse = new JSONObject(response); if(!jsonResponse.has("serviceException")){ - log.debug("Sniro Managers asynchronous response is valid"); + logger.debug("Sniro Managers asynchronous response is valid"); }else{ String message = jsonResponse.getJSONObject("serviceException").getString("text"); if(isNotBlank(message)){ - log.debug("Sniro Managers response contains a service exception: " + message); + logger.debug("Sniro Managers response contains a service exception: " + message); }else{ - log.debug("Sniro Managers response contains a service exception: no service exception text provided"); + logger.debug("Sniro Managers response contains a service exception: no service exception text provided"); message = "error message not provided"; } throw new BadResponseException("Sniro Managers asynchronous response contains a service exception: " + message); } }else{ - log.debug("Sniro Managers asynchronous response is empty"); + logger.debug("Sniro Managers asynchronous response is empty"); throw new BadResponseException("Sniro Managers asynchronous response is empty"); } } @@ -106,33 +109,31 @@ public class SniroValidator { * @throws BadResponseException */ public void validateReleaseResponse(LinkedHashMap<String, Object> response) throws BadResponseException { - log.debug("Validating Sniro Conductors response"); + logger.debug("Validating Sniro Conductors response"); if(!response.isEmpty()){ String status = (String) response.get("status"); if(isNotBlank(status)){ if(status.equals("success")){ - log.debug("Sniro Conductors synchronous response indicates success"); + logger.debug("Sniro Conductors synchronous response indicates success"); }else{ String message = (String) response.get("message"); if(isNotBlank(message)){ - log.debug("Sniro Conductors response indicates failed: " + message); + logger.debug("Sniro Conductors response indicates failed: " + message); }else{ - log.debug("Sniro Conductors response indicates failed: error message not provided"); + logger.debug("Sniro Conductors response indicates failed: error message not provided"); message = "error message not provided"; } throw new BadResponseException("Sniro Conductors synchronous response indicates failed: " + message); } }else{ - log.debug("Sniro Managers Conductors response does not contain: status"); + logger.debug("Sniro Managers Conductors response does not contain: status"); throw new BadResponseException("Sniro Conductors synchronous response does not contain: status"); } }else{ - log.debug("Sniro Conductors response is empty"); + logger.debug("Sniro Conductors response is empty"); throw new BadResponseException("Sniro Conductors response is empty"); } } - - } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SniroConductorRequest.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SniroConductorRequest.java index bc8e27ce86..11417d646c 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SniroConductorRequest.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SniroConductorRequest.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 @@ -24,19 +26,19 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.List; -import org.onap.so.logger.MsoLogger; - import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectWriter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class SniroConductorRequest implements Serializable{ private static final long serialVersionUID = 1906052095861777655L; - private static final MsoLogger log = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SniroConductorRequest.class); + private static final Logger logger = LoggerFactory.getLogger(SniroConductorRequest.class); @JsonProperty("release-locks") private List<Resource> resources = new ArrayList<Resource>(); @@ -55,7 +57,7 @@ public class SniroConductorRequest implements Serializable{ try{ json = ow.writeValueAsString(this); }catch (Exception e){ - log.error("Unable to convert SniroConductorRequest to string", e); + logger.error("Unable to convert SniroConductorRequest to string", e); } return json; } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SniroManagerRequest.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SniroManagerRequest.java index 3c39456318..c1e376814f 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SniroManagerRequest.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SniroManagerRequest.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 @@ -22,20 +24,19 @@ package org.onap.so.client.sniro.beans; import java.io.Serializable; -import org.onap.so.logger.MsoLogger; - import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonRawValue; import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectWriter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class SniroManagerRequest implements Serializable{ private static final long serialVersionUID = -1541132882892163132L; - private static final MsoLogger log = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, SniroManagerRequest.class); + private static final Logger logger = LoggerFactory.getLogger(SniroManagerRequest.class); @JsonProperty("requestInfo") private RequestInfo requestInformation; @@ -82,7 +83,7 @@ public class SniroManagerRequest implements Serializable{ try{ json = ow.writeValueAsString(this); }catch (Exception e){ - log.error("Unable to convert SniroManagerRequest to string", e); + logger.error("Unable to convert SniroManagerRequest to string", e); } return json.replaceAll("\\\\", ""); } |