@ Override public boolean isScanNeeded ( ) { // see if we need to recheck if ( recheck == null ) { logger . debug ( "{}: scan not needed, recheck null" , collectionName ) ; return false ; } if ( ! hasScans ( ) ) { logger . debug ( "{}: scan not needed, no scanners" , collectionName ) ; return false ; } synchronized ( this ) { if ( map == null && ! isStatic ( ) ) { logger . debug ( "{}: scan needed, never scanned" , collectionName ) ; return true ; } } Date now = new Date ( ) ; Date lastCheckedDate = new Date ( getLastScanned ( ) ) ; Date need = recheck . add ( lastCheckedDate ) ; if ( now . before ( need ) ) { logger . debug ( "{}: scan not needed, last scanned={}, now={}" , collectionName , lastCheckedDate , now ) ; return false ; } return true ; }
Compute if synchronous scan is needed . True if recheck is true and enough time has elapsed .