private void deleteResourcesForPlugin(Subject subject, Plugin plugin) throws Exception {
// Uninventory all of the top level resources for the plugin's deleted types. The children go away automatically
ResourceTypeCriteria criteria = new ResourceTypeCriteria();
criteria.setStrict(true);
criteria.addFilterPluginName(plugin.getName());
criteria.addFilterDeleted(true); // get all deleted types ...
criteria.addFilterIgnored(null); // ... whether they are ignored or not
criteria.addFilterParentResourceTypesEmpty(true);
criteria.clearPaging();
List<ResourceType> deletedServerTypes = resourceTypeMgr.findResourceTypesByCriteria(subject, criteria);