|
|
@ -20,6 +20,7 @@ package org.wso2.carbon.device.mgt.core.metadata.mgt;
|
|
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.logging.Log;
|
|
|
|
import org.apache.commons.logging.Log;
|
|
|
|
import org.apache.commons.logging.LogFactory;
|
|
|
|
import org.apache.commons.logging.LogFactory;
|
|
|
|
|
|
|
|
import org.wso2.carbon.base.MultitenantConstants;
|
|
|
|
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
|
|
|
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
|
|
|
import org.wso2.carbon.device.mgt.common.PaginationRequest;
|
|
|
|
import org.wso2.carbon.device.mgt.common.PaginationRequest;
|
|
|
|
import org.wso2.carbon.device.mgt.common.PaginationResult;
|
|
|
|
import org.wso2.carbon.device.mgt.common.PaginationResult;
|
|
|
@ -91,8 +92,12 @@ public class MetadataManagementServiceImpl implements MetadataManagementService
|
|
|
|
}
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
MetadataManagementDAOFactory.openConnection();
|
|
|
|
MetadataManagementDAOFactory.openConnection();
|
|
|
|
return metadataDAO.getMetadata(
|
|
|
|
if (metaKey.equals("EVALUATE_TENANTS")){
|
|
|
|
PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true), metaKey);
|
|
|
|
return metadataDAO.getMetadata(MultitenantConstants.SUPER_TENANT_ID, metaKey);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return metadataDAO.getMetadata(
|
|
|
|
|
|
|
|
PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true), metaKey);
|
|
|
|
|
|
|
|
}
|
|
|
|
} catch (MetadataManagementDAOException e) {
|
|
|
|
} catch (MetadataManagementDAOException e) {
|
|
|
|
String msg = "Error occurred while retrieving the metadata entry for metaKey:" + metaKey;
|
|
|
|
String msg = "Error occurred while retrieving the metadata entry for metaKey:" + metaKey;
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|