|
Enterprise Information Portal APIs |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.gcs.db.component.DB2Pool | +--com.ibm.gcs.db.component.DB2Queue
DB2Queue represents the URLs in the database which must be crawled. It represents all DB2 URL records that satisfy the SQL query
SELECT * FROM urlpoolstable WHERE urlpoolstable.state_id=1 AND urlpoolstable.hide=0 ORDER BY 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
buildSQLSelect()
buildSQLCount()
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 | |
DB2Queue()
Constructor. |
Method Summary | |
boolean |
contains(DB2URLContainer urlC,
Transaction t)
Checks to see if the specified URL must be crawled. |
java.lang.String |
getSQLCount()
Return the SQL SELECT COUNT(*) statement. |
java.lang.String |
getSQLSelect()
Return the SQL SELECT statement. |
void |
insert(DB2URLContainer urlC)
Updates the state information of the java URL object to reflect a URL in this DB2Queue but does not save this information in the database. |
static void |
main(java.lang.String[] args)
Simple test. |
void |
setOrderBy(java.lang.String columnNames)
Specify how to order the urls when selected. |
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 |
public DB2Queue()
Sets order by column to default order and calls
buildSQLSelect()
and buildSQLCount()
to build the SQL statements.
Method Detail |
public boolean contains(DB2URLContainer urlC, Transaction t) throws TransactionException
A URL must be crawled if it is in the state_id=0 and hide=0.
contains
in class DB2Pool
urlC
- The DB2URLContainer to check.t
- The transaction object for DB2 access.TransactionException
- on failed SQL
execution.public void insert(DB2URLContainer urlC)
Sets state_id=1 and hide=0.
insert
in class DB2Pool
urlC
- The DB2URLContainer to check.public java.lang.String getSQLSelect()
SELECT * FROM urlcrawltable WHERE state_id=1 AND hide=0 ORDER BY <column name>
getSQLSelect
in class DB2Pool
public java.lang.String getSQLCount()
SELECT COUNT(*) FROM urlcrawltable WHERE state_id=1 AND hide=0
getSQLCount
in class DB2Pool
public void setOrderBy(java.lang.String columnNames)
Rebuilds the SQL select statement with the new ORDER BY clause.
columnNames
- A comma separated list of
column names to order the urls by.public static void main(java.lang.String[] args)
|
EIP Web Crawler APIs | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |