private int getMaximumCacheLimit(Configuration configuration) { int limit = ClientProperties.getValue(configuration.getProperties(), ClientProperties.DIGESTAUTH_URI_CACHE_SIZELIMIT, MAXIMUM_DIGEST_CACHE_SIZE); if (limit < 1) { limit = MAXIMUM_DIGEST_CACHE_SIZE; } return limit; }
private int getMaximumCacheLimit(Configuration configuration) { int limit = ClientProperties.getValue(configuration.getProperties(), ClientProperties.DIGESTAUTH_URI_CACHE_SIZELIMIT, MAXIMUM_DIGEST_CACHE_SIZE); if (limit < 1) { limit = MAXIMUM_DIGEST_CACHE_SIZE; } return limit; }
@Override public Connector getConnector(final Client client, final Configuration config) { final Map<String, Object> properties = config.getProperties(); int computedChunkSize = ClientProperties.getValue(properties, ClientProperties.CHUNKED_ENCODING_SIZE, chunkSize, Integer.class); if (computedChunkSize < 0) { LOGGER.warning(LocalizationMessages.NEGATIVE_CHUNK_SIZE(computedChunkSize, chunkSize)); computedChunkSize = chunkSize; } final boolean computedUseFixedLengthStreaming = ClientProperties.getValue(properties, USE_FIXED_LENGTH_STREAMING, useFixedLengthStreaming, Boolean.class); final boolean computedUseSetMethodWorkaround = ClientProperties.getValue(properties, SET_METHOD_WORKAROUND, useSetMethodWorkaround, Boolean.class); return createHttpUrlConnector(client, connectionFactory, computedChunkSize, computedUseFixedLengthStreaming, computedUseSetMethodWorkaround); }
private int getMaximumCacheLimit(Configuration configuration) { int limit = ClientProperties.getValue(configuration.getProperties(), ClientProperties.DIGESTAUTH_URI_CACHE_SIZELIMIT, MAXIMUM_DIGEST_CACHE_SIZE); if (limit < 1) { limit = MAXIMUM_DIGEST_CACHE_SIZE; } return limit; }
@Override public Connector getConnector(final Client client, final Configuration config) { final Map<String, Object> properties = config.getProperties(); int computedChunkSize = ClientProperties.getValue(properties, ClientProperties.CHUNKED_ENCODING_SIZE, chunkSize, Integer.class); if (computedChunkSize < 0) { LOGGER.warning(LocalizationMessages.NEGATIVE_CHUNK_SIZE(computedChunkSize, chunkSize)); computedChunkSize = chunkSize; } final boolean computedUseFixedLengthStreaming = ClientProperties.getValue(properties, USE_FIXED_LENGTH_STREAMING, useFixedLengthStreaming, Boolean.class); final boolean computedUseSetMethodWorkaround = ClientProperties.getValue(properties, SET_METHOD_WORKAROUND, useSetMethodWorkaround, Boolean.class); return createHttpUrlConnector(client, connectionFactory, computedChunkSize, computedUseFixedLengthStreaming, computedUseSetMethodWorkaround); }
@Override public Connector getConnector(final Client client, final Configuration config) { final Map<String, Object> properties = config.getProperties(); int computedChunkSize = ClientProperties.getValue(properties, ClientProperties.CHUNKED_ENCODING_SIZE, chunkSize, Integer.class); if (computedChunkSize < 0) { LOGGER.warning(LocalizationMessages.NEGATIVE_CHUNK_SIZE(computedChunkSize, chunkSize)); computedChunkSize = chunkSize; } final boolean computedUseFixedLengthStreaming = ClientProperties.getValue(properties, USE_FIXED_LENGTH_STREAMING, useFixedLengthStreaming, Boolean.class); final boolean computedUseSetMethodWorkaround = ClientProperties.getValue(properties, SET_METHOD_WORKAROUND, useSetMethodWorkaround, Boolean.class); return createHttpUrlConnector(client, connectionFactory, computedChunkSize, computedUseFixedLengthStreaming, computedUseSetMethodWorkaround); }
private ProxyConfiguration(Map<String, Object> properties) { String uriStr = ClientProperties.getValue(properties, ClientProperties.PROXY_URI, String.class); if (uriStr == null) { configured = false; host = null; port = -1; userName = null; password = null; return; } configured = true; URI proxyUri = URI.create(uriStr); host = proxyUri.getHost(); if (proxyUri.getPort() == -1) { port = 8080; } else { port = proxyUri.getPort(); } userName = JdkConnectorProperties.getValue(properties, ClientProperties.PROXY_USERNAME, String.class); password = JdkConnectorProperties.getValue(properties, ClientProperties.PROXY_PASSWORD, String.class); }
Integer timeout = ClientProperties.getValue(jerseyRequest.getConfiguration().getProperties(), ClientProperties.READ_TIMEOUT, 0);
@Override protected void initChannel(SocketChannel ch) throws Exception { ChannelPipeline p = ch.pipeline(); // Enable HTTPS if necessary. if ("https".equals(requestUri.getScheme())) { // making client authentication optional for now; it could be extracted to configurable property JdkSslContext jdkSslContext = new JdkSslContext(client.getSslContext(), true, ClientAuth.NONE); p.addLast(jdkSslContext.newHandler(ch.alloc())); } // http proxy Configuration config = jerseyRequest.getConfiguration(); final Object proxyUri = config.getProperties().get(ClientProperties.PROXY_URI); if (proxyUri != null) { final URI u = getProxyUri(proxyUri); final String userName = ClientProperties.getValue( config.getProperties(), ClientProperties.PROXY_USERNAME, String.class); final String password = ClientProperties.getValue( config.getProperties(), ClientProperties.PROXY_PASSWORD, String.class); p.addLast(new HttpProxyHandler(new InetSocketAddress(u.getHost(), u.getPort() == -1 ? 8080 : u.getPort()), userName, password)); } p.addLast(new HttpClientCodec()); p.addLast(new ChunkedWriteHandler()); p.addLast(new HttpContentDecompressor()); p.addLast(new JerseyClientHandler(NettyConnector.this, jerseyRequest, jerseyCallback, settableFuture)); } });
.build(); final Integer chunkSize = ClientProperties.getValue(config.getProperties(), ClientProperties.CHUNKED_ENCODING_SIZE, ClientProperties.DEFAULT_CHUNK_SIZE, Integer.class);
final HttpHost proxy = new HttpHost(u.getHost(), u.getPort(), u.getScheme()); final String userName; userName = ClientProperties.getValue(config.getProperties(), ClientProperties.PROXY_USERNAME, String.class); if (userName != null) { final String password; password = ClientProperties.getValue(config.getProperties(), ClientProperties.PROXY_PASSWORD, String.class);
Integer connectTimeout = ClientProperties.getValue(jerseyRequest.getConfiguration().getProperties(), ClientProperties.CONNECT_TIMEOUT, 0); if (connectTimeout > 0) {
builder.setConnectTimeout(ClientProperties.getValue(config.getProperties(), ClientProperties.CONNECT_TIMEOUT, 10000)); builder.setRequestTimeout(ClientProperties.getValue(config.getProperties(), ClientProperties.READ_TIMEOUT, 10000)); proxyProperties.setProperty(ProxyUtils.PROXY_PORT, String.valueOf(u.getPort())); final String userName = ClientProperties.getValue( config.getProperties(), ClientProperties.PROXY_USERNAME, String.class); if (userName != null) { proxyProperties.setProperty(ProxyUtils.PROXY_USER, userName); final String password = ClientProperties.getValue( config.getProperties(), ClientProperties.PROXY_PASSWORD, String.class); if (password != null) {
threadPoolConfig.setCorePoolSize(ClientProperties.getValue(properties, ClientProperties.ASYNC_THREADPOOL_SIZE, threadPoolConfig.getCorePoolSize(), Integer.class)); containerIdleTimeout = JdkConnectorProperties.getValue(properties, JdkConnectorProperties.CONTAINER_IDLE_TIMEOUT, followRedirects = ClientProperties.getValue(properties, ClientProperties.FOLLOW_REDIRECTS, true, Boolean.class); JdkConnectorProperties.DEFAULT_CONNECTION_IDLE_TIMEOUT, Integer.class); responseTimeout = ClientProperties.getValue(properties, ClientProperties.READ_TIMEOUT, 0, Integer.class); connectTimeout = ClientProperties.getValue(properties, ClientProperties.CONNECT_TIMEOUT, 0, Integer.class);
boolean followRedirects = ClientProperties.getValue(clientRequest.getConfiguration().getProperties(), ClientProperties.FOLLOW_REDIRECTS, true);
.getValue(runtimeProperties, ClientProperties.ASYNC_THREADPOOL_SIZE, Integer.class);
.getValue(runtimeProperties, ClientProperties.ASYNC_THREADPOOL_SIZE, Integer.class);
.getValue(runtimeProperties, ClientProperties.ASYNC_THREADPOOL_SIZE, Integer.class);
private int getMaximumCacheLimit(Configuration configuration) { int limit = ClientProperties.getValue(configuration.getProperties(), ClientProperties.DIGESTAUTH_URI_CACHE_SIZELIMIT, MAXIMUM_DIGEST_CACHE_SIZE); if (limit < 1) { limit = MAXIMUM_DIGEST_CACHE_SIZE; } return limit; }
private int getMaximumCacheLimit(Configuration configuration) { int limit = ClientProperties.getValue(configuration.getProperties(), ClientProperties.DIGESTAUTH_URI_CACHE_SIZELIMIT, MAXIMUM_DIGEST_CACHE_SIZE); if (limit < 1) { limit = MAXIMUM_DIGEST_CACHE_SIZE; } return limit; }