private void waitIfNeeded() {

        if (getUrlsDone().size() == 0) {
            return;
        }

        // 2回目以降の処理の待機処理
        long wait = 0;
        // 前回のアクセスで反応がなかった場合は5秒待つ
        if (isBlnNoResInRow()) {
            wait = (long) Constant.SLEEP_TIME_AFTER_ACCESS_UNAVAILABLE * 1000;
        } else {
            wait = (long) (Constant.SLEEP_TIME_AFTER_ACCESS_AVAILABLE * 1000);
        }
        // それ以外は0.5秒待つ
        try {
            Thread.sleep(wait);
        } catch (InterruptedException e) {
            logger.severe("Thread.sleep() failed.");
            e.printStackTrace();
        }
    }