diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/src/main/java/org/wso2/carbon/policy/mgt/common/spi/PolicyMonitoringService.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/src/main/java/org/wso2/carbon/policy/mgt/common/spi/PolicyMonitoringService.java index c1ca58a291e..5494c0a942c 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/src/main/java/org/wso2/carbon/policy/mgt/common/spi/PolicyMonitoringService.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/src/main/java/org/wso2/carbon/policy/mgt/common/spi/PolicyMonitoringService.java @@ -34,4 +34,6 @@ public interface PolicyMonitoringService { ComplianceData checkPolicyCompliance(DeviceIdentifier deviceIdentifier, Policy policy, Object response) throws PolicyComplianceException; + + String getType(); } diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/internal/PolicyManagementServiceComponent.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/internal/PolicyManagementServiceComponent.java index 4ea26e0a1b7..f0b98fa6f6a 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/internal/PolicyManagementServiceComponent.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/internal/PolicyManagementServiceComponent.java @@ -163,7 +163,8 @@ public class PolicyManagementServiceComponent { log.debug("Setting Policy Monitoring Service"); } // TODO: FIX THE device type by taking from properties - PolicyManagementDataHolder.getInstance().setPolicyMonitoringService("", policyMonitoringService); + PolicyManagementDataHolder.getInstance().setPolicyMonitoringService(policyMonitoringService.getType(), + policyMonitoringService); } protected void unsetPolicyMonitoringService(PolicyMonitoringService policyMonitoringService) { @@ -171,7 +172,7 @@ public class PolicyManagementServiceComponent { log.debug("Removing the Policy Monitoring Service"); } // TODO: FIX THE device type by taking from properties - PolicyManagementDataHolder.getInstance().unsetPolicyMonitoringService(""); + PolicyManagementDataHolder.getInstance().unsetPolicyMonitoringService(policyMonitoringService.getType()); } protected void setTaskService(TaskService taskService) {