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

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


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


  /* (non-Javadoc)
   * @see org.fusesource.ide.fabric8.core.connector.Fabric8ConnectorType#getFabricStatus()
   */
  @Override
  public FabricStatusDTO getFabricStatus() {
    FabricStatusDTO status = null;
    try {
            J4pExecRequest request = JolokiaHelpers.createExecRequest(FABRIC_MBEAN_URL, "fabricStatusAsJson()");
            J4pExecResponse response = getJolokiaClient().execute(request);
            String json = response.getValue();
            final ModelNode rootNode = JsonHelper.getModelNode(json);
View Full Code Here

      String filterJson = JsonHelper.convertToJson(filter);
      J4pExecRequest request = JolokiaHelpers.createExecRequest(INSIGHT_MBEAN_URL, "filterLogEvents(java.lang.String)", filterJson);
          J4pExecResponse response = getJolokiaClient().execute(request);
          String json = response.getValue();
          final ModelNode rootNode = JsonHelper.getModelNode(json);
      LogResultsDTO result = LogResultsDTO.fromJson(rootNode);
      return result;
    } catch (Exception e) {
      Fabric8CorePlugin.getLogger().error("Failed to query the logs", e);
    }
    return null;
View Full Code Here

      try {
            J4pExecRequest request = JolokiaHelpers.createExecRequest(FABRIC_MBEAN_URL, "getProfiles(java.lang.String)", versionId);
            J4pExecResponse response = getJolokiaClient().execute(request);
            List<Map<String, Object>> values = response.getValue();
            for (Map<String, Object> value : values) {
              ProfileDTO p = new ProfileDTO(fabricFacade, value);
              if (p.isHidden()) {
                continue; // don't return hidden profiles
              }
              profiles.add(p);
            }
        } catch (Exception e) {
View Full Code Here

  /* (non-Javadoc)
   * @see org.fusesource.ide.fabric8.core.connector.Fabric8ConnectorType#getProfile(java.lang.String, java.lang.String)
   */
  @Override
  public ProfileDTO getProfile(String versionId, String profileId) {
    ProfileDTO profile = null;
      try {
            J4pExecRequest request = JolokiaHelpers.createExecRequest(FABRIC_MBEAN_URL, "getProfile(java.lang.String, java.lang.String)", versionId, profileId);
            J4pExecResponse response = getJolokiaClient().execute(request);
            Map<String, Object> values = response.getValue();
            profile = new ProfileDTO(this.fabricFacade, values);
        } catch (Exception e) {
          Fabric8CorePlugin.getLogger().error("Failed to fetch profile with id '" + profileId + "' and version id '" + versionId + "'.", e);
        }
      return profile;
  }
View Full Code Here

  /* (non-Javadoc)
   * @see org.fusesource.ide.fabric8.core.connector.Fabric8ConnectorType#createProfile(java.lang.String, java.lang.String)
   */
  @Override
  public ProfileDTO createProfile(String versionId, String profileId) {
    ProfileDTO profile = null;
      try {
            J4pExecRequest request = JolokiaHelpers.createExecRequest(FABRIC_MBEAN_URL, "createProfile(java.lang.String, java.lang.String)", versionId, profileId);
            J4pExecResponse response = getJolokiaClient().execute(request);
            Map<String, Object> values = response.getValue();
            profile = new ProfileDTO(this.fabricFacade, values);
        } catch (Exception e) {
          Fabric8CorePlugin.getLogger().error("Failed to create profile with id '" + profileId + "' and version id '" + versionId + "'.", e);
        }
      return profile;
  }
View Full Code Here

  }

  @Override
  public void createTextFields(Composite parent) {
    this.featuresList = null;
    ProfileDTO profile = node.getProfile();
    String sectionTitle = profile.getId();

    Composite inner = createSectionComposite(sectionTitle, new GridData(GridData.FILL_BOTH));
    createProfileForm(profile, inner);

    createLabel(inner, Messages.profileParentsLabel);
    parentsForm.createColumnsViewer(inner);
    parentsForm.setProfilesViewerInput(node.getVersionNode());
    parentsForm.getProfilesViewer().setContentProvider(new ProfileParentsContentProvider(node));

    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.horizontalSpan = 2;
    parentsForm.getProfilesViewer().getTree().setLayoutData(gridData);
    List<ProfileDTO> parents = profile.getParents();
    parentsForm.setCheckedProfiles(parents);
  }
View Full Code Here

  /* (non-Javadoc)
   * @see org.fusesource.ide.commons.ui.form.FormSupport#createTextFields(org.eclipse.swt.widgets.Composite)
   */
  @Override
  protected void createTextFields(Composite parent) {
    ProfileDTO profile = node.getProfile();
    String sectionTitle = profile.getId();

    Composite inner = createSectionComposite(sectionTitle, new GridData(GridData.FILL_BOTH));

    GridLayout layout = new GridLayout();
    layout.numColumns = 3;
View Full Code Here

    pReqs = reqs.findProfileRequirements(this.node.getProfile().getId());
    if (pReqs != null) {
      this.formModel.setMinInstances(pReqs.getMinimumInstances());
      this.formModel.setMaxInstances(pReqs.getMaximumInstances());
      for (String pId : pReqs.getDependentProfiles()) {
        ProfileDTO p = node.getFabric().getFabricService().getProfile(this.node.getVersionNode().getVersionId(), pId);
        this.formModel.addDependency(p)
      }
    }
    parentsForm.setCheckedProfiles(formModel.getDependencies());
  }
View Full Code Here


  @Override
  protected void loadPreference() {
    if (selectedProfile != null) {
      ProfileDTO profile = selectedProfile.getProfile();
      if (profile != null) {
        List<ProfileDTO> profs = new ArrayList<ProfileDTO>();
        profs.add(profile);
        setCheckedProfiles(profs);
      }
View Full Code Here

TOP

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

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.