From 8a03c7a36843e0712e19fb01e17616b19775fc02 Mon Sep 17 00:00:00 2001 From: manoj Date: Sat, 30 May 2015 00:29:57 +0530 Subject: [PATCH] Add policy operation for effective policy --- .../mgt/core/PolicyManagerServiceImpl.java | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/PolicyManagerServiceImpl.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/PolicyManagerServiceImpl.java index 879c8906af..2f7f05767f 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/PolicyManagerServiceImpl.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/PolicyManagerServiceImpl.java @@ -99,17 +99,22 @@ public class PolicyManagerServiceImpl implements PolicyManagerService { List effectiveFeatures = policy.getProfile().getProfileFeaturesList(); List profileOperationList = new ArrayList(); - for (ProfileFeature feature : effectiveFeatures) { - ProfileOperation operation = new ProfileOperation(); - operation.setCode(feature.getFeatureCode()); - operation.setEnabled(true); - operation.setStatus(Operation.Status.PENDING); - operation.setType(Operation.Type.PROFILE); - operation.setPayLoad(feature.getContent()); - PolicyManagementDataHolder.getInstance().getDeviceManagementService(). - addOperation(operation, deviceIdentifiers); + PolicyOperation policyOperation = new PolicyOperation(); + + for (ProfileFeature feature : effectiveFeatures) { + ProfileOperation profileOperation = new ProfileOperation(); + + profileOperation.setCode(feature.getFeatureCode()); + profileOperation.setEnabled(true); + profileOperation.setStatus(Operation.Status.PENDING); + profileOperation.setType(Operation.Type.PROFILE); + profileOperation.setPayLoad(feature.getContent()); + profileOperationList.add(profileOperation); } + policyOperation.setProfileOperations(profileOperationList); + PolicyManagementDataHolder.getInstance().getDeviceManagementService(). + addOperation(policyOperation, deviceIdentifiers); } else { return null;