use of com.netflix.metacat.main.services.MetacatService in project metacat by Netflix.
the class MetadataV1Resource method deleteDefinitionMetadata.
/**
* {@inheritDoc}
*/
@Override
public void deleteDefinitionMetadata(final QualifiedName name, final Boolean force) {
final MetacatRequestContext metacatRequestContext = MetacatContextManager.getContext();
requestWrapper.processRequest("deleteDefinitionMetadata", () -> {
final MetacatService service = helper.getService(name);
BaseDto dto = null;
try {
dto = service.get(name);
} catch (NotFoundException ignored) {
}
if ((force || dto == null) && !"rds".equalsIgnoreCase(name.getCatalogName())) {
helper.postPreUpdateEvent(name, metacatRequestContext, dto);
userMetadataService.deleteDefinitionMetadatas(Lists.newArrayList(name));
if (dto instanceof HasDefinitionMetadata) {
((HasDefinitionMetadata) dto).setDefinitionMetadata(null);
}
final BaseDto newDto = service.get(name);
helper.postPostUpdateEvent(name, metacatRequestContext, dto, newDto);
}
return null;
});
}
Aggregations