Package org.fusesource.ide.fabric8.core.dto

Examples of org.fusesource.ide.fabric8.core.dto.VersionDTO


  /* (non-Javadoc)
   * @see org.fusesource.ide.fabric8.core.connector.Fabric8ConnectorType#getDefaultVersion()
   */
  @Override
  public VersionDTO getDefaultVersion() {
    VersionDTO version = null;
      try {
            J4pExecRequest request = JolokiaHelpers.createExecRequest(FABRIC_MBEAN_URL, "defaultVersion()");
            J4pExecResponse response = getJolokiaClient().execute(request);
            Map<String, Object> values = response.getValue();
            version = new VersionDTO(this.fabricFacade, values);
        } catch (Exception e) {
          Fabric8CorePlugin.getLogger().error("Failed to fetch current container from fabric8.", e);
        }
      return version;
  }
View Full Code Here


      public void doubleClick(DoubleClickEvent event) {
        VersionsNode versionsNode = fabric.getVersionsNode();
        if (versionsNode != null) {
          List<VersionDTO> selectedVersions = getSelectedVersions();
          if (!selectedVersions.isEmpty()) {
            VersionDTO version = selectedVersions.get(0);
            VersionNode versionNode = versionsNode.getVersionNode(version.getId());
            if (versionNode != null) {
              Selections.setSingleSelection(fabric.getRefreshableUI(), versionNode);
            }
          }
        }
View Full Code Here

    List<VersionDTO> versions = new ArrayList<VersionDTO>();
    IStructuredSelection selection = Selections.getStructuredSelection(getViewer());
    if (selection != null) {
      Iterator iterator = selection.iterator();
      while (iterator.hasNext()) {
        VersionDTO version = VersionNode.toVersion(iterator.next());
        if (version != null) {
          versions.add(version);
        }
      }
    }
View Full Code Here

  }
 
    protected VersionNode getSelectedVersionNode() {
        Object first = Selections.getFirstSelection(getViewer());
        if (first instanceof VersionDTO) {
            VersionDTO version = (VersionDTO) first;
            String id = version.getId();
            for (Node n : fabric.getVersionsNode().getChildrenList()) {
              if (n != null && n instanceof VersionNode && ((VersionNode)n).getVersionId().equals(id)) {
                return (VersionNode)n;
              }
            }
View Full Code Here

        int column = 0;

        Function1 function = new Function1() {
            @Override
            public Object apply(Object element) {
                VersionDTO version = asVersionDTO(element);
                if (version != null) {
                    return version.getId();
                }
                return null;
            }
        };
        column = addColumnFunction(250, column, function, "Id");

        function = new Function1() {
            @Override
            public Boolean apply(Object element) {
              VersionDTO version = asVersionDTO(element);
                if (version != null) {
                    return version.isDefaultVersion();
                }
                return null;
            }
        };
        column = addColumnFunction(bounds, column, function, "Default");
View Full Code Here

   * required
   */
  public void setContainerProfiles(ContainerDTO newContainer, ProfileDTO[] profiles) {
    if (!isConnected() || newContainer == null)
      return;
    VersionDTO version = getProfilesVersion(profiles);
    if (version != null) {
      newContainer.setVersion(version);
    }
    newContainer.setProfileDTOs(Arrays.asList(profiles));
  }
View Full Code Here

  /**
   * Returns the version for the profiles (assuming they are all part of the
   * same version
   */
  public VersionDTO getProfilesVersion(ProfileDTO[] profiles) {
    VersionDTO version = null;
    if (isConnected()) {
      // lets assume all the versions are the same
      for (ProfileDTO profile : profiles) {
        String versionName = profile.getVersionId();
        if (versionName != null) {
View Full Code Here

   * @return
   */
  public String getDefaultVersionId() {
    Fabric8Facade service = getFabricService();
    if (service != null) {
      VersionDTO defaultVersion = service.getDefaultVersion();
      if (defaultVersion != null) {
        return defaultVersion.getId();
      }
    }
    return null;
  }
View Full Code Here

  }

  @Override
  public void run() {
    String defaultValue = "";
    VersionDTO latestVersion = oldVersionSupplier.get();
    if (latestVersion != null) {
      VersionSequenceDTO next = latestVersion.getVersionSequence().next();
      while (next != null && getVersionNode(next.getName()) != null) {
        next = next.next();
      }
      if (next != null) {
        defaultValue = next.getName();
View Full Code Here

    }
    return null;
  }

  protected void createVersion(String newVersion) {
    VersionDTO oldVersion = oldVersionSupplier.get();
    FabricPlugin.getLogger().debug("Creating new version " + newVersion + " from old " + Fabrics.getVersionName(oldVersion));

    if (oldVersion != null) {
      fabric.getFabricService().createVersion(oldVersion.getId(), newVersion);
    } else {
      fabric.getFabricService().createVersion(newVersion);
    }
    fabric.getVersionsNode().refresh();
  }
View Full Code Here

TOP

Related Classes of org.fusesource.ide.fabric8.core.dto.VersionDTO

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.