Package org.cloudfoundry.client.lib

Examples of org.cloudfoundry.client.lib.CloudCredentials


        throw CloudErrorUtil.toCoreException("No org and space was set in test harness for: "
            + cloudFoundryServer.getServerId());
      }
      try {
        return CloudFoundryPlugin.getCloudFoundryClientFactory().getCloudFoundryOperations(
            new CloudCredentials(cloudFoundryServer.getUsername(), cloudFoundryServer.getPassword()),
            new URL(cloudFoundryServer.getUrl()), space.getOrgName(), space.getSpaceName(),
            cloudFoundryServer.getSelfSignedCertificate());
      }
      catch (MalformedURLException e) {
        throw CloudErrorUtil.toCoreException(e);
View Full Code Here


        public void run(IProgressMonitor monitor) throws CoreException {
          String url = urlText;
          if (displayURL) {
            url = getUrlFromDisplayText(urlText);
          }
          supportsSpaces[0] = CloudFoundryServerBehaviour.getCloudSpacesExternalClient(new CloudCredentials(
              userName, password), url, selfSigned, monitor);
        }
      };
      if (context != null) {
        runForked(coreRunner, context);
View Full Code Here

          List<String> uris = new ArrayList<String>();
          uris.add("test-proxy-upload.cloudfoundry.com");

          // Do a direct client test with the proxy settings
          client = CloudFoundryPlugin.getCloudFoundryClientFactory().getCloudFoundryOperations(
              new CloudCredentials(serverBehavior.getCloudFoundryServer().getUsername(), serverBehavior
                  .getCloudFoundryServer().getPassword()),
              new URL(serverBehavior.getCloudFoundryServer().getUrl()), false);
          client.createApplication("test", new Staging(), 128, uris, new ArrayList<String>());
          fail("Expected ResourceAccessException due to invalid proxy configuration");
        }
View Full Code Here

  }

  public static CloudFoundryClient clientInit() {
    CloudFoundryClient client = null;
    try {
      client = new CloudFoundryClient(new CloudCredentials(vcap_email, vcap_passwd), new URL(CC_URL));
    } catch (MalformedURLException e) {
      throw new RuntimeException(e);
    }
    client.login();
    return client;
View Full Code Here

      System.err.println("The specified org '" + vcap_org + "' and space '" + vcap_space + "' not found!");
      System.exit(1);
    }
    CloudFoundryClient spaceClient = null;
    try {
      client = new CloudFoundryClient(new CloudCredentials(vcap_email, vcap_passwd), new URL(CC_URL), useSpace);
    } catch (MalformedURLException e) {
      throw new RuntimeException(e);
    }
    client.login();
    return client;
View Full Code Here

    restUtil.createRestTemplate(null, false);
    restUtil.createOauthClient(new URL(CCNG_API_URL), null, false);

    controllerClient = new CloudControllerClientImpl(new URL("http://api.dummyendpoint.com/login"),
        restTemplate, oauthClient, loggregatorClient,
        new CloudCredentials(CCNG_USER_EMAIL, CCNG_USER_PASS),
        CCNG_USER_ORG, CCNG_USER_SPACE);
  }
View Full Code Here

    Assert.configurationNotNull(org, "org", SystemProperties.ORG);
    Assert.configurationNotNull(space, "space", SystemProperties.SPACE);

    getLog().debug(String.format("Connecting to Cloud Foundry at '%s' using token", target.toString()));

    final CloudCredentials credentials = new CloudCredentials(token);
    return createConnection(credentials, target, org, space, trustSelfSignedCerts);
  }
View Full Code Here

    getLog().debug(String.format(
        "Connecting to Cloud Foundry at '%s' with username: '%s'",
        target, username));

    final CloudCredentials credentials = new CloudCredentials(username, password);
    CloudFoundryClient client = createConnection(credentials, target, org, space, trustSelfSignedCerts);
    connectToCloudFoundry(client);
    return client;
  }
View Full Code Here

    try {
      vcapUrl = new URL(VCAP_TARGET);
    } catch (MalformedURLException e) {
      throw new RuntimeException(e);
    }
    CloudFoundryClient client = new CloudFoundryClient(new CloudCredentials(VCAP_EMAIL, VCAP_PASSWD), vcapUrl);
    client.login();
    String version = client.getCloudInfo().getVersion();
    if (Float.valueOf(version) >= 2.0) {
      client = new CloudFoundryClient(new CloudCredentials(VCAP_EMAIL, VCAP_PASSWD), vcapUrl, getSpace(client));
      client.login();
    }
    return client;
  }
View Full Code Here

  }

  @Override
  public void updatePassword(CloudCredentials credentials, String newPassword) {
    oauthClient.changePassword(credentials.getPassword(), newPassword);
    CloudCredentials newCloudCredentials = new CloudCredentials(credentials.getEmail(), newPassword);
    if (cloudCredentials.getProxyUser() != null) {
      cloudCredentials = newCloudCredentials.proxyForUser(cloudCredentials.getProxyUser());
    } else {
      cloudCredentials = newCloudCredentials;
    }
  }
View Full Code Here

TOP

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

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.