public static String[][] read(Set fileNames,LogQuery logQuery,Object userCrdential) throws IOException, NoSuchFieldException, IllegalArgumentException, RuntimeException, Exception {
  LogReader lr=new LogReader();
  lr.readConfiguration();
  if (fileNames == null) {
    throw new IllegalArgumentException("filenames can't be null");
  }
  if (fileNames.isEmpty()) {
    throw new IllegalArgumentException("filenames can't be empty");
  }
 else {
    for (Iterator it=fileNames.iterator(); it.hasNext(); ) {
      String ss=(String)it.next();
      if (ss != null) {
        ss=ss.trim();
      }
      if ((ss == null) || (ss.length() == 0)) {
        throw new IllegalArgumentException("filename cannot be null");
      }
    }
  }
  if (maxReordToReturn <= 0) {
    maxReordToReturn=1;
  }
  if (logQuery != null) {
    if (logQuery.getNumRecordsWanted() < LogQuery.ALL_RECORDS) {
      logQuery.setMaxRecord(maxReordToReturn);
    }
 else     if ((logQuery.getNumRecordsWanted() == LogQuery.MOST_RECENT_MAX_RECORDS) && (logTypeIsFile)) {
      logQuery.setMaxRecord(maxReordToReturn);
    }
  }
 else {
    logQuery=new LogQuery(maxReordToReturn);
  }
  String tmpF=getAllFilenames(fileNames);
  setLoggerName(tmpF);
  if (lr.isAllowed(userCrdential) != true) {
    throw new AMLogException(tmpF + ":" + AMLogException.LOG_RD_AUTH_FAILED);
  }
  if (logTypeIsFile) {
    Set fullFileNames=new HashSet();
    for (Iterator it=fileNames.iterator(); it.hasNext(); ) {
      String ss=(String)it.next();
      ss=logPathName + ss;
      fullFileNames.add(ss);
    }
    queryResult=currentHandler.logRecRead(fullFileNames,logQuery,true);
  }
 else {
    queryResult=currentDBHandler.logRecRead(fileNames,logQuery,manager,true);
  }
  return queryResult;
}

public static String [ ] [ ] read ( Set fileNames , LogQuery logQuery , Object userCrdential ) throws IOException , NoSuchFieldException , IllegalArgumentException , RuntimeException , Exception { LogReader lr = new LogReader ( ) ; lr . readConfiguration ( ) ; if ( fileNames == null ) { throw new IllegalArgumentException ( "filenames can't be null" ) ; } if ( fileNames . isEmpty ( ) ) { throw new IllegalArgumentException ( "filenames can't be empty" ) ; } else { for ( Iterator it = fileNames . iterator ( ) ; it . hasNext ( ) ; ) { String ss = ( String ) it . next ( ) ; if ( ss != null ) { ss = ss . trim ( ) ; } if ( ( ss == null ) || ( ss . length ( ) == 0 ) ) { throw new IllegalArgumentException ( "filename cannot be null" ) ; } } } if ( maxReordToReturn <= 0 ) { maxReordToReturn = 1 ; } if ( logQuery != null ) { if ( logQuery . getNumRecordsWanted ( ) < LogQuery . ALL_RECORDS ) { logQuery . setMaxRecord ( maxReordToReturn ) ; } else if ( ( logQuery . getNumRecordsWanted ( ) == LogQuery . MOST_RECENT_MAX_RECORDS ) && ( logTypeIsFile ) ) { logQuery . setMaxRecord ( maxReordToReturn ) ; } } else { logQuery = new LogQuery ( maxReordToReturn ) ; } String tmpF = getAllFilenames ( fileNames ) ; setLoggerName ( tmpF ) ; if ( lr . isAllowed ( userCrdential ) != true ) { throw new AMLogException ( tmpF + ":" + AMLogException . LOG_RD_AUTH_FAILED ) ; } if ( logTypeIsFile ) { Set fullFileNames = new HashSet ( ) ; for ( Iterator it = fileNames . iterator ( ) ; it . hasNext ( ) ; ) { String ss = ( String ) it . next ( ) ; ss = logPathName + ss ; fullFileNames . add ( ss ) ; } queryResult = currentHandler . logRecRead ( fullFileNames , logQuery , true ) ; } else { queryResult = currentDBHandler . logRecRead ( fileNames , logQuery , manager , true ) ; } return queryResult ; }
retrieves specific records in a given sorted order on specific field ( if user specifies valid sorting by field ) . the api also needs the user has a successful authorization .
