Examples of HostConfiguration


Examples of com.dotcms.repackage.org.apache.commons.httpclient.HostConfiguration

           !location.startsWith(HTTPS_WITH_SLASH)) {

        location = HTTP_WITH_SLASH + location;
      }

      HostConfiguration hostConfig = new HostConfiguration();

      hostConfig.setHost(new URI(location));

      if (Validator.isNotNull(PROXY_HOST) && PROXY_PORT > 0) {
        hostConfig.setProxy(PROXY_HOST, PROXY_PORT);
      }

      client.setHostConfiguration(hostConfig);
      client.setConnectionTimeout(5000);
      client.setTimeout(5000);
View Full Code Here

Examples of com.impetus.kundera.service.HostConfiguration

        puMap.put(CassandraConstants.CQL_VERSION, CassandraConstants.CQL_VERSION_3_0);

        emf = Persistence.createEntityManagerFactory("partialPropertyOverridePU", puMap);
        em = emf.createEntityManager();

        HostConfiguration hostConfig = new CassandraHostConfiguration(puMap, CassandraPropertyReader.csmd,
                "partialPropertyOverridePU", ((EntityManagerFactoryImpl) emf).getKunderaMetadataInstance());
        Assert.assertEquals(hostConfig.getHosts().get(0).getHost(), "localhost");
        Assert.assertEquals(hostConfig.getHosts().get(0).getPort(), 9160);
    }
View Full Code Here

Examples of org.apache.axis2.util.HostConfiguration

        ConfigurationContextFactory builder = new ConfigurationContextFactory();
        ar = builder.createConfigurationContextFromFileSystem(repo).getAxisConfiguration();
    }

    public void testHostConfig() throws AxisFault {
        HostConfiguration  hc = ar.getHostConfiguration();
        assertNotNull(hc);
        assertEquals(5555,hc.getPort());
    }
View Full Code Here

Examples of org.apache.commons.httpclient.HostConfiguration

            }

        }

        // to see the host is a proxy and in the proxy list - available in axis2.xml
        HostConfiguration config = new HostConfiguration();

        // one might need to set his own socket factory. Let's allow that case as well.
        Protocol protocolHandler =
                (Protocol)msgCtx.getOptions().getProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER);

        // setting the real host configuration
        // I assume the 90% case, or even 99% case will be no protocol handler case.
        if (protocolHandler == null) {
            config.setHost(targetURL.getHost(), port, targetURL.getProtocol());
        } else {
            config.setHost(targetURL.getHost(), port, protocolHandler);
        }

        if (isAuthenticationEnabled) {
            // Basic, Digest, NTLM and custom authentications.
            this.setAuthenticationInfo(client, msgCtx, config);
View Full Code Here

Examples of org.apache.commons.httpclient.HostConfiguration

    }

    static final Object lock = new Object();
    protected void executeMethod(HttpClient httpClient, MessageContext msgContext, URL url,
                                 HttpMethod method) throws IOException {
        HostConfiguration config = this.getHostConfiguration(httpClient, msgContext, url);

        if (!msgContext.getOptions().isUseSeparateListener())
            msgContext.setProperty(HTTPConstants.HTTP_METHOD, method);

        // set the custom headers, if available
View Full Code Here

Examples of org.apache.commons.httpclient.HostConfiguration

    {
        HttpClient client;
        try
        {
            client = new HttpClient(new MultiThreadedHttpConnectionManager());
            final HostConfiguration config = new HostConfiguration();
            config.setHost(hostname, port);

            if (fileSystemOptions != null)
            {
                String proxyHost = HttpFileSystemConfigBuilder.getInstance().getProxyHost(fileSystemOptions);
                int proxyPort = HttpFileSystemConfigBuilder.getInstance().getProxyPort(fileSystemOptions);

                if (proxyHost != null && proxyPort > 0)
                {
                    config.setProxy(proxyHost, proxyPort);
                }
            }

            client.setHostConfiguration(config);
View Full Code Here

Examples of org.apache.commons.httpclient.HostConfiguration

   */
  public static HTTPHEADInfo getHeadInfoWithGet(IFeed feed, URL url)
      throws NetworkException {

    HttpClient hClient = new HttpClient();
    HostConfiguration hc = hClient.getHostConfiguration();
    hc = setProxySetttings(hClient, hc);

    GetMethod gMethod = new GetMethod(url.toString());
    gMethod.setRequestHeader("cache-control", "no-cache");
    try {
View Full Code Here

Examples of org.apache.commons.httpclient.HostConfiguration

    // Check if HTTP protocol otherwise assume we have a local file
    if ("http".equals(url.getProtocol())) {

      HttpClient hClient = new HttpClient();
      hClient.getParams().setSoTimeout(NetPropertiesHandler.timeoutValue);
      HostConfiguration hc = hClient.getHostConfiguration();
      hc = setProxySetttings(hClient, hc);

      GetMethod gMethod = new GetMethod(url.toString());
      gMethod.setFollowRedirects(false);
      gMethod.setRequestHeader("cache-control", "no-cache");
View Full Code Here

Examples of org.apache.commons.httpclient.HostConfiguration

      throws NetworkException {
    HTTPHEADInfo head = null;
    HttpClient hClient = new HttpClient();
    hClient.getParams().setSoTimeout(25000);
    // hClient.setTimeout(5000); deprecated in 3.0 client
    HostConfiguration hc = hClient.getHostConfiguration();
    hc = setProxySetttings(hClient, hc);
    HeadMethod hMethod = null;
    try {
      hMethod = new HeadMethod(url.toString());
      hMethod.setRequestHeader("cache-control", "no-cache");
View Full Code Here

Examples of org.apache.commons.httpclient.HostConfiguration

      if ("http".equals(lUrl.getProtocol())) {
        HttpClient hClient = new HttpClient();
        // CB TODO, get this from core preferences.
        hClient.getParams().setSoTimeout(
            NetPropertiesHandler.timeoutValue);
        HostConfiguration hc = hClient.getHostConfiguration();
        hc = setProxySetttings(hClient, hc);
        gMethod = new GetMethod(lUrl.toExternalForm());

        // Add a byte range header asking for partial content.
        if (pDownload.getAttachment().isIncomplete()) {
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.