Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
slandelle committed Jan 18, 2018
1 parent 78f6d9e commit 30e7235
Show file tree
Hide file tree
Showing 69 changed files with 793 additions and 801 deletions.
Expand Up @@ -139,85 +139,84 @@ public class DefaultAsyncHttpClientConfig implements AsyncHttpClientConfig {
private final ResponseBodyPartFactory responseBodyPartFactory;
private final int ioThreadsCount;

private DefaultAsyncHttpClientConfig(//
// http
boolean followRedirect,//
int maxRedirects,//
boolean strict302Handling,//
boolean compressionEnforced,//
String userAgent,//
Realm realm,//
int maxRequestRetry,//
boolean disableUrlEncodingForBoundRequests,//
boolean useLaxCookieEncoder,//
boolean disableZeroCopy,//
boolean keepEncodingHeader,//
ProxyServerSelector proxyServerSelector,//
boolean validateResponseHeaders,//
private DefaultAsyncHttpClientConfig(// http
boolean followRedirect,
int maxRedirects,
boolean strict302Handling,
boolean compressionEnforced,
String userAgent,
Realm realm,
int maxRequestRetry,
boolean disableUrlEncodingForBoundRequests,
boolean useLaxCookieEncoder,
boolean disableZeroCopy,
boolean keepEncodingHeader,
ProxyServerSelector proxyServerSelector,
boolean validateResponseHeaders,
boolean aggregateWebSocketFrameFragments,

// timeouts
int connectTimeout,//
int requestTimeout,//
int readTimeout,//
int shutdownQuietPeriod,//
int shutdownTimeout,//
int connectTimeout,
int requestTimeout,
int readTimeout,
int shutdownQuietPeriod,
int shutdownTimeout,

// keep-alive
boolean keepAlive,//
int pooledConnectionIdleTimeout,//
int connectionPoolCleanerPeriod,//
int connectionTtl,//
int maxConnections,//
int maxConnectionsPerHost,//
ChannelPool channelPool,//
KeepAliveStrategy keepAliveStrategy,//
boolean keepAlive,
int pooledConnectionIdleTimeout,
int connectionPoolCleanerPeriod,
int connectionTtl,
int maxConnections,
int maxConnectionsPerHost,
ChannelPool channelPool,
KeepAliveStrategy keepAliveStrategy,

// ssl
boolean useOpenSsl,//
boolean useInsecureTrustManager,//
boolean disableHttpsEndpointIdentificationAlgorithm,//
int handshakeTimeout,//
String[] enabledProtocols,//
String[] enabledCipherSuites,//
int sslSessionCacheSize,//
int sslSessionTimeout,//
SslContext sslContext,//
SslEngineFactory sslEngineFactory,//
boolean useOpenSsl,
boolean useInsecureTrustManager,
boolean disableHttpsEndpointIdentificationAlgorithm,
int handshakeTimeout,
String[] enabledProtocols,
String[] enabledCipherSuites,
int sslSessionCacheSize,
int sslSessionTimeout,
SslContext sslContext,
SslEngineFactory sslEngineFactory,

// filters
List<RequestFilter> requestFilters,//
List<ResponseFilter> responseFilters,//
List<IOExceptionFilter> ioExceptionFilters,//
List<RequestFilter> requestFilters,
List<ResponseFilter> responseFilters,
List<IOExceptionFilter> ioExceptionFilters,

// cookie store
CookieStore cookieStore,

// tuning
boolean tcpNoDelay,//
boolean soReuseAddress,//
int soLinger, //
int soSndBuf, //
int soRcvBuf, //
boolean tcpNoDelay,
boolean soReuseAddress,
int soLinger,
int soSndBuf,
int soRcvBuf,

// internals
String threadPoolName,//
int httpClientCodecMaxInitialLineLength,//
int httpClientCodecMaxHeaderSize,//
int httpClientCodecMaxChunkSize,//
int httpClientCodecInitialBufferSize,//
int chunkedFileChunkSize,//
int webSocketMaxBufferSize,//
int webSocketMaxFrameSize,//
Map<ChannelOption<Object>, Object> channelOptions,//
EventLoopGroup eventLoopGroup,//
boolean useNativeTransport,//
ByteBufAllocator allocator,//
Timer nettyTimer,//
ThreadFactory threadFactory,//
Consumer<Channel> httpAdditionalChannelInitializer,//
Consumer<Channel> wsAdditionalChannelInitializer,//
ResponseBodyPartFactory responseBodyPartFactory,//
String threadPoolName,
int httpClientCodecMaxInitialLineLength,
int httpClientCodecMaxHeaderSize,
int httpClientCodecMaxChunkSize,
int httpClientCodecInitialBufferSize,
int chunkedFileChunkSize,
int webSocketMaxBufferSize,
int webSocketMaxFrameSize,
Map<ChannelOption<Object>, Object> channelOptions,
EventLoopGroup eventLoopGroup,
boolean useNativeTransport,
ByteBufAllocator allocator,
Timer nettyTimer,
ThreadFactory threadFactory,
Consumer<Channel> httpAdditionalChannelInitializer,
Consumer<Channel> wsAdditionalChannelInitializer,
ResponseBodyPartFactory responseBodyPartFactory,
int ioThreadsCount) {

// http
Expand Down Expand Up @@ -1170,70 +1169,70 @@ private ProxyServerSelector resolveProxyServerSelector() {

public DefaultAsyncHttpClientConfig build() {

return new DefaultAsyncHttpClientConfig(//
followRedirect, //
maxRedirects, //
strict302Handling, //
compressionEnforced, //
userAgent, //
realm, //
maxRequestRetry, //
disableUrlEncodingForBoundRequests, //
useLaxCookieEncoder, //
disableZeroCopy, //
keepEncodingHeader, //
resolveProxyServerSelector(), //
validateResponseHeaders, //
aggregateWebSocketFrameFragments, //
connectTimeout, //
requestTimeout, //
readTimeout, //
shutdownQuietPeriod, //
shutdownTimeout, //
keepAlive, //
pooledConnectionIdleTimeout, //
connectionPoolCleanerPeriod, //
connectionTtl, //
maxConnections, //
maxConnectionsPerHost, //
channelPool, //
keepAliveStrategy, //
useOpenSsl, //
useInsecureTrustManager, //
disableHttpsEndpointIdentificationAlgorithm, //
handshakeTimeout, //
enabledProtocols, //
enabledCipherSuites, //
sslSessionCacheSize, //
sslSessionTimeout, //
sslContext, //
sslEngineFactory, //
requestFilters.isEmpty() ? Collections.emptyList() : Collections.unmodifiableList(requestFilters), //
responseFilters.isEmpty() ? Collections.emptyList() : Collections.unmodifiableList(responseFilters),//
ioExceptionFilters.isEmpty() ? Collections.emptyList() : Collections.unmodifiableList(ioExceptionFilters),//
return new DefaultAsyncHttpClientConfig(
followRedirect,
maxRedirects,
strict302Handling,
compressionEnforced,
userAgent,
realm,
maxRequestRetry,
disableUrlEncodingForBoundRequests,
useLaxCookieEncoder,
disableZeroCopy,
keepEncodingHeader,
resolveProxyServerSelector(),
validateResponseHeaders,
aggregateWebSocketFrameFragments,
connectTimeout,
requestTimeout,
readTimeout,
shutdownQuietPeriod,
shutdownTimeout,
keepAlive,
pooledConnectionIdleTimeout,
connectionPoolCleanerPeriod,
connectionTtl,
maxConnections,
maxConnectionsPerHost,
channelPool,
keepAliveStrategy,
useOpenSsl,
useInsecureTrustManager,
disableHttpsEndpointIdentificationAlgorithm,
handshakeTimeout,
enabledProtocols,
enabledCipherSuites,
sslSessionCacheSize,
sslSessionTimeout,
sslContext,
sslEngineFactory,
requestFilters.isEmpty() ? Collections.emptyList() : Collections.unmodifiableList(requestFilters),
responseFilters.isEmpty() ? Collections.emptyList() : Collections.unmodifiableList(responseFilters),
ioExceptionFilters.isEmpty() ? Collections.emptyList() : Collections.unmodifiableList(ioExceptionFilters),
cookieStore,
tcpNoDelay, //
soReuseAddress, //
soLinger, //
soSndBuf, //
soRcvBuf, //
threadPoolName, //
httpClientCodecMaxInitialLineLength, //
httpClientCodecMaxHeaderSize, //
httpClientCodecMaxChunkSize, //
httpClientCodecInitialBufferSize, //
chunkedFileChunkSize, //
webSocketMaxBufferSize, //
webSocketMaxFrameSize, //
channelOptions.isEmpty() ? Collections.emptyMap() : Collections.unmodifiableMap(channelOptions),//
eventLoopGroup, //
useNativeTransport, //
allocator, //
nettyTimer, //
threadFactory, //
httpAdditionalChannelInitializer, //
wsAdditionalChannelInitializer, //
responseBodyPartFactory, //
tcpNoDelay,
soReuseAddress,
soLinger,
soSndBuf,
soRcvBuf,
threadPoolName,
httpClientCodecMaxInitialLineLength,
httpClientCodecMaxHeaderSize,
httpClientCodecMaxChunkSize,
httpClientCodecInitialBufferSize,
chunkedFileChunkSize,
webSocketMaxBufferSize,
webSocketMaxFrameSize,
channelOptions.isEmpty() ? Collections.emptyMap() : Collections.unmodifiableMap(channelOptions),
eventLoopGroup,
useNativeTransport,
allocator,
nettyTimer,
threadFactory,
httpAdditionalChannelInitializer,
wsAdditionalChannelInitializer,
responseBodyPartFactory,
ioThreadsCount);
}
}
Expand Down
2 changes: 1 addition & 1 deletion client/src/main/java/org/asynchttpclient/Dsl.java
Expand Up @@ -103,7 +103,7 @@ public static Realm.Builder realm(Realm prototype) {
}

public static Realm.Builder realm(AuthScheme scheme, String principal, String password) {
return new Realm.Builder(principal, password)//
return new Realm.Builder(principal, password)
.setScheme(scheme);
}

Expand Down
80 changes: 40 additions & 40 deletions client/src/main/java/org/asynchttpclient/Realm.java
Expand Up @@ -61,23 +61,23 @@ public class Realm {
private final boolean useAbsoluteURI;
private final boolean omitQuery;

private Realm(AuthScheme scheme, //
String principal, //
String password, //
String realmName, //
String nonce, //
String algorithm, //
String response, //
String opaque, //
String qop, //
String nc, //
String cnonce, //
Uri uri, //
boolean usePreemptiveAuth, //
Charset charset, //
String ntlmDomain, //
String ntlmHost, //
boolean useAbsoluteURI, //
private Realm(AuthScheme scheme,
String principal,
String password,
String realmName,
String nonce,
String algorithm,
String response,
String opaque,
String qop,
String nc,
String cnonce,
Uri uri,
boolean usePreemptiveAuth,
Charset charset,
String ntlmDomain,
String ntlmHost,
boolean useAbsoluteURI,
boolean omitQuery) {

this.scheme = assertNotNull(scheme, "scheme");
Expand Down Expand Up @@ -333,9 +333,9 @@ private String parseRawQop(String rawQop) {
}

public Builder parseWWWAuthenticateHeader(String headerLine) {
setRealmName(match(headerLine, "realm"))//
.setNonce(match(headerLine, "nonce"))//
.setOpaque(match(headerLine, "opaque"))//
setRealmName(match(headerLine, "realm"))
.setNonce(match(headerLine, "nonce"))
.setOpaque(match(headerLine, "opaque"))
.setScheme(isNonEmpty(nonce) ? AuthScheme.DIGEST : AuthScheme.BASIC);
String algorithm = match(headerLine, "algorithm");
if (isNonEmpty(algorithm)) {
Expand All @@ -352,9 +352,9 @@ public Builder parseWWWAuthenticateHeader(String headerLine) {
}

public Builder parseProxyAuthenticateHeader(String headerLine) {
setRealmName(match(headerLine, "realm"))//
.setNonce(match(headerLine, "nonce"))//
.setOpaque(match(headerLine, "opaque"))//
setRealmName(match(headerLine, "realm"))
.setNonce(match(headerLine, "nonce"))
.setOpaque(match(headerLine, "opaque"))
.setScheme(isNonEmpty(nonce) ? AuthScheme.DIGEST : AuthScheme.BASIC);
String algorithm = match(headerLine, "algorithm");
if (isNonEmpty(algorithm)) {
Expand Down Expand Up @@ -484,23 +484,23 @@ public Realm build() {
newResponse(md);
}

return new Realm(scheme, //
principal, //
password, //
realmName, //
nonce, //
algorithm, //
response, //
opaque, //
qop, //
nc, //
cnonce, //
uri, //
usePreemptive, //
charset, //
ntlmDomain, //
ntlmHost, //
useAbsoluteURI, //
return new Realm(scheme,
principal,
password,
realmName,
nonce,
algorithm,
response,
opaque,
qop,
nc,
cnonce,
uri,
usePreemptive,
charset,
ntlmDomain,
ntlmHost,
useAbsoluteURI,
omitQuery);
}
}
Expand Down

0 comments on commit 30e7235

Please sign in to comment.