From ca297aeb432b3d718bf09f0bac7b9f051c26e66d Mon Sep 17 00:00:00 2001 From: vempo Date: Tue, 30 Jan 2018 21:35:14 +0200 Subject: Removed log constants Removed constants associated with audit/metrics logging. Deleted unused code. Some other safe cleanup and refactoring. Change-Id: Idfda72e1fb27ca695a74f2a09cb46381c9caed1a Issue-ID: SDC-772 Signed-off-by: vempo --- .../applicationconfig/impl/ApplicationConfigManagerImpl.java | 7 +------ .../sdc/validation/impl/UploadValidationManagerImpl.java | 9 +-------- .../sdc/vendorlicense/impl/VendorLicenseManagerImpl.java | 12 ------------ .../utils/VendorSoftwareProductUtils.java | 4 ---- 4 files changed, 2 insertions(+), 30 deletions(-) (limited to 'openecomp-be/backend') diff --git a/openecomp-be/backend/openecomp-sdc-application-config-manager/src/main/java/org/openecomp/sdc/applicationconfig/impl/ApplicationConfigManagerImpl.java b/openecomp-be/backend/openecomp-sdc-application-config-manager/src/main/java/org/openecomp/sdc/applicationconfig/impl/ApplicationConfigManagerImpl.java index 777739983d..50b0100522 100644 --- a/openecomp-be/backend/openecomp-sdc-application-config-manager/src/main/java/org/openecomp/sdc/applicationconfig/impl/ApplicationConfigManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-application-config-manager/src/main/java/org/openecomp/sdc/applicationconfig/impl/ApplicationConfigManagerImpl.java @@ -28,13 +28,8 @@ import org.openecomp.sdc.applicationconfig.ApplicationConfigManager; import org.openecomp.sdc.common.errors.CoreException; import org.openecomp.sdc.common.errors.ErrorCategory; import org.openecomp.sdc.common.errors.ErrorCode; -import org.openecomp.sdc.datatypes.error.ErrorLevel; import org.openecomp.sdc.logging.api.Logger; import org.openecomp.sdc.logging.api.LoggerFactory; -import org.openecomp.sdc.logging.types.LoggerConstants; -import org.openecomp.sdc.logging.types.LoggerErrorCode; -import org.openecomp.sdc.logging.types.LoggerErrorDescription; -import org.openecomp.sdc.logging.types.LoggerTragetServiceName; import java.util.Collection; @@ -43,7 +38,7 @@ import java.util.Collection; */ public class ApplicationConfigManagerImpl implements ApplicationConfigManager { - private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + private final Logger log = LoggerFactory.getLogger(this.getClass().getName()); private static final String SCHEMA_GENERATOR_INITIALIZATION_ERROR = "SCHEMA_GENERATOR_INITIALIZATION_ERROR"; diff --git a/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/impl/UploadValidationManagerImpl.java b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/impl/UploadValidationManagerImpl.java index ac2d912e24..42c77b96d8 100644 --- a/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/impl/UploadValidationManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/impl/UploadValidationManagerImpl.java @@ -30,19 +30,13 @@ import org.openecomp.sdc.common.errors.ErrorCategory; import org.openecomp.sdc.common.errors.ErrorCode; import org.openecomp.sdc.common.errors.Messages; import org.openecomp.sdc.common.utils.SdcCommon; -import org.openecomp.sdc.datatypes.error.ErrorLevel; import org.openecomp.sdc.datatypes.error.ErrorMessage; import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList; import org.openecomp.sdc.heat.services.tree.HeatTreeManager; import org.openecomp.sdc.heat.services.tree.HeatTreeManagerUtil; -import org.openecomp.sdc.logging.types.LoggerConstants; -import org.openecomp.sdc.logging.types.LoggerErrorCode; -import org.openecomp.sdc.logging.types.LoggerErrorDescription; -import org.openecomp.sdc.logging.types.LoggerTragetServiceName; import org.openecomp.sdc.validation.UploadValidationManager; import org.openecomp.sdc.validation.types.ValidationFileResponse; import org.openecomp.sdc.validation.util.ValidationManagerUtil; -import org.slf4j.MDC; import java.io.ByteArrayInputStream; import java.io.File; @@ -94,7 +88,6 @@ public class UploadValidationManagerImpl implements UploadValidationManager { } if (CollectionUtils.isNotEmpty(folderList)) { - MDC.put(LoggerConstants.ERROR_DESCRIPTION, LoggerErrorDescription.INVALID_ZIP); throw new CoreException((new ErrorCode.ErrorCodeBuilder()) .withMessage(Messages.ZIP_SHOULD_NOT_CONTAIN_FOLDERS.getErrorMessage()) .withId(Messages.ZIP_SHOULD_NOT_CONTAIN_FOLDERS.getErrorMessage()) @@ -125,7 +118,7 @@ public class UploadValidationManagerImpl implements UploadValidationManager { HeatTreeManager tree; ValidationStructureList validationStructureList = new ValidationStructureList(); - if (type.toLowerCase().equals("heat")) { + if (type.equalsIgnoreCase("heat")) { FileContentHandler content = getFileContent(fileToValidate); if (!content.containsFile(SdcCommon.MANIFEST_NAME)) { throw new CoreException((new ErrorCode.ErrorCodeBuilder()) diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java index dface94dfc..5553b784f6 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java @@ -21,12 +21,6 @@ import org.openecomp.core.util.UniqueValueUtil; import org.openecomp.core.utilities.CommonMethods; import org.openecomp.sdc.common.errors.CoreException; import org.openecomp.sdc.common.errors.ErrorCode; -import org.openecomp.sdc.datatypes.error.ErrorLevel; -import org.openecomp.sdc.logging.types.LoggerConstants; -import org.openecomp.sdc.logging.types.LoggerErrorCode; -import org.openecomp.sdc.logging.types.LoggerErrorDescription; -import org.openecomp.sdc.logging.types.LoggerServiceName; -import org.openecomp.sdc.logging.types.LoggerTragetServiceName; import org.openecomp.sdc.vendorlicense.VendorLicenseConstants; import org.openecomp.sdc.vendorlicense.VendorLicenseManager; import org.openecomp.sdc.vendorlicense.dao.EntitlementPoolDao; @@ -65,12 +59,6 @@ public class VendorLicenseManagerImpl implements VendorLicenseManager { private EntitlementPoolDao entitlementPoolDao; private LicenseKeyGroupDao licenseKeyGroupDao; private LimitDao limitDao; - private static final String VLM_ID = "VLM id"; - private static final String EP_LKGID = "EP/LKGId"; - private static final String VLM_ID_LKG_ID = "VLM id, LKG id"; - private static final String VLM_ID_LA_ID = "VLM id, LA id"; - private static final String VLM_ID_FG_ID = "VLM id, FG id"; - private static final String VLM_ID_EP_ID = "VLM id, EP id"; private static final String EP_POOL_START_TIME = "T00:00:00Z"; private static final String EP_POOL_EXPIRY_TIME = "T23:59:59Z"; private static final DateTimeFormatter FORMATTER diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/utils/VendorSoftwareProductUtils.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/utils/VendorSoftwareProductUtils.java index 44bca4032e..2964b72f5d 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/utils/VendorSoftwareProductUtils.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/utils/VendorSoftwareProductUtils.java @@ -27,11 +27,8 @@ import org.openecomp.sdc.datatypes.error.ErrorLevel; import org.openecomp.sdc.datatypes.error.ErrorMessage; import org.openecomp.sdc.logging.api.Logger; import org.openecomp.sdc.logging.api.LoggerFactory; -import org.openecomp.sdc.logging.types.LoggerConstants; -import org.openecomp.sdc.logging.types.LoggerErrorDescription; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentMonitoringUploadEntity; import org.openecomp.sdc.vendorsoftwareproduct.types.OrchestrationTemplateActionResponse; -import org.slf4j.MDC; import java.io.File; import java.util.ArrayList; @@ -72,7 +69,6 @@ public class VendorSoftwareProductUtils { */ public static void validateContentZipData(FileContentHandler contentMap, Map> errors) { - MDC.put(LoggerConstants.ERROR_DESCRIPTION, LoggerErrorDescription.INVALID_ZIP); if (contentMap.getFileList().isEmpty()) { ErrorMessage.ErrorMessageUtil.addMessage(SdcCommon.UPLOAD_FILE, errors) .add(new ErrorMessage(ErrorLevel.ERROR, Messages.INVALID_ZIP_FILE.getErrorMessage())); -- cgit 1.2.3-korg