org.apache.directory.server.log.impl
Class DefaultLogScanner

java.lang.Object
  extended by org.apache.directory.server.log.impl.DefaultLogScanner
All Implemented Interfaces:
LogScanner

public class DefaultLogScanner
extends Object
implements LogScanner


Constructor Summary
DefaultLogScanner(LogAnchor startingLogAnchor, org.apache.directory.server.log.impl.LogFileManager logFileManger)
           
 
Method Summary
 void close()
          Closes the scanner and releases any resources.
 long getLastGoodFileNumber()
          Returns the last successfully read log file number
 long getLastGoodOffset()
          Returns the last successfully read log file number
 boolean getNextRecord(UserLogRecord logRecord)
          Reads and returns the next user record from the log into a backing byte array and returns a reference to it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultLogScanner

public DefaultLogScanner(LogAnchor startingLogAnchor,
                         org.apache.directory.server.log.impl.LogFileManager logFileManger)
Method Detail

getNextRecord

public boolean getNextRecord(UserLogRecord logRecord)
                      throws IOException,
                             InvalidLogException
Reads and returns the next user record from the log into a backing byte array and returns a reference to it. Returned array can be overwritten after the next call to getNextRecord()

Specified by:
getNextRecord in interface LogScanner
Returns:
true if there is a next record throws IOException throws InvalidLogException thrown if the log content is invalid
Throws:
IOException
InvalidLogException

getLastGoodFileNumber

public long getLastGoodFileNumber()
Returns the last successfully read log file number

Specified by:
getLastGoodFileNumber in interface LogScanner
Returns:
last successfully read log file number

getLastGoodOffset

public long getLastGoodOffset()
Returns the last successfully read log file number

Specified by:
getLastGoodOffset in interface LogScanner
Returns:
last successfully read log file number

close

public void close()
Closes the scanner and releases any resources.

Specified by:
close in interface LogScanner


Copyright © 2003-2012 The Apache Software Foundation. All Rights Reserved.