Examples of LogResultsDTO


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

      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

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

  @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
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.