|
SAP NetWeaver '04 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.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.
| Field Summary |
| 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 |
| Fields inherited from class com.sap.tc.logging.ExceptionHandling |
EX_NO_FILTER_EMSG, EX_NO_FORMATTER_EMSG, EX_NO_INSTANCE_EMSG |
| Constructor Summary | |
ReadableLog(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. |
protected Object |
clone()
|
void |
close()
Closes output of this log object. |
static IReadLog |
createFileReadLog(FileLog fileLog)
Deprecated. Not suported |
static IReadLog |
createFileReadLog(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. |
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(String[] searchTokens)
This method returns LoggingResultSet that contains one or zero LogRecords. |
ILoggingResultSet |
getNextMatch(String[] searchTokens,
boolean ignoreCase)
This method returns LoggingResultSet that contains one or zero LogRecords. |
ILoggingResultSet |
getPreviousMatch(String[] searchTokens)
This method returns LoggingResultSet that contains one or zero LogRecords. |
ILoggingResultSet |
getPreviousMatch(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. |
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. |
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. |
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. |
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, equalsPattern, expandPattern, expandPattern, expandPattern, findBeginningOfFileSet, findEndOfFileSet, getCnt, getFileCurrentlyBeingWritten, getFileLength, getFileName, getFileNamePattern, getFilePathPattern, getIndex, getLimit, getLogId, getMode, getParent, getParentFile, getPath, getPattern, isAppend, resetInt, setAppend, setCnt, setFormatterInt, setIndex, setLimit, setMode, setPattern, setRotation, writeInt, writeLogFooter, writeLogHeader |
| Methods inherited from class com.sap.tc.logging.StreamLog |
closeInt, flushInt, getEncoding, getOutputStream, openInt, setEncoding |
| Methods inherited from class com.sap.tc.logging.Log |
addFilter, addOwner, beGroup, beLogged, finalize, flush, getDescription, getEffectiveSeverity, getFilters, getFooter, getFormatter, getHeader, getLocalLogOwner, getLoggedCount, getLogName, getLogTypeAccessibility, getName, getNumberOfLogRecordsWritten, getOwners, getRecord, getVerInUse, isAutoFlush, isClosed, isFiltersAgreeing, isHeaderWritten, isOpened, isSuppressing, removeFilter, removeFilters, removeOwner, reset, resetLoggedCount, setAutoFlush, setDescription, setEffectiveSeverity, setFooter, setHeader, setHeaderWritten, setLocalLogOwner, setLogName, setLogTypeAccessibility, setName, setSize, setStatus, setSuppressing, setVerInUse, size, write, writeInt |
| 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(String pattern)
| Method Detail |
public static IReadLog createFileReadLog(FileLog fileLog)
public static IReadLog createFileReadLog(String fileName)
throws FileDataException
fileName -
FileDataExceptionpublic static IReadableLog createReadableLog(FileLog fileLog)
public IReadableLog createReadableLog()
createReadableLog in interface IReadableLog
public ILoggingResultSet readLatestMsgRecords(int numberOfRecords)
throws IllegalArgumentException,
UnsupportedFormatException,
FileNotFoundException,
SecurityException,
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 IReadableLognumberOfRecords - Number of messages (>0) to be retrieved
LogRecord in chronological
order, stored in a list of the result set, with position [0] holding the oldest
of the resulting messages.IllegalArgumentException - Negative number or zero messages requested
UnsupportedFormatException - Formatter type not supported by Log Viewer
FileNotFoundException - Output file not found
SecurityException - Access to output file denied
IOException - Problem reading data from output fileLoggingResultSet
public ILoggingResultSet readOldestMsgRecords(int numberOfRecords)
throws IllegalArgumentException,
UnsupportedFormatException,
FileNotFoundException,
SecurityException,
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 IReadableLognumberOfRecords - Number of messages (>0) to be retrieved
LogRecord in chronological
order, stored in a list of the result set, with position [0] holding the oldest
of the resulting messages.IllegalArgumentException - Negative number or zero messages requested
UnsupportedFormatException - Formatter type not supported by Log Viewer
FileNotFoundException - Output file not found
SecurityException - Access to output file denied
IOException - Problem reading data from output fileLoggingResultSet
public ILoggingResultSet readPrevMsgRecords(int numberOfRecords)
throws IllegalArgumentException,
UnsupportedFormatException,
FileNotFoundException,
SecurityException,
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 IReadableLognumberOfRecords - Number of messages(>0) to be retrieved
LogRecord 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:
IllegalArgumentException - Negative number or zero messages requested
UnsupportedFormatException - Formatter type not supported by Log Viewer
FileNotFoundException - Output file not found
SecurityException - Access to output file denied
IOException - Problem reading data from output file- See Also:
LoggingResultSet,
FileLog.LogRecordResultSet
public ILoggingResultSet readNextMsgRecords(int numberOfRecords)
throws IllegalArgumentException,
UnsupportedFormatException,
FileNotFoundException,
SecurityException,
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 IReadableLognumberOfRecords - Number of messages(>0) to be retrieved
LogRecord 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:
IllegalArgumentException - Negative number or zero messages requested
UnsupportedFormatException - Formatter type not supported by Log Viewer
FileNotFoundException - Output file not found
SecurityException - Access to output file denied
IOException - Problem reading data from output file- See Also:
LoggingResultSet,
FileLog.LogRecordResultSet
public ILoggingResultSet getNextMatch(String[] searchTokens)
throws IllegalArgumentException,
UnsupportedFormatException,
FileNotFoundException,
SecurityException,
IOException
getNextMatch in interface IReadableLogsearchTokens -
IllegalArgumentException
UnsupportedFormatException
IOException
FileNotFoundException
SecurityException
public ILoggingResultSet getNextMatch(String[] searchTokens,
boolean ignoreCase)
throws IllegalArgumentException,
UnsupportedFormatException,
FileNotFoundException,
SecurityException,
IOException
getNextMatch in interface IReadableLogsearchTokens - ignoreCase -
IllegalArgumentException
UnsupportedFormatException
IOException
FileNotFoundException
SecurityException
public ILoggingResultSet getPreviousMatch(String[] searchTokens)
throws IllegalArgumentException,
UnsupportedFormatException,
FileNotFoundException,
SecurityException,
IOException
getPreviousMatch in interface IReadableLogsearchTokens -
IllegalArgumentException
UnsupportedFormatException
IOException
FileNotFoundException
SecurityException
public ILoggingResultSet getPreviousMatch(String[] searchTokens,
boolean ignoreCase)
throws IllegalArgumentException,
UnsupportedFormatException,
FileNotFoundException,
SecurityException,
IOException
getPreviousMatch in interface IReadableLogsearchTokens - ignoreCase -
IllegalArgumentException
UnsupportedFormatException
IOException
FileNotFoundException
SecurityExceptionpublic boolean areLoggingAttributesEditable()
areLoggingAttributesEditable in interface IReadableLogpublic String getFileBeingCurrentlyRead()
public long getFilePointer()
throws IOException
IOException
public void seek(long filePointer)
throws IOException
filePointer -
IOException
public long getLastModified()
throws IOException
getLastModified in interface IReadableLogIOExceptionpublic int status()
ILog
status 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()
protected Object clone()
throws CloneNotSupportedException
clone in class FileLogCloneNotSupportedException
public ArrayList readLatestRecords(int numMsg)
throws IllegalArgumentException,
UnsupportedFormatException,
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 retrieved
UnsupportedFormatException
IllegalArgumentException - Negative number or zero messages requested
IOException - Problem reading data from output file
public ArrayList readOldestRecords(int numMsg)
throws IllegalArgumentException,
UnsupportedFormatException,
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 retrieved
UnsupportedFormatException
IllegalArgumentException - Negative number or zero messages requested
IOException - Problem reading data from output file
public ArrayList readPrevRecords(int numMsg)
throws IllegalArgumentException,
UnsupportedFormatException,
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 retrieved
UnsupportedFormatException
IllegalArgumentException - Negative number or zero messages requested
IOException - Problem reading data from output file
public ArrayList readNextRecords(int numMsg)
throws IllegalArgumentException,
UnsupportedFormatException,
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 retrieved
UnsupportedFormatException
IllegalArgumentException - Negative number or zero messages requested
IOException - Problem reading data from output filepublic long length()
|
SAP NetWeaver '04 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||