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 0223ed73bc0..07fd0b68d34 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 ac1f6ebf895..d737cbaa3fb 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 bf668f8531d..74ce2adf1a4 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 c8bd6e1d2f7..96d7aac4d2f 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 eae94ce7c82..7f003190521 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 7fe3561ec28..32f4efc212f 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; }