app.processTasks(task);
} else if (MaintenanceCommand.class.isAssignableFrom(taskOrCommand)) {
MaintenanceCommand cmd = (MaintenanceCommand)StructrApp.getInstance(securityContext).command(taskOrCommand);
if (cmd.requiresEnclosingTransaction()) {
try (final Tx tx = app.tx()) {
cmd.execute(propertySet);
tx.success();
}
} else {
cmd.execute(propertySet);
}
} else {
return new RestMethodResult(HttpServletResponse.SC_NOT_FOUND);
}