Skip to content

Commit

Permalink
Issue #12023 - Remove deprecated classes/methods.
Browse files Browse the repository at this point in the history
Removed deprecated classes/methods from jetty-client.

Signed-off-by: Simone Bordet <[email protected]>
  • Loading branch information
sbordet committed Aug 7, 2024
1 parent 2ba2250 commit d22b068
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 570 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

package org.eclipse.jetty.client;

import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.time.Duration;
import java.util.Map;
Expand Down Expand Up @@ -73,10 +72,4 @@ public void connect(SocketAddress address, Map<String, Object> context)
context.put(ClientConnector.CLIENT_CONNECTOR_CONTEXT_KEY, connector);
destination.getOrigin().getTransport().connect(address, context);
}

@Override
public void connect(InetSocketAddress address, Map<String, Object> context)
{
connect((SocketAddress)address, context);
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -471,13 +471,7 @@ public Origin createOrigin(Request request, Origin.Protocol protocol)
port = normalizePort(scheme, port);
Transport transport = request.getTransport();
if (transport == null)
{
// Ask the ClientConnector for backwards compatibility
// until ClientConnector.Configurator is removed.
transport = connector.newTransport();
if (transport == null)
transport = Transport.TCP_IP;
}
transport = Transport.TCP_IP;
return new Origin(scheme, new Origin.Address(host, port), request.getTag(), protocol, transport);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

package org.eclipse.jetty.client;

import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.util.Map;

Expand Down Expand Up @@ -71,24 +70,8 @@ public interface HttpClientTransport extends ClientConnectionFactory
*
* @param address the address to connect to
* @param context the context information to establish the connection
* @deprecated use {@link #connect(SocketAddress, Map)} instead.
*/
@Deprecated
public void connect(InetSocketAddress address, Map<String, Object> context);

/**
* Establishes a physical connection to the given {@code address}.
*
* @param address the address to connect to
* @param context the context information to establish the connection
*/
public default void connect(SocketAddress address, Map<String, Object> context)
{
if (address instanceof InetSocketAddress)
connect((InetSocketAddress)address, context);
else
throw new UnsupportedOperationException("Unsupported SocketAddress " + address);
}
public void connect(SocketAddress address, Map<String, Object> context);

/**
* @return the factory for ConnectionPool instances
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Optional;
Expand Down Expand Up @@ -91,19 +90,6 @@ public HttpClientTransportDynamic()
this(new ClientConnector(), HttpClientConnectionFactory.HTTP11);
}

/**
* <p>Creates a dynamic transport that speaks the given protocols, in order of preference
* (first the most preferred).</p>
*
* @param infos the protocols this dynamic transport speaks
* @deprecated use {@link #HttpClientTransportDynamic(ClientConnector, ClientConnectionFactory.Info...)}
*/
@Deprecated(since = "12.0.7", forRemoval = true)
public HttpClientTransportDynamic(ClientConnectionFactory.Info... infos)
{
this(findClientConnector(infos), infos);
}

/**
* <p>Creates a dynamic transport with the given {@link ClientConnector} and the given protocols,
* in order of preference (first the most preferred).</p>
Expand All @@ -121,14 +107,6 @@ public HttpClientTransportDynamic(ClientConnector connector, ClientConnectionFac
);
}

private static ClientConnector findClientConnector(ClientConnectionFactory.Info[] infos)
{
return Arrays.stream(infos)
.flatMap(info -> info.getContainedBeans(ClientConnector.class).stream())
.findFirst()
.orElseGet(ClientConnector::new);
}

@Override
public Origin newOrigin(Request request)
{
Expand Down Expand Up @@ -216,11 +194,7 @@ else if (matches == 1)
Transport transport = request.getTransport();
if (transport == null)
{
// Ask the ClientConnector for backwards compatibility
// until ClientConnector.Configurator is removed.
transport = getClientConnector().newTransport();
if (transport == null)
transport = matchingInfos.get(0).newTransport();
transport = matchingInfos.get(0).newTransport();
request.transport(transport);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,6 @@ public class HttpDestination extends ContainerLifeCycle implements Destination,
private boolean stale;
private long activeNanoTime;

/**
* @param client the {@link HttpClient}
* @param origin the {@link Origin}
* @param intrinsicallySecure whether the destination is intrinsically secure
* @deprecated use {@link #HttpDestination(HttpClient, Origin)} instead
*/
@Deprecated(since = "12.0.7", forRemoval = true)
public HttpDestination(HttpClient client, Origin origin, boolean intrinsicallySecure)
{
this(client, origin);
}

/**
* <p>Creates a new HTTP destination.</p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,6 @@ public void connect(SocketAddress address, Map<String, Object> context)
connect(address, destination.getClientConnectionFactory(), listenerPromise, listenerPromise, context);
}

@Override
public void connect(InetSocketAddress address, Map<String, Object> context)
{
connect((SocketAddress)address, context);
}

protected void connect(SocketAddress address, ClientConnectionFactory factory, Session.Listener listener, Promise<Session> promise, Map<String, Object> context)
{
HttpDestination destination = (HttpDestination)context.get(HTTP_DESTINATION_CONTEXT_KEY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

package org.eclipse.jetty.http3.client.transport;

import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.time.Duration;
import java.util.List;
Expand Down Expand Up @@ -99,12 +98,6 @@ public Destination newDestination(Origin origin)
return new HttpDestination(getHttpClient(), origin);
}

@Override
public void connect(InetSocketAddress address, Map<String, Object> context)
{
connect((SocketAddress)address, context);
}

@Override
public void connect(SocketAddress address, Map<String, Object> context)
{
Expand Down
Loading

0 comments on commit d22b068

Please sign in to comment.