Search in sources :

Example 1 with SubGraph

use of org.neo4j.cypher.export.SubGraph in project neo4j by neo4j.

the class Dump method handleResult.

@Override
protected void handleResult(Output out, Result result, long startTime) throws RemoteException, ShellException {
    final SubGraph subGraph = CypherResultSubGraph.from(result, getServer().getDb(), false);
    export(subGraph, out);
}
Also used : SubGraph(org.neo4j.cypher.export.SubGraph) DatabaseSubGraph(org.neo4j.cypher.export.DatabaseSubGraph) CypherResultSubGraph(org.neo4j.cypher.export.CypherResultSubGraph)

Example 2 with SubGraph

use of org.neo4j.cypher.export.SubGraph in project neo4j by neo4j.

the class Dump method execute.

@Override
public Continuation execute(AppCommandParser parser, Session session, Output out) throws Exception {
    if (// Dump the whole graph
    parser.arguments().isEmpty()) {
        try (Transaction tx = getServer().getDb().beginTransaction(implicit, AUTH_DISABLED)) {
            getServer().registerTopLevelTransactionInProgress(session.getId());
            final SubGraph graph = DatabaseSubGraph.from(getServer().getDb());
            export(graph, out);
            tx.success();
            return Continuation.INPUT_COMPLETE;
        }
    } else {
        AppCommandParser newParser = newParser(parser);
        return super.execute(newParser, session, out);
    }
}
Also used : Transaction(org.neo4j.graphdb.Transaction) AppCommandParser(org.neo4j.shell.AppCommandParser) SubGraph(org.neo4j.cypher.export.SubGraph) DatabaseSubGraph(org.neo4j.cypher.export.DatabaseSubGraph) CypherResultSubGraph(org.neo4j.cypher.export.CypherResultSubGraph)

Aggregations

CypherResultSubGraph (org.neo4j.cypher.export.CypherResultSubGraph)2 DatabaseSubGraph (org.neo4j.cypher.export.DatabaseSubGraph)2 SubGraph (org.neo4j.cypher.export.SubGraph)2 Transaction (org.neo4j.graphdb.Transaction)1 AppCommandParser (org.neo4j.shell.AppCommandParser)1