File tree Expand file tree Collapse file tree 1 file changed +22
-5
lines changed
api/src/main/java/org/asynchttpclient/channel/pool Expand file tree Collapse file tree 1 file changed +22
-5
lines changed Original file line number Diff line number Diff line change 1818
1919public interface ConnectionPoolPartitioning {
2020
21- Object getPartitionKey (Uri uri , ProxyServer proxy );
21+ public class ProxyPartitionKey {
22+ private final String proxyUrl ;
23+ private final String targetHostBaseUrl ;
24+
25+ public ProxyPartitionKey (String proxyUrl , String targetHostBaseUrl ) {
26+ this .proxyUrl = proxyUrl ;
27+ this .targetHostBaseUrl = targetHostBaseUrl ;
28+ }
29+
30+ @ Override
31+ public String toString () {
32+ return new StringBuilder ()//
33+ .append ("ProxyPartitionKey(proxyUrl=" ).append (proxyUrl )//
34+ .append (", targetHostBaseUrl=" ).append (targetHostBaseUrl )//
35+ .toString ();
36+ }
37+ }
38+
39+ Object getPartitionKey (Uri uri , ProxyServer proxyServer );
2240
2341 public enum PerHostConnectionPoolPartitioning implements ConnectionPoolPartitioning {
2442
2543 INSTANCE ;
2644
27- @ Override
28- public String getPartitionKey (Uri uri , ProxyServer proxyServer ) {
29- String serverPart = AsyncHttpProviderUtils .getBaseUrl (uri );
30- return proxyServer != null ? proxyServer .getUrl () + serverPart : serverPart ;
45+ public Object getPartitionKey (Uri uri , ProxyServer proxyServer ) {
46+ String targetHostBaseUrl = AsyncHttpProviderUtils .getBaseUrl (uri );
47+ return proxyServer != null ? new ProxyPartitionKey (proxyServer .getUrl (), targetHostBaseUrl ) : targetHostBaseUrl ;
3148 }
3249 }
3350}
You can’t perform that action at this time.
0 commit comments