org.lastbamboo.common.http.client
Interface HttpListener

All Superinterfaces:
EventListener, org.littleshoot.util.WriteListener

public interface HttpListener
extends org.littleshoot.util.WriteListener

Interface for listening to download events, such as setting of the download content length, new data downloaded, etc.


Method Summary
 void onBadHeader(String header)
           
 void onConnect(long ms)
          Called when a connection is made to the remote host.
 void onContentLength(long contentLength)
          Called when the downloader has determined the content length of the resource.
 void onContentRange(org.apache.commons.lang.math.LongRange range)
           
 void onCouldNotConnect()
          Called when we could not connect to the remote host.
 void onDownloadStarted()
          Called when the download has started.
 void onFailure()
           
 void onHttpException(org.apache.commons.httpclient.HttpException httpException)
          Called when there's an HTTP exception while connecting to the remote host.
 void onMessageBodyRead()
          Called when the HTTP message body has been read.
 void onNoTwoHundredOk(int responseCode)
          Called when we receive a response code other than 200 OK.
 void onPermanentFailure()
           
 void onStatusEvent(String status)
          Called when the status of the the download has changed.
 
Methods inherited from interface org.littleshoot.util.WriteListener
onBytesRead
 

Method Detail

onContentLength

void onContentLength(long contentLength)
Called when the downloader has determined the content length of the resource.

Parameters:
contentLength - The length of the content in bytes.

onStatusEvent

void onStatusEvent(String status)
Called when the status of the the download has changed.

Parameters:
status - The status of the download.

onDownloadStarted

void onDownloadStarted()
Called when the download has started.


onCouldNotConnect

void onCouldNotConnect()
Called when we could not connect to the remote host.


onConnect

void onConnect(long ms)
Called when a connection is made to the remote host.

Parameters:
ms - The number of milliseconds it took to connect.

onHttpException

void onHttpException(org.apache.commons.httpclient.HttpException httpException)
Called when there's an HTTP exception while connecting to the remote host.

Parameters:
httpException - The exception from attempting the HTTP connection.

onNoTwoHundredOk

void onNoTwoHundredOk(int responseCode)
Called when we receive a response code other than 200 OK.

Parameters:
responseCode - The response code received.

onMessageBodyRead

void onMessageBodyRead()
Called when the HTTP message body has been read.


onBadHeader

void onBadHeader(String header)

onContentRange

void onContentRange(org.apache.commons.lang.math.LongRange range)
                    throws IOException
Throws:
IOException

onFailure

void onFailure()

onPermanentFailure

void onPermanentFailure()


Copyright © 2013 LittleShoot. All Rights Reserved.