|
|
@ -33,6 +33,7 @@ public class SimpleEvaluationPoint implements PolicyEvaluationPoint {
|
|
|
|
//TODO : to revove the stale reference
|
|
|
|
//TODO : to revove the stale reference
|
|
|
|
private PolicyManagerService policyManagerService;
|
|
|
|
private PolicyManagerService policyManagerService;
|
|
|
|
private List<Policy> policyList;
|
|
|
|
private List<Policy> policyList;
|
|
|
|
|
|
|
|
PIPDevice pipDevice;
|
|
|
|
// public SimpleEvaluationPoint() {
|
|
|
|
// public SimpleEvaluationPoint() {
|
|
|
|
// policyManagerService = PolicyDecisionPointDataHolder.getInstance().getPolicyManagerService();
|
|
|
|
// policyManagerService = PolicyDecisionPointDataHolder.getInstance().getPolicyManagerService();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
@ -73,6 +74,12 @@ public class SimpleEvaluationPoint implements PolicyEvaluationPoint {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Policy getEffectivePolicy(DeviceIdentifier deviceIdentifier) throws PolicyEvaluationException {
|
|
|
|
public Policy getEffectivePolicy(DeviceIdentifier deviceIdentifier) throws PolicyEvaluationException {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
policyManagerService = getPolicyManagerService();
|
|
|
|
|
|
|
|
PolicyInformationPoint policyInformationPoint = policyManagerService.getPIP();
|
|
|
|
|
|
|
|
pipDevice = policyInformationPoint.getDeviceData(deviceIdentifier);
|
|
|
|
|
|
|
|
policyList = policyInformationPoint.getRelatedPolicies(pipDevice);
|
|
|
|
|
|
|
|
|
|
|
|
if (policyManagerService == null || policyList.size() == 0) {
|
|
|
|
if (policyManagerService == null || policyList.size() == 0) {
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -82,6 +89,11 @@ public class SimpleEvaluationPoint implements PolicyEvaluationPoint {
|
|
|
|
profile.setProfileFeaturesList(getEffectiveFeatures(deviceIdentifier));
|
|
|
|
profile.setProfileFeaturesList(getEffectiveFeatures(deviceIdentifier));
|
|
|
|
policy.setProfile(profile);
|
|
|
|
policy.setProfile(profile);
|
|
|
|
return policy;
|
|
|
|
return policy;
|
|
|
|
|
|
|
|
} catch (PolicyManagementException e) {
|
|
|
|
|
|
|
|
String msg = "Error occurred when retrieving the policy related data from policy management service.";
|
|
|
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
|
|
|
throw new PolicyEvaluationException(msg, e);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private Policy policyResolve(List<Policy> policyList) throws PolicyEvaluationException, PolicyManagementException {
|
|
|
|
private Policy policyResolve(List<Policy> policyList) throws PolicyEvaluationException, PolicyManagementException {
|
|
|
|