public abstract class MultipartResponseFacade extends java.lang.Object implements IResponseListener
IResponseListener
interface to ease the reception of multipart HTTP messages.
For each message part the onPartReceived() method will be invoked. When there are no more parts a call to onResponseHandlingFinished will be made.
Constructor and Description |
---|
MultipartResponseFacade() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
onEmptyBody(IReceiveEvent event)
Invoked when the response body is empty
|
protected abstract void |
onErrorReceived(IReceiveEvent event)
Invoked when the response status code is above 400.
|
protected abstract void |
onPartReceived(int statusCode,
java.lang.String contentType,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> responseHeaders,
java.lang.String responseBody)
Invoked when a message part is processed.
|
protected abstract void |
onResponseHandlingFinished(IReceiveEvent event)
Invoked when message processing is successfully finished.
|
void |
onResponseReceived(IReceiveEvent event)
Invoked when the response has been received.
|
public final void onResponseReceived(IReceiveEvent event) throws java.io.IOException
IResponseListener
onResponseReceived
in interface IResponseListener
event
- the event, must be non-nulljava.io.IOException
- in case of problems reading from the stream/readerprotected abstract void onPartReceived(int statusCode, java.lang.String contentType, java.util.Map<java.lang.String,java.util.List<java.lang.String>> responseHeaders, java.lang.String responseBody)
statusCode
- HTTP status codecontentType
- content-type of the part, can be nullresponseHeaders
- response headers extracted from the message partresponseBody
- response body, always non-nullprotected abstract void onResponseHandlingFinished(IReceiveEvent event)
protected abstract void onErrorReceived(IReceiveEvent event) throws java.io.IOException
java.io.IOException
protected abstract void onEmptyBody(IReceiveEvent event)