Java Doc for WorkQueue.java in  » Web-Crawler » heritrix » org » archive » crawler » frontier » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Crawler » heritrix » org.archive.crawler.frontier 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.archive.crawler.frontier.WorkQueue

All known Subclasses:   org.archive.crawler.frontier.BdbWorkQueue,
WorkQueue
abstract public class WorkQueue implements Frontier.FrontierGroup,Comparable,Serializable,Reporter(Code)
A single queue of related URIs to visit, grouped by a classKey (typically "hostname:port" or similar)
author:
   gojomo
author:
   Christian Kohlschuetter


Field Summary
final protected  StringclassKey
    
protected  CrawlSubstatssubstats
    

Constructor Summary
public  WorkQueue(String pClassKey)
    

Method Summary
public  voidclearHeld()
    
final public  intcompareTo(Object obj)
    
abstract protected  voiddeleteItem(WorkQueueFrontier frontier, CrawlURI item)
     Removes the given item from the queue.
public  longdeleteMatching(WorkQueueFrontier frontier, String match)
     Delete URIs matching the given pattern from this queue.
abstract protected  longdeleteMatchingFromQueue(WorkQueueFrontier frontier, String match)
     Delete URIs matching the given pattern from this queue.
public synchronized  voiddequeue(WorkQueueFrontier frontier)
     Remove the peekItem from the queue and adjusts the count.
public synchronized  voidenqueue(WorkQueueFrontier frontier, CrawlURI curi)
     Add the given CrawlURI, noting its addition in running count.
public  intexpend(int amount)
     Decrease the internal running budget by the given amount.
public  StringgetClassKey()
    
public synchronized  longgetCount()
    
public  String[]getReports()
    
public  intgetSessionBalance()
    
public  CrawlSubstatsgetSubstats()
    
public  longgetTotalExpenditure()
    
public  longgetWakeTime()
    
public  intincrementSessionBalance(int amount)
    
abstract protected  voidinsertItem(WorkQueueFrontier frontier, CrawlURI curi, boolean expectedPresent)
     Insert the given curi, whether it is already present or not. Hook for subclasses.
public  booleanisHeld()
    
public  booleanisOverBudget()
     Check whether queue has temporarily or permanently exceeded its budget.
public  booleanisRetired()
    
public  voidnoteError(int penalty)
     Note an error and assess an extra penalty.
public  CrawlURIpeek(WorkQueueFrontier frontier)
     Return the topmost queue item -- and remember it, such that even later higher-priority inserts don't change it.
abstract protected  CrawlURIpeekItem(WorkQueueFrontier frontier)
    
public  intrefund(int amount)
    
public  voidreportTo(PrintWriter writer)
    
public  voidreportTo(String name, PrintWriter writer)
    
protected  voidresume(WorkQueueFrontier frontier)
     Resumes this WorkQueue.
public  voidsetActive(WorkQueueFrontier frontier, boolean b)
    
public  voidsetHeld()
    
public  voidsetRetired(boolean b)
     Set the retired status of this queue.
public  voidsetSessionBalance(int balance)
    
public  voidsetTotalBudget(long budget)
     Set the total expenditure level allowable before queue is considered inherently 'over-budget'.
public  voidsetWakeTime(long l)
    
public  StringsingleLineLegend()
    
public  StringsingleLineReport()
    
public  voidsingleLineReportTo(PrintWriter writer)
    
protected  voidsuspend(WorkQueueFrontier frontier)
     Suspends this WorkQueue.
public  voidunpeek()
     Forgive the peek, allowing a subsequent peek to return a different item.
public  voidupdate(WorkQueueFrontier frontier, CrawlURI curi)
     Update the given CrawlURI, which should already be present.

Field Detail
classKey
final protected String classKey(Code)
The classKey



substats
protected CrawlSubstats substats(Code)
Substats for all CrawlURIs in this group




Constructor Detail
WorkQueue
public WorkQueue(String pClassKey)(Code)




Method Detail
clearHeld
public void clearHeld()(Code)
Clear isHeld to false



compareTo
final public int compareTo(Object obj)(Code)



deleteItem
abstract protected void deleteItem(WorkQueueFrontier frontier, CrawlURI item) throws IOException(Code)
Removes the given item from the queue. This is only used to remove the first item in the queue, so it is not necessary to implement a random-access queue.
Parameters:
  frontier - Work queues manager.
throws:
  IOException - if there was a problem while deleting the item



deleteMatching
public long deleteMatching(WorkQueueFrontier frontier, String match)(Code)
Delete URIs matching the given pattern from this queue.
Parameters:
  frontier -
Parameters:
  match - count of deleted URIs



deleteMatchingFromQueue
abstract protected long deleteMatchingFromQueue(WorkQueueFrontier frontier, String match) throws IOException(Code)
Delete URIs matching the given pattern from this queue.
Parameters:
  frontier - WorkQueues manager.
Parameters:
  match - the pattern to match count of deleted URIs
throws:
  IOException - if there was a problem while deleting



dequeue
public synchronized void dequeue(WorkQueueFrontier frontier)(Code)
Remove the peekItem from the queue and adjusts the count.
Parameters:
  frontier - Work queues manager.



enqueue
public synchronized void enqueue(WorkQueueFrontier frontier, CrawlURI curi)(Code)
Add the given CrawlURI, noting its addition in running count. (It should not already be present.)
Parameters:
  frontier - Work queues manager.
Parameters:
  curi - CrawlURI to insert.



expend
public int expend(int amount)(Code)
Decrease the internal running budget by the given amount.
Parameters:
  amount - tp decrement updated budget value



getClassKey
public String getClassKey()(Code)
classKey, the 'identifier', for this queue.



getCount
public synchronized long getCount()(Code)
Returns the count.



getReports
public String[] getReports()(Code)



getSessionBalance
public int getSessionBalance()(Code)
Return current session 'activity budget balance' session balance



getSubstats
public CrawlSubstats getSubstats()(Code)



getTotalExpenditure
public long getTotalExpenditure()(Code)
Return the tally of all expenditures on this queue total amount expended on this queue



getWakeTime
public long getWakeTime()(Code)
wakeTime



incrementSessionBalance
public int incrementSessionBalance(int amount)(Code)
Increase the internal running budget to be used before deactivating the queue
Parameters:
  amount - amount to increment updated budget value



insertItem
abstract protected void insertItem(WorkQueueFrontier frontier, CrawlURI curi, boolean expectedPresent) throws IOException(Code)
Insert the given curi, whether it is already present or not. Hook for subclasses.
Parameters:
  frontier - WorkQueueFrontier.
Parameters:
  curi - CrawlURI to insert.
throws:
  IOException - if there was a problem while inserting the item



isHeld
public boolean isHeld()(Code)
Whether the queue is already in a lifecycle stage -- such as ready, in-progress, snoozed -- and thus should not be redundantly inserted to readyClassQueues isHeld



isOverBudget
public boolean isOverBudget()(Code)
Check whether queue has temporarily or permanently exceeded its budget. true if queue is over its set budget(s)



isRetired
public boolean isRetired()(Code)



noteError
public void noteError(int penalty)(Code)
Note an error and assess an extra penalty.
Parameters:
  penalty - additional amount to deduct



peek
public CrawlURI peek(WorkQueueFrontier frontier)(Code)
Return the topmost queue item -- and remember it, such that even later higher-priority inserts don't change it. TODO: evaluate if this is really necessary
Parameters:
  frontier - Work queues manager topmost queue item, or null



peekItem
abstract protected CrawlURI peekItem(WorkQueueFrontier frontier) throws IOException(Code)
Returns first item from queue (does not delete) The peeked item, or null
throws:
  IOException - if there was a problem while peeking



refund
public int refund(int amount)(Code)
A URI should not have been charged against queue (eg it was disregarded); return the amount expended
Parameters:
  amount - to return updated budget value



reportTo
public void reportTo(PrintWriter writer)(Code)



reportTo
public void reportTo(String name, PrintWriter writer)(Code)

Parameters:
  writer -
throws:
  IOException -



resume
protected void resume(WorkQueueFrontier frontier) throws IOException(Code)
Resumes this WorkQueue. Eventually opens connections to resources etc.
Parameters:
  frontier -
throws:
  IOException -



setActive
public void setActive(WorkQueueFrontier frontier, boolean b)(Code)



setHeld
public void setHeld()(Code)
Set isHeld to true



setRetired
public void setRetired(boolean b)(Code)
Set the retired status of this queue.
Parameters:
  b - new value for retired status



setSessionBalance
public void setSessionBalance(int balance)(Code)
Set the session 'activity budget balance' to the given value
Parameters:
  balance - to use



setTotalBudget
public void setTotalBudget(long budget)(Code)
Set the total expenditure level allowable before queue is considered inherently 'over-budget'.
Parameters:
  budget -



setWakeTime
public void setWakeTime(long l)(Code)

Parameters:
  l -



singleLineLegend
public String singleLineLegend()(Code)



singleLineReport
public String singleLineReport()(Code)



singleLineReportTo
public void singleLineReportTo(PrintWriter writer)(Code)



suspend
protected void suspend(WorkQueueFrontier frontier) throws IOException(Code)
Suspends this WorkQueue. Closes all connections to resources etc.
Parameters:
  frontier -
throws:
  IOException -



unpeek
public void unpeek()(Code)
Forgive the peek, allowing a subsequent peek to return a different item.



update
public void update(WorkQueueFrontier frontier, CrawlURI curi)(Code)
Update the given CrawlURI, which should already be present. (This is not checked.) Equivalent to an enqueue without affecting the count.
Parameters:
  frontier - Work queues manager.
Parameters:
  curi - CrawlURI to update.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.