use of com.evolveum.midpoint.xml.ns._public.common.common_3.TracingOutputType in project midpoint by Evolveum.
the class TraceParser method parse.
public TracingOutputType parse(InputStream inputStream, boolean isZip, boolean raw, String description) throws SchemaException, IOException {
TracingOutputType wholeTracingOutput = getObject(inputStream, isZip, description);
if (!raw && wholeTracingOutput != null) {
new DictionaryExpander(wholeTracingOutput).expand();
new OperationCategorizer(wholeTracingOutput).categorize();
}
return wholeTracingOutput;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.TracingOutputType in project midpoint by Evolveum.
the class TraceParser method getObject.
public TracingOutputType getObject(InputStream stream, boolean isZip, String description) throws IOException, SchemaException {
long start = System.currentTimeMillis();
Object object;
if (isZip) {
try (ZipInputStream zis = new ZipInputStream(stream)) {
ZipEntry zipEntry = zis.getNextEntry();
if (zipEntry != null) {
object = prismContext.parserFor(zis).xml().compat().parseRealValue();
} else {
LOGGER.error("No zip entry in input file '{}'", description);
object = null;
}
}
} else {
object = prismContext.parserFor(stream).xml().compat().parseRealValue();
}
stream.close();
long read = System.currentTimeMillis();
LOGGER.debug("Read the content of {} in {} milliseconds", description, read - start);
if (object instanceof TracingOutputType) {
return (TracingOutputType) object;
} else if (object instanceof OperationResultType) {
TracingOutputType rv = new TracingOutputType(prismContext);
rv.setResult((OperationResultType) object);
return rv;
} else {
LOGGER.error("Wrong object type in input file '{}': {}", description, object);
return null;
}
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.TracingOutputType in project midpoint by Evolveum.
the class EditTraceAction method execute.
@Override
public void execute() throws Exception {
TracingOutputType trace = parseInput();
if (options.isPrintStat() || options.isPrintStatExtra()) {
printStatistics(trace);
}
if (CollectionUtils.isNotEmpty(options.getKeep()) || CollectionUtils.isNotEmpty(options.getKill())) {
applyKeep(trace);
applyKill(trace);
writeTrace(trace);
}
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.TracingOutputType 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;
}
Aggregations