Minor refactoring on policy evaluation

4.x.x
Supun94 8 years ago
parent 02fb952cc0
commit 451b2fd1dc

@ -97,7 +97,7 @@ public class PolicyManagementDataHolder {
return policyEvaluationPoints.get(policyEvaluationPointName); return policyEvaluationPoints.get(policyEvaluationPointName);
} }
public void putPolicyEvaluationPoint(String name, PolicyEvaluationPoint policyEvaluationPoint) { public void setPolicyEvaluationPoint(String name, PolicyEvaluationPoint policyEvaluationPoint) {
policyEvaluationPoints.put(name,policyEvaluationPoint); policyEvaluationPoints.put(name,policyEvaluationPoint);
} }

@ -159,7 +159,7 @@ public class PolicyManagementServiceComponent {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Setting Policy Information Service"); log.debug("Setting Policy Information Service");
} }
PolicyManagementDataHolder.getInstance().putPolicyEvaluationPoint(pepService.getName(), pepService); PolicyManagementDataHolder.getInstance().setPolicyEvaluationPoint(pepService.getName(), pepService);
} }
protected void unsetPEPService(PolicyEvaluationPoint pepService) { protected void unsetPEPService(PolicyEvaluationPoint pepService) {

@ -27,14 +27,10 @@ import org.testng.annotations.Test;
import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationService;
import org.wso2.carbon.device.mgt.core.authorization.DeviceAccessAuthorizationServiceImpl;
import org.wso2.carbon.device.mgt.core.internal.DeviceManagementDataHolder;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderServiceImpl; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderServiceImpl;
import org.wso2.carbon.ntask.common.TaskException; import org.wso2.carbon.ntask.common.TaskException;
import org.wso2.carbon.policy.mgt.common.*; import org.wso2.carbon.policy.mgt.common.*;
import org.wso2.carbon.policy.mgt.core.enforcement.DelegationTask;
import org.wso2.carbon.policy.mgt.core.internal.PolicyManagementDataHolder; import org.wso2.carbon.policy.mgt.core.internal.PolicyManagementDataHolder;
import org.wso2.carbon.policy.mgt.core.services.SimplePolicyEvaluationTest; import org.wso2.carbon.policy.mgt.core.services.SimplePolicyEvaluationTest;
@ -51,7 +47,7 @@ public class PolicyEvaluationTestCase extends BasePolicyManagementDAOTest {
@Override @Override
public void init() throws Exception { public void init() throws Exception {
PolicyEvaluationPoint evaluationPoint = new SimplePolicyEvaluationTest(); PolicyEvaluationPoint evaluationPoint = new SimplePolicyEvaluationTest();
PolicyManagementDataHolder.getInstance().putPolicyEvaluationPoint(evaluationPoint.getName(), evaluationPoint); PolicyManagementDataHolder.getInstance().setPolicyEvaluationPoint(evaluationPoint.getName(), evaluationPoint);
} }
@Test @Test

Loading…
Cancel
Save