public boolean enableRemoteShell( Map<String, Serializable> initialProperties ) { return enableRemoteShell(); }
@Override public Result execute( String query, Map<String,Object> parameters, long timeout, TimeUnit unit ) throws QueryExecutionException { return readOnly(); }
private static <T> T readOnly() { throw readOnlyException(); }
@Override public Iterable<Relationship> getRelationships( Direction direction, RelationshipType... types ) { return relationships( actual.getRelationships( direction, types ) ); }
@Override public Result execute( String query ) { return execute( query, Collections.emptyMap() ); }
@Override public ResourceIterable<Node> getAllNodes() { return nodes( actual.getAllNodes() ); }
public GraphDatabaseShellServer( GraphDatabaseAPI graphDb, boolean readOnly ) throws RemoteException { super(); this.graphDb = readOnly ? new ReadOnlyGraphDatabaseProxy( graphDb ) : graphDb; this.bashInterpreter.addReplacer( "W", new WorkingDirReplacer() ); this.graphDbCreatedHere = false; }
@Override public Iterable<Relationship> getRelationships( RelationshipType type, Direction dir ) { return relationships( actual.getRelationships( type, dir ) ); }
@Override public Result execute( String query, long timeout, TimeUnit unit ) throws QueryExecutionException { return execute( query, Collections.emptyMap(), timeout, unit ); }
@Override public <T> TransactionEventHandler<T> registerTransactionEventHandler( TransactionEventHandler<T> handler ) { return readOnly(); }
@Override public Iterable<Relationship> getRelationships( RelationshipType... types ) { return relationships( actual.getRelationships( types ) ); }
@Override public Result execute( String query, Map<String, Object> parameters ) { return readOnly(); }
@Override public Iterable<Relationship> getRelationships() { return relationships( actual.getRelationships() ); }
@Override public Long createNodeId() { return readOnly(); }
@Override public Iterable<Relationship> getRelationships( Direction dir ) { return relationships( actual.getRelationships( dir ) ); }
@Override public Node createNode( Label... labels ) { return readOnly(); }
@Override Node wrap( Node actual ) { return readOnly( actual ); }
@Override Relationship wrap( Relationship actual ) { return readOnly( actual ); }
@Override public Node createNode() { return readOnly(); }
@Override public KernelEventHandler registerKernelEventHandler( KernelEventHandler handler ) { return readOnly(); }