Enterprise Information Portal APIs

com.ibm.gcs.db.component
Class DB2RevisitQueue

java.lang.Object
  |
  +--com.ibm.gcs.db.component.DB2Pool
        |
        +--com.ibm.gcs.db.component.DB2Queue
              |
              +--com.ibm.gcs.db.component.DB2RevisitQueue

public class DB2RevisitQueue
extends DB2Queue

DB2RevisitQueue represents the URLs in the database which must be recrawled. It represents all DB2 URL records that satisfy the SQL query

SELECT * 
     FROM urlcrawltable
     WHERE hide=0 AND (state_id=1
		OR (visit_time < theTime AND (state_id>3))
	    OR (state_id=2 AND time < theTime))
     ORDER BY depth, state_id, time
  

The method setOrderBy may be used to specify a different column for the ORDER BY clause.

The constructor creates the SQL SELECT and SQL SELECT COUNT(*) statements by calling the following methods

  1. buildSQLSelect()
  2. buildSQLCount()
These methods use getSQLPredicate() and getSQLOrderBy() to build the statements. Extending classes may override getSQLPredicate() and getSQLOrderBy() to refine the properties of the queue. For example, DB2PriorityQueue overrides getSQLPredicate and append the " AND priority=p" to the predicate. These classes also override insert(), and contains() to reflect the changes.


Fields inherited from class com.ibm.gcs.db.component.DB2Pool
debug
 
Constructor Summary
DB2RevisitQueue()
          Constructor.
DB2RevisitQueue(java.sql.Timestamp visitedBefore)
          Constructor.
 
Method Summary
 boolean contains(DB2URLContainer urlC, Transaction t)
          Checks to see if the specified URL is a member of this queue.
static void main(java.lang.String[] args)
          Simple test.
 
Methods inherited from class com.ibm.gcs.db.component.DB2Queue
getSQLCount, getSQLSelect, insert, setOrderBy
 
Methods inherited from class com.ibm.gcs.db.component.DB2Pool
getURLContainers, num, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DB2RevisitQueue

public DB2RevisitQueue(java.sql.Timestamp visitedBefore)
Constructor.

Sets order by column to default order and calls buildSQLSelect() and buildSQLCount() to build the SQL statements.

Parameters:
visitedBefore - Revisit if visited before this time.

DB2RevisitQueue

public DB2RevisitQueue()
Constructor.

Sets order by column to default order and calls buildSQLSelect() and buildSQLCount() to build the SQL statements.

Method Detail

contains

public boolean contains(DB2URLContainer urlC,
                        Transaction t)
                 throws TransactionException
Checks to see if the specified URL is a member of this queue.

A URL is a member of this queue if it matches the SQL predicate.

Overrides:
contains in class DB2Queue
Parameters:
urlC - The DB2URLContainer to check.
t - The transaction object for DB2 access.
Returns:
true if the URL container is a member, false otherwise.
Throws:
TransactionException - on failed SQL execution.

main

public static void main(java.lang.String[] args)
Description copied from class: DB2Queue
Simple test.

EIP Web Crawler APIs

(c) Copyright International Business Machines Corporation 1996, 2002. IBM Corp. All rights reserved.