private void sweepExpiredNonces ( ) { // Do not sweep until enough time has elapsed since the last sweep long currentTime = System . currentTimeMillis ( ) ; if ( currentTime - lastSweep < SWEEP_INTERVAL ) return ; // Record time of sweep lastSweep = currentTime ; // For each stored nonce Iterator < Map . Entry < String , Long > > entries = nonces . entrySet ( ) . iterator ( ) ; while ( entries . hasNext ( ) ) { // Remove all entries which have expired Map . Entry < String , Long > current = entries . next ( ) ; if ( current . getValue ( ) <= System . currentTimeMillis ( ) ) entries . remove ( ) ; } }
Iterates through the entire Map of generated nonces removing any nonce that has exceeded its expiration timestamp . If insufficient time has elapsed since the last sweep as dictated by SWEEP_INTERVAL this function has no effect .