private synchronized int getEndingMessageId ( final Follower follower ) { if ( this . isFollowerActive ( follower ) ) { return this . messages . getLatestPosition ( ) ; } else if ( this . isFollowerTerminated ( follower ) ) { return this . terminatedFollowerRanges . get ( follower ) [ 1 ] ; } else { throw new IllegalStateException ( "Follower never before seen." ) ; } }
Get index of the last plus one message that the follower has access to .