use of com.emc.storageos.model.customconfig.ScopeParam in project coprhd-controller by CoprHD.
the class CustomConfigs method update.
@FlashException
public static void update(String id, String configType, String scopeType, String scopeValue, String value) {
CustomConfigRestRep customConfig = CustomConfigUtils.getCustomConfig(uri(id));
ScopeParam scope = customConfig.getScope();
try {
if (!scope.getType().equals(scopeType) || !scope.getValue().equals(scopeValue)) {
CustomConfigUtils.deleteCustomConfig(uri(id));
CustomConfigUtils.createCustomConfig(configType, scopeType, scopeValue, value);
} else {
CustomConfigUtils.updateCustomConfig(uri(id), value);
}
} catch (ServiceErrorException ex) {
flash.error(MessagesUtils.get("CustomConfigs.error.update", value, MessagesUtils.get("CustomConfigs.configType." + configType)));
}
}
Aggregations