Class SuppressWithNearbyTextFilter.Suppression

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.regex.Pattern eventIdRegexp
      The regexp which is used to match the event ID.
      private java.util.regex.Pattern eventMessageRegexp
      The regexp which is used to match the event message.
      private java.util.regex.Pattern eventSourceRegexp
      The regexp which is used to match the event source.
      private int firstLine
      The first line where warnings may be suppressed.
      private int lastLine
      The last line where warnings may be suppressed.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Suppression​(java.lang.String text, int lineNo, SuppressWithNearbyTextFilter filter)
      Constructs new Suppression instance.
    • Field Detail

      • firstLine

        private final int firstLine
        The first line where warnings may be suppressed.
      • lastLine

        private final int lastLine
        The last line where warnings may be suppressed.
      • eventSourceRegexp

        private final java.util.regex.Pattern eventSourceRegexp
        The regexp which is used to match the event source.
      • eventMessageRegexp

        private java.util.regex.Pattern eventMessageRegexp
        The regexp which is used to match the event message.
      • eventIdRegexp

        private java.util.regex.Pattern eventIdRegexp
        The regexp which is used to match the event ID.
    • Constructor Detail

      • Suppression

        private Suppression​(java.lang.String text,
                            int lineNo,
                            SuppressWithNearbyTextFilter filter)
        Constructs new Suppression instance.
        Parameters:
        text - suppression text.
        lineNo - suppression line number.
        filter - the SuppressWithNearbyTextFilter with the context.
        Throws:
        java.lang.IllegalArgumentException - if there is an error in the filter regex syntax.
    • Method Detail

      • parseRange

        private static int parseRange​(java.lang.String format,
                                      java.lang.String lineRange,
                                      java.lang.String text)
        Gets range from suppress filter range format param.
        Parameters:
        format - range format to parse
        lineRange - raw line range
        text - text of the suppression
        Returns:
        parsed range
        Throws:
        java.lang.IllegalArgumentException - when unable to parse int in format
      • isMatch

        private boolean isMatch​(AuditEvent event)
        Determines whether the source of an audit event matches the text of this suppression.
        Parameters:
        event - the AuditEvent to check.
        Returns:
        true if the source of event matches the text of this suppression.