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 @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). List<ProfileFeature> effectiveFeatures = evaluation.getEffectivePolicy(deviceIdentifier).
getProfile().getProfileFeaturesList(); 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; return effectiveFeatures;
} }

@ -32,14 +32,9 @@ import java.util.List;
public class SimpleEvaluationImpl implements SimpleEvaluation { public class SimpleEvaluationImpl implements SimpleEvaluation {
private static final Log log = LogFactory.getLog(SimpleEvaluationImpl.class); private static final Log log = LogFactory.getLog(SimpleEvaluationImpl.class);
//TODO : to revove the stale reference
private PolicyManagerService policyManagerService; private PolicyManagerService policyManagerService;
private List<Policy> policyList = new ArrayList<Policy>(); private List<Policy> policyList = new ArrayList<Policy>();
// public SimpleEvaluationImpl() {
// policyManagerService = PolicyDecisionPointDataHolder.getInstance().getPolicyManagerService();
// }
@Override @Override
public Policy getEffectivePolicy(DeviceIdentifier deviceIdentifier) throws PolicyEvaluationException { public Policy getEffectivePolicy(DeviceIdentifier deviceIdentifier) throws PolicyEvaluationException {
Policy policy = new Policy(); Policy policy = new Policy();
@ -74,7 +69,6 @@ public class SimpleEvaluationImpl implements SimpleEvaluation {
return policy; return policy;
} }
@Override @Override
public void sortPolicies() throws PolicyEvaluationException { public void sortPolicies() throws PolicyEvaluationException {
Collections.sort(policyList); Collections.sort(policyList);

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

@ -99,12 +99,10 @@ public class PolicyManagementDataHolder {
public void putPolicyEvaluationPoint(String name, PolicyEvaluationPoint policyEvaluationPoint) { public void putPolicyEvaluationPoint(String name, PolicyEvaluationPoint policyEvaluationPoint) {
policyEvaluationPoints.put(name,policyEvaluationPoint); policyEvaluationPoints.put(name,policyEvaluationPoint);
// this.policyEvaluationPoint = policyEvaluationPoint;
} }
public void removePolicyEvaluationPoint(PolicyEvaluationPoint policyEvaluationPoint) { public void removePolicyEvaluationPoint(PolicyEvaluationPoint policyEvaluationPoint) {
policyEvaluationPoints.put(policyEvaluationPoint.getName(), this.policyEvaluationPoint); policyEvaluationPoints.put(policyEvaluationPoint.getName(), this.policyEvaluationPoint);
// this.policyEvaluationPoint = policyEvaluationPoint;
} }

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

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

Loading…
Cancel
Save