org.semanticdesktop.aperture.crawler.base
Class CrawlReportBase

java.lang.Object
  extended by org.semanticdesktop.aperture.crawler.base.CrawlReportBase
All Implemented Interfaces:
CrawlReport

public class CrawlReportBase
extends Object
implements CrawlReport

A trivial implementation of the CrawlReport interface. This class provides additional support for writing the contents of the CrawlReport to a XML file.


Field Summary
static String CHANGED_COUNT_TAG
          tag containing the number of changed objects
static String COMPLETED_VALUE
          constant used to signify a successfully completed crawl
static String CRAWL_REPORT_TAG
          main CrawlReport XML tag
static String CRAWL_STARTED_TAG
          Crawl started tag - contains the date and time when the crawl has been started
static String CRAWL_STOPPED_TAG
          Crawl stopped tag - contains the date and time when the crawl has been stopped
static String EXIT_CODE_TAG
          Exit code tag - contains the exit code
static String FATAL_ERROR_VALUE
          constant used to signify a crawl interrupted due to a fatal error
static String NEW_COUNT_TAG
          tag containing the number of new objects
static String REMOVED_COUNT_TAG
          tag containing the number of removed objects
static String STOP_REQUESTED_VALUE
          constant used to signify a crawl that has been interrupted by the user
static String UNCHANGED_COUNT_TAG
          tag containing the number of unchanged objects
static String VERSION_ATTR
          crawl report version XML attribute
 
Constructor Summary
CrawlReportBase()
          Default constructor
 
Method Summary
 int getChangedCount()
          Returns the number of changed data objects encountered so far.
 long getCrawlStarted()
          Returns when the crawl was started, encoded in the typical milliseconds style.
 long getCrawlStopped()
          Returns when the crawl stopped.
 ExitCode getExitCode()
          Returns the status with which the crawl completed.
 Throwable getFatalErrorCause()
          Returns the Throwable that caused the fatal error during crawl.
 int getNewCount()
          Returns the number of new data objects encountered so far.
 int getRemovedCount()
          Returns the number of removed data objects encountered so far.
 int getTotalCount()
          Gets the total amount of items processed in the last crawl, i.e. the sum of the number of new, changed and unchanged items.
 int getUnchangedCount()
          Returns the number of unchanged data objects encountered so far.
 void increaseChangedCount()
           
 void increaseNewCount()
           
 void increaseRemovedCount()
           
 void increaseUnchangedCount()
           
 void read(InputStream stream)
           
 void setChangedCount(int changedCount)
           
 void setCrawlStarted(long crawlStarted)
           
 void setCrawlStopped(long crawlStopped)
           
 void setExitCode(ExitCode exitCode)
           
 void setFatalErrorCause(Throwable fatalErrorCause)
           
 void setNewCount(int newCount)
           
 void setRemovedCount(int removedCount)
           
 void setUnchangedCount(int unchangedCount)
           
 String toString()
           
 void write(OutputStream stream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CRAWL_REPORT_TAG

public static final String CRAWL_REPORT_TAG
main CrawlReport XML tag

See Also:
Constant Field Values

VERSION_ATTR

public static final String VERSION_ATTR
crawl report version XML attribute

See Also:
Constant Field Values

CRAWL_STARTED_TAG

public static final String CRAWL_STARTED_TAG
Crawl started tag - contains the date and time when the crawl has been started

See Also:
Constant Field Values

CRAWL_STOPPED_TAG

public static final String CRAWL_STOPPED_TAG
Crawl stopped tag - contains the date and time when the crawl has been stopped

See Also:
Constant Field Values

EXIT_CODE_TAG

public static final String EXIT_CODE_TAG
Exit code tag - contains the exit code

See Also:
Constant Field Values

COMPLETED_VALUE

public static final String COMPLETED_VALUE
constant used to signify a successfully completed crawl

See Also:
Constant Field Values

STOP_REQUESTED_VALUE

public static final String STOP_REQUESTED_VALUE
constant used to signify a crawl that has been interrupted by the user

See Also:
Constant Field Values

FATAL_ERROR_VALUE

public static final String FATAL_ERROR_VALUE
constant used to signify a crawl interrupted due to a fatal error

See Also:
Constant Field Values

NEW_COUNT_TAG

public static final String NEW_COUNT_TAG
tag containing the number of new objects

See Also:
Constant Field Values

CHANGED_COUNT_TAG

public static final String CHANGED_COUNT_TAG
tag containing the number of changed objects

See Also:
Constant Field Values

REMOVED_COUNT_TAG

public static final String REMOVED_COUNT_TAG
tag containing the number of removed objects

See Also:
Constant Field Values

UNCHANGED_COUNT_TAG

public static final String UNCHANGED_COUNT_TAG
tag containing the number of unchanged objects

See Also:
Constant Field Values
Constructor Detail

CrawlReportBase

public CrawlReportBase()
Default constructor

Method Detail

setCrawlStarted

public void setCrawlStarted(long crawlStarted)

getCrawlStarted

public long getCrawlStarted()
Description copied from interface: CrawlReport
Returns when the crawl was started, encoded in the typical milliseconds style.

Specified by:
getCrawlStarted in interface CrawlReport

setCrawlStopped

public void setCrawlStopped(long crawlStopped)

getCrawlStopped

public long getCrawlStopped()
Description copied from interface: CrawlReport
Returns when the crawl stopped. Returns a negative value when the crawl is still in progress.

Specified by:
getCrawlStopped in interface CrawlReport

setExitCode

public void setExitCode(ExitCode exitCode)

getExitCode

public ExitCode getExitCode()
Description copied from interface: CrawlReport
Returns the status with which the crawl completed. Returns null when the crawl is still in progress.

Specified by:
getExitCode in interface CrawlReport

setNewCount

public void setNewCount(int newCount)

increaseNewCount

public void increaseNewCount()

getNewCount

public int getNewCount()
Description copied from interface: CrawlReport
Returns the number of new data objects encountered so far.

Specified by:
getNewCount in interface CrawlReport

setChangedCount

public void setChangedCount(int changedCount)

increaseChangedCount

public void increaseChangedCount()

getChangedCount

public int getChangedCount()
Description copied from interface: CrawlReport
Returns the number of changed data objects encountered so far.

Specified by:
getChangedCount in interface CrawlReport

setRemovedCount

public void setRemovedCount(int removedCount)

increaseRemovedCount

public void increaseRemovedCount()

getRemovedCount

public int getRemovedCount()
Description copied from interface: CrawlReport
Returns the number of removed data objects encountered so far.

Specified by:
getRemovedCount in interface CrawlReport

getFatalErrorCause

public Throwable getFatalErrorCause()
Description copied from interface: CrawlReport
Returns the Throwable that caused the fatal error during crawl. This value is non-null only if CrawlReport.getExitCode() returns ExitCode.FATAL_ERROR.

Specified by:
getFatalErrorCause in interface CrawlReport

setFatalErrorCause

public void setFatalErrorCause(Throwable fatalErrorCause)

setUnchangedCount

public void setUnchangedCount(int unchangedCount)

increaseUnchangedCount

public void increaseUnchangedCount()

getUnchangedCount

public int getUnchangedCount()
Description copied from interface: CrawlReport
Returns the number of unchanged data objects encountered so far.

Specified by:
getUnchangedCount in interface CrawlReport

getTotalCount

public int getTotalCount()
Gets the total amount of items processed in the last crawl, i.e. the sum of the number of new, changed and unchanged items.


toString

public String toString()
Overrides:
toString in class Object

write

public void write(OutputStream stream)
           throws IOException
Throws:
IOException

read

public void read(InputStream stream)
          throws IOException
Throws:
IOException


Copyright © 2010 Aperture Development Team. All Rights Reserved.