public RemoteInstanceResult getLogListForServerInstance ( RemoteInstanceDetails indicator , RepositoryPointer after , int offset , int maxRecords , Locale locale ) throws LogRepositoryException { ServerInstanceLogRecordList instance ; // Pointer should be used only if start time is null. This way the same query object can be reused // for different server instances and start time value will indicate if pointer should be used. if ( after == null ) { instance = logReader . getLogListForServerInstance ( indicator . getStartTime ( ) , indicator . getQuery ( ) ) ; for ( String key : indicator . getProcPath ( ) ) { instance = instance . getChildren ( ) . get ( key ) ; if ( instance == null ) { // Specified subprocess is not found (most probably it was purged already). Return an empty result. return new RemoteInstanceResult ( null , null , new HashSet < String > ( ) ) ; } } } else { instance = logReader . getLogListForServerInstance ( after , indicator . getQuery ( ) ) ; } RemoteInstanceResult result ; // Return start time, header, and subprocess info only on the first request (where cache is not set yet). if ( indicator . getCache ( ) == null ) { result = new RemoteInstanceResult ( instance . getStartTime ( ) , instance . getHeader ( ) , instance . getChildren ( ) . keySet ( ) ) ; } else { result = new RemoteInstanceResult ( null , null , new HashSet < String > ( ) ) ; if ( instance instanceof ServerInstanceLogRecordListImpl ) { ( ( ServerInstanceLogRecordListImpl ) instance ) . setCache ( indicator . getCache ( ) ) ; } } // Allow maxRecords to be 0 if caller is interested in instance header only. if ( maxRecords != 0 ) { for ( RepositoryLogRecord record : instance . range ( offset , maxRecords ) ) { if ( locale != null && ! locale . toString ( ) . equals ( record . getMessageLocale ( ) ) && record instanceof RepositoryLogRecordImpl ) { RepositoryLogRecordImpl recordImpl = ( RepositoryLogRecordImpl ) record ; recordImpl . setLocalizedMessage ( HpelFormatter . translateMessage ( record , locale ) ) ; recordImpl . setMessageLocale ( locale . toString ( ) ) ; } result . addRecord ( record ) ; } } // Return cache back only if caller does not have complete set if ( instance instanceof ServerInstanceLogRecordListImpl && ( indicator . getCache ( ) == null || ! indicator . getCache ( ) . isComplete ( ) ) ) { result . setCache ( ( ( ServerInstanceLogRecordListImpl ) instance ) . getCache ( ) ) ; } return result ; }
retrieves records and header for one server instance .