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>
import javax.ws.rs.BadRequestException;
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;
import org.onap.clamp.clds.exception.policy.PolicyClientException;
import org.onap.clamp.clds.model.prop.ModelProperties;
import org.onap.clamp.clds.model.refprop.RefProp;
// following failure: java.lang.Exception: Policy send failed: PE300 -
// Data Issue: No policyDescription given.
policyParameters.setPolicyDescription(refProp.getStringValue("op.policyDescription"));
// following failure: java.lang.Exception: Policy send failed: PE300 -
// Data Issue: No policyDescription given.
policyParameters.setPolicyDescription(refProp.getStringValue("op.policyDescription"));
policyParameters.setAttributes(attributes);
policyParameters.setAttributes(attributes);
// Set a random UUID(Mandatory)
policyParameters.setRequestID(UUID.fromString(policyRequestUuid));
String policyNamePrefix = refProp.getStringValue("policy.op.policyNamePrefix");
// Set a random UUID(Mandatory)
policyParameters.setRequestID(UUID.fromString(policyRequestUuid));
String policyNamePrefix = refProp.getStringValue("policy.op.policyNamePrefix");
* @param configBody
* The config policy string body
* @param configPolicyName
* @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
*/
* @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
PolicyParameters policyParameters = new PolicyParameters();
// Set Policy Type
responseMessage = response.getResponseMessage();
} catch (Exception e) {
logger.error("Exception occurred during policy communication", e);
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);
}
logger.info(LOG_POLICY_PREFIX + responseMessage);