From c4739efd0e10cf7806507a036032356193ad8ce7 Mon Sep 17 00:00:00 2001 From: geethkokila Date: Mon, 20 Jul 2015 19:05:13 +0530 Subject: [PATCH] Fixing the policy monitoring service adding --- .../policy/mgt/common/spi/PolicyMonitoringService.java | 2 ++ .../mgt/core/internal/PolicyManagementServiceComponent.java | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) 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 c1ca58a291..5494c0a942 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 4ea26e0a1b..f0b98fa6f6 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) {