rmCatalog = catalog;
break;
}
}
}catch (Exception e) {
throw new CatalogServiceException("Failed to find catalog object for catalog URN '" + catalogId + "' : " + e.getMessage(), e);
}finally {
this.catalogsLock.readLock().unlock();
}
if (rmCatalog != null) {
this.catalogsLock.writeLock().lock();
try {
LOG.log(Level.INFO, "Removing catalog '" + rmCatalog + "'");
this.catalogs.remove(rmCatalog);
this.catalogRepository.deleteSerializedCatalog(catalogId);
if (!preserveMapping) {
this.ingestMapperLock.writeLock().lock();
try {
LOG.log(Level.INFO, "Deleting all index mappings for catalog '" + rmCatalog + "'");
this.ingestMapper.deleteAllMappingsForCatalog(catalogId);
}catch (Exception e) {
throw e;
}finally {
this.ingestMapperLock.writeLock().unlock();
}
}
}catch (Exception e) {
throw new CatalogServiceException("Failed to remove Catalog '" + catalogId + "' from this CatalogService");
}finally {
this.catalogsLock.writeLock().unlock();
}
}else {
LOG.log(Level.WARNING, "Catalog '" + catalogId + "' is not currently managed by this CatalogService");