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 e96e4ff6a0..1ad71fa0f9 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 @@ -119,43 +119,13 @@ public class PolicyManagerServiceImpl implements PolicyManagerService { public List getEffectiveFeatures(DeviceIdentifier deviceIdentifier) throws FeatureManagementException { try { - - List effectiveFeatures = PolicyManagementDataHolder.getInstance() - .getPolicyEvaluationPoint(). - getEffectiveFeatures(deviceIdentifier); - - List deviceIdentifiers = new ArrayList(); - deviceIdentifiers.add(deviceIdentifier); - List profileOperationList = new ArrayList(); - - if (!effectiveFeatures.isEmpty()) { - for (ProfileFeature feature : effectiveFeatures) { - ProfileOperation operation = new ProfileOperation(); - - operation.setCode(feature.getFeatureCode()); - operation.setPayLoad(feature.getContent()); - operation.setStatus(Operation.Status.PENDING); - operation.setType(Operation.Type.PROFILE); - operation.setEnabled(true); - profileOperationList.add(operation); - PolicyManagementDataHolder.getInstance().getDeviceManagementService(). - addOperation(operation, deviceIdentifiers); - } - } else { - return null; - } - - return effectiveFeatures; + return PolicyManagementDataHolder.getInstance(). + getPolicyEvaluationPoint().getEffectiveFeatures(deviceIdentifier); } catch (PolicyEvaluationException e) { String msg = "Error occurred while getting the effective features from the PEP service " + deviceIdentifier.getId() + " - " + deviceIdentifier.getType(); log.error(msg, e); throw new FeatureManagementException(msg, e); - } catch (OperationManagementException e) { - String msg = "Error occurred while adding the effective feature to database." + - deviceIdentifier.getId() + " - " + deviceIdentifier.getType(); - log.error(msg, e); - throw new FeatureManagementException(msg, e); } }