Examples of HttpClientParams


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

       
        // TODO make it configurable
        mgr.getParams().setMaxTotalConnections(1000);
       
          s_client = new HttpClient(mgr);
          HttpClientParams clientParams = new HttpClientParams();
          clientParams.setSoTimeout(_requestTimeoutSeconds * 1000);
         
          s_client.setParams(clientParams);
      }
      return s_client;
    }
View Full Code Here

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

    HttpClient _client = mock(HttpClient.class);
    HttpMethod _method;

    @Before
    public void setUp() {
        HttpClientParams hmp = mock(HttpClientParams.class);
        when (_client.getParams()).thenReturn(hmp);
        _api = new BigSwitchVnsApi() {
            @Override
            protected HttpClient createHttpClient() {
                return _client;
View Full Code Here

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

    this.cluster = cluster;
    httpClient = new HttpClient(new MultiThreadedHttpConnectionManager());
    HttpConnectionManagerParams managerParams =
      httpClient.getHttpConnectionManager().getParams();
    managerParams.setConnectionTimeout(2000); // 2 s
    HttpClientParams clientParams = httpClient.getParams();
    clientParams.setVersion(HttpVersion.HTTP_1_1);
  }
View Full Code Here

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

  HttpClient _client = mock(HttpClient.class);
  HttpMethod _method;
 
  @Before
  public void setUp() {
    HttpClientParams hmp = mock(HttpClientParams.class);
    when (_client.getParams()).thenReturn(hmp);
    _api = new NiciraNvpApi() {
      @Override
      protected HttpClient createHttpClient() {
        return _client;
View Full Code Here

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

        httpMethod.setRequestEntity(entity);

        try {

            HttpClient client = getSendHttpClient();
            HttpClientParams params = new HttpClientParams();
            params.setSoTimeout(soTimeout);
            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

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

    @Override
    protected Endpoint<HttpExchange> createEndpoint(String uri, String remaining, Map parameters) throws Exception {
        uri = uri.startsWith("jetty:") ? remaining : uri;

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

        configureParameters(parameters);

        // restructure uri to be based on the parameters left as we dont want to include the Camel internal options
View Full Code Here

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

        try
        {
            HttpClient client = new HttpClient();

            // MCHANGES-89 Allow circular redirects
            HttpClientParams clientParams = client.getParams();
            clientParams.setBooleanParameter( HttpClientParams.ALLOW_CIRCULAR_REDIRECTS, true );

            HttpState state = new HttpState();

            HostConfiguration hc = new HostConfiguration();
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

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

    /* (non-Javadoc)
     * @see org.jasig.portal.portlets.registerportal.IPortalDataSubmitter#submitPortalData(org.jasig.portal.portlets.registerportal.PortalRegistrationData)
     */
    public boolean submitPortalData(PortalRegistrationData portalRegistrationData) {
        final HttpClient client = new HttpClient();
        final HttpClientParams httpClientParams = client.getParams();
        httpClientParams.setSoTimeout(5000);
       
        String postUrl = this.submitUrl;
        for (int redirectCounter = 0; redirectCounter < 10; redirectCounter++) {
            final PostMethod post = new PostMethod(postUrl);
            try {
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.