Enterprise Information Portal APIs

com.ibm.gcs.db.component
Class DB2PriorityQueue

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

public class DB2PriorityQueue
extends DB2Queue

DB2PriorityQueue represents the URLs in the database which must be crawled and belong to the specified priority group. These URL records that satisfy the SQL query

  SELECT * 
    FROM urlpoolstable
    WHERE urlpoolstable.state_id=1
     AND urlpoolstable.hide=0
     AND urlpoolstable.priority=<priority>
URLCollection classes may create a set of these queues to represent priority groups for the URLs.


Fields inherited from class com.ibm.gcs.db.component.DB2Pool
debug
 
Method Summary
 boolean contains(DB2URLContainer urlC, Transaction t)
          Checks to see if the specified URL is waiting to be crawled AND is in the priority group.
 int getPriority()
          return the priority of this class
 void insert(DB2URLContainer urlC)
          Updates the state information of the java URL object to reflect a URL in this DB2PriorityQueue but does not save this information in the database.
static void main(java.lang.String[] args)
          Simple test.
 void setPriority(int p)
          Set the priority of this class.
 
Methods inherited from class com.ibm.gcs.db.component.DB2Queue
getSQLCount, getSQLSelect, 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
 

Method Detail

getPriority

public int getPriority()
return the priority of this class
Returns:
int priority

setPriority

public void setPriority(int p)
Set the priority of this class.

Calls buildSQLSelect() and buildSQLCount() to rebuild the SQL statements.

Parameters:
p - the priority of this pool

contains

public boolean contains(DB2URLContainer urlC,
                        Transaction t)
                 throws TransactionException
Checks to see if the specified URL is waiting to be crawled AND is in the priority group.

A URL is waiting to be crawled if it is in the state TOBECRAWLED and its hide flag is false.

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

insert

public void insert(DB2URLContainer urlC)
Updates the state information of the java URL object to reflect a URL in this DB2PriorityQueue but does not save this information in the database. (The URL object must be saved explicitly.)
Overrides:
insert in class DB2Queue
Parameters:
urlC - The DB2URLContainer to check.
t - The transaction object for DB2 access.
Throws:
TransactionException - on failed SQL execution.

main

public static void main(java.lang.String[] args)
Simple test.

EIP Web Crawler APIs

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