NASA World Wind

gov.nasa.worldwind.retrieve
Class URLRetriever

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.WWObjectImpl
          extended by 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


Field Summary
 
Fields inherited from class gov.nasa.worldwind.avlist.AVListImpl
changeSupport
 
Fields inherited from interface gov.nasa.worldwind.retrieve.Retriever
RETRIEVER_STATE_CONNECTING, RETRIEVER_STATE_ERROR, RETRIEVER_STATE_INTERRUPTED, RETRIEVER_STATE_NOT_STARTED, RETRIEVER_STATE_READING, RETRIEVER_STATE_STARTED, RETRIEVER_STATE_SUCCESSFUL
 
Constructor Summary
URLRetriever(URL url, RetrievalPostProcessor postProcessor)
           
 
Method Summary
 Retriever call()
           
protected  ByteBuffer doRead(URLConnection connection)
           
 boolean equals(Object o)
           
 long getBeginTime()
           
 ByteBuffer getBuffer()
           
protected  URLConnection getConnection()
           
 int getConnectTimeout()
           
 int getContentLength()
           
 int getContentLengthRead()
           
 String getContentType()
           
 long getEndTime()
           
 String getName()
           
 RetrievalPostProcessor getPostProcessor()
           
 int getReadTimeout()
           
 int getStaleRequestLimit()
           
 String getState()
           
 long getSubmitTime()
           
 URL getUrl()
           
 int hashCode()
           
 void setBeginTime(long beginTime)
           
 void setConnectTimeout(int connectTimeout)
           
protected  void setContentLengthRead(int length)
           
 void setEndTime(long endTime)
           
 void setReadTimeout(int readTimeout)
           
 void setStaleRequestLimit(int staleRequestLimit)
           
 void setSubmitTime(long submitTime)
           
 String toString()
           
 
Methods inherited from class gov.nasa.worldwind.WWObjectImpl
propertyChange
 
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
 

Constructor Detail

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.
Method Detail

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

NASA World Wind