Package org.cloudfoundry.client.lib

Examples of org.cloudfoundry.client.lib.CloudFoundryOperations


   */
  public T run(IProgressMonitor monitor) throws CoreException {

    SubMonitor subProgress = SubMonitor.convert(monitor, label, 100);

    CloudFoundryOperations client = getClient(subProgress);
    if (client == null) {
      throw CloudErrorUtil.toCoreException(NLS.bind(Messages.ERROR_NO_CLIENT, label));
    }

    HttpTracer.getCurrent().trace(client);
View Full Code Here


* @author Terry Denney
*/
public class CloudFoundryClientConnectionTest extends TestCase {

  public void testConnectToNonSecureUrl() throws Exception {
    CloudFoundryOperations client = CloudFoundryPlugin.getCloudFoundryClientFactory().getCloudFoundryOperations(
        CloudFoundryTestFixture.CF_PIVOTAL_SERVER_URL_HTTP);

    CloudInfo cloudInfo = client.getCloudInfo();
    Assert.assertNotNull(cloudInfo);
  }
View Full Code Here

    CloudInfo cloudInfo = client.getCloudInfo();
    Assert.assertNotNull(cloudInfo);
  }

  public void testConnectToSecureUrl() throws Exception {
    CloudFoundryOperations client = CloudFoundryPlugin.getCloudFoundryClientFactory().getCloudFoundryOperations(
        CloudFoundryTestFixture.CF_PIVOTAL_SERVER_URL_HTTPS);
    CloudInfo cloudInfo = client.getCloudInfo();
    Assert.assertNotNull(cloudInfo);

  }
View Full Code Here

  public void testValidPasswordOperationHandler() throws Exception {

    CredentialProperties credentials = getTestFixture().getCredentials();
    CloudCredentials cloudCredentials = new CloudCredentials(credentials.userEmail, credentials.password);

    CloudFoundryOperations client = createClient(cloudCredentials,
        CloudFoundryTestFixture.CF_PIVOTAL_SERVER_URL_HTTP);
    CloudFoundryLoginHandler operationsHandler = new CloudFoundryLoginHandler(client);

    try {
      operationsHandler.login(new NullProgressMonitor());
View Full Code Here

    CredentialProperties credentials = getTestFixture().getCredentials();

    String invalidPassword = "invalid password";

    CloudFoundryOperations client = createClient(new CloudCredentials(credentials.userEmail, invalidPassword),
        CloudFoundryTestFixture.CF_PIVOTAL_SERVER_URL_HTTP);

    CloudFoundryLoginHandler operationsHandler = new CloudFoundryLoginHandler(client);
    CoreException error = null;
View Full Code Here

    CredentialProperties credentials = getTestFixture().getCredentials();

    String invalidUsername = "invalid username";

    CloudFoundryOperations client = createClient(new CloudCredentials(invalidUsername, credentials.password),
        CloudFoundryTestFixture.CF_PIVOTAL_SERVER_URL_HTTP);

    CloudFoundryLoginHandler operationsHandler = new CloudFoundryLoginHandler(client);
    CoreException error = null;
View Full Code Here

  public void testInvalidAndValidCredentials() throws Exception {
    CredentialProperties credentials = getTestFixture().getCredentials();

    String invalidUsername = "invalid username";

    CloudFoundryOperations client = createClient(new CloudCredentials(invalidUsername, credentials.password),
        CloudFoundryTestFixture.CF_PIVOTAL_SERVER_URL_HTTP);

    CloudFoundryLoginHandler operationsHandler = new CloudFoundryLoginHandler(client);
    CoreException error = null;
View Full Code Here

   * @return resolved orgs and spaces for the given credential and server URL.
   */
  public static CloudOrgsAndSpaces getCloudSpacesExternalClient(CloudCredentials credentials, final String url,
      boolean selfSigned, IProgressMonitor monitor) throws CoreException {

    final CloudFoundryOperations operations = CloudFoundryServerBehaviour.createExternalClientLogin(url,
        credentials.getEmail(), credentials.getPassword(), selfSigned, monitor);

    return new ClientRequest<CloudOrgsAndSpaces>("Getting orgs and spaces") { //$NON-NLS-1$
      @Override
      protected CloudOrgsAndSpaces doRun(CloudFoundryOperations client, SubMonitor progress) throws CoreException {
View Full Code Here

  public static CloudFoundryOperations createExternalClientLogin(final String location, String userName,
      String password, boolean selfSigned, IProgressMonitor monitor) throws CoreException {
    SubMonitor progress = SubMonitor.convert(monitor);
    progress.beginTask("Connecting", IProgressMonitor.UNKNOWN); //$NON-NLS-1$
    try {
      final CloudFoundryOperations client = createClient(location, userName, password, selfSigned);

      new ClientRequest<Void>(Messages.VALIDATING_CREDENTIALS) {

        @Override
        protected Void doRun(CloudFoundryOperations client, SubMonitor progress) throws CoreException {
View Full Code Here

  public static void register(String location, String userName, String password, boolean selfSigned,
      IProgressMonitor monitor) throws CoreException {
    SubMonitor progress = SubMonitor.convert(monitor);
    progress.beginTask("Connecting", IProgressMonitor.UNKNOWN); //$NON-NLS-1$
    try {
      CloudFoundryOperations client = createClient(location, userName, password, selfSigned);
      client.register(userName, password);
    }
    catch (RestClientException e) {
      throw CloudErrorUtil.toCoreException(e);
    }
    catch (RuntimeException e) {
View Full Code Here

TOP

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

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.