Examples of VersionDTO


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

    /* (non-Javadoc)
     * @see org.fusesource.ide.fabric8.core.connector.Fabric8ConnectorType#createVersion(java.lang.String)
     */
    @Override
    public VersionDTO createVersion(String versionId) {
      VersionDTO version = null;
      try {
            J4pExecRequest request = JolokiaHelpers.createExecRequest(FABRIC_MBEAN_URL, "createVersion()");
            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 create version with id '" + versionId + "'.", e);
        }
      return version;
    }
View Full Code Here

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

      try {
            J4pExecRequest request = JolokiaHelpers.createExecRequest(FABRIC_MBEAN_URL, "versions()");
            J4pExecResponse response = getJolokiaClient().execute(request);
            List<Map<String, Object>> values = response.getValue();
            for (Map<String, Object> value : values) {
              VersionDTO v = new VersionDTO(this.fabricFacade, value);
              if (v.getId().equalsIgnoreCase("master")) continue; // don't show "MASTER" version
              versions.add(new VersionDTO(this.fabricFacade, value));
            }
        } catch (Exception e) {
          Fabric8CorePlugin.getLogger().error("Failed to fetch containers from fabric8.", e);
        }
     
View Full Code Here

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

  /* (non-Javadoc)
   * @see org.fusesource.ide.fabric8.core.connector.Fabric8ConnectorType#createVersion(java.lang.String, java.lang.String)
   */
  @Override
  public VersionDTO createVersion(String parentVersionId, String versionId) {
    VersionDTO version = null;
      try {
            J4pExecRequest request = JolokiaHelpers.createExecRequest(FABRIC_MBEAN_URL, "createVersion(java.lang.String, java.lang.String)", parentVersionId, versionId);
            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 create subversion with id '" + versionId + "' under version '" + parentVersionId + "'.", e);
        }
      return version;
  }
View Full Code Here

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

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

      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

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

    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

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

  }
 
    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

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

        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

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

   * 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

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

  /**
   * 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
TOP
Copyright © 2018 www.massapi.com. 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.