gov.nasa.worldwind.retrieve
Class URLRetriever
java.lang.Object
gov.nasa.worldwind.avlist.AVListImpl
gov.nasa.worldwind.WWObjectImpl
gov.nasa.worldwind.retrieve.URLRetriever
- All Implemented Interfaces:
- AVList, Retriever, WWObject, PropertyChangeListener, Callable<Retriever>, EventListener
- Direct Known Subclasses:
- HTTPRetriever
public abstract class URLRetriever
- extends WWObjectImpl
- implements Retriever
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl |
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues |
Methods inherited from interface gov.nasa.worldwind.avlist.AVList |
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues |
URLRetriever
public URLRetriever(URL url,
RetrievalPostProcessor postProcessor)
- Parameters:
url
- the URL of the resource to retrieve.postProcessor
- the retrieval post-processor to invoke when the resource is retrieved.
- Throws:
IllegalArgumentException
- if url
or postProcessor
is null.
call
public final Retriever call()
throws Exception
- Specified by:
call
in interface Callable<Retriever>
- Throws:
Exception
doRead
protected ByteBuffer doRead(URLConnection connection)
throws Exception
- Parameters:
connection
- the connection to read from.
- Returns:
- a buffer containing the content read from the connection
- Throws:
Exception
- if connection
is null or an exception occurs during reading.
IllegalArgumentException
- if connection
is null
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
getBeginTime
public long getBeginTime()
- Specified by:
getBeginTime
in interface Retriever
getBuffer
public final ByteBuffer getBuffer()
- Specified by:
getBuffer
in interface Retriever
getConnection
protected final URLConnection getConnection()
getConnectTimeout
public final int getConnectTimeout()
- Specified by:
getConnectTimeout
in interface Retriever
getContentLength
public final int getContentLength()
- Specified by:
getContentLength
in interface Retriever
getContentLengthRead
public final int getContentLengthRead()
- Specified by:
getContentLengthRead
in interface Retriever
getContentType
public final String getContentType()
- Specified by:
getContentType
in interface Retriever
getEndTime
public long getEndTime()
- Specified by:
getEndTime
in interface Retriever
getName
public final String getName()
- Specified by:
getName
in interface Retriever
getPostProcessor
public final RetrievalPostProcessor getPostProcessor()
getReadTimeout
public int getReadTimeout()
- Specified by:
getReadTimeout
in interface Retriever
getStaleRequestLimit
public int getStaleRequestLimit()
- Specified by:
getStaleRequestLimit
in interface Retriever
getState
public final String getState()
- Specified by:
getState
in interface Retriever
getSubmitTime
public long getSubmitTime()
- Specified by:
getSubmitTime
in interface Retriever
getUrl
public final URL getUrl()
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
setBeginTime
public void setBeginTime(long beginTime)
- Specified by:
setBeginTime
in interface Retriever
setConnectTimeout
public final void setConnectTimeout(int connectTimeout)
- Specified by:
setConnectTimeout
in interface Retriever
setContentLengthRead
protected void setContentLengthRead(int length)
setEndTime
public void setEndTime(long endTime)
- Specified by:
setEndTime
in interface Retriever
setReadTimeout
public void setReadTimeout(int readTimeout)
- Specified by:
setReadTimeout
in interface Retriever
setStaleRequestLimit
public void setStaleRequestLimit(int staleRequestLimit)
- Specified by:
setStaleRequestLimit
in interface Retriever
setSubmitTime
public void setSubmitTime(long submitTime)
- Specified by:
setSubmitTime
in interface Retriever
toString
public String toString()
- Overrides:
toString
in class Object