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

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


  @Override
  public void selectionChanged(IWorkbenchPart part, ISelection selection) {
    Object firstSelection = Selections.getFirstSelection(selection);
    if (firstSelection != null) {
      LogEventDTO event = (LogEventDTO)firstSelection;
      if (event != null) {
        setLogEvent(event);
      }
    }
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

  @Override
  public void queryLogs(LogContext context, boolean filterChanged) {
    Fabric8Facade fabricService = getFabricService();
    if (fabricService == null) return;
    LogResultsDTO res = fabricService.queryLog(context.getLogFilter());
   
    List<LogEventDTO> logs = res.getLogEvents();
    if (this.node instanceof ContainerNode) {
      // filter container
      String containerId = ((ContainerNode)this.node).getId();
      List<LogEventDTO> unwantedEntries = new ArrayList<LogEventDTO>();
      for (LogEventDTO ev : logs) {
        if (!ev.getContainer().equalsIgnoreCase(containerId)) {
          unwantedEntries.add(ev);
        }
      }
      logs.removeAll(unwantedEntries);
    }
   
    context.addLogResults(logs);
    context.getLogFilter().setAfterTimestamp(res.getTo())
    context.getLogFilter().setBeforeTimestamp(System.currentTimeMillis());
  }
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

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

TOP

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

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.