|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectxsmeral.semnet.crawler.URLManager
public class URLManager
URL Manager for HTMLCrawler
.
Responsible for persistence of URLs. Contains methods for querying, locking,
updating, adding.
HTMLCrawler
Nested Class Summary | |
---|---|
static interface |
URLManager.LimitClause
The LIMIT clause of SQL statement. |
static interface |
URLManager.OrderClause
The ORDER BY clause of SQL statement. |
static interface |
URLManager.Query
Complete SQL query. |
static interface |
URLManager.QueryBuilder
Builder of queries. |
class |
URLManager.QueryBuilderImpl
Implementation of QueryBuilder for URL entries. |
static interface |
URLManager.WhereClause
The WHERE clause of SQL statement. |
Constructor Summary | |
---|---|
URLManager(RDBLayer db)
Creates an instance for the specified DB layer. |
Method Summary | |
---|---|
int |
addEntries(Collection<URLEntry> entries)
Adds given entries to DB. |
boolean |
addEntry(URLEntry entry)
Adds given entry to DB. |
void |
close()
Closes the DB connection and all prepared statements. |
Collection<URLEntry> |
fetchEntries(URLManager.Query q,
int ownerId)
Retrieves URLs based on the given query. |
URLManager.WhereClause |
getQueryForHost(int hostId)
Returns a Query for host with given ID. |
Collection<URLEntry> |
listBroken()
Returns list of URL marked as not working. |
Collection<URLEntry> |
listLocked()
Returns list of locked entries. |
void |
returnEntry(URLEntry entry)
Updates and unlocks the given entry in DB. |
boolean |
unlockAll()
Unlocks all locked URLs. |
boolean |
unlockUrl(URLEntry entry)
Unlocks the URL specified by given entry. |
boolean |
unlockUrls(Collection<URLEntry> entries)
See unlockUrl |
void |
updateEntry(URLEntry entry)
Updates the given entry in DB. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public URLManager(RDBLayer db) throws SQLException
SQLException
- If an error occurs when connecting to DB or preparing statements.Method Detail |
---|
public URLManager.WhereClause getQueryForHost(int hostId)
public Collection<URLEntry> fetchEntries(URLManager.Query q, int ownerId)
returnEntry(entry)
.
q
- The Query to useownerId
- An identification of the entity that is retrieving and locking this URLpublic void returnEntry(URLEntry entry)
public boolean addEntry(URLEntry entry)
addEntries(java.util.Collection)
public int addEntries(Collection<URLEntry> entries)
public void updateEntry(URLEntry entry)
public void close()
public boolean unlockUrl(URLEntry entry)
public boolean unlockUrls(Collection<URLEntry> entries)
unlockUrl
public Collection<URLEntry> listLocked()
public Collection<URLEntry> listBroken()
public boolean unlockAll()
lockUrl
,
unlockUrl
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |