diff options
author | Balaji, Ramya (rb111y) <rb111y@att.com> | 2018-03-13 16:58:23 -0400 |
---|---|---|
committer | Takamune Cho <tc012c@att.com> | 2018-03-14 14:25:40 +0000 |
commit | 9527f582f62b1cfeda7ba93035ea27376a40b97e (patch) | |
tree | 8059131d353651d49895b45c3c55f2b098fb468c /appc-outbound/appc-aai-client/provider/src/main/java/org | |
parent | 733ed3ba65c6d1cac885bf449a71e5d66bfccb4f (diff) |
Directed Graph & Associated code changes
Changes to DGs for A&AI processing and
for formatting controller template id
if passed in input.
Issue-ID: APPC-690, APPC-691
Change-Id: I3019d093f8327839aa286a5784fcc96bde0fb0d6
Signed-off-by: Balaji, Ramya (rb111y) <rb111y@att.com>
Diffstat (limited to 'appc-outbound/appc-aai-client/provider/src/main/java/org')
-rw-r--r-- | appc-outbound/appc-aai-client/provider/src/main/java/org/onap/appc/aai/client/node/AAIResourceNode.java | 26 |
1 files changed, 23 insertions, 3 deletions
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<String, String> 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<String, String> 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); + } + } } |