com.ibm.websphere.logging.hpel.reader

Interface ServerInstanceLogRecordList

  • All Superinterfaces:
    java.lang.Iterable<RepositoryLogRecord>


    public interface ServerInstanceLogRecordList
    extends java.lang.Iterable<RepositoryLogRecord>
    A list of log records originating from one process.

    Example of intended usage:

     for (ServerInstanceLogRecordList pid: reader.getLogListForCurrentServerInstance()) {
            Properties header = pid.getHeader();
            <process header>
            for (RepositoryLogRecord record: pid) {
                    <process record>
            }
            pid.close();
     }
     
    An extension for z/OS to start with a controller and get all servants (and merge them) can be seen at MergedRepository Take special note of the getChildren method on the ServerInstanceLogRecordList object. An example of getting all records for the controller and all servants on z/OS could look like this:
     for (ServerInstanceLogRecordList pid: reader.getLogListForCurrentServerInstance()) {
            Properties header = pid.getHeader();
            <process header>
            for (RepositoryLogRecord record: pid) { // This PID is the controller
                    <process controller record>
            }
      MapservantMap = pid.getChildren() ;
      Iterator servantKeys = servantMap.keySet().iterator() ;
      while (servantKeys.hasNext()) {
            // Map label has key information to identify which child process. This can be used to get just one servant,
          //  here we are going to print the results for all servants
            String label = servantKeys.next() ;                     
            ServerInstanceLogRecordList servantRecs = servantMap.get(label) ;       // Extract the child process ServerInstanceLogRecordList
          Properties subHeader = servantRecs.getHeader() ;
                for (RepositoryLogRecord subRec: servantRecs) {             // Pull all records for this servant
                        <process servant record>
                }
            servantRecs.close() ;           
      }
    
            pid.close();
     }
     
    • Method Detail

      • getHeader

        java.util.Properties getHeader()
        Returns the header belonging to records from this process. These properties help describe the process and environment that the log records originated from.
        Returns:
        properties belonging to all records in this list.
      • range

        java.lang.Iterable<RepositoryLogRecord> range(int offset,
                                                    int length)
        Returns a subset of records from this query result.

        Example of use:

        • range(offset, length) returns iterator over the length records after skipping first offset records.
        • range(offset, -1) returns iterator over the rest of records after skipping first offset records.
        • range(-offset, length) returns iterator over the length records starting with offset record before last.
        • range(0, -1) returns iterator over all records in the result.
        Parameters:
        offset - the number of records to skip from the beginning of the result. A negative value means to skip -offset records from the end of the result. Values greater than #size() will result in an empty subset being returned.
        length - the maximum number of records to include in this subset. A negative value means that all records starting from the offset are returned.
        Returns:
        Iterable instance listing records in the subset.
      • getChildren

        java.util.Map<java.lang.String,ServerInstanceLogRecordList> getChildren()
        Returns the children for the process of a ServerInstanceLogRecordList. ServerInstanceLogRecordList represents the log records for a given process. A process with subprocesses will return a map with each child subprocess represented by a ServerInstanceLogRecordList. The key to each entry is computed internally, and the caller must invoke this method in order to obtain the valid key for a specific entry.
        Returns:
        the map that represents the children. Each child subprocess is an entry in the map.
      • getStartTime

        java.util.Date getStartTime()
        Returns start time of this instance. Start time is the time of the first log or trace record written by this instance.
        Returns:
        start time as a Date object or null if time can not be obtained.
IBM WebSphere Application ServerTM
Release 8.5