From 9c3020fc77b6dc80e828321ee5e0003f28a4e857 Mon Sep 17 00:00:00 2001 From: Thashmi-nil Date: Thu, 16 Feb 2023 13:37:19 +0530 Subject: [PATCH] Add improvements for chat feature --- .../core/metadata/mgt/MetadataManagementServiceImpl.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/metadata/mgt/MetadataManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/metadata/mgt/MetadataManagementServiceImpl.java index 7d7fd1d7c01..f82c5c32953 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/metadata/mgt/MetadataManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/metadata/mgt/MetadataManagementServiceImpl.java @@ -20,6 +20,7 @@ package org.wso2.carbon.device.mgt.core.metadata.mgt; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.mgt.common.PaginationRequest; import org.wso2.carbon.device.mgt.common.PaginationResult; @@ -91,8 +92,12 @@ public class MetadataManagementServiceImpl implements MetadataManagementService } try { MetadataManagementDAOFactory.openConnection(); - return metadataDAO.getMetadata( - PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true), metaKey); + if (metaKey.equals("EVALUATE_TENANTS")){ + return metadataDAO.getMetadata(MultitenantConstants.SUPER_TENANT_ID, metaKey); + } else { + return metadataDAO.getMetadata( + PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true), metaKey); + } } catch (MetadataManagementDAOException e) { String msg = "Error occurred while retrieving the metadata entry for metaKey:" + metaKey; log.error(msg, e);