Class RepositoryReaderImpl

java.lang.Object
com.ibm.websphere.logging.hpel.reader.RepositoryReaderImpl
All Implemented Interfaces:
RepositoryReader

public class RepositoryReaderImpl extends Object implements RepositoryReader
Implementation of the RepositoryReader providing access to a local HPEL repository.
  • Constructor Details

    • RepositoryReaderImpl

      public RepositoryReaderImpl(String directory)
      creates RepositoryReader instance working on the binary log set.
      Parameters:
      directory - or zip file containing log and/or trace files.
    • RepositoryReaderImpl

      public RepositoryReaderImpl(String logDirectory, String traceDirectory)
      Creates RepositoryReader instance working on the binary log set and trace log set. This allows for a merging of repositories in directories which may not be adjacent.
      Parameters:
      logDirectory - containing log files. If this is null, then use trace only
      traceDirectory - containing log files. If this is null, then use log only
      Throws:
      IllegalArgumentException - if both logDirectory and traceDirectory are null.
    • RepositoryReaderImpl

      public RepositoryReaderImpl(File directory)
      creates RepositoryReader instance working on the binary log set.
      Parameters:
      directory - or zip file containing log and/or trace files.
    • RepositoryReaderImpl

      public RepositoryReaderImpl(File logLocation, File traceLocation)
      Creates RepositoryReader instance working on the binary log set and trace log set. This allows for a merging of repositories in directories which may not be adjacent.
      Parameters:
      logLocation - containing log files. If this is null, then use trace only
      traceLocation - containing log files. If this is null, then use log only
      Throws:
      IllegalArgumentException - if both logLocation and traceLocation are null.
  • Method Details

    • getLogLocation

      public String getLogLocation()
      Returns log directory used by this reader.
      Returns:
      absolute path to log directory.
    • getTraceLocation

      public String getTraceLocation()
      Returns trace directory used by this reader.
      Returns:
      absolute path to trace directory.
    • containsLogFiles

      public static boolean containsLogFiles(File location)
      checks if specified location contains log files.
      Parameters:
      location - to check.
      Returns:
      true if the directory itself or known subdirectories contain log files.
    • listRepositories

      public static File[] listRepositories(File parent)
      list subdirectories containing repository files.
      Parameters:
      parent - the directory to check subdirectories in.
      Returns:
      list of subdirectory names containing repository files.
    • getLogLists

      public Iterable<ServerInstanceLogRecordList> getLogLists()
      returns log records from the binary repository
      Specified by:
      getLogLists in interface RepositoryReader
      Returns:
      the iterable instance of a list of log records If no records are available, the iterable has no entries
    • getLogLists

      returns log records from the binary repository that are within the date range and which satisfy condition of the filter as specified by the parameters.
      Specified by:
      getLogLists in interface RepositoryReader
      Parameters:
      after - pointer to the a repository location where the query should start. Only includes records after this point
      Returns:
      the iterable instance of a list of log records within a process that are within the parameter range and satisfy the condition. If no records exist after the location, an Iterable is returned with no entries
    • getLogLists

      public Iterable<ServerInstanceLogRecordList> getLogLists(Date beginTime, Date endTime, LogRecordHeaderFilter filter)
      returns log records from the binary repository that are within the date range and which satisfy condition of the filter as specified by the parameters.
      Parameters:
      beginTime - the minimum Date value that the returned records can have
      endTime - the maximum Date value that the returned records can have
      filter - an instance implementing LogRecordHeaderFilter interface to verify one record at a time.
      Returns:
      the iterable instance of a list of log records within a process that are within the parameter range and satisfy the condition. If no records meet the criteria, an Iterable is returned with no entries
    • getLogLists

      public Iterable<ServerInstanceLogRecordList> getLogLists(RepositoryPointer after, Date endTime, LogRecordHeaderFilter filter)
      returns log records from the binary repository that are beyond a given repository location, occured before a given time, and meet a filter condition as specified by the parameters. Callers would have to invoke RepositoryLogRecordHeader.getRepositoryPointer() to obtain the RepositoryPointer of the last record read.
      Parameters:
      after - RepositoryPointer of the last read log record.
      endTime - the maximum Date value that the returned records can have
      filter - an instance implementing LogRecordHeaderFilter interface to verify one record at a time.
      Returns:
      the iterable instance of a list of log records within a process that are within the parameter range and satisfy the condition. If no records meet the criteria, an Iterable is returned with no entries
    • getLogLists

      public Iterable<ServerInstanceLogRecordList> getLogLists(Date beginTime, Date endTime, LogRecordFilter filter)
      returns log records from the binary repository that are within the date range and which satisfy condition of the filter as specified by the parameters.
      Parameters:
      beginTime - the minimum Date value that the returned records can have
      endTime - the maximum Date value that the returned records can have
      filter - an instance implementing LogRecordFilter interface to verify one record at a time.
      Returns:
      the iterable instance of a list of log records within a process that are within the parameter range and satisfy the condition. If no records meet the criteria, an Iterable is returned with no entries
    • getLogLists

      public Iterable<ServerInstanceLogRecordList> getLogLists(RepositoryPointer after, Date endTime, LogRecordFilter filter)
      returns log records from the binary repository that are beyond a given repository location, occured before a given time, and meet a filter condition as specified by the parameters. Callers would have to invoke RepositoryLogRecordHeader.getRepositoryPointer() to obtain the RepositoryPointer of the last record read.
      Parameters:
      after - RepositoryPointer of the last read log record.
      endTime - the maximum Date value that the returned records can have
      filter - an instance implementing LogRecordFilter interface to verify one record at a time.
      Returns:
      the iterable instance of a list of log records within a process that are within the parameter range and satisfy the condition. If no records meet the criteria, an Iterable is returned with no entries
    • getLogLists

      public Iterable<ServerInstanceLogRecordList> getLogLists(int minLevel, int maxLevel)
      returns log records from the binary repository that are within the level range as specified by the parameters.
      Parameters:
      minLevel - integer value of the minimum Level that the returned records need to match
      maxLevel - integer value of the maximum Level that the returned records need to match
      Returns:
      the iterable instance of a list of log records within a process that are within the parameter range If no records meet the criteria, an Iterable is returned with no entries
    • getLogLists

      public Iterable<ServerInstanceLogRecordList> getLogLists(RepositoryPointer after, int minLevel, int maxLevel)
      returns log records from the binary repository beyond the given repository pointer and within the level range as specified by the parameters. Callers would have to invoke RepositoryLogRecordHeader.getRepositoryPointer() to obtain the RepositoryPointer of the last record read.
      Parameters:
      after - RepositoryPointer of the last read log record.
      minLevel - integer value of the minimum Level that the returned records need to match
      maxLevel - integer value of the maximum Level that the returned records need to match
      Returns:
      the iterable instance of a list of log records within a process that are within the parameter range If no records meet the criteria, an Iterable is returned with no entries
    • getLogLists

      public Iterable<ServerInstanceLogRecordList> getLogLists(Level minLevel, Level maxLevel)
      returns log records from the binary repository beyond the given repository pointer and within the level range as specified by the parameters. Callers would have to invoke RepositoryLogRecordHeader.getRepositoryPointer() to obtain the RepositoryPointer of the last record read.
      Specified by:
      getLogLists in interface RepositoryReader
      Parameters:
      minLevel - integer value of the minimum Level that the returned records need to match
      maxLevel - integer value of the maximum Level that the returned records need to match
      Returns:
      the iterable instance of a list of log records within a process that are within the parameter range If no records meet the criteria, an Iterable is returned with no entries
    • getLogLists

      public Iterable<ServerInstanceLogRecordList> getLogLists(RepositoryPointer after, Level minLevel, Level maxLevel)
      returns log records from the binary repository beyond the given repository pointer and within the level range as specified by the parameters. Callers would have to invoke RepositoryLogRecordHeader.getRepositoryPointer() to obtain the RepositoryPointer of the last record read.
      Specified by:
      getLogLists in interface RepositoryReader
      Parameters:
      after - RepositoryPointer of the last read log record.
      minLevel - Level value of the minimum Level that the returned records need to match
      maxLevel - Level value of the maximum Level that the returned records need to match
      Returns:
      the iterable instance of a list of log records within a process that are within the parameter range If no records meet the criteria, an Iterable is returned with no entries
    • getLogLists

      public Iterable<ServerInstanceLogRecordList> getLogLists(Date minTime, Date maxTime)
      returns log records from the binary repository that are between 2 dates (inclusive)
      Specified by:
      getLogLists in interface RepositoryReader
      Parameters:
      minTime - the minimum Date value that the returned records can have
      maxTime - the maximum Date value that the returned records can have
      Returns:
      the iterable instance of a list of log records within a process that are within the parameter range and satisfy the condition. If no records meet the criteria, an Iterable is returned with no entries
    • getLogLists

      public Iterable<ServerInstanceLogRecordList> getLogLists(RepositoryPointer after, Date maxTime)
      returns log records from the binary repository that are after a given location and less than or equal to a given date Callers would have to invoke RepositoryLogRecordHeader.getRepositoryPointer() to obtain the RepositoryPointer of the last record read.
      Specified by:
      getLogLists in interface RepositoryReader
      Parameters:
      after - RepositoryPointer of the last read log record.
      maxTime - the maximum Date value that the returned records can have
      Returns:
      the iterable instance of a list of log records within a process that are within the parameter range and satisfy the condition. If no records meet the criteria, an Iterable is returned with no entries
    • getLogLists

      public Iterable<ServerInstanceLogRecordList> getLogLists(LogQueryBean query)
      Description copied from interface: RepositoryReader
      returns log records from the repository according to the criteria specified by the log query bean.
      Specified by:
      getLogLists in interface RepositoryReader
      Parameters:
      query - LogQueryBean instance representing set of criteria each of which need to be met by the return records.
      Returns:
      the iterable instance of a list of log records within a process that are within the parameter range If no records meet the criteria, an Iterable is returned with no entries
    • getLogLists

      Description copied from interface: RepositoryReader
      returns log records from the repository that are beyond a given repository location, according to the criteria specified by the log query bean.
      Specified by:
      getLogLists in interface RepositoryReader
      Parameters:
      after - pointer to a record the list will start after
      query - LogQueryBean instance representing set of criteria each of which need to be met by the return records.
      Returns:
      the iterable instance of a list of log records within a process that are within the parameter range If no records meet the criteria, an Iterable is returned with no entries
    • getLogListForCurrentServerInstance

      public ServerInstanceLogRecordList getLogListForCurrentServerInstance()
      Description copied from interface: RepositoryReader
      returns log records from the repository that were created since the last server startup.
      Specified by:
      getLogListForCurrentServerInstance in interface RepositoryReader
      Returns:
      the iterable list of log records If no records meet the criteria, an Iterable is returned with no entries
    • getLogListForServerInstance

      public ServerInstanceLogRecordList getLogListForServerInstance(Date time)
      Description copied from interface: RepositoryReader
      returns log records from the repository of a server instance running at the time specified.
      Specified by:
      getLogListForServerInstance in interface RepositoryReader
      Parameters:
      time - Date value used to determine the server instance where the server start time occurs before this value and the server stop time occurs after this value
      Returns:
      the iterable list of log records If no records meet the criteria, a list is returned with a null properties object and a null record list
    • getLogListForServerInstance

      public ServerInstanceLogRecordList getLogListForServerInstance(RepositoryPointer after)
      Description copied from interface: RepositoryReader
      returns log records from the repository that are beyond a given repository location as specified. Callers need to invoke RepositoryLogRecordHeader.getRepositoryPointer() to obtain the RepositoryPointer for a particular log record. The returned logs will be from one server instance.
      Specified by:
      getLogListForServerInstance in interface RepositoryReader
      Parameters:
      after - pointer to a record the list will start after
      Returns:
      the iterable list of log records If no records meet the criteria, the list is empty.
    • getLogListForServerInstance

      public ServerInstanceLogRecordList getLogListForServerInstance(Date time, LogRecordHeaderFilter filter)
      returns log records from the binary repository which satisfy condition of the filter as specified by the parameter. The returned logs will be from the same server instance. The server instance will be determined by the time as specified by the parameter.
      Parameters:
      time - the Date time value used to determine the server instance where the server start time occurs before this value and the server stop time occurs after this value
      filter - an instance implementing LogRecordHeaderFilter interface to verify one record at a time.
      Returns:
      the iterable list of log records
    • getLogListForServerInstance

      public ServerInstanceLogRecordList getLogListForServerInstance(RepositoryPointer after, LogRecordHeaderFilter filter)
      returns log records from the binary repository that are beyond a given repository location and satisfies the filter criteria as specified by the parameters. Callers would have to invoke RepositoryLogRecordHeader.getRepositoryPointer() to obtain the RepositoryPointer of the last record read. The returned logs will be from the same server instance.
      Parameters:
      after - RepositoryPointer of the last read log record.
      filter - an instance implementing LogRecordHeaderFilter interface to verify one record at a time.
      Returns:
      the iterable list of log records
    • getLogListForServerInstance

      public ServerInstanceLogRecordList getLogListForServerInstance(Date time, LogRecordFilter filter)
      returns log records from the binary repository which satisfy condition of the filter as specified by the parameter. The returned logs will be from the same server instance. The server instance will be determined by the time as specified by the parameter.
      Parameters:
      time - the Date time value used to determine the server instance where the server start time occurs before this value and the server stop time occurs after this value
      filter - an instance implementing LogRecordFilter interface to verify one record at a time.
      Returns:
      the iterable list of log records
    • getLogListForServerInstance

      public ServerInstanceLogRecordList getLogListForServerInstance(RepositoryPointer after, LogRecordFilter filter)
      returns log records from the binary repository that are beyond a given repository location and satisfies the filter criteria as specified by the parameters. Callers would have to invoke RepositoryLogRecordHeader.getRepositoryPointer() to obtain the RepositoryPointer of the last record read. The returned logs will be from the same server instance.
      Parameters:
      after - RepositoryPointer of the last read log record.
      filter - an instance implementing LogRecordFilter interface to verify one record at a time.
      Returns:
      the iterable list of log records
    • getLogListForServerInstance

      public ServerInstanceLogRecordList getLogListForServerInstance(Date time, Level minLevel, Level maxLevel)
      Description copied from interface: RepositoryReader
      returns log records from the repository of a server instance running at a specified time, within the level range as specified.
      Specified by:
      getLogListForServerInstance in interface RepositoryReader
      Parameters:
      time - Date value used to determine the server instance where the server start time occurs before this value and the server stop time occurs after this value
      minLevel - minimum Level that will be included in the returned list
      maxLevel - maximum Level that will be included in the returned list
      Returns:
      the iterable list of log records If no records meet the criteria, the list is empty.
    • getLogListForServerInstance

      public ServerInstanceLogRecordList getLogListForServerInstance(RepositoryPointer after, Level minLevel, Level maxLevel)
      Description copied from interface: RepositoryReader
      returns log records from the repository that are beyond a given repository location and within the level range as specified. Callers need to invoke RepositoryLogRecordHeader.getRepositoryPointer() to obtain the RepositoryPointer for a particular log record. The returned logs will be from one server instance.
      Specified by:
      getLogListForServerInstance in interface RepositoryReader
      Parameters:
      after - pointer to a record the list will start after
      minLevel - minimum Level that will be included in the returned list
      maxLevel - maximum Level that will be included in the returned list
      Returns:
      the iterable list of log records If no records meet the criteria, the list is empty.
    • getLogListForServerInstance

      public ServerInstanceLogRecordList getLogListForServerInstance(Date time, int threadID)
      Description copied from interface: RepositoryReader
      returns log records from the repository of a server instance running at a specified time created by the given thread.
      Specified by:
      getLogListForServerInstance in interface RepositoryReader
      Parameters:
      time - Date value used to determine the server instance where the server start time occurs before this value and the server stop time occurs after this value
      threadID - ID of the thread that the returned records will match
      Returns:
      the iterable list of log records If no records meet the criteria, the list is empty.
    • getLogListForServerInstance

      public ServerInstanceLogRecordList getLogListForServerInstance(RepositoryPointer after, int threadID)
      Description copied from interface: RepositoryReader
      returns log records from the repository that are beyond a given repository location and created by a given thread as specified. Callers need to invoke RepositoryLogRecordHeader.getRepositoryPointer() to obtain the RepositoryPointer for a particular log record. The returned logs will be from one server instance.
      Specified by:
      getLogListForServerInstance in interface RepositoryReader
      Parameters:
      after - pointer to a record the list will start after
      threadID - ID of the thread that the returned records will match
      Returns:
      the iterable list of log records If no records meet the criteria, the list is empty.
    • getLogListForServerInstance

      public ServerInstanceLogRecordList getLogListForServerInstance(Date time, LogQueryBean query)
      Description copied from interface: RepositoryReader
      returns log records from the repository of a server instance running at a specified time, according to the criteria specified by the log query bean.
      Specified by:
      getLogListForServerInstance in interface RepositoryReader
      Parameters:
      time - Date value used to determine the server instance where the server start time occurs before this value and the server stop time occurs after this value
      query - LogQueryBean instance representing set of criteria each of which need to be met by the return records.
      Returns:
      the iterable list of log records If no records meet the criteria, the list is empty.
      See Also:
    • getLogListForServerInstance

      public ServerInstanceLogRecordList getLogListForServerInstance(RepositoryPointer after, LogQueryBean query)
      Description copied from interface: RepositoryReader
      returns log records from the repository for one server instance that are beyond a given repository location, according to the criteria specified by the log query bean.
      Specified by:
      getLogListForServerInstance in interface RepositoryReader
      Parameters:
      after - pointer to a record the list will start after
      query - LogQueryBean instance representing set of criteria each of which need to be met by the return records.
      Returns:
      the iterable list of log records If no records meet the criteria, the list is empty.
      See Also: