xsmeral.semnet.crawler
Class URLManager.QueryBuilderImpl

java.lang.Object
  extended by xsmeral.semnet.crawler.URLManager.QueryBuilderImpl
All Implemented Interfaces:
URLManager.LimitClause, URLManager.OrderClause, URLManager.Query, URLManager.QueryBuilder, URLManager.WhereClause
Enclosing class:
URLManager

public class URLManager.QueryBuilderImpl
extends Object
implements URLManager.QueryBuilder

Implementation of QueryBuilder for URL entries.


Constructor Summary
URLManager.QueryBuilderImpl()
           
 
Method Summary
 URLManager.WhereClause current()
          Appends condition for URLs that need updating (where [current_time]-update_freq > last_visited).
 URLManager.WhereClause entity(Boolean entity)
          Appends condition for URLs that represent entities/sources.
 URLManager.WhereClause forHost(Integer hostId)
          Appends condition for the given host.
 URLManager.WhereClause forPattern(String pattern)
          Appends condition for given pattern.
 URLManager.Query getQuery()
          Constructs the query.
 PreparedStatement getStatement()
          Returns the constructed SQL prepared statement.
 URLManager.Query limit(Integer count)
          Appends LIMIT with the given argument.
 URLManager.QueryBuilder locked()
          Appends condition for locked URLs.
 URLManager.WhereClause notLocked()
          Appends condition for URLs not locked.
 URLManager.LimitClause orderBy(String order)
          Appends ORDER BY [order].
 URLManager.LimitClause sourceFirst()
          Orders by entity field, so that source URLs are returned first.
 URLManager.WhereClause working(Boolean working)
          Appends condition for URLs that are (not) working.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLManager.QueryBuilderImpl

public URLManager.QueryBuilderImpl()
Method Detail

locked

public URLManager.QueryBuilder locked()
Description copied from interface: URLManager.QueryBuilder
Appends condition for locked URLs.

Specified by:
locked in interface URLManager.QueryBuilder

notLocked

public URLManager.WhereClause notLocked()
Description copied from interface: URLManager.WhereClause
Appends condition for URLs not locked.

Specified by:
notLocked in interface URLManager.WhereClause

current

public URLManager.WhereClause current()
Description copied from interface: URLManager.WhereClause
Appends condition for URLs that need updating (where [current_time]-update_freq > last_visited).

Specified by:
current in interface URLManager.WhereClause

entity

public URLManager.WhereClause entity(Boolean entity)
Description copied from interface: URLManager.WhereClause
Appends condition for URLs that represent entities/sources.

Specified by:
entity in interface URLManager.WhereClause
Parameters:
entity - If null, a wildcard (?) is used

forHost

public URLManager.WhereClause forHost(Integer hostId)
Description copied from interface: URLManager.WhereClause
Appends condition for the given host.

Specified by:
forHost in interface URLManager.WhereClause
Parameters:
hostId - If null, a wildcard (?) is used

forPattern

public URLManager.WhereClause forPattern(String pattern)
Description copied from interface: URLManager.WhereClause
Appends condition for given pattern.

Specified by:
forPattern in interface URLManager.WhereClause
Parameters:
pattern - If null, a wildcard (?) is used

working

public URLManager.WhereClause working(Boolean working)
Description copied from interface: URLManager.WhereClause
Appends condition for URLs that are (not) working.

Specified by:
working in interface URLManager.WhereClause
Parameters:
working - If null, a wildcard (?) is used

orderBy

public URLManager.LimitClause orderBy(String order)
Description copied from interface: URLManager.OrderClause
Appends ORDER BY [order].

Specified by:
orderBy in interface URLManager.OrderClause
Parameters:
order - The full SQL-equivalent argument to ORDER BY clause. If null, a wildcard (?) is used.

sourceFirst

public URLManager.LimitClause sourceFirst()
Description copied from interface: URLManager.OrderClause
Orders by entity field, so that source URLs are returned first.

Specified by:
sourceFirst in interface URLManager.OrderClause

limit

public URLManager.Query limit(Integer count)
Description copied from interface: URLManager.LimitClause
Appends LIMIT with the given argument.

Specified by:
limit in interface URLManager.LimitClause
Parameters:
count - If null, a wildcard (?) is used.

getQuery

public URLManager.Query getQuery()
                          throws ConfigurationException
Description copied from interface: URLManager.Query
Constructs the query. Must be called before getStatement().

Specified by:
getQuery in interface URLManager.Query
Throws:
ConfigurationException

getStatement

public PreparedStatement getStatement()
Description copied from interface: URLManager.Query
Returns the constructed SQL prepared statement. The getQuery() must be called before calling this method.

Specified by:
getStatement in interface URLManager.Query