use of com.evolveum.midpoint.studio.impl.trace.StudioNameResolver in project midpoint-studio by Evolveum.
the class TraceViewEditor method initialize.
private void initialize() {
OpNode root;
long start = System.currentTimeMillis();
LOG.info("Initializing TraceViewEditor");
try (InputStream is = file.getInputStream()) {
String extension = file.getExtension();
boolean isZip = extension != null && extension.equalsIgnoreCase("zip");
PrismContext prismContext = MidPointUtils.DEFAULT_PRISM_CONTEXT;
TraceParser parser = new TraceParser(prismContext);
TracingOutputType tracingOutput = parser.parse(is, isZip, file.getCanonicalPath());
LOG.info("Initializing TraceViewEditor - parsed tracing output: " + (System.currentTimeMillis() - start) + " ms");
StudioNameResolver nameResolver = new StudioNameResolver(tracingOutput.getDictionary(), file);
List<OpNode> data = new OpNodeTreeBuilder(prismContext).build(tracingOutput, nameResolver);
if (data.size() == 1) {
root = data.get(0);
} else {
throw new IllegalStateException("Unexpected # of OpNode objects: " + data.size());
}
LOG.info("Initializing TraceViewEditor - built op node tree: " + (System.currentTimeMillis() - start) + " ms");
} catch (Exception ex) {
MidPointService mm = MidPointService.getInstance(project);
mm.printToConsole(null, TraceViewEditor.class, "Couldn't load file", ex, ConsoleViewContentType.LOG_ERROR_OUTPUT);
MidPointUtils.publishExceptionNotification(project, null, TraceViewEditor.class, NOTIFICATION_KEY, "Couldn't load file", ex);
ex.printStackTrace();
root = null;
}
if (root != null) {
PresentationInitializer.initialize(root);
}
opTreePanel = new OpTreePanel(project, root);
wrapper.setContent(opTreePanel);
}
Aggregations