Package com.sun.identity.log.handlers
Class LogReadDBHandler
- java.lang.Object
-
- com.sun.identity.log.handlers.LogReadDBHandler
-
- All Implemented Interfaces:
ReadDBHandler
public class LogReadDBHandler extends Object implements ReadDBHandler
LogReadDBHandler class implements ReadDBHandler 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 DB table, 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).
-
-
Constructor Summary
Constructors Constructor Description LogReadDBHandler()constructor does nothing
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetNumberOfRows(LogManager logMgr, String fileName)Return number of records in each tableString[][]getTableNames(LogManager logMgr)Return table names for each loggerString[][]logRecRead(String tableName, LogQuery logQuery, LogManager logMgr, boolean sourceData)LogReader calls this method.String[][]logRecRead(Set tableNames, LogQuery logQuery, LogManager logMgr, boolean sourceData)LogReader calls this method.
-
-
-
Method Detail
-
logRecRead
public String[][] logRecRead(String tableName, LogQuery logQuery, LogManager logMgr, boolean sourceData) throws IOException, NoSuchFieldException, IllegalArgumentException, RuntimeException, SQLException, Exception
LogReader calls this 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 interfaceReadDBHandler- Parameters:
tableName- db table namelogQuery- is user specified qury chriteria with sorting requirementlogMgr- the log manager associated with this handlersourceData- 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.SQLException- if it fails to process sql query.Exception- if it fails any of operation.
-
logRecRead
public String[][] logRecRead(Set tableNames, LogQuery logQuery, LogManager logMgr, boolean sourceData) throws IOException, NoSuchFieldException, IllegalArgumentException, RuntimeException, SQLException, Exception
LogReader calls this 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 interfaceReadDBHandler- Parameters:
tableNames- db table nameslogQuery- is user specified qury chriteria with sorting requirementlogMgr- the log manager associated with this handlersourceData- 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.SQLException- if it fails to process sql query.Exception- if it fails any of operation.
-
getTableNames
public String[][] getTableNames(LogManager logMgr)
Return table names for each logger- Parameters:
logMgr- Log Manager that is maintaing table names- Returns:
- table names for each logger
-
getNumberOfRows
public long getNumberOfRows(LogManager logMgr, String fileName)
Return number of records in each table- Parameters:
logMgr- Log Manager that is maintaing table names- Returns:
- number of records in each table
-
-