aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-translator-lib
diff options
context:
space:
mode:
authorvempo <vitaliy.emporopulo@amdocs.com>2018-02-01 17:13:50 +0200
committerAvi Gaffa <avi.gaffa@amdocs.com>2018-02-04 06:47:31 +0000
commit693a3f26aba6104fad1659d9b481cbdd0b75d6d8 (patch)
tree5de2bfccdd1bbd1602644e07c5b5c8fe309eb4a8 /openecomp-be/lib/openecomp-sdc-translator-lib
parent26ffd0e871eef90a4aa308583404fd5917196a4b (diff)
Removed unnecessary log constants
Removed unnecessary constants associated with logging. Moved remaining constants close to their respective business logic. Change-Id: I3497479a2edcf2c98dca888b2aed52cb2a98e86b Issue-ID: SDC-772 Signed-off-by: vempo <vitaliy.emporopulo@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-translator-lib')
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesServiceTemplates.java7
-rw-r--r--openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/utils/ResourceWalker.java5
2 files changed, 7 insertions, 5 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesServiceTemplates.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesServiceTemplates.java
index 5490452155..99f550e8e4 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesServiceTemplates.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/globaltypes/GlobalTypesServiceTemplates.java
@@ -20,7 +20,6 @@ import org.openecomp.core.utilities.orchestration.OnboardingTypesEnum;
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.logging.types.LoggerErrorDescription;
import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate;
import org.openecomp.sdc.tosca.services.ToscaExtensionYamlUtil;
import org.openecomp.sdc.tosca.services.ToscaUtil;
@@ -32,6 +31,8 @@ import java.util.Map;
public class GlobalTypesServiceTemplates {
+ private static final String FAILED_TO_GENERATE_GLOBAL_TYPES = "Failed to generate globalTypes";
+
private static final Map<OnboardingTypesEnum, Map<String, ServiceTemplate>>
onboardingGlobalTypesServiceTemplates;
@@ -46,7 +47,7 @@ public class GlobalTypesServiceTemplates {
throw coreException;
} catch (Exception exception) {
throw new CoreException((new ErrorCode.ErrorCodeBuilder())
- .withMessage(LoggerErrorDescription.FAILED_TO_GENERATE_GLOBAL_TYPES)
+ .withMessage(FAILED_TO_GENERATE_GLOBAL_TYPES)
.withId("GlobalTypes Read Error").withCategory(ErrorCategory.APPLICATION).build(),
exception);
}
@@ -57,7 +58,7 @@ public class GlobalTypesServiceTemplates {
onboardingType) {
if (onboardingType == null) {
throw new CoreException((new ErrorCode.ErrorCodeBuilder())
- .withMessage(LoggerErrorDescription.FAILED_TO_GENERATE_GLOBAL_TYPES)
+ .withMessage(FAILED_TO_GENERATE_GLOBAL_TYPES)
.withId("Invalid Onboarding Type").withCategory(ErrorCategory.APPLICATION).build());
}
return onboardingGlobalTypesServiceTemplates.get(onboardingType);
diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/utils/ResourceWalker.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/utils/ResourceWalker.java
index dfeea57163..e5993677cd 100644
--- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/utils/ResourceWalker.java
+++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/utils/ResourceWalker.java
@@ -20,7 +20,6 @@ import org.apache.commons.io.IOUtils;
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.logging.types.LoggerErrorDescription;
import java.io.BufferedReader;
import java.io.File;
@@ -42,6 +41,8 @@ import java.util.zip.ZipFile;
public class ResourceWalker {
+ private static final String RESOURCE_FILE_READ_ERROR = "Can't read resource file from class path.";
+
private ResourceWalker() {
}
@@ -61,7 +62,7 @@ public class ResourceWalker {
filesContent.put(fileName, IOUtils.toString(reader));
} catch (IOException exception) {
throw new CoreException((new ErrorCode.ErrorCodeBuilder())
- .withMessage(LoggerErrorDescription.RESOURCE_FILE_READ_ERROR
+ .withMessage(RESOURCE_FILE_READ_ERROR
+ " File name = " + fileName)
.withId("Resource Read Error").withCategory(ErrorCategory.APPLICATION).build(),
exception);