public void onProgress(ProgressToken token) {
            if (progressMeta.shouldWriteProgress()) {
                 synchronized (token) {
                     progressMeta.unwrittenUpdates++;
                     progressMeta.lastProgressContents = token.toString();
                     long nowNanos = System.nanoTime();
                     if ((nowNanos - progressMeta.lastWriteAtNanos) > progressMeta.writeInterval.toNanos()) {
                         rewriteProgressFile();
                         progressMeta.unwrittenUpdates = 0;
                         progressMeta.lastWriteAtNanos = nowNanos;
                     }
                 }
            }
            if (showProgress) {
                synchronized (printLock) {
                    DecimalFormat df = new DecimalFormat("#.#");
                    String percentage = df.format(token.percentFinished());
                    if (!percentage.equals(lastPercentage)) {
                        if (lastLineIsProgress) {
                            System.err.print('\r');
                        }
                        // Pad with a few extra spaces to handle case where current line written is shorter
                        // than the previous line written. Would otherwise leave stale characters behind.
                        System.err.print(percentage + " % finished.   ");
                        lastLineIsProgress = true;
                        lastPercentage = percentage;
                    }
                }
            }
            super.onProgress(token);
        }
An abstract class that can be subclassed by different visitor handlers.

@author Thomas Gundersen
vespaclient-java/src/main/java/com/yahoo/vespavisit/VdsVisitHandler.java