jetbrains.buildServer.serverSide.buildLog
Class LogMessageFilter

java.lang.Object
  extended by jetbrains.buildServer.serverSide.buildLog.LogMessageFilter
Direct Known Subclasses:
LogMessageFilter.DefaultFilter, LogMessageFilter.ProblemsFilter

public abstract class LogMessageFilter
extends java.lang.Object


Nested Class Summary
static class LogMessageFilter.DefaultFilter
          This filter accepts all messages with priority WARNING, ERROR and FAILURE, and messages from incomplete blocks.
static class LogMessageFilter.ProblemsFilter
          Returns messages with status greater then WARNING (see Status) and warning messages if these messages are last messages in their parent block.
 
Constructor Summary
LogMessageFilter()
           
 
Method Summary
 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, java.util.List<LogMessage> filtered)
          Appends message and all its parents to the list.
 java.util.List<LogMessage> filter(java.util.Iterator<LogMessage> iterator)
          Reads messages from iterator and filters them.
protected  java.util.List<LogMessage> getListForStoringMessages(int maxImportantListSize)
          Returns list for storing log messages
protected  LogMessage getStopLoadingMessage()
           
 java.util.List<LogMessage> postProcess(java.util.List<LogMessage> filteredMessages)
          Called before returning result.
protected  void rememberMessage(java.util.List<LogMessage> filtered, LogMessage message)
           
protected  void rememberStopLoadingMessage(java.util.List<LogMessage> filtered, LogMessage stopLoadingMessage)
           
protected  boolean shouldCheckMaxListSize()
          Returns true if should check maximum list size, false otherwise
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogMessageFilter

public LogMessageFilter()
Method Detail

acceptMessage

public abstract boolean acceptMessage(LogMessage message,
                                      boolean lastMessageInParent)
Called if simple log message appeared.

Parameters:
message - message to filter
lastMessageInParent - 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(BlockLogMessage message,
                                  boolean lastMessageInParent)
Called if block log message appeared. By default calls acceptMessage() method.

Parameters:
message - message to filter
lastMessageInParent - 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

public java.util.List<LogMessage> postProcess(java.util.List<LogMessage> filteredMessages)
Called before returning result.

Parameters:
filteredMessages - filtered messages
Returns:
post processed messages

filter

public java.util.List<LogMessage> filter(java.util.Iterator<LogMessage> iterator)
Reads messages from iterator and filters them.

Parameters:
iterator - iterator to read messages from
Returns:
filtered messages.

rememberMessage

protected void rememberMessage(java.util.List<LogMessage> filtered,
                               LogMessage message)

rememberStopLoadingMessage

protected void rememberStopLoadingMessage(java.util.List<LogMessage> filtered,
                                          LogMessage stopLoadingMessage)

getStopLoadingMessage

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

protected java.util.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(LogMessage message,
                                        java.util.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 append
filtered - list where to append message