|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.spy.SpyObject
net.spy.net.URLItem
public class URLItem
A particular URL that's being watched.
| Constructor Summary | |
|---|---|
URLItem(URL u)
Get an instance of URLItem. |
|
URLItem(URL u,
int i)
Get an instance of URLItem. |
|
| Method Summary | |
|---|---|
String |
getContent()
Get the content from the last fetch. |
protected HTTPFetch |
getFetcher(Map<String,List<String>> headers)
Get a fetcher (override for testing). |
long |
getLastRequest()
Find out when the last request was. |
int |
getMaxIdleTime()
Get the maximum number of milliseconds this URL will remain in the container if nothing requests it. |
int |
getUpdateFrequency()
Get the update frequency. |
URL |
getURL()
Get the URL this thing is watching. |
boolean |
isRunning()
True if this is still running. |
void |
run()
|
void |
setMaxIdleTime(int to)
Set the maximum number of milliseconds this URL will remain in the container if nothing requests it. |
String |
waitForContent(long dur,
TimeUnit timeunit)
Wait for content to arrive. |
| Methods inherited from class net.spy.SpyObject |
|---|
getLogger |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public URLItem(URL u)
u - URL to watch
public URLItem(URL u,
int i)
u - URL to watchi - the update frequency| Method Detail |
|---|
protected HTTPFetch getFetcher(Map<String,List<String>> headers)
public String getContent()
throws IOException
IOException
public String waitForContent(long dur,
TimeUnit timeunit)
throws InterruptedException,
TimeoutException
InterruptedException
TimeoutExceptionpublic long getLastRequest()
public URL getURL()
public void setMaxIdleTime(int to)
public int getMaxIdleTime()
public boolean isRunning()
public int getUpdateFrequency()
public void run()
run in interface Runnable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||