diff options
author | 2018-02-26 11:43:19 +0100 | |
---|---|---|
committer | 2018-02-26 19:11:04 +0000 | |
commit | 534f94b92547efab097040209e61fa06e07f6e43 (patch) | |
tree | 29fa789a3538c4e4c51361e03aeb721d25dbd947 /appc-config/appc-config-generator/provider/src/main/java/org/onap/sdnc/config/generator/transform | |
parent | 23e0901d5ba71ebadfb99e91d10bda0275708518 (diff) |
appc-config-generator-provider sonar fixes part 1
Initial code reformat and import rearrangement
Change-Id: I0a808bc3043d8558d96f15e0b695fddf5333bab1
Issue-ID: APPC-671
Signed-off-by: Jakub Dudycz <jakub.dudycz@nokia.com>
Diffstat (limited to 'appc-config/appc-config-generator/provider/src/main/java/org/onap/sdnc/config/generator/transform')
-rw-r--r-- | appc-config/appc-config-generator/provider/src/main/java/org/onap/sdnc/config/generator/transform/XSLTTransformerNode.java | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/appc-config/appc-config-generator/provider/src/main/java/org/onap/sdnc/config/generator/transform/XSLTTransformerNode.java b/appc-config/appc-config-generator/provider/src/main/java/org/onap/sdnc/config/generator/transform/XSLTTransformerNode.java index 2aacc587e..5ce7a69b0 100644 --- a/appc-config/appc-config-generator/provider/src/main/java/org/onap/sdnc/config/generator/transform/XSLTTransformerNode.java +++ b/appc-config/appc-config-generator/provider/src/main/java/org/onap/sdnc/config/generator/transform/XSLTTransformerNode.java @@ -24,6 +24,8 @@ package org.onap.sdnc.config.generator.transform; +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; import java.io.File; import java.io.StringReader; import java.io.StringWriter; @@ -41,17 +43,15 @@ import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; import org.onap.sdnc.config.generator.ConfigGeneratorConstant; -import com.att.eelf.configuration.EELFLogger; -import com.att.eelf.configuration.EELFManager; public class XSLTTransformerNode implements SvcLogicJavaPlugin { private static final EELFLogger log = - EELFManager.getInstance().getLogger(XSLTTransformerNode.class); + EELFManager.getInstance().getLogger(XSLTTransformerNode.class); public void transformData(Map<String, String> inParams, SvcLogicContext ctx) - throws SvcLogicException { + throws SvcLogicException { log.trace("Received convertJson2DGContext call with params : " + inParams); String responsePrefix = inParams.get(ConfigGeneratorConstant.INPUT_PARAM_RESPONSE_PRIFIX); try { @@ -61,10 +61,10 @@ public class XSLTTransformerNode implements SvcLogicJavaPlugin { if (StringUtils.isNotBlank(templateData)) { String templateFile = - inParams.get(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_FILE); + inParams.get(ConfigGeneratorConstant.INPUT_PARAM_TEMPLATE_FILE); if (StringUtils.isNotBlank(templateFile)) { templateData = FileUtils.readFileToString(new File(templateFile), - Charset.defaultCharset()); + Charset.defaultCharset()); } } if (StringUtils.isBlank(templateData)) { @@ -79,27 +79,27 @@ public class XSLTTransformerNode implements SvcLogicJavaPlugin { String transformedData = transform(requestData, templateData); log.trace("Transformed Data : " + transformedData); ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_TRANSFORMED_DATA, - transformedData); + transformedData); ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS, - ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS); + ConfigGeneratorConstant.OUTPUT_STATUS_SUCCESS); } catch (Exception e) { e.printStackTrace(); ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_STATUS, - ConfigGeneratorConstant.OUTPUT_STATUS_FAILURE); + ConfigGeneratorConstant.OUTPUT_STATUS_FAILURE); ctx.setAttribute(responsePrefix + ConfigGeneratorConstant.OUTPUT_PARAM_ERROR_MESSAGE, - e.getMessage()); + e.getMessage()); log.error("Failed in XSLTTransformerNode : " + e.getMessage()); throw new SvcLogicException(e.getMessage()); } } public String transform(String requestData, String templateData) - throws TransformerConfigurationException, TransformerException { + throws TransformerConfigurationException, TransformerException { StringWriter xmlResultResource = new StringWriter(); Transformer xmlTransformer = TransformerFactory.newInstance() - .newTransformer(new StreamSource(new StringReader(templateData))); + .newTransformer(new StreamSource(new StringReader(templateData))); xmlTransformer.transform(new StreamSource(new StringReader(requestData)), - new StreamResult(xmlResultResource)); + new StreamResult(xmlResultResource)); return xmlResultResource.getBuffer().toString(); } |