|
|
@ -85,20 +85,14 @@ public class MetadataManagementServiceImpl implements MetadataManagementService
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Metadata retrieveMetadata(String metaKey) throws MetadataManagementException, MetadataKeyNotFoundException {
|
|
|
|
public Metadata retrieveMetadata(String metaKey) throws MetadataManagementException {
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
log.debug("Retrieving Metadata for metaKey:" + metaKey);
|
|
|
|
log.debug("Retrieving Metadata for metaKey:" + metaKey);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
MetadataManagementDAOFactory.openConnection();
|
|
|
|
MetadataManagementDAOFactory.openConnection();
|
|
|
|
Metadata metadata = metadataDAO.getMetadata(
|
|
|
|
return metadataDAO.getMetadata(
|
|
|
|
PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true), metaKey);
|
|
|
|
PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true), metaKey);
|
|
|
|
if (metadata == null) {
|
|
|
|
|
|
|
|
String msg = "Specified Metadata entry has not found. {metaKey:" + metaKey + "}";
|
|
|
|
|
|
|
|
log.error(msg);
|
|
|
|
|
|
|
|
throw new MetadataKeyNotFoundException(msg);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return metadata;
|
|
|
|
|
|
|
|
} 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);
|
|
|
|