public abstract class AbstractRecorder extends Object implements MessageRecorder
MessageRecorder interface.| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MSG_LIMIT |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractRecorder() |
protected |
AbstractRecorder(int errorMsgLimit) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Resets this MessageRecorder.
|
String |
getContext()
Get the current context string.
|
int |
getErrorCount() |
int |
getInfoCount() |
long |
getRunTimeMillis()
How long the MessageRecorder has been running since it was created or the
last time clear was called.
|
long |
getStartTimeMillis()
Get the time when the MessageRecorder was created or the last time that
the clear method was called.
|
int |
getWarningCount() |
boolean |
hasErrors()
Returns true if there are one or more error messages.
|
boolean |
hasInformation()
Returns true if there are one or more informational messages.
|
boolean |
hasWarnings()
Returns true if there are one or more warning messages.
|
static void |
logMessage(String context,
String msg,
mondrian.recorder.AbstractRecorder.MsgType msgType,
org.apache.log4j.Logger logger)
Helper method to format a message and write to logger.
|
void |
popContextName()
Remove the last context name added.
|
void |
pushContextName(String name)
Add the name parameter to the current context.
|
protected abstract void |
recordMessage(String msg,
Object info,
mondrian.recorder.AbstractRecorder.MsgType msgType)
Handles a message.
|
void |
reportError(Exception ex)
Add an Exception.
|
void |
reportError(Exception ex,
Object info)
Add an Exception and extra informaton.
|
void |
reportError(String msg)
Add an error message.
|
void |
reportError(String msg,
Object info)
Add an error message and extra information.
|
void |
reportInfo(String msg)
Add an informational message.
|
void |
reportInfo(String msg,
Object info)
Add an informational message and extra information.
|
void |
reportWarning(String msg)
Add a warning message.
|
void |
reportWarning(String msg,
Object info)
Add a warning message and extra information.
|
void |
throwRTException()
This simply throws a RTException.
|
public static final int DEFAULT_MSG_LIMIT
protected AbstractRecorder()
protected AbstractRecorder(int errorMsgLimit)
public static void logMessage(String context, String msg, mondrian.recorder.AbstractRecorder.MsgType msgType, org.apache.log4j.Logger logger)
public void clear()
clear in interface MessageRecorderpublic long getStartTimeMillis()
MessageRecordergetStartTimeMillis in interface MessageRecorderpublic long getRunTimeMillis()
MessageRecordergetRunTimeMillis in interface MessageRecorderpublic boolean hasInformation()
MessageRecorderhasInformation in interface MessageRecorderpublic boolean hasWarnings()
MessageRecorderhasWarnings in interface MessageRecorderpublic boolean hasErrors()
MessageRecorderhasErrors in interface MessageRecorderpublic int getInfoCount()
public int getWarningCount()
public int getErrorCount()
public String getContext()
MessageRecordergetContext in interface MessageRecorderpublic void pushContextName(String name)
MessageRecorderpushContextName in interface MessageRecorderpublic void popContextName()
MessageRecorderpopContextName in interface MessageRecorderpublic void throwRTException()
throws RecorderException
MessageRecorderthrowRTException in interface MessageRecorderRecorderExceptionpublic void reportError(Exception ex) throws RecorderException
MessageRecorderreportError in interface MessageRecorderex - the Exception added.RecorderException - if too many error messages have been added.public void reportError(Exception ex, Object info) throws RecorderException
MessageRecorderreportError in interface MessageRecorderex - the Exception added.info - extra information (not meant to be part of printed message)RecorderException - if too many error messages have been added.public void reportError(String msg) throws RecorderException
MessageRecorderreportError in interface MessageRecordermsg - the text of the error message.RecorderException - if too many error messages have been added.public void reportError(String msg, Object info) throws RecorderException
MessageRecorderreportError in interface MessageRecordermsg - the text of the error message.info - extra information (not meant to be part of printed message)RecorderException - if too many error messages have been added.public void reportWarning(String msg)
MessageRecorderreportWarning in interface MessageRecordermsg - the text of the warning message.public void reportWarning(String msg, Object info)
MessageRecorderreportWarning in interface MessageRecordermsg - the text of the warning message.info - extra information (not meant to be part of printed message)public void reportInfo(String msg)
MessageRecorderreportInfo in interface MessageRecordermsg - the text of the info message.public void reportInfo(String msg, Object info)
MessageRecorderreportInfo in interface MessageRecordermsg - the text of the info message.info - extra information (not meant to be part of printed message)protected abstract void recordMessage(String msg, Object info, mondrian.recorder.AbstractRecorder.MsgType msgType)
msg - the error or warning message.info - the information Object which might be null.msgType - one of the message type enum valuesCopyright © 2021 Hitachi Vantara. All rights reserved.