    public HttpResponse doScan(StaplerRequest req) throws IOException, GeneralSecurityException {
        if(req.hasParameter("background")) {
            synchronized (this) {
                if (!isRewriterActive()) {
                    rekeyThread = new RekeyThread();
                    rekeyThread.start();
                }
            }
        } else
        if(req.hasParameter("schedule")) {
            scanOnBoot.on();
        } else
        if(req.hasParameter("dismiss")) {
            disable(true);
        } else
            throw HttpResponses.error(400,"Invalid request submission");

        return HttpResponses.redirectViaContextPath("/manage");
    }