com.sun.enterprise.server.logging.logviewer.backend
Class LogFilter

java.lang.Object
  extended by com.sun.enterprise.server.logging.logviewer.backend.LogFilter

@Service
public class LogFilter
extends java.lang.Object

LogFilter will be used by Admin Too Log Viewer Front End to filter the records. LogMBean delegates the getLogRecordsUsingQuery method to this class static method.


Constructor Summary
LogFilter()
           
 
Method Summary
protected  boolean allChecks(LogFile.LogEntry entry, java.util.Date fromDate, java.util.Date toDate, java.lang.String queryLevel, boolean onlyLevel, java.util.List listOfModules, java.util.Properties nameValueMap, java.lang.String anySearch)
          This method accepts the first line of the Log Record and checks to see if it matches the query.
protected  boolean dateTimeCheck(java.util.Date loggedDateTime, java.util.Date fromDateTime, java.util.Date toDateTime)
           
protected  javax.management.AttributeList fetchRecordsUsingQuery(LogFile logFile, long startingRecord, boolean next, boolean forward, long requestedCount, java.util.Date fromDate, java.util.Date toDate, java.lang.String logLevel, boolean onlyLevel, java.util.List listOfModules, java.util.Properties nameValueMap, java.lang.String anySearch)
          Internal method that will be called from getLogRecordsUsingQuery()
 java.util.Vector getInstanceLogFileNames(java.lang.String instanceName)
           
 LogFile getLogFile()
          This provides access to the LogFile object.
 LogFile getLogFile(java.lang.String fileName)
          This fetches or updates logFileCache entries.
 java.lang.String getLogFileForGivenTarget(java.lang.String targetServerName)
           
 javax.management.AttributeList getLogRecordsUsingQuery(java.lang.String logFileName, java.lang.Long fromRecord, java.lang.Boolean next, java.lang.Boolean forward, java.lang.Integer requestedCount, java.util.Date fromDate, java.util.Date toDate, java.lang.String logLevel, java.lang.Boolean onlyLevel, java.util.List listOfModules, java.util.Properties nameValueMap, java.lang.String anySearch)
          The public method that Log Viewer Front End will be calling on.
 javax.management.AttributeList getLogRecordsUsingQuery(java.lang.String logFileName, java.lang.Long fromRecord, java.lang.Boolean next, java.lang.Boolean forward, java.lang.Integer requestedCount, java.util.Date fromDate, java.util.Date toDate, java.lang.String logLevel, java.lang.Boolean onlyLevel, java.util.List listOfModules, java.util.Properties nameValueMap, java.lang.String anySearch, java.lang.String instanceName)
           
protected  boolean levelCheck(java.lang.String loggedLevel, java.lang.String queryLevelIn, boolean isOnlyLevelFlag)
           
protected  boolean messageDataCheck(java.lang.String message, java.lang.String nvp, java.lang.String anySearch)
           
protected  boolean moduleCheck(java.lang.String loggerName, java.util.List modules)
           
protected  boolean nameValueCheck(java.lang.String loggedNameValuePairs, java.util.Properties queriedNameValueMap)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogFilter

public LogFilter()
Method Detail

getLogRecordsUsingQuery

public javax.management.AttributeList getLogRecordsUsingQuery(java.lang.String logFileName,
                                                              java.lang.Long fromRecord,
                                                              java.lang.Boolean next,
                                                              java.lang.Boolean forward,
                                                              java.lang.Integer requestedCount,
                                                              java.util.Date fromDate,
                                                              java.util.Date toDate,
                                                              java.lang.String logLevel,
                                                              java.lang.Boolean onlyLevel,
                                                              java.util.List listOfModules,
                                                              java.util.Properties nameValueMap,
                                                              java.lang.String anySearch)
The public method that Log Viewer Front End will be calling on. The query will be run on records starting from the fromRecord. If any of the elements for the query is null, then that element will not be used for the query. If the user is interested in viewing only records whose Log Level is SEVERE and WARNING, then the query would look like:

fromDate = null, toDate = null, logLevel = WARNING, onlyLevel = false, listOfModules = null, nameValueMap = null.

Parameters:
logFileName - The LogFile to use to run the query. If null the current server.log will be used. This is not the absolute file name, just the fileName needs to be passed. We will use the parent directory of the previous server.log to build the absolute file name.
fromRecord - The location within the LogFile
next - True to get the next set of results, false to get the previous set
forward - True to search forward through the log file
requestedCount - The # of desired return values
fromDate - The lower bound date
toDate - The upper bound date
logLevel - The minimum log level to display
onlyLevel - True to only display messsage for "logLevel"
listOfModules - List of modules to match
nameValueMap - NVP's to match
Returns:

getInstanceLogFileNames

public java.util.Vector getInstanceLogFileNames(java.lang.String instanceName)

getLogFileForGivenTarget

public java.lang.String getLogFileForGivenTarget(java.lang.String targetServerName)
                                          throws java.io.IOException
Throws:
java.io.IOException

getLogRecordsUsingQuery

public javax.management.AttributeList getLogRecordsUsingQuery(java.lang.String logFileName,
                                                              java.lang.Long fromRecord,
                                                              java.lang.Boolean next,
                                                              java.lang.Boolean forward,
                                                              java.lang.Integer requestedCount,
                                                              java.util.Date fromDate,
                                                              java.util.Date toDate,
                                                              java.lang.String logLevel,
                                                              java.lang.Boolean onlyLevel,
                                                              java.util.List listOfModules,
                                                              java.util.Properties nameValueMap,
                                                              java.lang.String anySearch,
                                                              java.lang.String instanceName)

fetchRecordsUsingQuery

protected javax.management.AttributeList fetchRecordsUsingQuery(LogFile logFile,
                                                                long startingRecord,
                                                                boolean next,
                                                                boolean forward,
                                                                long requestedCount,
                                                                java.util.Date fromDate,
                                                                java.util.Date toDate,
                                                                java.lang.String logLevel,
                                                                boolean onlyLevel,
                                                                java.util.List listOfModules,
                                                                java.util.Properties nameValueMap,
                                                                java.lang.String anySearch)
Internal method that will be called from getLogRecordsUsingQuery()


getLogFile

public LogFile getLogFile()
This provides access to the LogFile object.


getLogFile

public LogFile getLogFile(java.lang.String fileName)
This fetches or updates logFileCache entries.

_REVISIT_: We may want to limit the entries here as each logFile takes up so much of memory to maintain indexes


allChecks

protected boolean allChecks(LogFile.LogEntry entry,
                            java.util.Date fromDate,
                            java.util.Date toDate,
                            java.lang.String queryLevel,
                            boolean onlyLevel,
                            java.util.List listOfModules,
                            java.util.Properties nameValueMap,
                            java.lang.String anySearch)
This method accepts the first line of the Log Record and checks to see if it matches the query.


dateTimeCheck

protected boolean dateTimeCheck(java.util.Date loggedDateTime,
                                java.util.Date fromDateTime,
                                java.util.Date toDateTime)

levelCheck

protected boolean levelCheck(java.lang.String loggedLevel,
                             java.lang.String queryLevelIn,
                             boolean isOnlyLevelFlag)

moduleCheck

protected boolean moduleCheck(java.lang.String loggerName,
                              java.util.List modules)

nameValueCheck

protected boolean nameValueCheck(java.lang.String loggedNameValuePairs,
                                 java.util.Properties queriedNameValueMap)

messageDataCheck

protected boolean messageDataCheck(java.lang.String message,
                                   java.lang.String nvp,
                                   java.lang.String anySearch)


Copyright © 2012 GlassFish Community. All Rights Reserved.