Improve code and comments. 83/30483/1
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>
Tue, 6 Feb 2018 15:21:59 +0000 (16:21 +0100)
committerDeterme, Sebastien (sd378r) <sd378r@intl.att.com>
Tue, 6 Feb 2018 15:21:59 +0000 (16:21 +0100)
Improve the code and comments of the execute method.

Issue-ID: CLAMP-74
Change-Id: I74a26f9daf1336aa36f1d31d7ac74e87b370d642
Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
src/main/java/org/onap/clamp/clds/client/OperationalPolicyDelegate.java

index 58f5e00..e2d16c5 100644 (file)
@@ -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<AttributeType, Map<String, String>> 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());