|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.spinn3r.api.BaseClient
com.spinn3r.api.SourceListClient
public class SourceListClient
| Field Summary | |
|---|---|
static int |
CONSERVATIVE_LIMIT
|
static long |
DEFAULT_SLEEP_INTERVAL
When we've ran out of results (because the client is up to date) then we should spin for a few seconds. |
static int |
MAX_LIMIT
|
static int |
OPTIMAL_LIMIT
|
static java.lang.String |
ROUTER
Base router request URL. |
| Fields inherited from class com.spinn3r.api.BaseClient |
|---|
ACCEPT_ENCODING_HEADER, COMMENT_HANDLER, config, DEFAULT_CONNECT_TIMEOUT, DEFAULT_HOST, DEFAULT_HTTP_KEEPALIVE, DEFAULT_MAX_REDIRECTS, DEFAULT_READ_TIMEOUT, disable_parse, FEED_HANDLER, GZIP_ENCODING, isCompressed, LINK_HANDLER, NETWORKADDRESS_CACHE_TTL, NS_API, NS_ATOM, NS_COMMENT, NS_DC, NS_FEED, NS_LINK, NS_POST, NS_SOURCE, NS_TARGET, NS_WEBLOG, PERMALINK_HANDLER, RESTART_BUFFER, results, RETRY_MAX, USER_AGENT, USER_AGENT_HEADER |
| Constructor Summary | |
|---|---|
SourceListClient()
|
|
| Method Summary | |
|---|---|
void |
fetch()
|
protected java.lang.String |
generateFirstRequestURL()
Generate the first request URL based just on configuration directives. |
protected int |
getConservativeLimit()
Conservative limit for items which should work in all situations (but might be slower) |
protected int |
getMaxLimit()
Return the maximum number of request per call. |
protected int |
getOptimalLimit()
Return the optimal limit for fetches. |
java.util.List<Source> |
getResults()
|
java.lang.String |
getRouter()
Return the router for this client. |
long |
getSleepInterval()
|
static void |
main(java.lang.String[] args)
|
protected BaseResult |
parseItem(ContentApi.Entry current)
|
protected BaseItem |
parseItem(org.w3c.dom.Element current)
Parse an individual item which might be specific to this client. |
static void |
printf(Source source)
Print a source to stdout. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.spinn3r.api.Client |
|---|
getCallDuration, getConfig, getHost, getInputStream, getLastRequestURL, getNextRequestURL, getParseDuration, getRestartPoint, getSleepDuration, setConfig, setHost, setParseDuration, setSleepDuration |
| Field Detail |
|---|
public static final long DEFAULT_SLEEP_INTERVAL
public static int MAX_LIMIT
public static int OPTIMAL_LIMIT
public static int CONSERVATIVE_LIMIT
public static java.lang.String ROUTER
| Constructor Detail |
|---|
public SourceListClient()
| Method Detail |
|---|
public void fetch()
throws java.io.IOException,
ParseException,
java.lang.InterruptedException
fetch in interface Clientjava.io.IOException
ParseException
java.lang.InterruptedExceptionprotected java.lang.String generateFirstRequestURL()
generateFirstRequestURL in class BaseClientpublic java.util.List<Source> getResults()
getResults in interface Client
protected BaseResult parseItem(ContentApi.Entry current)
throws java.lang.Exception
parseItem in class BaseClientjava.lang.Exception
protected BaseItem parseItem(org.w3c.dom.Element current)
throws java.lang.Exception
BaseClient
parseItem in class BaseClientjava.lang.Exceptionprotected int getMaxLimit()
BaseClient
getMaxLimit in class BaseClientprotected int getOptimalLimit()
BaseClient
getOptimalLimit in class BaseClientprotected int getConservativeLimit()
BaseClient
getConservativeLimit in class BaseClientpublic java.lang.String getRouter()
BaseClient
getRouter in interface ClientgetRouter in class BaseClientpublic long getSleepInterval()
public static void printf(Source source)
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||