From 0f146e83faf3a06413f20c567c54465baf743903 Mon Sep 17 00:00:00 2001 From: geethkokila Date: Mon, 16 Nov 2015 17:17:15 +0530 Subject: [PATCH] Fixing the issue which cause policy not bieng applied to device which were enrolled before the adding the policy to the system --- .../policy/mgt/core/enforcement/DelegationTask.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/enforcement/DelegationTask.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/enforcement/DelegationTask.java index ad9f58654c1..2de040e451d 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/enforcement/DelegationTask.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/enforcement/DelegationTask.java @@ -32,7 +32,6 @@ import org.wso2.carbon.policy.mgt.core.mgt.PolicyManager; import org.wso2.carbon.policy.mgt.core.mgt.impl.PolicyManagerImpl; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Map; @@ -73,13 +72,13 @@ public class DelegationTask implements Task { throw new PolicyManagementException("Error occurred while taking the devices", e); } } - HashMap deviceIdPolicy = policyManager.getAppliedPolicyIdsDeviceIds(); +// HashMap deviceIdPolicy = policyManager.getAppliedPolicyIdsDeviceIds(); List toBeNotified = new ArrayList<>(); for (Device device : devices) { - if (deviceIdPolicy.containsKey(device.getId())) { - toBeNotified.add(device); - } +// if (deviceIdPolicy.containsKey(device.getId())) { + toBeNotified.add(device); +// } } if (!toBeNotified.isEmpty()) { PolicyEnforcementDelegator enforcementDelegator = new PolicyEnforcementDelegatorImpl(toBeNotified);