|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.openharbor.beck.map.PollableURL
A document identified by a URL, with a relatively efficient method to check whether it has changed. This class is not thread-safe.
| Nested Class Summary | |
protected static class |
PollableURL.Description
Properties of a document that are examined to decide whether it has changed. |
| Field Summary | |
protected long |
expirationTime
|
protected org.apache.commons.logging.Log |
log
|
protected static long |
NEVER
|
protected static long |
UNKNOWN
|
protected static long |
UNKNOWN_TIME
|
| Fields inherited from interface com.openharbor.beck.map.PollableInput |
SECONDS |
| Constructor Summary | |
PollableURL(java.net.URL url)
|
|
| Method Summary | |
protected PollableURL.Description |
getDescription(java.net.URLConnection connection)
This method must not consume data from getInputStream(connection). |
protected void |
getExpirationTime(java.net.URLConnection connection)
Note the document's expiration time (if any). |
protected java.io.InputStream |
getInputStream(java.net.URLConnection connection)
|
java.lang.String |
getSystemID()
The SystemID that identifies the input source, or null if its SystemID is unknown. |
java.net.URL |
getURL()
|
java.io.InputStream |
input()
Begin reading the data (as a stream of bytes). |
java.io.InputStream |
inputIfModified()
Begin reading the data (as a stream of bytes) if it has changed since the last call to input() or inputIfModified(). |
void |
pollSoon()
Check for a change in the data next time inputIfModified is called, regardless of the currently acceptable staleness. |
void |
setAcceptableStaleness(long msec)
Set the maximum amount of time that may elapse from a change in the data until the change is detected by this object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected final org.apache.commons.logging.Log log
protected long expirationTime
protected static final long UNKNOWN
protected static final long UNKNOWN_TIME
protected static final long NEVER
| Constructor Detail |
public PollableURL(java.net.URL url)
| Method Detail |
public java.net.URL getURL()
public void setAcceptableStaleness(long msec)
PollableInput
setAcceptableStaleness in interface PollableInputmsec - the acceptable staleness, in units of milliseconds.public java.lang.String getSystemID()
PollableInput
getSystemID in interface PollableInput
public java.io.InputStream input()
throws java.io.IOException
PollableInput
input in interface PollableInputjava.io.IOException
public java.io.InputStream inputIfModified()
throws java.io.IOException
PollableInput
inputIfModified in interface PollableInputjava.io.IOExceptionpublic void pollSoon()
PollableInput
pollSoon in interface PollableInput
protected PollableURL.Description getDescription(java.net.URLConnection connection)
throws java.io.IOException
java.io.IOExceptionprotected void getExpirationTime(java.net.URLConnection connection)
protected java.io.InputStream getInputStream(java.net.URLConnection connection)
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||