use of org.neo4j.shell.Welcome in project neo4j by neo4j.
the class AbstractClient method sayHi.
protected void sayHi(ShellServer server) throws RemoteException, ShellException {
Welcome welcome = server.welcome(initialSession);
id = welcome.getId();
prompt = welcome.getPrompt();
if (!welcome.getMessage().isEmpty()) {
getOutput().println(welcome.getMessage());
}
}
use of org.neo4j.shell.Welcome in project neo4j by neo4j.
the class GraphDatabaseShellServer method welcome.
@Override
public Welcome welcome(Map<String, Serializable> initialSession) throws RemoteException, ShellException {
try (org.neo4j.graphdb.Transaction transaction = graphDb.beginTx()) {
Welcome welcome = super.welcome(initialSession);
transaction.success();
return welcome;
} catch (RuntimeException e) {
throw new RemoteException(e.getMessage(), e);
}
}
use of org.neo4j.shell.Welcome in project neo4j by neo4j.
the class SimpleAppServer method welcome.
@Override
public Welcome welcome(Map<String, Serializable> initialSession) throws RemoteException, ShellException {
Serializable clientId = newClientId();
if (clientSessions.containsKey(clientId)) {
throw new IllegalStateException("Client " + clientId + " already initialized");
}
Session session = newSession(clientId, initialSession);
clientSessions.put(clientId, session);
try {
String message = noWelcome(initialSession) ? "" : getWelcomeMessage();
return new Welcome(message, clientId, getPrompt(session));
} catch (ShellException e) {
throw new RemoteException(e.getMessage());
}
}
Aggregations