From 9dc1bebdf768fe33b5c9b983c8072ba5cb16f8a8 Mon Sep 17 00:00:00 2001 From: "Determe, Sebastien (sd378r)" Date: Tue, 6 Feb 2018 16:21:59 +0100 Subject: Improve code and comments. Improve the code and comments of the execute method. Issue-ID: CLAMP-74 Change-Id: I74a26f9daf1336aa36f1d31d7ac74e87b370d642 Signed-off-by: Determe, Sebastien (sd378r) --- .../org/onap/clamp/clds/client/OperationalPolicyDelegate.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/onap/clamp/clds/client/OperationalPolicyDelegate.java b/src/main/java/org/onap/clamp/clds/client/OperationalPolicyDelegate.java index 58f5e0086..e2d16c56c 100644 --- a/src/main/java/org/onap/clamp/clds/client/OperationalPolicyDelegate.java +++ b/src/main/java/org/onap/clamp/clds/client/OperationalPolicyDelegate.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP CLAMP * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -45,7 +45,7 @@ import org.springframework.beans.factory.annotation.Autowired; /** * Send Operational Policy info to policy api. It uses the policy code to define * the model and communicate with it. See also the PolicyClient class. - * + * */ public class OperationalPolicyDelegate implements JavaDelegate { protected static final EELFLogger logger = EELFManager.getInstance() @@ -70,19 +70,18 @@ public class OperationalPolicyDelegate implements JavaDelegate { * @throws BuilderException * In case of issues with OperationalPolicyReq * @throws UnsupportedEncodingException + * In case of issues with the Charset encoding */ @Override - public void execute(DelegateExecution execution) - throws BuilderException, UnsupportedEncodingException { + public void execute(DelegateExecution execution) throws BuilderException, UnsupportedEncodingException { String responseMessage = null; ModelProperties prop = ModelProperties.create(execution); Policy policy = prop.getType(Policy.class); if (policy.isFound()) { for (PolicyChain policyChain : prop.getType(Policy.class).getPolicyChains()) { - String operationalPolicyRequestUuid = LoggingUtils.getRequestId(); Map> attributes = OperationalPolicyReq.formatAttributes(refProp, prop, prop.getType(Policy.class).getId(), policyChain); - responseMessage = policyClient.sendBrmsPolicy(attributes, prop, operationalPolicyRequestUuid); + responseMessage = policyClient.sendBrmsPolicy(attributes, prop, LoggingUtils.getRequestId()); } if (responseMessage != null) { execution.setVariable("operationalPolicyResponseMessage", responseMessage.getBytes()); -- cgit 1.2.3-korg