|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.sap.tc.logging.ExceptionHandling
|
+--com.sap.tc.logging.Log
|
+--com.sap.tc.logging.StreamLog
|
+--com.sap.tc.logging.FileLog
|
+--com.sap.tc.logging.reader.ReadableLog
Defines common operations to read log messages (a message record) from a log destination. Currently, this mainly handles sequential records retrieval starting either from the oldest or latest time point. To avoid messing up the sequential reading from concurrent readers on the same log destination, it is recommended to get a copy of this 'readable' log for each reader.
| Fields inherited from class com.sap.tc.logging.FileLog |
DEF_LIMIT, MODE_FILE_SET, MODE_MAX, MODE_MIN, MODE_SINGLE_FILE, NO_CNT, NO_LIMIT |
| Fields inherited from class com.sap.tc.logging.Log |
LOG_ACCESSABILITY_TYPE_LOCAL_LOG, LOG_ACCESSABILITY_TYPE_NORMAL_LOG, LOG_ACCESSABILITY_TYPE_PRIVATE_LOG, STATUS_CLOSED, STATUS_INVALID, STATUS_OPENED |
| Constructor Summary | |
ReadableLog(java.lang.String pattern)
Deprecated. ReadableLog become factory class. Use factory methods: - createReadableLog(FileLog fileLog) to get old IReadableLog instance - createFileReadLog(FileLog fileLog) to get new IReadLog instance for reading Files written using ListFormatter and TraceFormatter |
|
| Method Summary | |
boolean |
areLoggingAttributesEditable()
This method verifies whether the attributes like severity can be set. |
void |
close()
Closes output of this log object. |
static IReadLog |
createFileReadLog(FileLog fileLog)
Deprecated. Not suported |
static IReadLog |
createFileReadLog(java.lang.String fileName)
Create FileReadLog object. |
IReadableLog |
createReadableLog()
Create a 'copy' of this Filelog, exposing only the message reading API. |
static IReadableLog |
createReadableLog(FileLog fileLog)
Create a 'copy' of this Filelog, exposing only the message reading API. |
static IReadableLog |
createReadableLog(FileLog fileLog,
java.util.Locale locale)
|
IReadableLog |
createReadableLog(java.util.Locale locale)
|
java.lang.String |
getFileBeingCurrentlyRead()
This method returns the name of the file that is being currently read. |
long |
getFilePointer()
This returns the file pointer. |
long |
getLastModified()
|
ILoggingResultSet |
getNextMatch(java.lang.String[] searchTokens)
This method returns LoggingResultSet that contains one or zero LogRecords. |
ILoggingResultSet |
getNextMatch(java.lang.String[] searchTokens,
boolean ignoreCase)
This method returns LoggingResultSet that contains one or zero LogRecords. |
ILoggingResultSet |
getPreviousMatch(java.lang.String[] searchTokens)
This method returns LoggingResultSet that contains one or zero LogRecords. |
ILoggingResultSet |
getPreviousMatch(java.lang.String[] searchTokens,
boolean ignoreCase)
This method returns LoggingResultSet that contains one or zero LogRecords. |
long |
length()
Deprecated. Use getFileLenght() |
void |
open()
Closes output of this log object. |
ILoggingResultSet |
readLatestMsgRecords(int numberOfRecords)
Retrieve the latest n messages and return them in a result set in chronological order. |
java.util.ArrayList |
readLatestRecords(int numMsg)
Deprecated. Resulting logrecords do not indicate status which is not good enough for complicated scenario like logfile rotation. It will kept around for a while, but will be eventually replaced by readLatestMsgRecords(int). |
ILoggingResultSet |
readNextMsgRecords(int numberOfRecords)
Continue retrieving x relatively newer messages, picked from the point where the last message read from the previous read operation, with respect to the direction of the previous read operation. |
java.util.ArrayList |
readNextRecords(int numMsg)
Deprecated. Resulting logrecords do not indicate status which is not good enough for complicated scenario like logfile rotation. It will kept around for a while, but will be eventually replaced by readNextMsgRecords(int). |
ILoggingResultSet |
readOldestMsgRecords(int numberOfRecords)
Retrieve the oldest n messages and return them in a result set in chronological order. |
java.util.ArrayList |
readOldestRecords(int numMsg)
Deprecated. Resulting logrecords do not indicate status which is not good enough for complicated scenario like logfile rotation. It will kept around for a while, but will be eventually replaced by readOldestMsgRecords(int). |
ILoggingResultSet |
readPrevMsgRecords(int numberOfRecords)
Continue retrieving x relatively older messages, picked from the point where the last message read from the previous read operation, with respect to the direction of the previous read operation. |
java.util.ArrayList |
readPrevRecords(int numMsg)
Deprecated. Resulting logrecords do not indicate status which is not good enough for complicated scenario like logfile rotation. It will kept around for a while, but will be eventually replaced by readPrevMsgRecords(int). |
void |
seek(long filePointer)
Tries to set the file pointer specified by the parameter. |
void |
setFormatter(Formatter formatter)
Sets the formatter that dictates the format of log records in this log. |
int |
status()
Status of this log object. |
| Methods inherited from class com.sap.tc.logging.FileLog |
calculateFileNames, calculateFileNames, equals, findBeginningOfFileSet, findEndOfFileSet, getCnt, getFileCurrentlyBeingWritten, getFileLength, getFileName, getFileNamePattern, getFilePathPattern, getIndex, getLimit, getLogId, getMode, getParent, getParentFile, getPath, getPattern, isAppend, setMode, setRotation |
| Methods inherited from class com.sap.tc.logging.StreamLog |
getEncoding, setEncoding |
| Methods inherited from class com.sap.tc.logging.Log |
addFilter, beGroup, beLogged, flush, getDescription, getEffectiveSeverity, getFilters, getFooter, getFormatter, getHeader, getLoggedCount, getLogName, getLogTypeAccessibility, getName, getNumberOfLogRecordsWritten, getOwners, getRecord, getVerInUse, isAutoFlush, isClosed, isFiltersAgreeing, isOpened, isSuppressing, removeFilter, removeFilters, reset, resetLoggedCount, setAutoFlush, setDescription, setEffectiveSeverity, setLogName, setLogTypeAccessibility, setName, setSuppressing, size, write |
| Methods inherited from class com.sap.tc.logging.ExceptionHandling |
getException, getExceptions, handleException, handleException, resetException, throwException |
| Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.sap.tc.logging.interfaces.IReadableLog |
getLogId |
| Methods inherited from interface com.sap.tc.logging.interfaces.IFileLog |
getCnt, getFileLength, getFileName, getLimit, getParent, getPath, getPattern, isAppend |
| Methods inherited from interface com.sap.tc.logging.interfaces.ILog |
addFilter, beLogged, flush, getEffectiveSeverity, getEncoding, getFilters, getFooter, getFormatter, getHeader, getLogTypeAccessibility, getNumberOfLogRecordsWritten, isAutoFlush, isClosed, isOpened, removeFilter, removeFilters, setAutoFlush, setEffectiveSeverity, setEncoding, setLogTypeAccessibility |
| Methods inherited from interface com.sap.tc.logging.interfaces.IObjectInfo |
getDescription, getName, getVerInUse |
| Constructor Detail |
public ReadableLog(java.lang.String pattern)
| Method Detail |
public static IReadLog createFileReadLog(FileLog fileLog)
public static IReadLog createFileReadLog(java.lang.String fileName)
throws FileDataException
fileName - FileDataException - public static IReadableLog createReadableLog(FileLog fileLog)
public static IReadableLog createReadableLog(FileLog fileLog,
java.util.Locale locale)
public IReadableLog createReadableLog()
createReadableLog in interface IReadableLogpublic IReadableLog createReadableLog(java.util.Locale locale)
public ILoggingResultSet readLatestMsgRecords(int numberOfRecords)
throws java.lang.IllegalArgumentException,
UnsupportedFormatException,
java.io.FileNotFoundException,
java.lang.SecurityException,
java.io.IOException
Retrieve the latest n messages and return them in a result set in chronological order. This method always refers to the newest messages even the output file is growing and rotating.
readLatestMsgRecords in interface IReadableLognumMsg - number of messages (>0) to be retrievedLogRecord in chronological
order, stored in a list of the result set, with position [0] holding the oldest
of the resulting messages.java.lang.IllegalArgumentException - Negative number or zero messages requestedUnsupportedFormatException - Formatter type not supported by Log Viewerjava.io.FileNotFoundException - Output file not foundjava.lang.SecurityException - Access to output file deniedjava.io.IOException - Problem reading data from output file
public ILoggingResultSet readOldestMsgRecords(int numberOfRecords)
throws java.lang.IllegalArgumentException,
UnsupportedFormatException,
java.io.FileNotFoundException,
java.lang.SecurityException,
java.io.IOException
Retrieve the oldest n messages and return them in a result set in chronological order. This method always refers to the currently available oldest messages which may be different due to the rotating feature from the constantly growing output file size.
readOldestMsgRecords in interface IReadableLognumMsg - number of messages (>0) to be retrievedLogRecord in chronological
order, stored in a list of the result set, with position [0] holding the oldest
of the resulting messages.java.lang.IllegalArgumentException - Negative number or zero messages requestedUnsupportedFormatException - Formatter type not supported by Log Viewerjava.io.FileNotFoundException - Output file not foundjava.lang.SecurityException - Access to output file deniedjava.io.IOException - Problem reading data from output file
public ILoggingResultSet readPrevMsgRecords(int numberOfRecords)
throws java.lang.IllegalArgumentException,
UnsupportedFormatException,
java.io.FileNotFoundException,
java.lang.SecurityException,
java.io.IOException
Continue retrieving x relatively older messages, picked from the point where the last message read from the previous read operation, with respect to the direction of the previous read operation. For example, if previous call is readLatestMsgRecords(5), this call readPrevMsgRecords(2) will retrieve the 7th and 6th lastest messages. If previous call is readOldestMsgRecords(5), this call readPrevMsgRecords(2) will retrieve the 3rd & 4th oldest messages.
If this method is called without a prior call to readLatestMsgRecords(int)
or readOldestMsgRecords(int),
this will behave the same as calling readLatestMsgRecords(numMsg) .
Messages are returned in a result set in chronological order. Due to the potential file overwriting by the rotating feature, the file being currently referenced to may no longer exist and thus data will become invalid. It is always a good idea to check the overall status of the result set before getting the resulting list.
readPrevMsgRecords in interface IReadableLognumMsg - number of messages(>0) to be retrievedLogRecord in chronological
order, stored in a list of the result set, with position [0] holding the oldest
of the resulting messages. Due to the potential rotating feature, you are
advised to check the overall status of the result set (isValid()) before
retrieving the resulting list.
The resulting list contains all valid available messages,
that is, the size may be smaller than the requested number.
This can happen if there actually exists fewer messages in the file (status valid), or certain
messages are getting parsing error (status invalid).
If no more older message can be retrieved, this will return
a valid empty list in the result set.
If current file is being overwritten while reading, status set to invalid in result set.- Throws:
java.lang.IllegalArgumentException - Negative number or zero messages requestedUnsupportedFormatException - Formatter type not supported by Log Viewerjava.io.FileNotFoundException - Output file not foundjava.lang.SecurityException - Access to output file deniedjava.io.IOException - Problem reading data from output file- See Also:
LoggingResultSet,
FileLog.LogRecordResultSet
public ILoggingResultSet readNextMsgRecords(int numberOfRecords)
throws java.lang.IllegalArgumentException,
UnsupportedFormatException,
java.io.FileNotFoundException,
java.lang.SecurityException,
java.io.IOException
Continue retrieving x relatively newer messages, picked from the point where the last message read from the previous read operation, with respect to the direction of the previous read operation. For example, if previous call is readOldestMsgRecords(5), this call readNextMsgRecords(2) will retrieve the 6th and 7th oldest messages. If previous call is readLatestMsgRecords(5), this call readNextMsgRecords(2) will retrieve the 4th & 3rd lastest messages.
If this method is called without a prior call to readLatestMsgRecords(int)
or readOldestMsgRecords(int),
this will behave the same as calling readOldestMsgRecords(numMsg) .
Messages are returned in a result set in chronological order. Due to the potential file overwriting by the rotating feature, the file being currently referenced to may no longer exist and thus data will become invalid. It is always a good idea to check the overall status of the result set before getting the resulting list.
readNextMsgRecords in interface IReadableLognumMsg - number of messages(>0) to be retrievedLogRecord in chronological
order, stored in a list of the result set, with position [0] holding the oldest
of the resulting messages. Due to the potential rotating feature, you are
advised to check the overall status of the result set (isValid()) before
retrieving the resulting list.
The resulting list contains all valid available messages,
that is, the size may be smaller than the requested number.
This can happen if there actually exists fewer messages in the file (status valid), or certain
messages are getting parsing error (status invalid).
If no more newer message can be retrieved, this will return
a valid empty list in the result set.
If current file is being overwritten while reading, status set to invalid in result set.- Throws:
java.lang.IllegalArgumentException - Negative number or zero messages requestedUnsupportedFormatException - Formatter type not supported by Log Viewerjava.io.FileNotFoundException - Output file not foundjava.lang.SecurityException - Access to output file deniedjava.io.IOException - Problem reading data from output file- See Also:
LoggingResultSet,
FileLog.LogRecordResultSet
public ILoggingResultSet getNextMatch(java.lang.String[] searchTokens)
throws java.lang.IllegalArgumentException,
UnsupportedFormatException,
java.io.FileNotFoundException,
java.lang.SecurityException,
java.io.IOException
getNextMatch in interface IReadableLogsearchTokens - java.lang.IllegalArgumentException - UnsupportedFormatException - java.io.IOException -
public ILoggingResultSet getNextMatch(java.lang.String[] searchTokens,
boolean ignoreCase)
throws java.lang.IllegalArgumentException,
UnsupportedFormatException,
java.io.FileNotFoundException,
java.lang.SecurityException,
java.io.IOException
getNextMatch in interface IReadableLogsearchTokens - ignoreCase - java.lang.IllegalArgumentException - UnsupportedFormatException - java.io.IOException -
public ILoggingResultSet getPreviousMatch(java.lang.String[] searchTokens)
throws java.lang.IllegalArgumentException,
UnsupportedFormatException,
java.io.FileNotFoundException,
java.lang.SecurityException,
java.io.IOException
getPreviousMatch in interface IReadableLogsearchTokens - java.lang.IllegalArgumentException - UnsupportedFormatException - java.io.IOException -
public ILoggingResultSet getPreviousMatch(java.lang.String[] searchTokens,
boolean ignoreCase)
throws java.lang.IllegalArgumentException,
UnsupportedFormatException,
java.io.FileNotFoundException,
java.lang.SecurityException,
java.io.IOException
getPreviousMatch in interface IReadableLogsearchTokens - ignoreCase - java.lang.IllegalArgumentException - UnsupportedFormatException - java.io.IOException - public boolean areLoggingAttributesEditable()
areLoggingAttributesEditable in interface IReadableLogpublic java.lang.String getFileBeingCurrentlyRead()
public long getFilePointer()
throws java.io.IOException
java.io.IOException -
public void seek(long filePointer)
throws java.io.IOException
filePointer - java.io.IOException -
public long getLastModified()
throws java.io.IOException
getLastModified in interface IReadableLogpublic int status()
ILogstatus in interface ILogstatus in class Logpublic void open()
open in interface ILogopen in class Logpublic void close()
close in interface ILogclose in class Logpublic void setFormatter(Formatter formatter)
setFormatter in interface ILogsetFormatter in class FileLogLog.getFormatter()
public java.util.ArrayList readLatestRecords(int numMsg)
throws java.lang.IllegalArgumentException,
UnsupportedFormatException,
java.io.IOException
readLatestMsgRecords(int).
Retrieve the latest n messages and return them in an array list. This method always refers to the newest messages even the output file is growing.
readLatestRecords in interface IReadableLognumMsg - Number of messages (>0) to be retrievedUnsupportedFormatException - java.lang.IllegalArgumentException - Negative number or zero messages requestedjava.io.IOException - Problem reading data from output file
public java.util.ArrayList readOldestRecords(int numMsg)
throws java.lang.IllegalArgumentException,
UnsupportedFormatException,
java.io.IOException
readOldestMsgRecords(int).
Retrieve the oldest n messages and return them in an array list. This method
always refers to the currently available oldest messages which may be
different due to the rotating feature(not covered at this stage) from the
constantly growing output file size.
readOldestRecords in interface IReadableLognumMsg - Number of messages (>0) to be retrievedUnsupportedFormatException - java.lang.IllegalArgumentException - Negative number or zero messages requestedjava.io.IOException - Problem reading data from output file
public java.util.ArrayList readPrevRecords(int numMsg)
throws java.lang.IllegalArgumentException,
UnsupportedFormatException,
java.io.IOException
readPrevMsgRecords(int).
Continue retrieving x relatively older messages, picked from the point where the last message read from the previous read operation, with respective to the direction of the previous read operation.
If this method is called without a prior call to readLatestRecords(int) or readOldestRecords(int), this will
behave the same as calling readLatestRecords(numMsg) .
Messages are returned in an array list.
readPrevRecords in interface IReadableLognumMsg - Number of messages(>0) to be retrievedUnsupportedFormatException - java.lang.IllegalArgumentException - Negative number or zero messages requestedjava.io.IOException - Problem reading data from output file
public java.util.ArrayList readNextRecords(int numMsg)
throws java.lang.IllegalArgumentException,
UnsupportedFormatException,
java.io.IOException
readNextMsgRecords(int).
Continue retrieving x relatively newer messages, picked from the point where the last message read from the previous read operation, with respective to the direction of the previous read operation.
If this method is called without a prior call to readLatestRecords(int) or readOldestRecords(int), this will
behave the same as calling readOldestRecords(numMsg) .
Messages are returned in an array list.
readNextRecords in interface IReadableLognumMsg - Number of messages(>0) to be retrievedUnsupportedFormatException - java.lang.IllegalArgumentException - Negative number or zero messages requestedjava.io.IOException - Problem reading data from output filepublic long length()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||