View Javadoc

1   package com.github.triceo.splitlog.api;
2   
3   /**
4    * Allows users to filter messages based on their own criteria. These conditions
5    * will be used whenever the {@link LogWatch} and its {@link Follower}s need to
6    * notify other parts of code about newly received {@link Message}s.
7    */
8   public interface MidDeliveryMessageCondition {
9   
10      /**
11       * Evaluate a message against a user-provided condition when the message has
12       * been received from a {@link Follower}. This will happen when the message
13       * condition evaluation happens within {@link MergingFollower}.
14       *
15       * @param evaluate
16       *            The message to evaluate.
17       * @param status
18       *            Current processing status of the message.
19       * @param source
20       *            The notifying object.
21       * @return True if message matches.
22       */
23      boolean accept(Message evaluate, MessageDeliveryStatus status, Follower source);
24  
25      /**
26       * Evaluate a message against a user-provided condition when the message has
27       * been received from a {@link LogWatch}.
28       *
29       * @param evaluate
30       *            The message to evaluate.
31       * @param status
32       *            Current processing status of the message.
33       * @param source
34       *            The notifying object.
35       * @return True if message matches.
36       */
37      boolean accept(Message evaluate, MessageDeliveryStatus status, LogWatch source);
38  }