コード例 #1
0
 @Override
 public boolean isExpired(final TicketState ticketState) {
   return ticketState == null
       || ticketState
           .getCreationTime()
           .plus(this.timeToKillInMilliSeconds, ChronoUnit.MILLIS)
           .isBefore(ZonedDateTime.now(ZoneOffset.UTC));
 }
コード例 #2
0
 @Override
 public boolean isExpired(final TicketState ticketState) {
   if (ticketState == null) {
     return true;
   }
   final ZonedDateTime now = ZonedDateTime.now(ZoneOffset.UTC);
   final ZonedDateTime expirationTime =
       ticketState.getLastTimeUsed().plus(this.timeToKillInSeconds, ChronoUnit.SECONDS);
   return now.isAfter(expirationTime);
 }