T- type of the leader gateway
V- type of the operation result
M- type of the message headers
protected abstract class AbstractAsynchronousOperationHandlers.StatusHandler<T extends RestfulGateway,V,M extends MessageParameters> extends AbstractRestHandler<T,EmptyRequestBody,AsynchronousOperationResult<V>,M>
AsynchronousOperationResultwhich indicates whether the operation is still in progress or has completed. In case that the operation has been completed, the
AsynchronousOperationResultcontains the operation result.
|Modifier||Constructor and Description|
|Modifier and Type||Method and Description|
Create an exceptional operation result from the given
Extract the operation key under which the operation result future is stored.
This method is called for every incoming request and returns a
Create the operation result from the given value.
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public CompletableFuture<AsynchronousOperationResult<V>> handleRequest(@Nonnull HandlerRequest<EmptyRequestBody,M> request, @Nonnull T gateway) throws RestHandlerException
CompletableFuturecontaining a the response.
Failing the future with another exception type or throwing unchecked exceptions is regarded as an
implementation error as it does not allow us to provide a meaningful HTTP status code. In this case a
HttpResponseStatus.INTERNAL_SERVER_ERROR will be returned.
AbstractRestHandler<T extends RestfulGateway,EmptyRequestBody,AsynchronousOperationResult<V>,M extends MessageParameters>
request- request that should be handled
gateway- leader gateway
RestHandlerException- if the handling failed
public CompletableFuture<Void> closeHandlerAsync()
protected abstract K getOperationKey(HandlerRequest<EmptyRequestBody,M> request)
request- with which the status handler has been called
Throwable. This method is called if the asynchronous operation failed.
throwable- failure of the asynchronous operation
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.