Class LogMessageFilter
- java.lang.Object
-
- jetbrains.buildServer.serverSide.buildLog.LogMessageFilter
-
- Direct Known Subclasses:
DefaultLogMessageFilter
,ProblemsFilter
public abstract class LogMessageFilter extends Object
Not thread safe! Has state and must be recreated each time.
-
-
Constructor Summary
Constructors Constructor Description LogMessageFilter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
acceptBlockMessage(BlockLogMessage message, boolean lastMessageInParent)
Called if block log message appeared.abstract boolean
acceptMessage(LogMessage message, boolean lastMessageInParent)
Called if simple log message appeared.protected void
appendMessageWithParents(LogMessage message, List<LogMessage> filtered)
Appends message and all its parents to the list.List<LogMessage>
filter(Iterator<LogMessage> iterator)
Reads messages from iterator and filters them.protected List<LogMessage>
getListForStoringMessages(int maxImportantListSize)
Returns list for storing log messagesprotected LogMessage
getStopLoadingMessage()
List<LogMessage>
postProcess(List<LogMessage> filteredMessages)
Called before returning result.protected void
rememberMessage(List<LogMessage> filtered, LogMessage message)
protected void
rememberStopLoadingMessage(List<LogMessage> filtered, LogMessage stopLoadingMessage)
protected boolean
shouldCheckMaxListSize()
Returns true if should check maximum list size, false otherwise
-
-
-
Method Detail
-
acceptMessage
public abstract boolean acceptMessage(@NotNull LogMessage message, boolean lastMessageInParent)
Called if simple log message appeared.- Parameters:
message
- message to filterlastMessageInParent
- true if this is the last message in parent block- Returns:
- true if message accepted and false if message should be removed. If message is accepted then all its parents are accepted too.
-
acceptBlockMessage
public boolean acceptBlockMessage(@NotNull BlockLogMessage message, boolean lastMessageInParent)
Called if block log message appeared. By default calls acceptMessage() method.- Parameters:
message
- message to filterlastMessageInParent
- true if this is the last message in parent block- Returns:
- true if message accepted and false if message should be removed. If message is accepted then all its parents are accepted too.
-
postProcess
@NotNull public List<LogMessage> postProcess(@NotNull List<LogMessage> filteredMessages)
Called before returning result.- Parameters:
filteredMessages
- filtered messages- Returns:
- post processed messages
-
filter
@NotNull public List<LogMessage> filter(@NotNull Iterator<LogMessage> iterator)
Reads messages from iterator and filters them.- Parameters:
iterator
- iterator to read messages from- Returns:
- filtered messages.
-
rememberMessage
protected void rememberMessage(@NotNull List<LogMessage> filtered, @NotNull LogMessage message)
-
rememberStopLoadingMessage
protected void rememberStopLoadingMessage(@NotNull List<LogMessage> filtered, @NotNull LogMessage stopLoadingMessage)
-
getStopLoadingMessage
@NotNull protected LogMessage getStopLoadingMessage()
-
shouldCheckMaxListSize
protected boolean shouldCheckMaxListSize()
Returns true if should check maximum list size, false otherwise- Returns:
- true if should check maximum list size, false otherwise
-
getListForStoringMessages
@NotNull protected List<LogMessage> getListForStoringMessages(int maxImportantListSize)
Returns list for storing log messages- Parameters:
maxImportantListSize
- maximal important list size- Returns:
- list for storing log messages
-
appendMessageWithParents
protected void appendMessageWithParents(@NotNull LogMessage message, @NotNull List<LogMessage> filtered)
Appends message and all its parents to the list. Only those parents are appended which are not already in the list.- Parameters:
message
- message to appendfiltered
- list where to append message
-
-