private void performRestartOperation(RestartOperation restartOperation)
      throws IOException, InterruptedException, TimeoutException {
    boolean needsToReconnect = false;
    try {
      restartOperation.perform(ops, Address.root());
    } catch (Throwable e) {
      // server went down before we received the response, this can happen
      needsToReconnect = true;
    }

    waitUntilServerIsRunning(needsToReconnect);
  }
 private boolean isRestartOperationRequired(RestartOperation restartOperation) throws IOException {
   return restartOperation.isRequired(
       ops.readAttribute(Address.root(), Constants.SERVER_STATE), false);
 }