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, java.beans.PropertyChangeListener, java.util.concurrent.Callable<Retriever>, java.util.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 class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
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 |
Methods inherited from interface java.beans.PropertyChangeListener |
propertyChange |
URLRetriever
public URLRetriever(java.net.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:
java.lang.IllegalArgumentException
- if url
or postProcessor
is null.
call
public final Retriever call()
throws java.lang.Exception
- Specified by:
call
in interface java.util.concurrent.Callable<Retriever>
- Throws:
java.lang.Exception
doRead
protected java.nio.ByteBuffer doRead(java.net.URLConnection connection)
throws java.lang.Exception
- Parameters:
connection
- the connection to read from.
- Returns:
- a buffer containing the content read from the connection
- Throws:
java.lang.Exception
- if connection
is null or an exception occurs during reading.
java.lang.IllegalArgumentException
- if connection
is null
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
getBeginTime
public long getBeginTime()
- Specified by:
getBeginTime
in interface Retriever
getBuffer
public final java.nio.ByteBuffer getBuffer()
- Specified by:
getBuffer
in interface Retriever
getConnection
protected final java.net.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 java.lang.String getContentType()
- Specified by:
getContentType
in interface Retriever
getEndTime
public long getEndTime()
- Specified by:
getEndTime
in interface Retriever
getName
public final java.lang.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 java.lang.String getState()
- Specified by:
getState
in interface Retriever
getSubmitTime
public long getSubmitTime()
- Specified by:
getSubmitTime
in interface Retriever
getUrl
public final java.net.URL getUrl()
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.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 java.lang.String toString()
- Overrides:
toString
in class java.lang.Object