com.ibm.websphere.logging.hpel.reader

Class RepositoryReaderImpl

  • java.lang.Object
    • com.ibm.websphere.logging.hpel.reader.RepositoryReaderImpl
    • Constructor Detail

      • RepositoryReaderImpl

        public RepositoryReaderImpl(java.lang.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(java.lang.String logDirectory,
                            java.lang.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:
        java.lang.IllegalArgumentException - if both logDirectory and traceDirectory are null.
      • RepositoryReaderImpl

        public RepositoryReaderImpl(java.io.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(java.io.File logLocation,
                            java.io.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:
        java.lang.IllegalArgumentException - if both logLocation and traceLocation are null.
    • Method Detail

      • getLogLocation

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

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

        public static boolean containsLogFiles(java.io.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 java.io.File[] listRepositories(java.io.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 java.lang.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

        public java.lang.Iterable<ServerInstanceLogRecordList> getLogLists(RepositoryPointer after)
        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 java.lang.Iterable<ServerInstanceLogRecordList> getLogLists(java.util.Date beginTime,
                                                                  java.util.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 java.lang.Iterable<ServerInstanceLogRecordList> getLogLists(RepositoryPointer after,
                                                                  java.util.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 java.lang.Iterable<ServerInstanceLogRecordList> getLogLists(java.util.Date beginTime,
                                                                  java.util.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 java.lang.Iterable<ServerInstanceLogRecordList> getLogLists(RepositoryPointer after,
                                                                  java.util.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 java.lang.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 java.lang.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 java.lang.Iterable<ServerInstanceLogRecordList> getLogLists(java.util.logging.Level minLevel,
                                                                  java.util.logging.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 java.lang.Iterable<ServerInstanceLogRecordList> getLogLists(RepositoryPointer after,
                                                                  java.util.logging.Level minLevel,
                                                                  java.util.logging.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 java.lang.Iterable<ServerInstanceLogRecordList> getLogLists(java.util.Date minTime,
                                                                  java.util.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 java.lang.Iterable<ServerInstanceLogRecordList> getLogLists(RepositoryPointer after,
                                                                  java.util.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 java.lang.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

        public java.lang.Iterable<ServerInstanceLogRecordList> getLogLists(RepositoryPointer after,
                                                                  LogQueryBean query)
        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
      • getLogListForServerInstance

        public ServerInstanceLogRecordList getLogListForServerInstance(java.util.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(java.util.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(java.util.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(java.util.Date time,
                                                              java.util.logging.Level minLevel,
                                                              java.util.logging.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,
                                                              java.util.logging.Level minLevel,
                                                              java.util.logging.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(java.util.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(java.util.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:
        LogQueryBean
      • 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:
        LogQueryBean
IBM WebSphere Application ServerTM
Release 9.0