Package com.sun.identity.log.handlers
Class LogReadFileHandler
- java.lang.Object
-
- com.sun.identity.log.handlers.LogReadFileHandler
-
- All Implemented Interfaces:
LogReadHandler
public class LogReadFileHandler extends Object implements LogReadHandler
LogReadFileHandler class implements LogReadHandler interface. This class name will be stored as a configuration parameter. LogReader will instantiate it at run time (when messages are logged into file). This class reads the disk file, applies query if any, sorts records on field name when required, collects most recent records (default option) or all records. It returns result 2D String to the caller (LogReader), it also exports a method that returns archived filename present in current set.
-
-
Constructor Summary
Constructors Constructor Description LogReadFileHandler()constructor does nothing
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String[][]logRecRead(String fileName, LogQuery logQuery, boolean sourceData)LogReader calls this method method.String[][]logRecRead(Set fileNames, LogQuery logQuery, boolean sourceData)LogReader calls this method method.
-
-
-
Method Detail
-
logRecRead
public String[][] logRecRead(String fileName, LogQuery logQuery, boolean sourceData) throws IOException, NoSuchFieldException, IllegalArgumentException, RuntimeException, Exception
LogReader calls this method method. It collects header, records, applies query (if any), sorts (if asked) the records on field, checks the max records to return, collects all the recods and returns.- Specified by:
logRecReadin interfaceLogReadHandler- Parameters:
fileName- is complete filename with pathlogQuery- is user specified qury chriteria with sorting requirementsourceData- it specifies whether return data should be original data received by logger (source) or formatted data as in file.- Returns:
- all the matched records with query
- Throws:
IOException- if it fails to read log records.NoSuchFieldException- if it fails to retrieve the name of field.IllegalArgumentException- if query has wrong value.RuntimeException- if it fails to retrieve log record.Exception- if it fails any of operation.
-
logRecRead
public String[][] logRecRead(Set fileNames, LogQuery logQuery, boolean sourceData) throws IOException, NoSuchFieldException, IllegalArgumentException, RuntimeException, Exception
LogReader calls this method method. It collects header, records, applies query (if any), sorts (if asked) the records on field, checks the max records to return, collects all the recods and returns.- Specified by:
logRecReadin interfaceLogReadHandler- Parameters:
fileNames- is a Set of filenames complete with pathlogQuery- is user specified qury chriteria with sorting requirementsourceData- it specifies whether return data should be original data received by logger (source) or formatted data as in file.- Returns:
- all the matched records with query
- Throws:
IOException- if it fails to read log records.NoSuchFieldException- if it fails to retrieve the name of field.IllegalArgumentException- if query has wrong value.RuntimeException- if it fails to retrieve log record.Exception- if it fails any of operation.
-
-