List of usage examples for com.squareup.okhttp HttpUrl defaultPort
public static int defaultPort(String scheme)
From source file:com.baidu.oped.apm.plugin.okhttp.interceptor.HttpEngineSendRequestMethodInterceptor.java
License:Apache License
private String getDestinationId(HttpUrl httpUrl) { if (httpUrl == null || httpUrl.host() == null) { return "UnknownHttpClient"; }// www. j a v a2s . c o m if (httpUrl.port() == HttpUrl.defaultPort(httpUrl.scheme())) { return httpUrl.host(); } final StringBuilder sb = new StringBuilder(); sb.append(httpUrl.host()); sb.append(':'); sb.append(httpUrl.port()); return sb.toString(); }
From source file:com.navercorp.pinpoint.plugin.okhttp.interceptor.RequestBuilderBuildMethodInterceptor.java
License:Apache License
private String getDestinationId(HttpUrl httpUrl) { if (httpUrl == null || httpUrl.host() == null) { return "UnknownHttpClient"; }// ww w . j a v a 2 s . c o m if (httpUrl.port() <= 0 || httpUrl.port() == HttpUrl.defaultPort(httpUrl.scheme())) { return httpUrl.host(); } final StringBuilder sb = new StringBuilder(); sb.append(httpUrl.host()); sb.append(':'); sb.append(httpUrl.port()); return sb.toString(); }
From source file:com.navercorp.pinpoint.plugin.okhttp.v2.interceptor.RequestBuilderBuildMethodInterceptor.java
License:Apache License
private String getDestinationId(HttpUrl httpUrl) { if (httpUrl == null || httpUrl.host() == null) { return "UnknownHttpClient"; }// w w w.j a v a2 s. c om final int port = EndPointUtils.getPort(httpUrl.port(), HttpUrl.defaultPort(httpUrl.scheme())); return HostAndPort.toHostAndPortString(httpUrl.host(), port); }