com.sap.tc.logging.interfaces
Interface IReadableLog

All Superinterfaces:
java.lang.Cloneable, IFileLog, ILog, IObjectInfo
All Known Implementing Classes:
ReadableLog

public interface IReadableLog
extends IFileLog

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.


Method Summary
 boolean areLoggingAttributesEditable()
          This method verifies whether the attributes like severity can be set.
 IReadableLog createReadableLog()
          Create a copy(clone) of this readable log, and thus the cursor to retrieve message records for each reader will be independent.
 long getLastModified()
           
 java.lang.String getLogId()
          Return an id for the corresponding Log that is unique
 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.
 ILoggingResultSet readLatestMsgRecords(int numMsg)
          Retrieve the latest n messages and return them in a result set.
 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 numMsg)
          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.
 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 numMsg)
          Retrieve the oldest n messages and return them in a result set.
 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 numMsg)
          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.
 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).
 
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, close, flush, getEffectiveSeverity, getEncoding, getFilters, getFooter, getFormatter, getHeader, getLogTypeAccessibility, getNumberOfLogRecordsWritten, isAutoFlush, isClosed, isOpened, open, removeFilter, removeFilters, setAutoFlush, setEffectiveSeverity, setEncoding, setFormatter, setLogTypeAccessibility, status
 
Methods inherited from interface com.sap.tc.logging.interfaces.IObjectInfo
getDescription, getName, getVerInUse
 

Method Detail

getLogId

public java.lang.String getLogId()
Return an id for the corresponding Log that is unique
Returns:
The logId value

createReadableLog

public IReadableLog createReadableLog()
Create a copy(clone) of this readable log, and thus the cursor to retrieve message records for each reader will be independent. This can avoid messing up the sequential reading pointers from potential concurrent readers.
Returns:
A copy of this readable log that contains mainly cursor actions.

readLatestRecords

public java.util.ArrayList readLatestRecords(int numMsg)
                                      throws java.lang.IllegalArgumentException,
                                             UnsupportedFormatException,
                                             java.io.IOException
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).

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.

Parameters:
numMsg - Number of messages (>0) to be retrieved
Returns:
Each retrieved message packed in an array list.
Throws:
UnsupportedFormatException -  
java.lang.IllegalArgumentException - Negative number or zero messages requested
java.io.IOException - Problem reading data from output file

readOldestRecords

public java.util.ArrayList readOldestRecords(int numMsg)
                                      throws java.lang.IllegalArgumentException,
                                             UnsupportedFormatException,
                                             java.io.IOException
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).

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.

Parameters:
numMsg - Number of messages (>0) to be retrieved
Returns:
Each retrieved messages packed in an array list.
Throws:
UnsupportedFormatException -  
java.lang.IllegalArgumentException - Negative number or zero messages requested
java.io.IOException - Problem reading data from output file

readPrevRecords

public java.util.ArrayList readPrevRecords(int numMsg)
                                    throws java.lang.IllegalArgumentException,
                                           UnsupportedFormatException,
                                           java.io.IOException
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).

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.

Parameters:
numMsg - Number of messages(>0) to be retrieved
Returns:
Each retrieved messages packed in an array list.
Throws:
UnsupportedFormatException -  
java.lang.IllegalArgumentException - Negative number or zero messages requested
java.io.IOException - Problem reading data from output file

readNextRecords

public java.util.ArrayList readNextRecords(int numMsg)
                                    throws java.lang.IllegalArgumentException,
                                           UnsupportedFormatException,
                                           java.io.IOException
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).

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.

Parameters:
numMsg - Number of messages(>0) to be retrieved
Returns:
Each retrieved messages packed in an array list.
Throws:
UnsupportedFormatException -  
java.lang.IllegalArgumentException - Negative number or zero messages requested
java.io.IOException - Problem reading data from output file

readLatestMsgRecords

public ILoggingResultSet readLatestMsgRecords(int numMsg)
                                       throws java.lang.IllegalArgumentException,
                                              UnsupportedFormatException,
                                              java.io.IOException
Retrieve the latest n messages and return them in a result set. This method always refers to the newest messages even the output file is growing.
Parameters:
numMsg - Number of messages (>0) to be retrieved
Returns:
Retrieved message records with the overall status in a result set.
Throws:
UnsupportedFormatException -  
java.lang.IllegalArgumentException - Negative number or zero messages requested
java.io.IOException - Problem reading data from output file
See Also:
LoggingResultSet

readOldestMsgRecords

public ILoggingResultSet readOldestMsgRecords(int numMsg)
                                       throws java.lang.IllegalArgumentException,
                                              UnsupportedFormatException,
                                              java.io.IOException
Retrieve the oldest n messages and return them in a result set. 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.
Parameters:
numMsg - Number of messages (>0) to be retrieved
Returns:
Retrieved message records with the overall status in a result set.
Throws:
UnsupportedFormatException -  
java.lang.IllegalArgumentException - Negative number or zero messages requested
java.io.IOException - Problem reading data from output file
See Also:
LoggingResultSet

readPrevMsgRecords

public ILoggingResultSet readPrevMsgRecords(int numMsg)
                                     throws java.lang.IllegalArgumentException,
                                            UnsupportedFormatException,
                                            java.io.IOException
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 readLatestMsgRecords(int) or readOldestMsgRecords(int), this will behave the same as calling readLatestMsgRecords(numMsg) .
Messages are returned in a result set.
Parameters:
numMsg - Number of messages(>0) to be retrieved
Returns:
Retrieved message records with the overall status in a result set.
Throws:
UnsupportedFormatException -  
java.lang.IllegalArgumentException - Negative number or zero messages requested
java.io.IOException - Problem reading data from output file
See Also:
LoggingResultSet

readNextMsgRecords

public ILoggingResultSet readNextMsgRecords(int numMsg)
                                     throws java.lang.IllegalArgumentException,
                                            UnsupportedFormatException,
                                            java.io.IOException
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 readLatestMsgRecords(int) or readOldestMsgRecords(int), this will behave the same as calling readOldestMsgRecords(numMsg) .
Messages are returned in an array list.
Parameters:
numMsg - Number of messages(>0) to be retrieved
Returns:
Retrieved message records with the overall status in a result set.
Throws:
UnsupportedFormatException -  
java.lang.IllegalArgumentException - Negative number or zero messages requested
java.io.IOException - Problem reading data from output file
See Also:
LoggingResultSet

getNextMatch

public ILoggingResultSet getNextMatch(java.lang.String[] searchTokens)
                               throws java.lang.IllegalArgumentException,
                                      UnsupportedFormatException,
                                      java.io.IOException
This method returns LoggingResultSet that contains one or zero LogRecords. If the search is successful, there will be one LogRecord. If not, there will be zero records. It takes an array of strings that need to be searched. For now, the first string in the array is the only one to be searched for (August 8, 2003). In future, searching for multiple strings will be supported.
Parameters:
searchTokens -  
Returns:
A LoggingResultSet of matching LogRecord.
Throws:
java.lang.IllegalArgumentException -  
UnsupportedFormatException -  
java.io.IOException -  

getPreviousMatch

public ILoggingResultSet getPreviousMatch(java.lang.String[] searchTokens)
                                   throws java.lang.IllegalArgumentException,
                                          UnsupportedFormatException,
                                          java.io.IOException
This method returns LoggingResultSet that contains one or zero LogRecords. If the search is successful, there will be one LogRecord. If not, there will be zero records. It takes an array of strings that need to be searched. For now, the first string in the array is the only one to be searched for (August 8, 2003). In future, searching for multiple strings will be supported.
Parameters:
searchTokens -  
Returns:
A LoggingResultSet of matching LogRecord.
Throws:
java.lang.IllegalArgumentException -  
UnsupportedFormatException -  
java.io.IOException -  

getNextMatch

public ILoggingResultSet getNextMatch(java.lang.String[] searchTokens,
                                      boolean ignoreCase)
                               throws java.lang.IllegalArgumentException,
                                      UnsupportedFormatException,
                                      java.io.IOException
This method returns LoggingResultSet that contains one or zero LogRecords. If the search is successful, there will be one LogRecord. If not, there will be zero records. It takes an array of strings that need to be searched. For now, the first string in the array is the only one to be searched for (August 8, 2003). In future, searching for multiple strings will be supported. If ignoreCase is true, it will search for the searchTokens without paying attention to case.
Parameters:
searchTokens -  
ignoreCase -  
Returns:
A LoggingResultSet of matching LogRecord.
Throws:
java.lang.IllegalArgumentException -  
UnsupportedFormatException -  
java.io.IOException -  

getPreviousMatch

public ILoggingResultSet getPreviousMatch(java.lang.String[] searchTokens,
                                          boolean ignoreCase)
                                   throws java.lang.IllegalArgumentException,
                                          UnsupportedFormatException,
                                          java.io.IOException
This method returns LoggingResultSet that contains one or zero LogRecords. If the search is successful, there will be one LogRecord. If not, there will be zero records. It takes an array of strings that need to be searched. For now, the first string in the array is the only one to be searched for (August 8, 2003). In future, searching for multiple strings will be supported. If ignoreCase is true, it will search for the searchTokens without paying attention to case.
Parameters:
searchTokens -  
ignoreCase -  
Returns:
A LoggingResultSet of matching LogRecord.
Throws:
java.lang.IllegalArgumentException -  
UnsupportedFormatException -  
java.io.IOException -  

areLoggingAttributesEditable

public boolean areLoggingAttributesEditable()
This method verifies whether the attributes like severity can be set.
Returns:
boolean true if the attributes can be set and false otherwise.

getLastModified

public long getLastModified()
                     throws java.io.IOException