class BlobServerPortHandler extends AbstractRestHandler<DispatcherGateway, EmptyRequestBody, BlobServerPortResponseBody, EmptyMessageParameters> {

	@Override
	protected CompletableFuture<BlobServerPortResponseBody> handleRequest(@Nonnull HandlerRequest<EmptyRequestBody, EmptyMessageParameters> request, @Nonnull DispatcherGateway gateway) throws RestHandlerException {
		return gateway
			.getBlobServerPort(timeout)
			.thenApply(BlobServerPortResponseBody::new)
			.exceptionally(error -> {
				throw new CompletionException(new RestHandlerException(
					"Failed to retrieve blob server port.",
					HttpResponseStatus.INTERNAL_SERVER_ERROR,
					ExceptionUtils.stripCompletionException(error)));
			});
	}

	public  BlobServerPortHandler(
			CompletableFuture<String> localRestAddress,
			GatewayRetriever<? extends DispatcherGateway> leaderRetriever,
			Time timeout,
			Map<String, String> headers);

}