X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=appc-outbound%2Fappc-aai-client%2Fprovider%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fappc%2Faai%2Fclient%2Fnode%2FAAIResourceNode.java;fp=appc-outbound%2Fappc-aai-client%2Fprovider%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fappc%2Faai%2Fclient%2Fnode%2FAAIResourceNode.java;h=d15431cc786c71382290bbb023a9f31698c3927f;hb=9527f582f62b1cfeda7ba93035ea27376a40b97e;hp=073ca12f4293b5b402bea7739d12f80a5e6294a1;hpb=733ed3ba65c6d1cac885bf449a71e5d66bfccb4f;p=appc.git diff --git a/appc-outbound/appc-aai-client/provider/src/main/java/org/onap/appc/aai/client/node/AAIResourceNode.java b/appc-outbound/appc-aai-client/provider/src/main/java/org/onap/appc/aai/client/node/AAIResourceNode.java index 073ca12f4..d15431cc7 100644 --- a/appc-outbound/appc-aai-client/provider/src/main/java/org/onap/appc/aai/client/node/AAIResourceNode.java +++ b/appc-outbound/appc-aai-client/provider/src/main/java/org/onap/appc/aai/client/node/AAIResourceNode.java @@ -311,7 +311,7 @@ public class AAIResourceNode implements SvcLogicJavaPlugin { } } - private void processCheckForVfModule(String vfModuleIdFromRequest, SvcLogicContext ctx, + public void processCheckForVfModule(String vfModuleIdFromRequest, SvcLogicContext ctx, String responsePrefix, int vnfcRefLen) throws ResourceNodeInternalException { log.info("processCheckForVfModule()::vfModuleId From Request"+vfModuleIdFromRequest+"-"+vnfcRefLen); @@ -500,7 +500,7 @@ public class AAIResourceNode implements SvcLogicJavaPlugin { } public void processForVfModuleModelInfo(AaiService aaiService, Map inParams, SvcLogicContext ctx) { - log.info("processForVfModuleModelInfo()::Retrieving vf-module information :" + inParams.toString()); + log.info("processForVfModuleModelInfo()::Retrieving vf-module information :" + inParams); String responsePrefix = inParams.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX); try { responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix + ".") : ""; @@ -542,5 +542,25 @@ public class AAIResourceNode implements SvcLogicJavaPlugin { log.error("Failed in vfModuleInfo", e); } -} + } + + public void getFormattedValue(Map inParams, SvcLogicContext ctx) throws SvcLogicException { + log.info("getFormattedValue()::Formatting values :" + inParams.toString()); + String responsePrefix = inParams.get(AppcAaiClientConstant.INPUT_PARAM_RESPONSE_PREFIX); + try { + responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix + ".") : ""; + String inputValue = inParams.get("inputParameter"); + if (StringUtils.isBlank(inputValue)) { + return; + } + String outputValue = StringUtils.replace(inputValue, "/", "_");//change / to _ + outputValue = StringUtils.replace(outputValue," ","");//remove space + ctx.setAttribute("template-model-id", outputValue); + } catch (Exception e) { + ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_STATUS, + AppcAaiClientConstant.OUTPUT_STATUS_FAILURE); + ctx.setAttribute(responsePrefix + AppcAaiClientConstant.OUTPUT_PARAM_ERROR_MESSAGE, e.getMessage()); + log.error("Failed in getFormattedValue", e); + } + } }