private int sequentialFailureCount ( List < AuditEvent > events ) { int failureCount = 0 ; for ( AuditEvent event : events ) { if ( event . getType ( ) == failureEventType ) { failureCount ++ ; } else if ( event . getType ( ) == successEventType ) { // Successful authentication occurred within last allowable // failures, so ignore break ; } } return failureCount ; }
Counts the number of failures that occurred without an intervening successful login .