Class StreamClosingAsyncHandler<REQUEST extends BmcRequest<?>,RESPONSE>
- java.lang.Object
-
- com.oracle.bmc.responses.internal.ForwardingAsyncHandler<REQUEST,RESPONSE>
-
- com.oracle.bmc.responses.internal.StreamClosingAsyncHandler<REQUEST,RESPONSE>
-
- Type Parameters:
REQUEST
- type of the requestRESPONSE
- type of the response
- All Implemented Interfaces:
AsyncHandler<REQUEST,RESPONSE>
public class StreamClosingAsyncHandler<REQUEST extends BmcRequest<?>,RESPONSE> extends ForwardingAsyncHandler<REQUEST,RESPONSE>
A wrapper around an async handler that closes the stream at the end of a request, if the body is a stream.
-
-
Constructor Summary
Constructors Constructor Description StreamClosingAsyncHandler(AsyncHandler<REQUEST,RESPONSE> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onError(REQUEST request, Throwable error)
Called if the request could not be completed successfully.void
onSuccess(REQUEST request, RESPONSE response)
Called if the request was successfully completed.
-
-
-
Constructor Detail
-
StreamClosingAsyncHandler
public StreamClosingAsyncHandler(AsyncHandler<REQUEST,RESPONSE> delegate)
-
-
Method Detail
-
onSuccess
public void onSuccess(REQUEST request, RESPONSE response)
Description copied from interface:AsyncHandler
Called if the request was successfully completed.- Specified by:
onSuccess
in interfaceAsyncHandler<REQUEST extends BmcRequest<?>,RESPONSE>
- Overrides:
onSuccess
in classForwardingAsyncHandler<REQUEST extends BmcRequest<?>,RESPONSE>
- Parameters:
request
- The request that was made.response
- The response that was received.
-
onError
public void onError(REQUEST request, Throwable error)
Description copied from interface:AsyncHandler
Called if the request could not be completed successfully.- Specified by:
onError
in interfaceAsyncHandler<REQUEST extends BmcRequest<?>,RESPONSE>
- Overrides:
onError
in classForwardingAsyncHandler<REQUEST extends BmcRequest<?>,RESPONSE>
- Parameters:
request
- The request that was made.error
- The error that was received.
-
-