org.alfresco.linkvalidation
Class HrefValidationProgress

java.lang.Object
  extended by org.alfresco.linkvalidation.HrefValidationProgress
All Implemented Interfaces:
java.io.Serializable

public class HrefValidationProgress
extends java.lang.Object
implements java.io.Serializable

This class allows the progress of synchronous calls to updateHrefInfo to be be monitored asynchronously in another thread via polling. Whenever the status monitoring thread wishes to determine how many of the webaps, directories, files, or URLs have been updated sucessfully so far, it can query getWebappUpdateCount(), getDirUpdateCount(), getFileUpdateCount(), or getUrlUpdateCount(). The monitoring thread can determine when the call to updateHrefInfo() has completed by examining the value returned by isDone().

Note: It is safest to instantiate a fresh HrefValidationProgress object for every invocation of updateHrefInfo().

See Also:
Serialized Form

Constructor Summary
HrefValidationProgress()
           
 
Method Summary
 void abort()
          Tell the thread that is validating hrefs to abort its current operation, and cause that operation to declare it "done" and throw LinkValidationAbortedException.
 int getDirUpdateCount()
          Returns the number of directories that have been completely URL-revalidated thus far by a call to updateHrefInfo().
 int getFileUpdateCount()
          Returns the number of files that have been completely URL-revalidated thus far by a call to updateHrefInfo().
 int getUrlUpdateCount()
          Returns the number of distinct URLs that have been URL-revalidated thus far by a call to updateHrefInfo().
 int getWebappUpdateCount()
          Returns the number of webapps that have been completely URL-revalidated thus far by a call to updateHrefInfo().
 boolean isAborted()
          Indicates whether or not the validation operation was halted by abort().
 boolean isDone()
          Returns true if and only if the call to updateHrefInfo() has returned (whether by a normal return or via an exception).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HrefValidationProgress

public HrefValidationProgress()
Method Detail

getWebappUpdateCount

public int getWebappUpdateCount()
Returns the number of webapps that have been completely URL-revalidated thus far by a call to updateHrefInfo(). Note that it is possible to revalidate every webapp in a store via updateHrefInfo(), so this value can be greater than 1.


getDirUpdateCount

public int getDirUpdateCount()
Returns the number of directories that have been completely URL-revalidated thus far by a call to updateHrefInfo().


abort

public void abort()
Tell the thread that is validating hrefs to abort its current operation, and cause that operation to declare it "done" and throw LinkValidationAbortedException. Thus, if you have an observer polling progress & checking isDone(), they'll also see that things are "finished", and can check to see whether it's because isAborted() is true.


isAborted

public boolean isAborted()
Indicates whether or not the validation operation was halted by abort().


getFileUpdateCount

public int getFileUpdateCount()
Returns the number of files that have been completely URL-revalidated thus far by a call to updateHrefInfo().


getUrlUpdateCount

public int getUrlUpdateCount()
Returns the number of distinct URLs that have been URL-revalidated thus far by a call to updateHrefInfo().


isDone

public boolean isDone()
Returns true if and only if the call to updateHrefInfo() has returned (whether by a normal return or via an exception).



Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.