public synchronized SendableResponse<BootstrapFinishResponse> finished(ServerIdentity identity, BootstrapFinishRequest finishedRequest) { if (bootstrapping) { // only if the request is from the bootstrap server if (!isBootstrapServer(identity)) { return new SendableResponse<>(BootstrapFinishResponse.badRequest("not from a bootstrap server")); } // TODO delete bootstrap server (see 5.2.5.2 Bootstrap Delete) Runnable whenSent = new Runnable() { @Override public void run() { bootstrappingLatch.countDown(); } }; return new SendableResponse<>(BootstrapFinishResponse.success(), whenSent); } else { return new SendableResponse<>(BootstrapFinishResponse.badRequest("no pending bootstrap session")); } }