public class JSyncLogger extends java.lang.Object implements JSyncConstants
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
REVISION |
SC_BAD_ADDRESS, SC_BAD_LEADER, SC_BAD_MESSAGE, SC_INTERNAL_SERVER_ERROR, SC_JOIN_REJECTED, SC_LEADER_CANNOT_JOIN, SC_NO_ACK, SC_NO_SEND, SC_OK, SC_UNKNOWN, SC_UNKNOWN_URID, SC_URID_ALREADY_ADDED, STATUS_LEADER, STATUS_LONE, STATUS_MEMBER, STATUS_SUBLEADER
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEAR
Constructor and Description |
---|
JSyncLogger(java.io.File logDir)
Constructs a new JSyncLogger
|
Modifier and Type | Method and Description |
---|---|
void |
add(JSyncEvent event)
Add a JSyncEvent in the log
|
java.io.File |
getLogFile(java.util.Date date)
Return the log file for the given date
|
java.util.List<java.io.File> |
getLogFileList(java.util.Date beginDate,
java.util.Date endDate)
Return a list of log file for the given date range
|
java.lang.String |
getStatusLabel(int sc,
java.util.Locale locale)
Return the label of the given status code
|
public static final java.lang.String REVISION
public JSyncLogger(java.io.File logDir)
logDir
- the log directorypublic java.io.File getLogFile(java.util.Date date)
date
- the datepublic java.util.List<java.io.File> getLogFileList(java.util.Date beginDate, java.util.Date endDate)
beginDate
- the begin dateendDate
- the end datepublic java.lang.String getStatusLabel(int sc, java.util.Locale locale)
sc
- the status code (must be a new status code value (e.g. 1101, 1200, ...)locale
- the locale to be usedpublic void add(JSyncEvent event)
event
- the JSyncEventCopyright © 2001-2017 Jalios SA. All Rights Reserved.