private static boolean expiring ( Date expiry ) { long timeRemaining = expiry . getTime ( ) - System . currentTimeMillis ( ) ; return timeRemaining < EXPIRY_TIME_MILLIS ; }
Session credentials that expire in less than a minute are considered expiring .