public byte[] sendWriteMessageWithResult(final byte[] message, final Server server) throws ConnectionNotAvailableException {
        DataConnection connection = server.getConnection();

        if (connection == null) {
            throw new ConnectionNotAvailableException(server);
        }

        byte[] result = connection.sendWithResult(message);

        server.returnConnection(connection);

        return result;
    }
public byte [ ] sendWriteMessageWithResult ( final byte [ ] message , final Server server ) throws ConnectionNotAvailableException { DataConnection connection = server . getConnection ( ) ; if ( connection == null ) { throw new ConnectionNotAvailableException ( server ) ; } byte [ ] result = connection . sendWithResult ( message ) ; server . returnConnection ( connection ) ; return result ; }
Sends a binary message (which will probably create a write access) to the Neo4j cluster and waits for a reply.
@param message binary json message (usually json format)
@param server server that shall be used to send the message
@return result binary message (usually json format)
@throws ConnectionNotAvailableException no connection to server exception