public class XLogFilter extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ALLOW_ALL_REGEX |
static String |
MAX_ACTIONLIST_SCAN_DURATION |
static String |
MAX_SCAN_DURATION |
Constructor and Description |
---|
XLogFilter() |
XLogFilter(XLogUserFilterParam userLogFilter) |
Modifier and Type | Method and Description |
---|---|
Date |
adjustOffset(Date date,
int offset)
Adjust offset, offset will always be in min.
|
void |
calculateAndCheckDates(Date jobStartTime,
Date jobEndTime)
Calculate scan date
|
void |
constructPattern()
Constructs the regular expression according to the filter and assigns it
to fileterPattarn.
|
static void |
defineParameter(String filterParam) |
String |
getDebugMessage() |
Date |
getEndDate() |
Map<String,String> |
getFilterParams() |
Pattern |
getFilterPattern() |
String |
getFormattedEndDate() |
String |
getFormattedStartDate() |
int |
getLogLimit() |
Date |
getStartDate() |
String |
getTruncatedMessage() |
XLogUserFilterParam |
getUserLogFilter() |
boolean |
isActionList() |
boolean |
isDebugMode() |
boolean |
isFilterPresent() |
boolean |
matches(ArrayList<String> logParts)
Checks if the logLevel and logMessage goes through the logFilter.
|
static void |
reset() |
void |
setActionList(boolean isActionList) |
void |
setFilterPattern(Pattern filterPattern) |
void |
setLogLevel(String logLevel) |
void |
setParameter(String filterParam,
String value) |
protected void |
setTruncatedMessage(String message) |
void |
setUserLogFilter(XLogUserFilterParam userLogFilter) |
void |
splitLogMessage(LogLine logLine,
Pattern splitPattern)
If
logLine matches with splitPattern ,
Split the log line into timestamp, logLevel and remaining log
message.
Record the parts of message in logLine to avoid regex
matching in future.
Record the pattern to which logLine has matched.
|
ArrayList<String> |
splitLogMessage(String logLine)
Splits the log line into timestamp, logLevel and remaining log message.
|
boolean |
splitsMatches(LogLine logLine)
Checks if the logLevel and logMessage goes through the logFilter.
|
void |
validateDateRange(Date jobStartTime,
Date jobEndTime)
validate date range.
|
public static String MAX_ACTIONLIST_SCAN_DURATION
public static String MAX_SCAN_DURATION
public static final String ALLOW_ALL_REGEX
public XLogFilter()
public XLogFilter(XLogUserFilterParam userLogFilter)
public void setLogLevel(String logLevel)
public void setParameter(String filterParam, String value)
public static void defineParameter(String filterParam)
public boolean isFilterPresent()
public boolean splitsMatches(LogLine logLine)
logLine
- the log linepublic boolean matches(ArrayList<String> logParts)
logParts
- the arrayList of log partspublic ArrayList<String> splitLogMessage(String logLine)
logLine
- the linepublic void splitLogMessage(LogLine logLine, Pattern splitPattern)
logLine
matches with splitPattern
,
logLine
to avoid regex
matching in future.logLine
has matched.logLine
- the line to splitsplitPattern
- the pattern to usepublic void constructPattern()
public static void reset()
public final Map<String,String> getFilterParams()
public XLogUserFilterParam getUserLogFilter()
public void setUserLogFilter(XLogUserFilterParam userLogFilter)
public Date getEndDate()
public String getFormattedEndDate()
public String getFormattedStartDate()
public Date getStartDate()
public boolean isDebugMode()
public int getLogLimit()
public String getDebugMessage()
public boolean isActionList()
public void setActionList(boolean isActionList)
public void calculateAndCheckDates(Date jobStartTime, Date jobEndTime) throws IOException
jobStartTime
- the job start timejobEndTime
- the job end timeIOException
- Signals that an I/O exception has occurred.public void validateDateRange(Date jobStartTime, Date jobEndTime) throws IOException
jobStartTime
- the job start timejobEndTime
- the job end timeIOException
- Signals that an I/O exception has occurred.protected void setTruncatedMessage(String message)
public String getTruncatedMessage()
public Date adjustOffset(Date date, int offset) throws IOException
date
- the dateoffset
- the offsetIOException
- Signals that an I/O exception has occurred.public void setFilterPattern(Pattern filterPattern)
public Pattern getFilterPattern()
Copyright © 2018 Apache Software Foundation. All rights reserved.