X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Fclamp%2Fclds%2Fclient%2FPolicyClient.java;h=ed29afe7e96deb1cbaa07bf1b51a77551fa193de;hb=f0fdf8044bcfb29c87ec821705e8e8e38db50e87;hp=54b3fbb48d1d63b81dfea8ba2c50646808e5269d;hpb=1de3466a56a245223752c34423b7858117b56b73;p=clamp.git 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 54b3fbb4..ed29afe7 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,7 +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"); @@ -164,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 @@ -320,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);