others.removeAll(Arrays.asList(failedResource));
checkResourcesUpgraded(others, others.size());
}
protected void addChildrenToFail(Resource parent, ResType childResType, int... childrenOrdinals) {
InventoryManager inventoryManager = PluginContainer.getInstance().getInventoryManager();
ResourceContainer parentContainer = inventoryManager.getResourceContainer(parent);
BaseResourceComponentInterface parentComponent = (BaseResourceComponentInterface) parentContainer
.getResourceComponent();
if (parentComponent==null) {
throw new RuntimeException("Did not get a container for parent " + parent.getName() + ", " + parent.getUuid() + ", " + parent.getId());
}
Map<String, Set<Integer>> childrenToFail = new HashMap<String, Set<Integer>>();
Set<Integer> ordinals = new HashSet<Integer>();
for (int i = 0; i < childrenOrdinals.length; ++i) {
ordinals.add(childrenOrdinals[i]);
}
childrenToFail.put(childResType.getResourceTypeName(), ordinals);
Configuration newPluginConfig = parentComponent.createPluginConfigurationWithMarkedFailures(childrenToFail);
try {
int resourceId = parent.getId();
inventoryManager.updatePluginConfiguration(resourceId, newPluginConfig);
} catch (InvalidPluginConfigurationClientException e) {
fail("Updating plugin configuration failed.", e);
} catch (PluginContainerException e) {
fail("Updating plugin configuration failed.", e);
}