}, currentConfig.getHttpService());
}
}
private void migrateHttpProtocol(NetworkConfig config, final HttpService httpService) throws TransactionFailure {
final HttpProtocol httpProtocol = httpService.getHttpProtocol();
if (httpProtocol == null) {
return;
}
ConfigSupport.apply(new SingleConfigCode<NetworkConfig>() {
@Override
public Object run(NetworkConfig networkConfig) throws TransactionFailure {
final Protocols protocols = networkConfig.getProtocols();
if (protocols.getProtocol().isEmpty()) {
createNewProtocols(httpService, protocols);
}
for (Protocol protocol : protocols.getProtocol()) {
final Http http = protocol.getHttp();
if (http != null) {
ConfigSupport.apply(new SingleConfigCode<Http>() {
@Override
public Object run(Http http) {
http.setVersion(httpProtocol.getVersion());
http.setDnsLookupEnabled(httpProtocol.getDnsLookupEnabled());
// these are both deprecated and end up with the
// value 'AttributeDeprecated' if they exist
http.setForcedResponseType(null);
http.setDefaultResponseType(null);
return null;