Minor refactoring on policy decision point

revert-70aa11f8
Supun94 8 years ago
parent 35f3fcc8f9
commit 02fb952cc0

@ -40,23 +40,11 @@ public class PolicyEvaluationServiceImpl implements PolicyEvaluationPoint {
}
@Override
public List<ProfileFeature> getEffectiveFeatures(List<Policy> policyList, DeviceIdentifier deviceIdentifier) throws PolicyEvaluationException {
public List<ProfileFeature> getEffectiveFeatures(List<Policy> policyList, DeviceIdentifier deviceIdentifier)
throws PolicyEvaluationException {
List<ProfileFeature> effectiveFeatures = evaluation.getEffectivePolicy(deviceIdentifier).
getProfile().getProfileFeaturesList();
/* PolicyOperation policyOperation = new PolicyOperation();
List<ProfileOperation> profileOperationList = new ArrayList<ProfileOperation>();
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;
}

@ -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<Policy> policyList = new ArrayList<Policy>();
// 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);

@ -173,7 +173,6 @@ public class PolicyManagerServiceImpl implements PolicyManagerService {
@Override
public PolicyEvaluationPoint getPEP() throws PolicyManagementException {
PolicyManagementDataHolder.getInstance().getPolicyEvaluationPoint();
return PolicyManagementDataHolder.getInstance().getPolicyEvaluationPoint();
}

@ -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;
}

@ -42,8 +42,8 @@
<maxRetries>5</maxRetries>
<minRetriesToMarkUnreachable>8</minRetriesToMarkUnreachable>
<minRetriesToMarkInactive>20</minRetriesToMarkInactive>
<PolicyEvaluationPointName>SimplePolicyEvaluationServiceComponent</PolicyEvaluationPointName>
<!--<PolicyEvaluationPointName>MergedPolicyEvaluationServiceComponent</PolicyEvaluationPointName>-->
<!--<PolicyEvaluationPointName>SimplePolicyEvaluationServiceComponent</PolicyEvaluationPointName>-->
<PolicyEvaluationPointName>MergedPolicyEvaluationServiceComponent</PolicyEvaluationPointName>
</PolicyConfiguration>
</ManagementRepository>
</DeviceMgtConfiguration>

@ -43,8 +43,8 @@
<MaxRetries>5</MaxRetries>
<MinRetriesToMarkUnreachable>8</MinRetriesToMarkUnreachable>
<MinRetriesToMarkInactive>20</MinRetriesToMarkInactive>
<PolicyEvaluationPointName>SimplePolicyEvaluationServiceComponent</PolicyEvaluationPointName>
<!--<PolicyEvaluationPointName>MergedPolicyEvaluationServiceComponent</PolicyEvaluationPointName>-->
<!--<PolicyEvaluationPointName>SimplePolicyEvaluationServiceComponent</PolicyEvaluationPointName>-->
<PolicyEvaluationPointName>MergedPolicyEvaluationServiceComponent</PolicyEvaluationPointName>
<Platforms>
<Platform>android</Platform>
<Platform>ios</Platform>

Loading…
Cancel
Save