private void writeCommandExpectingResult(Channel channel, Command command) {
   final int id = transactionId++;
   command.setTransactionId(id);
   transactionToCommandMap.put(id, command.getName());
   Log.i(this.getClass().getName(), "sending command (expecting result): " + command);
   channel.write(command);
 }