public abstract class TransactionProvidingApp
extends org.neo4j.shell.impl.AbstractApp
App which has common methods and functionality
to use with neo4j.| Constructor and Description |
|---|
TransactionProvidingApp() |
| Modifier and Type | Method and Description |
|---|---|
List<String> |
completionCandidates(String partOfLine,
Session session)
Tries to complete the
partOfLine with likely candidates,
think of this as a hook for writing TAB-completion. |
Continuation |
execute(AppCommandParser parser,
Session session,
Output out)
The actual code for the application.
|
static NodeOrRelationship |
getCurrent(GraphDatabaseShellServer server,
Session session) |
static String |
getDisplayName(GraphDatabaseShellServer server,
Session session,
org.neo4j.graphdb.Node node,
boolean checkForMe) |
static String |
getDisplayName(GraphDatabaseShellServer server,
Session session,
NodeOrRelationship thing,
boolean checkForMe) |
static String |
getDisplayName(GraphDatabaseShellServer server,
Session session,
org.neo4j.graphdb.Relationship relationship,
boolean verbose,
boolean checkForMe) |
static String |
getDisplayName(GraphDatabaseShellServer server,
Session session,
org.neo4j.shell.kernel.apps.TypedId typedId,
boolean checkForMe) |
static String |
getDisplayNameForNonExistent() |
GraphDatabaseShellServer |
getServer()
Returns the server this app runs in.
|
static boolean |
isCurrent(Session session,
NodeOrRelationship thing) |
static List<org.neo4j.shell.kernel.apps.TypedId> |
readCurrentWorkingDir(Session session)
Reads the session variable specified in
Variables.WORKING_DIR_KEY and
returns it as a list of typed ids. |
static String |
withArrows(org.neo4j.graphdb.Relationship relationship,
String displayName,
org.neo4j.graphdb.Node leftNode) |
static void |
writeCurrentWorkingDir(List<org.neo4j.shell.kernel.apps.TypedId> paths,
Session session) |
public static NodeOrRelationship getCurrent(GraphDatabaseShellServer server, Session session) throws ShellException
server - the GraphDatabaseShellServer to get the current
node/relationship from.session - the Session used by the client.ShellException - if some error occured.public static boolean isCurrent(Session session, NodeOrRelationship thing) throws ShellException
ShellExceptionpublic GraphDatabaseShellServer getServer()
Apppublic Continuation execute(AppCommandParser parser, Session session, Output out) throws Exception
Appparser - holds the options (w/ or w/o values) as well as arguments.session - the client session (sort of like the environment
for the execution).out - the output channel for the execution, just like System.out.Exception - if the execution fails.public final List<String> completionCandidates(String partOfLine, Session session) throws ShellException
ApppartOfLine with likely candidates,
think of this as a hook for writing TAB-completion. Returned candidates
should contain the supplied part as well as possible completions.
Implementing this is optional and it's OK to just return an empty list.completionCandidates in interface AppcompletionCandidates in class org.neo4j.shell.impl.AbstractApppartOfLine - the part of the line which the client wants to complete
using TAB-completion.session - the Session from the client caller.partOfLine
as well as possible completions. Returns an empty list if no completions found
or if the implementing class chooses not to implement it properly.ShellException - if the execution failspublic static String getDisplayNameForNonExistent()
public static String getDisplayName(GraphDatabaseShellServer server, Session session, NodeOrRelationship thing, boolean checkForMe) throws ShellException
server - the GraphDatabaseShellServer to run at.session - the Session used by the client.thing - the thing to get the name-representation for.checkForMe - check if node/rel is the current one in the sessionNode.ShellException - if an error occurs.public static String getDisplayName(GraphDatabaseShellServer server, Session session, org.neo4j.shell.kernel.apps.TypedId typedId, boolean checkForMe) throws ShellException
server - the GraphDatabaseShellServer to run at.session - the Session used by the client.typedId - the id for the item to display.checkForMe - check if node/rel is the current one in the sessiontypedId.ShellException - if an error occurs.public static String getDisplayName(GraphDatabaseShellServer server, Session session, org.neo4j.graphdb.Node node, boolean checkForMe) throws ShellException
server - the GraphDatabaseShellServer to run at.session - the Session used by the client.node - the Node to get a display string for.checkForMe - check if node is the current one in the sessionnode.ShellException - if an error occurs.public static String getDisplayName(GraphDatabaseShellServer server, Session session, org.neo4j.graphdb.Relationship relationship, boolean verbose, boolean checkForMe) throws ShellException
server - the GraphDatabaseShellServer to run at.session - the Session used by the client.relationship - the Relationship to get a display name for.verbose - whether or not to include the relationship id as well.checkForMe - check if relationship is the current one in the sessionrelationship.ShellException - if an error occurs.public static String withArrows(org.neo4j.graphdb.Relationship relationship, String displayName, org.neo4j.graphdb.Node leftNode)
public static List<org.neo4j.shell.kernel.apps.TypedId> readCurrentWorkingDir(Session session) throws RemoteException
Variables.WORKING_DIR_KEY and
returns it as a list of typed ids.session - the session to read from.RemoteException - if an RMI error occurs.public static void writeCurrentWorkingDir(List<org.neo4j.shell.kernel.apps.TypedId> paths, Session session) throws RemoteException
RemoteExceptionCopyright © 2002–2017 The Neo4j Graph Database Project. All rights reserved.