Package org.cloudfoundry.client.lib

Examples of org.cloudfoundry.client.lib.HttpProxyConfiguration


    // handler
    // therefore it is not critical to set the proxy in the client on
    // client
    // creation

    HttpProxyConfiguration proxyConfiguration = getProxy(url);
    return session != null ? new CloudFoundryClient(credentials, url, session, selfSigned)
        : new CloudFoundryClient(credentials, url, proxyConfiguration, selfSigned);
  }
View Full Code Here


    // CloudFoundryServerBehaviour Request as well as the client login
    // handler
    // therefore it is not critical to set the proxy in the client on
    // client
    // creation
    HttpProxyConfiguration proxyConfiguration = getProxy(url);
    return new CloudFoundryClient(credentials, url, orgName, spaceName, proxyConfiguration, selfsigned);
  }
View Full Code Here

    // Proxies are always updated on each client call by the
    // CloudFoundryServerBehaviour Request as well as the client login
    // handler
    // therefore it is not critical to set the proxy in the client on client
    // creation
    HttpProxyConfiguration proxyConfiguration = getProxy(url);
    return new CloudFoundryClient(url, proxyConfiguration);
  }
View Full Code Here

              if (matchedProxyData.equals(data.getType())) {
                int proxyPort = data.getPort();
                String proxyHost = data.getHost();
                String user = data.getUserId();
                String password = data.getPassword();
                return proxyHost != null ? new HttpProxyConfiguration(proxyHost, proxyPort,
                    data.isRequiresAuthentication(), user, password) : null;
              }
            }
          }
        }
View Full Code Here

    new ProxyHandler(null, -1, false, IProxyData.HTTP_PROXY_TYPE) {

      @Override
      protected void handleProxyChange() throws CoreException {
        try {
          HttpProxyConfiguration configuration = CloudFoundryClientFactory
              .getProxy(new URL(VALID_V1_HTTP_URL));
          assertNull(configuration);

          // verify it is null for https as well
          configuration = CloudFoundryClientFactory.getProxy(new URL(VALID_V1_HTTPS_URL));
View Full Code Here

    new ProxyHandler(null, -1, false, IProxyData.HTTPS_PROXY_TYPE) {

      @Override
      protected void handleProxyChange() throws CoreException {
        try {
          HttpProxyConfiguration configuration = CloudFoundryClientFactory.getProxy(new URL(
              VALID_V1_HTTPS_URL));
          assertNull(configuration);

          // verify it is null for https as well
          configuration = CloudFoundryClientFactory.getProxy(new URL(VALID_V1_HTTP_URL));
View Full Code Here

    new ProxyHandler("invalid.proxy.test", 8080, enableProxies, IProxyData.HTTPS_PROXY_TYPE) {

      @Override
      protected void handleProxyChange() throws CoreException {
        try {
          HttpProxyConfiguration configuration = CloudFoundryClientFactory.getProxy(new URL(
              VALID_V1_HTTPS_URL));
          assertNull(configuration);

          // verify it is null for https as well
          configuration = CloudFoundryClientFactory.getProxy(new URL(VALID_V1_HTTP_URL));
View Full Code Here

    new ProxyHandler("invalid.proxy.test", 8080, enableProxies, IProxyData.HTTP_PROXY_TYPE) {

      @Override
      protected void handleProxyChange() throws CoreException {
        try {
          HttpProxyConfiguration configuration = CloudFoundryClientFactory
              .getProxy(new URL(VALID_V1_HTTP_URL));
          assertNull(configuration);

          // verify it is null for https as well
          configuration = CloudFoundryClientFactory.getProxy(new URL(VALID_V1_HTTPS_URL));
View Full Code Here

    new ProxyHandler("invalid.proxy.test", 8080, setProxy, IProxyData.HTTP_PROXY_TYPE) {

      @Override
      protected void handleProxyChange() throws CoreException {
        try {
          HttpProxyConfiguration configuration = CloudFoundryClientFactory
              .getProxy(new URL(VALID_V1_HTTP_URL));
          assertNotNull(configuration);
          assertTrue(configuration.getProxyHost().equals("invalid.proxy.test"));
          assertTrue(configuration.getProxyPort() == (8080));

          // verify it is null for https, since proxy lookup should
          // match the specified
          // protocol in the given URL (i.e. HTTP proxy -> HTTP URL,
          // HTTPS proxy -> HTTPS URL)
          configuration = CloudFoundryClientFactory.getProxy(new URL(VALID_V1_HTTPS_URL));

          // Need to add this code in case the server has a proxy set
          // for either HTTP or HTTPS
          if (configuration != null) {
            assertTrue(!configuration.getProxyHost().equals("invalid.proxy.text"));
          }

        }
        catch (MalformedURLException e) {
          throw CloudErrorUtil.toCoreException(e);
View Full Code Here

    new ProxyHandler("invalid.proxy.test", 8080, setProxy, IProxyData.HTTPS_PROXY_TYPE) {

      @Override
      protected void handleProxyChange() throws CoreException {
        try {
          HttpProxyConfiguration configuration = CloudFoundryClientFactory.getProxy(new URL(
              VALID_V1_HTTPS_URL));
          assertNotNull(configuration);
          assertTrue(configuration.getProxyHost().equals("invalid.proxy.test"));
          assertTrue(configuration.getProxyPort() == (8080));

          // verify it is null for http, since proxy lookup should
          // match the specified
          // protocol in the given URL (i.e. HTTP proxy -> HTTP URL,
          // HTTPS proxy -> HTTPS URL)
          configuration = CloudFoundryClientFactory.getProxy(new URL(VALID_V1_HTTP_URL));

          // Need to add this code in case the server has a proxy set
          // for either HTTP or HTTPS
          if (configuration != null) {
            assertTrue(!configuration.getProxyHost().equals("invalid.proxy.text"));
          }

        }
        catch (MalformedURLException e) {
          throw CloudErrorUtil.toCoreException(e);
View Full Code Here

TOP

Related Classes of org.cloudfoundry.client.lib.HttpProxyConfiguration

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.