From 89410dfae4847d2b4cb2f7e0cb609e1e19423847 Mon Sep 17 00:00:00 2001 From: Supun94 Date: Mon, 5 Dec 2016 10:25:35 +0530 Subject: [PATCH] Changing getEffectiveFeatures method --- .../policy/decision/point/merged/MergedEvaluationPoint.java | 2 +- .../decision/point/simple/PolicyEvaluationServiceImpl.java | 2 +- .../wso2/carbon/policy/mgt/common/PolicyEvaluationPoint.java | 2 +- .../org/wso2/carbon/policy/mgt/core/PolicyManagerService.java | 2 +- .../wso2/carbon/policy/mgt/core/PolicyManagerServiceImpl.java | 4 ++-- .../policy/mgt/core/services/SimplePolicyEvaluationTest.java | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/policy-mgt/org.wso2.carbon.policy.decision.point/src/main/java/org/wso2/carbon/policy/decision/point/merged/MergedEvaluationPoint.java b/components/policy-mgt/org.wso2.carbon.policy.decision.point/src/main/java/org/wso2/carbon/policy/decision/point/merged/MergedEvaluationPoint.java index 0223ed73bc..07fd0b68d3 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.decision.point/src/main/java/org/wso2/carbon/policy/decision/point/merged/MergedEvaluationPoint.java +++ b/components/policy-mgt/org.wso2.carbon.policy.decision.point/src/main/java/org/wso2/carbon/policy/decision/point/merged/MergedEvaluationPoint.java @@ -40,7 +40,7 @@ public class MergedEvaluationPoint implements PolicyEvaluationPoint { private static final String policyEvaluationPoint = "Merged"; @Override - public List getEffectiveFeatures(List policyList, DeviceIdentifier deviceIdentifier) + public List getEffectiveFeatures(DeviceIdentifier deviceIdentifier) throws PolicyEvaluationException { return this.getEffectivePolicy(deviceIdentifier).getProfile().getProfileFeaturesList(); } 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 ac1f6ebf89..d737cbaa3f 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 @@ -41,7 +41,7 @@ public class PolicyEvaluationServiceImpl implements PolicyEvaluationPoint { } @Override - public List getEffectiveFeatures(List policyList, DeviceIdentifier deviceIdentifier) + public List getEffectiveFeatures(DeviceIdentifier deviceIdentifier) throws PolicyEvaluationException { List effectiveFeatures = evaluation.getEffectivePolicy(deviceIdentifier). diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/src/main/java/org/wso2/carbon/policy/mgt/common/PolicyEvaluationPoint.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/src/main/java/org/wso2/carbon/policy/mgt/common/PolicyEvaluationPoint.java index bf668f8531..74ce2adf1a 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/src/main/java/org/wso2/carbon/policy/mgt/common/PolicyEvaluationPoint.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/src/main/java/org/wso2/carbon/policy/mgt/common/PolicyEvaluationPoint.java @@ -43,7 +43,7 @@ public interface PolicyEvaluationPoint { * @param deviceIdentifier device information. * @return returns the effective feature set. */ - List getEffectiveFeatures(List policyList,DeviceIdentifier deviceIdentifier) throws PolicyEvaluationException; + List getEffectiveFeatures(DeviceIdentifier deviceIdentifier) throws PolicyEvaluationException; /** * This method returns the name of the Policy Evaluation Point diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/PolicyManagerService.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/PolicyManagerService.java index c8bd6e1d2f..96d7aac4d2 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/PolicyManagerService.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/PolicyManagerService.java @@ -51,7 +51,7 @@ public interface PolicyManagerService { Policy getEffectivePolicy(DeviceIdentifier deviceIdentifier) throws PolicyManagementException; - List getEffectiveFeatures(List policyList,DeviceIdentifier deviceIdentifier) throws FeatureManagementException; + List getEffectiveFeatures(DeviceIdentifier deviceIdentifier) throws FeatureManagementException; List getPolicies(String deviceType) throws PolicyManagementException; 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 eae94ce7c8..7f00319052 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 @@ -135,12 +135,12 @@ public class PolicyManagerServiceImpl implements PolicyManagerService { } @Override - public List getEffectiveFeatures(List policyList,DeviceIdentifier deviceIdentifier) throws + public List getEffectiveFeatures(DeviceIdentifier deviceIdentifier) throws FeatureManagementException { try { PolicyEvaluationPoint policyEvaluationPoint = PolicyManagementDataHolder.getInstance().getPolicyEvaluationPoint(); if (policyEvaluationPoint != null) { - return policyEvaluationPoint.getEffectiveFeatures(policyList, deviceIdentifier); + return policyEvaluationPoint.getEffectiveFeatures(deviceIdentifier); } else { throw new FeatureManagementException("Error occurred while getting the policy evaluation point " + deviceIdentifier.getId() + " - " + deviceIdentifier.getType()); diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/services/SimplePolicyEvaluationTest.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/services/SimplePolicyEvaluationTest.java index 7fe3561ec2..32f4efc212 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/services/SimplePolicyEvaluationTest.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/services/SimplePolicyEvaluationTest.java @@ -73,7 +73,7 @@ SimplePolicyEvaluationTest implements PolicyEvaluationPoint { } @Override - public List getEffectiveFeatures(List policyList,DeviceIdentifier deviceIdentifier) throws PolicyEvaluationException { + public List getEffectiveFeatures(DeviceIdentifier deviceIdentifier) throws PolicyEvaluationException { return null; }