Package org.apache.commons.httpclient.params

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


        httpMethod.setRequestEntity(entity);

        try {

            HttpClient client = getSendHttpClient();
            HttpClientParams params = new HttpClientParams();
            params.setSoTimeout(MAX_CLIENT_TIMEOUT);
            client.setParams(params);
            int answer = client.executeMethod(httpMethod);
            if (answer != HttpStatus.SC_OK) {
                throw new IOException("Failed to post command: " + command + " as response was: " + answer);
            }
View Full Code Here


        if (config.getMaxConnections() != null) {
          mp.setMaxTotalConnections(config.getMaxConnections());
          mp.setMaxConnectionsPerHost(HostConfiguration.ANY_HOST_CONFIGURATION, config.getMaxConnections());
        }

        HttpClientParams cp = http.getParams();
        if (config.getTimeout() != null) {
            mp.setConnectionTimeout(config.getTimeout().intValue());
            cp.setConnectionManagerTimeout(config.getTimeout());
            cp.setSoTimeout(config.getTimeout().intValue());
        }
        if (config.getRetryHandler() != null) {
            cp.setParameter(HttpMethodParams.RETRY_HANDLER, config.getRetryHandler());
        }

        return http;
    }
View Full Code Here

            httpRegistry = DefaultHttpRegistry.getSingletonHttpRegistry();
        }

        uri = uri.startsWith("servlet:") ? remaining : uri;

        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

     *            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

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

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

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

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

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

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

TOP

Related Classes of org.apache.commons.httpclient.params.HttpClientParams

Copyright © 2018 www.massapicom. 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.