* Perform activity. Delete Operational Policy via policy api.
*
* @param camelExchange
- * The Camel Exchange object containing the properties
+ * The Camel Exchange object containing the properties
*/
@Handler
public void execute(Exchange camelExchange) {
Policy policy = prop.getType(Policy.class);
prop.setCurrentModelElementId(policy.getId());
String eventAction = (String) camelExchange.getProperty("eventAction");
- if(policy.getPolicyChains() != null && policy.getPolicyChains().size() > 0) {
- String responseMessage = "";
-
- if (!eventAction.equalsIgnoreCase(CldsEvent.ACTION_CREATE) && policy.isFound()) {
- for (PolicyChain policyChain : policy.getPolicyChains()) {
- prop.setPolicyUniqueId(policyChain.getPolicyId());
- responseMessage = policyClient.deleteBrms(prop);
- }
- if (responseMessage != null) {
- camelExchange.setProperty("operationalPolicyDeleteResponseMessage", responseMessage.getBytes());
- }
+ if (policy.getPolicyChains() != null && !policy.getPolicyChains().isEmpty()
+ && !eventAction.equalsIgnoreCase(CldsEvent.ACTION_CREATE) && policy.isFound()) {
+ for (PolicyChain policyChain : policy.getPolicyChains()) {
+ prop.setPolicyUniqueId(policyChain.getPolicyId());
+ logger.info("Policy Delete response: " + policyClient.deleteBrms(prop));
}
}
-
}
}