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 voidonError(REQUEST request, Throwable error)Called if the request could not be completed successfully.voidonSuccess(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:AsyncHandlerCalled if the request was successfully completed.- Specified by:
onSuccessin interfaceAsyncHandler<REQUEST extends BmcRequest<?>,RESPONSE>- Overrides:
onSuccessin 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:AsyncHandlerCalled if the request could not be completed successfully.- Specified by:
onErrorin interfaceAsyncHandler<REQUEST extends BmcRequest<?>,RESPONSE>- Overrides:
onErrorin classForwardingAsyncHandler<REQUEST extends BmcRequest<?>,RESPONSE>- Parameters:
request- The request that was made.error- The error that was received.
-
-