summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap
diff options
context:
space:
mode:
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2017-10-30 18:21:46 +0100
committerDeterme, Sebastien (sd378r) <sd378r@intl.att.com>2017-10-30 18:55:58 +0100
commitf0fdf8044bcfb29c87ec821705e8e8e38db50e87 (patch)
treec2022b8e66b99c2b32f0ae322c102d8c3d94f028 /src/main/java/org/onap
parenteb19eea362d3ad4c10ec6ada9c9ddffc04ba765d (diff)
Policy client fixes
Some fixes on policy, new exception, new params for BRMS. Change-Id: Ia30bf68ec492c448249c1634f3790712a27631e4 Issue-ID: CLAMP-62 Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
Diffstat (limited to 'src/main/java/org/onap')
-rw-r--r--src/main/java/org/onap/clamp/clds/client/PolicyClient.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main/java/org/onap/clamp/clds/client/PolicyClient.java b/src/main/java/org/onap/clamp/clds/client/PolicyClient.java
index e1ef0d936..ed29afe7e 100644
--- a/src/main/java/org/onap/clamp/clds/client/PolicyClient.java
+++ b/src/main/java/org/onap/clamp/clds/client/PolicyClient.java
@@ -37,7 +37,6 @@ import java.util.UUID;
import javax.ws.rs.BadRequestException;
-import org.onap.clamp.clds.client.req.TcaRequestFormatter;
import org.onap.clamp.clds.exception.policy.PolicyClientException;
import org.onap.clamp.clds.model.prop.ModelProperties;
import org.onap.clamp.clds.model.refprop.RefProp;
@@ -109,9 +108,7 @@ public class PolicyClient {
// following failure: java.lang.Exception: Policy send failed: PE300 -
// Data Issue: No policyDescription given.
policyParameters.setPolicyDescription(refProp.getStringValue("op.policyDescription"));
-
policyParameters.setAttributes(attributes);
-
// Set a random UUID(Mandatory)
policyParameters.setRequestID(UUID.fromString(policyRequestUuid));
String policyNamePrefix = refProp.getStringValue("policy.op.policyNamePrefix");
@@ -166,15 +163,16 @@ public class PolicyClient {
* @param configBody
* The config policy string body
* @param configPolicyName
- * The config policy name of the component that has been pre-deployed in DCAE
+ * The config policy name of the component that has been
+ * pre-deployed in DCAE
* @param prop
* The ModelProperties
* @param policyRequestUuid
* The policy request UUID
* @return The answer from policy call
*/
- public String sendBasePolicyInOther(String configBody, String configPolicyName, ModelProperties prop, String policyRequestUuid) {
-
+ public String sendBasePolicyInOther(String configBody, String configPolicyName, ModelProperties prop,
+ String policyRequestUuid) {
PolicyParameters policyParameters = new PolicyParameters();
// Set Policy Type
@@ -322,6 +320,7 @@ public class PolicyClient {
responseMessage = response.getResponseMessage();
} catch (Exception e) {
logger.error("Exception occurred during policy communication", e);
+ throw new PolicyClientException("Exception while communicating with Policy", e);
}
logger.info(LOG_POLICY_PREFIX + responseMessage);