Package org.cloudfoundry.client.lib.domain

Examples of org.cloudfoundry.client.lib.domain.CloudSpace


      @Override
      public void setInitialSelectionInViewer() {
        if (cloudServerSpaceDelegate == null) {
          return;
        }
        CloudSpace selectedSpace = cloudSpaceServerDelegate.getSpaceWithNoServerInstance();

        // First set the default cloud space as the selected
        // space
        setSpaceSelection(selectedSpace);
        if (selectedSpace != null) {
View Full Code Here


  }

  @Override
  public boolean performFinish() {

    final CloudSpace selectedSpace = cloudSpacePage.getSelectedCloudSpace();

    // Only create a new space, if it doesnt match the existing space
    if (selectedSpace != null
        && !CloudServerSpacesDelegate.matchesExisting(selectedSpace, cloudServer.getCloudFoundrySpace())) {
View Full Code Here

  protected void setInitialSelectionInViewer() {
    if (cloudSpaceServerDelegate == null) {
      return;
    }

    CloudSpace selectedSpace = cloudSpaceServerDelegate.getCurrentCloudSpace();

    if (selectedSpace != null) {
      setSelectionInViewer(selectedSpace);
    }
  }
View Full Code Here

   * If available, a default space will be set in the server
   */
  protected void internalDescriptorChanged() throws CoreException {
    // Set a default space, if one is available
    if (getCurrentSpacesDescriptor() != null) {
      CloudSpace defaultCloudSpace = getSpaceWithNoServerInstance();
      setSelectedSpace(defaultCloudSpace);
    }
    else {

      // clear the selected space if there is no available spaces
View Full Code Here

          null);
      Assert.isTrue(spaces != null, "Failed to resolve orgs and spaces.");
      Assert.isTrue(spaces.getDefaultCloudSpace() != null,
          "No default space selected in cloud space lookup handler.");

      CloudSpace cloudSpace = spaces.getSpace(orgName, spaceName);
      if (cloudSpace == null) {
        throw CloudErrorUtil.toCoreException("Failed to resolve cloud space when running junits: " + orgName
            + " - " + spaceName);
      }
      cloudServer.setSpace(cloudSpace);
View Full Code Here

      Tree tree = orgsSpacesViewer.getTree();
      TreeItem[] selectedItems = tree.getSelection();
      if (selectedItems != null && selectedItems.length > 0) {
        // It's a single selection tree, so only get the first selection
        Object selectedObj = selectedItems[0].getData();
        CloudSpace selectedSpace = selectedObj instanceof CloudSpace ? (CloudSpace) selectedObj : null;
        setSpaceSelection(selectedSpace);
      }
    }
  }
View Full Code Here

    return client;
  }

  public static CloudFoundryClient clientOrgSpace(CloudFoundryClient client) {
    List<CloudSpace> spaces = client.getSpaces();
    CloudSpace useSpace = null;
    for (CloudSpace space : spaces) {
      if (space.getOrganization().getName().equals(vcap_org) && space.getName().equals(vcap_space)) {
        useSpace = space;
        break;
      }
View Full Code Here

    info.put("version", "2");
    when(client.getCloudInfo()).thenReturn(new CloudInfo(info));

    Date date = new Date();
    CloudOrganization org = new CloudOrganization(new CloudEntity.Meta(UUID.randomUUID(), date, date), "my-org");
    CloudSpace space = new CloudSpace(new CloudEntity.Meta(UUID.randomUUID(), date, date), "my-space", org);
    List<CloudSpace> spaces = Arrays.asList(space);
    when(client.getSpaces()).thenReturn(spaces);

    login.doExecute();
View Full Code Here

  @Override
  protected void doExecute() throws MojoExecutionException {
    final OAuth2AccessToken token = getClient().login();
    final CloudInfo cloudInfo = getClient().getCloudInfo();
    final CloudSpace space = getCurrentSpace();

    tokensFile.saveToken(getTarget(), token, cloudInfo, space);

    getLog().info("Authentication successful");
  }
View Full Code Here

    return client;
  }

  private static CloudSpace getSpace(CloudFoundryClient client) {
    List<CloudSpace> spaces = client.getSpaces();
    CloudSpace useSpace = null;
    for (CloudSpace space : spaces) {
      if (space.getOrganization().getName().equals(VCAP_ORG) && space.getName().equals(VCAP_SPACE)) {
        useSpace = space;
        break;
      }
View Full Code Here

TOP

Related Classes of org.cloudfoundry.client.lib.domain.CloudSpace

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.