Examples of HttpClientParams


Examples of org.apache.commons.httpclient.params.HttpClientParams

     * to use.
     *
     * @since 2.0
     */
    public HttpClient(HttpConnectionManager httpConnectionManager) {
        this(new HttpClientParams(), httpConnectionManager);
    }
View Full Code Here

Examples of org.apache.commons.httpclient.params.HttpClientParams

    protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
        if (httpRegistry == null) {
            httpRegistry = DefaultHttpRegistry.getSingletonHttpRegistry();
        }

        HttpClientParams params = new HttpClientParams();
        IntrospectionSupport.setProperties(params, parameters, "httpClient.");

        // create the configurer to use for this endpoint
        final Set<AuthMethod> authMethods = new LinkedHashSet<AuthMethod>();
        HttpClientConfigurer configurer = createHttpClientConfigurer(parameters, authMethods);
View Full Code Here

Examples of org.apache.commons.httpclient.params.HttpClientParams

            userAgent += ", " + ClientConfiguration.DEFAULT_USER_AGENT;
        }
        userAgent += "-" + VersionInfoUtils.getVersion();

        /* Set HTTP client parameters */
        HttpClientParams httpClientParams = new HttpClientParams();
        httpClientParams.setParameter(HttpMethodParams.USER_AGENT, userAgent);
        httpClientParams.setParameter(HttpClientParams.RETRY_HANDLER, new RetryHandler());

        /* Set host configuration */
        HostConfiguration hostConfiguration = new HostConfiguration();

        /* Set connection manager parameters */
 
View Full Code Here

Examples of org.apache.commons.httpclient.params.HttpClientParams

                        client.getState().setProxyCredentials(scope, proxyCreds);
                    }

                    if (builder.isPreemptiveAuth(fileSystemOptions))
                    {
                        HttpClientParams httpClientParams = new HttpClientParams();
                        httpClientParams.setAuthenticationPreemptive(true);
                        client.setParams(httpClientParams);
                    }
                }

                Cookie[] cookies = builder.getCookies(fileSystemOptions);
View Full Code Here

Examples of org.apache.commons.httpclient.params.HttpClientParams

    HttpConnectionManagerParams managerParams = manager.getParams();
    managerParams.setConnectionTimeout(2000); // 2 s
    managerParams.setDefaultMaxConnectionsPerHost(10);
    managerParams.setMaxTotalConnections(100);
    this.httpClient = new HttpClient(manager);
    HttpClientParams clientParams = httpClient.getParams();
    clientParams.setVersion(HttpVersion.HTTP_1_1);
  }
View Full Code Here

Examples of org.apache.commons.httpclient.params.HttpClientParams

      AuthScope scope = new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT, AuthScope.ANY_REALM, AuthScope.ANY_SCHEME);

      client.getState().setCredentials(scope, new UsernamePasswordCredentials(username, job.get(SolrConstants.PASSWORD)));

      HttpClientParams params = client.getParams();
      params.setAuthenticationPreemptive(true);

      client.setParams(params);
    }

    String serverURL = job.get(SolrConstants.SERVER_URL);
View Full Code Here

Examples of org.apache.commons.httpclient.params.HttpClientParams

     * Creates an instance of ProxyClient using default {@link HttpClientParams parameter set}.
     *
     * @see HttpClientParams
     */
    public ProxyClient() {
        this(new HttpClientParams());
    }
View Full Code Here

Examples of org.apache.commons.httpclient.params.HttpClientParams

     * Creates an instance of HttpClient using default {@link HttpClientParams parameter set}.
     *
     * @see HttpClientParams
     */
    public HttpClient() {
        this(new HttpClientParams());
    }
View Full Code Here

Examples of org.apache.commons.httpclient.params.HttpClientParams

     * to use.
     *
     * @since 2.0
     */
    public HttpClient(HttpConnectionManager httpConnectionManager) {
        this(new HttpClientParams(), httpConnectionManager);
    }
View Full Code Here

Examples of org.apache.commons.httpclient.params.HttpClientParams

     *            this <code>UrlConfig</code>
     */
    private void setConnectionAuthorization(HttpClient client, URL u, AuthManager authManager) {
        HttpState state = client.getState();
        if (authManager != null) {
            HttpClientParams params = client.getParams();
            Authorization auth = authManager.getAuthForURL(u);
            if (auth != null) {
                    String username = auth.getUser();
                    String realm = auth.getRealm();
                    String domain = auth.getDomain();
                    if (log.isDebugEnabled()){
                        log.debug(username + " >  D="+ username + " D="+domain+" R="+realm);
                    }
                    state.setCredentials(
                            new AuthScope(u.getHost(),u.getPort(),
                                    realm.length()==0 ? null : realm //"" is not the same as no realm
                                    ,AuthScope.ANY_SCHEME),
                            // NT Includes other types of Credentials
                            new NTCredentials(
                                    username,
                                    auth.getPass(),
                                    localHost,
                                    domain
                            ));
                    // We have credentials - should we set pre-emptive authentication?
                    if (canSetPreEmptive){
                        log.debug("Setting Pre-emptive authentication");
                        params.setAuthenticationPreemptive(true);
                    }
            } else {
                state.clearCredentials();
                if (canSetPreEmptive){
                    params.setAuthenticationPreemptive(false);
                }
            }
        } else {
            state.clearCredentials();
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.