use of org.apache.tinkerpop.gremlin.jsr223.console.RemoteException in project cypher-for-gremlin by opencypher.
the class CypherRemoteAcceptor method submit.
@Override
public Object submit(List<String> args) throws RemoteException {
String line = String.join(" ", args);
line = DriverRemoteAcceptor.getScript(line, shellEnvironment);
try {
final List<Result> resultSet = send(line);
shellEnvironment.setVariable(RESULT, resultSet);
return resultSet.stream().map(Result::getObject).iterator();
} catch (Exception ex) {
throw new RemoteException(ex);
}
}
use of org.apache.tinkerpop.gremlin.jsr223.console.RemoteException in project cypher-for-gremlin by opencypher.
the class CypherRemoteAcceptor method getField.
@SuppressWarnings("unchecked")
private static <T> T getField(Object obj, String fieldName) throws RemoteException {
try {
Field field = obj.getClass().getDeclaredField(fieldName);
field.setAccessible(true);
return (T) field.get(obj);
} catch (NoSuchFieldException | IllegalAccessException e) {
throw new RemoteException(e);
}
}
Aggregations