throw new ResourceException(
CLIENT_ERROR_NOT_FOUND, "Could not find Yum repository with id '" + repositoryId + "'"
);
}
final CapabilityReference capabilityReference = capabilities.iterator().next();
final GenerateMetadataCapabilityConfiguration configuration =
capabilityReference.capabilityAs(GenerateMetadataCapability.class).getConfig();
final String version = payload.toString();
final Map<String, String> newAliases = Maps.newHashMap();
newAliases.putAll(configuration.aliases());
newAliases.put(alias, version);
final GenerateMetadataCapabilityConfiguration newConfiguration =
new GenerateMetadataCapabilityConfiguration(
configuration.repository(),
newAliases,
configuration.shouldProcessDeletes(),
configuration.deleteProcessingDelay(),
configuration.getYumGroupsDefinitionFile()
);
try {
capabilityRegistry.update(
capabilityReference.context().id(),
capabilityReference.context().isEnabled(),
capabilityReference.context().notes(),
newConfiguration.asMap()
);
}
catch (CapabilityNotFoundException e) {
throw new ResourceException(Status.CLIENT_ERROR_NOT_FOUND, e.getMessage());