Search in sources :

Example 1 with TraceParser

use of com.evolveum.midpoint.schema.traces.TraceParser in project midpoint by Evolveum.

the class PageTraceView method createOpNodeList.

private void createOpNodeList(String filePath) throws IOException, SchemaException {
    if (parsedOpNodeList == null || !filePath.equals(parsedFilePath)) {
        PrismContext prismContext = getPrismContext();
        TraceParser parser = new TraceParser(prismContext);
        TracingOutputType parsed = parser.parse(new File(filePath));
        parsedOpNodeList = new OpNodeTreeBuilder(prismContext).build(parsed);
        parsedFilePath = filePath;
    }
}
Also used : TraceParser(com.evolveum.midpoint.schema.traces.TraceParser) OpNodeTreeBuilder(com.evolveum.midpoint.schema.traces.OpNodeTreeBuilder) PrismContext(com.evolveum.midpoint.prism.PrismContext) File(java.io.File)

Example 2 with TraceParser

use of com.evolveum.midpoint.schema.traces.TraceParser in project midpoint by Evolveum.

the class TestTracing method assertTraceCanBeParsed.

private void assertTraceCanBeParsed(OperationResult result) throws SchemaException, IOException {
    SearchResultList<PrismObject<ReportDataType>> reportDataObjects = repositoryService.searchObjects(ReportDataType.class, null, null, result);
    assertThat(reportDataObjects.size()).as("# of report outputs").isEqualTo(1);
    String file = reportDataObjects.get(0).asObjectable().getFilePath();
    TraceParser parser = new TraceParser(prismContext);
    TracingOutputType parsed = parser.parse(new File(file));
    System.out.println("Tracing output parsed OK: " + parsed);
}
Also used : PrismObject(com.evolveum.midpoint.prism.PrismObject) TraceParser(com.evolveum.midpoint.schema.traces.TraceParser) File(java.io.File)

Example 3 with TraceParser

use of com.evolveum.midpoint.schema.traces.TraceParser in project midpoint by Evolveum.

the class EditTraceAction method parseInput.

private TracingOutputType parseInput() throws IOException, SchemaException {
    String inputFile = options.getInput();
    log.info("Starting parsing input file: {}", inputFile);
    long start = System.currentTimeMillis();
    TraceParser parser = new TraceParser(context.getPrismContext());
    TracingOutputType trace = parser.parse(new File(inputFile), true);
    log.info("Parsing finished; in {} seconds", (System.currentTimeMillis() - start) / 1000);
    return trace;
}
Also used : TraceParser(com.evolveum.midpoint.schema.traces.TraceParser) TracingOutputType(com.evolveum.midpoint.xml.ns._public.common.common_3.TracingOutputType) File(java.io.File)

Aggregations

TraceParser (com.evolveum.midpoint.schema.traces.TraceParser)3 File (java.io.File)3 PrismContext (com.evolveum.midpoint.prism.PrismContext)1 PrismObject (com.evolveum.midpoint.prism.PrismObject)1 OpNodeTreeBuilder (com.evolveum.midpoint.schema.traces.OpNodeTreeBuilder)1 TracingOutputType (com.evolveum.midpoint.xml.ns._public.common.common_3.TracingOutputType)1