From 6b1ab862764722f477a34f23c317520ccc83c225 Mon Sep 17 00:00:00 2001 From: Hasunie Date: Thu, 16 Feb 2017 18:19:05 +0530 Subject: [PATCH] fixing policyManagementDataHolder issue --- .../carbon/policy/mgt/core/task/MonitoringTask.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/task/MonitoringTask.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/task/MonitoringTask.java index 4237b25d7a..eb195cd8bc 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/task/MonitoringTask.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/task/MonitoringTask.java @@ -30,11 +30,8 @@ import org.wso2.carbon.ntask.core.Task; import org.wso2.carbon.device.mgt.common.policy.mgt.monitor.PolicyComplianceException; import org.wso2.carbon.policy.mgt.core.internal.PolicyManagementDataHolder; import org.wso2.carbon.policy.mgt.core.mgt.MonitoringManager; -import org.wso2.carbon.user.api.Tenant; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.device.mgt.common.DeviceManagementException; -import org.wso2.carbon.device.mgt.common.policy.mgt.monitor.PolicyComplianceException; -import org.wso2.carbon.device.mgt.core.internal.DeviceManagementDataHolder; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderServiceImpl; import java.util.ArrayList; @@ -65,17 +62,14 @@ public class MonitoringTask implements Task { } try { -// Tenant tenants[] = PolicyManagementDataHolder.getInstance(). -// getRealmService().getTenantManager().getAllTenants(); - - // for (Tenant tenant : tenants) { - + PolicyManagementDataHolder.getInstance(). + getRealmService().getTenantManager().getAllTenants(); DeviceManagementProviderService deviceManagementService = new DeviceManagementProviderServiceImpl(); List tenants = deviceManagementService.getDeviceEnrolledTenants(); for (Integer tenant : tenants) { - String tenantDomain = DeviceManagementDataHolder.getInstance(). + String tenantDomain = PolicyManagementDataHolder.getInstance(). getRealmService().getTenantManager().getDomain(tenant); try { PrivilegedCarbonContext.startTenantFlow();