|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.phleisch.app.itsucks.io.impl.AbstractUrlDataRetriever
de.phleisch.app.itsucks.io.http.impl.HttpRetriever
public class HttpRetriever
Implementation of an data retriever for the http protocol.
| Field Summary | |
|---|---|
protected static long |
DEFAULT_TIME_TO_WAIT_BETWEEN_RETRY
|
protected boolean |
mAbort
|
protected long |
mBytesToSkip
|
protected HttpRetrieverConfiguration |
mConfiguration
|
protected java.util.List<java.lang.String> |
mCookieList
|
protected GetMethod |
mGet
|
protected HttpMetadata |
mMetadata
|
protected java.net.URL |
mReferer
|
protected HttpRetrieverResponseCodeBehaviour |
mResponseCodeBehaviour
|
protected int |
mResultCode
|
protected long |
mTimeToWaitBetweenRetry
|
| Fields inherited from class de.phleisch.app.itsucks.io.impl.AbstractUrlDataRetriever |
|---|
mUrl |
| Fields inherited from interface de.phleisch.app.itsucks.io.UrlDataRetriever |
|---|
RESULT_RETRIEVAL_ABORTED, RESULT_RETRIEVAL_FAILED, RESULT_RETRIEVAL_FAILED_BUT_RETRYABLE, RESULT_RETRIEVAL_NOT_STARTED_YET, RESULT_RETRIEVAL_OK, RESULT_RETRIEVAL_UNKNOWN |
| Fields inherited from interface de.phleisch.app.itsucks.io.DataRetriever |
|---|
NOTIFICATION_PROGRESS |
| Constructor Summary | |
|---|---|
HttpRetriever(java.net.URL pUrl,
HttpRetrieverConfiguration pHttpRetrieverConfiguration)
|
|
| Method Summary | |
|---|---|
void |
abort()
Aborts the current retrieving. |
protected void |
analyzeResultCode()
|
void |
connect()
Advise the Retriever to connect to the data source. |
protected static HttpRetrieverResponseCodeBehaviour |
createDefaultHttpRetrieverBehaviour()
|
protected HttpClient |
createHttpClient(HttpRetrieverConfiguration pConfiguration)
|
void |
disconnect()
Disconnect from the data source. |
long |
getBytesSkipped()
Returns the skipped bytes. |
HttpRetrieverConfiguration |
getConfiguration()
|
long |
getContentLenght()
Returns the content length in bytes. |
java.util.List<java.lang.String> |
getCookieList()
|
java.io.InputStream |
getDataAsInputStream()
Returns an input stream for the retrieved data. |
protected HttpClient |
getHttpClientFromConfiguration()
|
HttpMetadata |
getMetadata()
Returns the metadata of the data source connection. |
java.net.URL |
getReferer()
|
HttpRetrieverResponseCodeBehaviour |
getResponseCodeBehaviour()
|
int |
getResultCode()
Returns the internal state and result code after connecting. |
long |
getSuggestedTimeToWaitForRetry()
Returns the suggested time to wait befory retry the retrieval in ms. |
boolean |
isConnected()
Returns true if the retriever is connected. |
boolean |
isDataAvailable()
Returns true if the data source contains any data to be read. |
void |
setBytesToSkip(long pBytesToSkip)
Skip the given bytes (seek) when reading the data source. |
void |
setConfiguration(HttpRetrieverConfiguration pConfiguration)
|
void |
setCookieList(java.util.List<java.lang.String> pCookieList)
|
void |
setReferer(java.net.URL pReferer)
|
void |
setResponseCodeBehaviour(HttpRetrieverResponseCodeBehaviour pResponseCodeBehaviour)
|
| Methods inherited from class de.phleisch.app.itsucks.io.impl.AbstractUrlDataRetriever |
|---|
getUrl, setUrl, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final long DEFAULT_TIME_TO_WAIT_BETWEEN_RETRY
protected long mTimeToWaitBetweenRetry
protected HttpRetrieverConfiguration mConfiguration
protected HttpRetrieverResponseCodeBehaviour mResponseCodeBehaviour
protected java.util.List<java.lang.String> mCookieList
protected java.net.URL mReferer
protected GetMethod mGet
protected HttpMetadata mMetadata
protected int mResultCode
protected boolean mAbort
protected long mBytesToSkip
| Constructor Detail |
|---|
public HttpRetriever(java.net.URL pUrl,
HttpRetrieverConfiguration pHttpRetrieverConfiguration)
| Method Detail |
|---|
public void connect()
throws java.io.IOException
DataRetriever
java.io.IOExceptionprotected HttpClient getHttpClientFromConfiguration()
protected HttpClient createHttpClient(HttpRetrieverConfiguration pConfiguration)
public boolean isDataAvailable()
throws java.io.IOException
DataRetriever
java.io.IOException
public boolean isConnected()
throws java.io.IOException
DataRetriever
java.io.IOException
public java.io.InputStream getDataAsInputStream()
throws java.io.IOException
DataRetriever
java.io.IOExceptionpublic void disconnect()
DataRetriever
public HttpMetadata getMetadata()
DataRetriever
public void abort()
DataRetriever
public void setBytesToSkip(long pBytesToSkip)
DataRetriever
public long getBytesSkipped()
DataRetriever
public int getResultCode()
UrlDataRetriever
protected void analyzeResultCode()
public long getSuggestedTimeToWaitForRetry()
UrlDataRetriever
public long getContentLenght()
DataRetriever
public HttpRetrieverConfiguration getConfiguration()
public void setConfiguration(HttpRetrieverConfiguration pConfiguration)
public HttpRetrieverResponseCodeBehaviour getResponseCodeBehaviour()
public void setResponseCodeBehaviour(HttpRetrieverResponseCodeBehaviour pResponseCodeBehaviour)
protected static HttpRetrieverResponseCodeBehaviour createDefaultHttpRetrieverBehaviour()
public java.util.List<java.lang.String> getCookieList()
public void setCookieList(java.util.List<java.lang.String> pCookieList)
public java.net.URL getReferer()
public void setReferer(java.net.URL pReferer)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||