diff --git a/components/policy-mgt/org.wso2.carbon.policy.decision.point/src/main/java/org/wso2/carbon/policy/decision/point/simple/PolicyEvaluationServiceImpl.java b/components/policy-mgt/org.wso2.carbon.policy.decision.point/src/main/java/org/wso2/carbon/policy/decision/point/simple/PolicyEvaluationServiceImpl.java index 7229bfc747c..24ec30dc84b 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.decision.point/src/main/java/org/wso2/carbon/policy/decision/point/simple/PolicyEvaluationServiceImpl.java +++ b/components/policy-mgt/org.wso2.carbon.policy.decision.point/src/main/java/org/wso2/carbon/policy/decision/point/simple/PolicyEvaluationServiceImpl.java @@ -40,23 +40,11 @@ public class PolicyEvaluationServiceImpl implements PolicyEvaluationPoint { } @Override - public List getEffectiveFeatures(List policyList, DeviceIdentifier deviceIdentifier) throws PolicyEvaluationException { + public List getEffectiveFeatures(List policyList, DeviceIdentifier deviceIdentifier) + throws PolicyEvaluationException { List effectiveFeatures = evaluation.getEffectivePolicy(deviceIdentifier). getProfile().getProfileFeaturesList(); - -/* PolicyOperation policyOperation = new PolicyOperation(); - - List profileOperationList = new ArrayList(); - for (ProfileFeature feature : effectiveFeatures) { - ProfileOperation operation = new ProfileOperation(); - - operation.setCode(feature.getFeatureCode()); - operation.setPayLoad(feature.getContent()); - profileOperationList.add(operation); - } - policyOperation.setProfileOperations(profileOperationList); - policyOperation.setCode(PolicyManagementConstants.POLICY_BUNDLE);*/ return effectiveFeatures; } diff --git a/components/policy-mgt/org.wso2.carbon.policy.decision.point/src/main/java/org/wso2/carbon/policy/decision/point/simple/SimpleEvaluationImpl.java b/components/policy-mgt/org.wso2.carbon.policy.decision.point/src/main/java/org/wso2/carbon/policy/decision/point/simple/SimpleEvaluationImpl.java index aa1d02e58fe..f8c75e31057 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.decision.point/src/main/java/org/wso2/carbon/policy/decision/point/simple/SimpleEvaluationImpl.java +++ b/components/policy-mgt/org.wso2.carbon.policy.decision.point/src/main/java/org/wso2/carbon/policy/decision/point/simple/SimpleEvaluationImpl.java @@ -32,14 +32,9 @@ import java.util.List; public class SimpleEvaluationImpl implements SimpleEvaluation { private static final Log log = LogFactory.getLog(SimpleEvaluationImpl.class); - //TODO : to revove the stale reference private PolicyManagerService policyManagerService; private List policyList = new ArrayList(); -// public SimpleEvaluationImpl() { -// policyManagerService = PolicyDecisionPointDataHolder.getInstance().getPolicyManagerService(); -// } - @Override public Policy getEffectivePolicy(DeviceIdentifier deviceIdentifier) throws PolicyEvaluationException { Policy policy = new Policy(); @@ -74,7 +69,6 @@ public class SimpleEvaluationImpl implements SimpleEvaluation { return policy; } - @Override public void sortPolicies() throws PolicyEvaluationException { Collections.sort(policyList); 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 24659bb4214..1cd88a72d04 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 @@ -173,7 +173,6 @@ public class PolicyManagerServiceImpl implements PolicyManagerService { @Override public PolicyEvaluationPoint getPEP() throws PolicyManagementException { - PolicyManagementDataHolder.getInstance().getPolicyEvaluationPoint(); return PolicyManagementDataHolder.getInstance().getPolicyEvaluationPoint(); } diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/internal/PolicyManagementDataHolder.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/internal/PolicyManagementDataHolder.java index f089d811854..5809468694d 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/internal/PolicyManagementDataHolder.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/internal/PolicyManagementDataHolder.java @@ -99,12 +99,10 @@ public class PolicyManagementDataHolder { public void putPolicyEvaluationPoint(String name, PolicyEvaluationPoint policyEvaluationPoint) { policyEvaluationPoints.put(name,policyEvaluationPoint); -// this.policyEvaluationPoint = policyEvaluationPoint; } public void removePolicyEvaluationPoint(PolicyEvaluationPoint policyEvaluationPoint) { policyEvaluationPoints.put(policyEvaluationPoint.getName(), this.policyEvaluationPoint); -// this.policyEvaluationPoint = policyEvaluationPoint; } diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml index 5dbad500c44..559cc3edd5a 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml @@ -42,8 +42,8 @@ 5 8 20 - SimplePolicyEvaluationServiceComponent - + + MergedPolicyEvaluationServiceComponent diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/conf/cdm-config.xml b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/conf/cdm-config.xml index d115d0b74fb..9e326a4f039 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/conf/cdm-config.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/src/main/resources/conf/cdm-config.xml @@ -43,8 +43,8 @@ 5 8 20 - SimplePolicyEvaluationServiceComponent - + + MergedPolicyEvaluationServiceComponent android ios