public abstract class ContentMatchingInterceptor extends Object implements LogInterceptor
Modifier and Type | Field and Description |
---|---|
protected String |
stringToMatch |
Constructor and Description |
---|
ContentMatchingInterceptor(String stringToMatch,
boolean matchErrorMessages) |
Modifier and Type | Method and Description |
---|---|
int |
getMatchAge() |
String |
getStringToMatch() |
boolean |
hasMatched() |
void |
intercept(LogEntry logEntry)
Method invoked whenever a new log entry is logged
|
void |
interceptError(LogEntry logEntry)
Method invoked whenever a new error log entry is logged
|
boolean |
isMatchRecentEnough(int maximumAge)
Returns true if content has been matched and occurred less than maximumAge lines from the end of log.
|
protected abstract boolean |
matches(LogEntry logEntry) |
protected final String stringToMatch
public ContentMatchingInterceptor(String stringToMatch, boolean matchErrorMessages)
public void intercept(@NotNull LogEntry logEntry)
LogInterceptor
intercept
in interface LogInterceptor
public void interceptError(@NotNull LogEntry logEntry)
LogInterceptor
interceptError
in interface LogInterceptor
protected abstract boolean matches(LogEntry logEntry)
public boolean hasMatched()
public int getMatchAge()
public boolean isMatchRecentEnough(int maximumAge)
maximumAge
- the maximum age (distance in lines between occurrence and end of log) for the match to be recent enough.
If set to -1, any match will be valid.public String getStringToMatch()
Copyright © 2020 Atlassian Software Systems Pty Ltd. All rights reserved.