diff --git a/src/main/java/org/springframework/data/elasticsearch/client/reactive/RawActionResponse.java b/src/main/java/org/springframework/data/elasticsearch/client/reactive/RawActionResponse.java index 111e1b979..4e89f83f5 100644 --- a/src/main/java/org/springframework/data/elasticsearch/client/reactive/RawActionResponse.java +++ b/src/main/java/org/springframework/data/elasticsearch/client/reactive/RawActionResponse.java @@ -15,32 +15,22 @@ */ package org.springframework.data.elasticsearch.client.reactive; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -import java.util.List; - import org.elasticsearch.action.ActionResponse; -import org.springframework.core.ParameterizedTypeReference; + import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseCookie; -import org.springframework.http.ResponseEntity; import org.springframework.http.client.reactive.ClientHttpResponse; -import org.springframework.util.MultiValueMap; import org.springframework.web.reactive.function.BodyExtractor; import org.springframework.web.reactive.function.client.ClientResponse; -import org.springframework.web.reactive.function.client.ExchangeStrategies; -import org.springframework.web.reactive.function.client.WebClientResponseException; /** - * Extension to {@link ActionResponse} that also implements {@link ClientResponse}. + * Extension to {@link ActionResponse} that also delegates to {@link ClientResponse}. * * @author Christoph Strobl * @author Peter-Josef Meisch * @author Mark Paluch * @since 3.2 */ -class RawActionResponse extends ActionResponse implements ClientResponse { +class RawActionResponse extends ActionResponse { private final ClientResponse delegate; @@ -52,157 +42,23 @@ class RawActionResponse extends ActionResponse implements ClientResponse { return new RawActionResponse(response); } - /* - * (non-Javadoc) - * @see org.springframework.web.reactive.function.client.ClientResponse#statusCode() - */ - @Override public HttpStatus statusCode() { return delegate.statusCode(); } - /* - * (non-Javadoc) - * @see org.springframework.web.reactive.function.client.ClientResponse#rawStatusCode() - */ - @Override - public int rawStatusCode() { - return delegate.rawStatusCode(); - } - /* * (non-Javadoc) * @see org.springframework.web.reactive.function.client.ClientResponse#headers() */ - @Override - public Headers headers() { + public ClientResponse.Headers headers() { return delegate.headers(); } - /* - * (non-Javadoc) - * @see org.springframework.web.reactive.function.client.ClientResponse#cookies() - */ - @Override - public MultiValueMap cookies() { - return delegate.cookies(); - } - - /* - * (non-Javadoc) - * @see org.springframework.web.reactive.function.client.ClientResponse#strategies() - */ - @Override - public ExchangeStrategies strategies() { - return delegate.strategies(); - } - /* * (non-Javadoc) * @see org.springframework.web.reactive.function.client.ClientResponse#body(org.springframework.web.reactive.function.BodyExtractor) */ - @Override public T body(BodyExtractor extractor) { return delegate.body(extractor); } - - /* - * (non-Javadoc) - * @see org.springframework.web.reactive.function.client.ClientResponse#bodyToMono(java.lang.Class) - */ - @Override - public Mono bodyToMono(Class elementClass) { - return delegate.bodyToMono(elementClass); - } - - /* - * (non-Javadoc) - * @see org.springframework.web.reactive.function.client.ClientResponse#bodyToMono(org.springframework.core.ParameterizedTypeReference) - */ - @Override - public Mono bodyToMono(ParameterizedTypeReference typeReference) { - return delegate.bodyToMono(typeReference); - } - - /* - * (non-Javadoc) - * @see org.springframework.web.reactive.function.client.ClientResponse#bodyToFlux(java.lang.Class) - */ - @Override - public Flux bodyToFlux(Class elementClass) { - return delegate.bodyToFlux(elementClass); - } - - /* - * (non-Javadoc) - * @see org.springframework.web.reactive.function.client.ClientResponse#bodyToFlux(org.springframework.core.ParameterizedTypeReference) - */ - @Override - public Flux bodyToFlux(ParameterizedTypeReference typeReference) { - return delegate.bodyToFlux(typeReference); - } - - /* - * (non-Javadoc) - * @see org.springframework.web.reactive.function.client.ClientResponse#releaseBody() - */ - @Override - public Mono releaseBody() { - return delegate.releaseBody(); - } - - /* - * (non-Javadoc) - * @see org.springframework.web.reactive.function.client.ClientResponse#toEntity(java.lang.Class) - */ - @Override - public Mono> toEntity(Class bodyType) { - return delegate.toEntity(bodyType); - } - - /* - * (non-Javadoc) - * @see org.springframework.web.reactive.function.client.ClientResponse#toEntity(org.springframework.core.ParameterizedTypeReference) - */ - @Override - public Mono> toEntity(ParameterizedTypeReference typeReference) { - return delegate.toEntity(typeReference); - } - - /* - * (non-Javadoc) - * @see org.springframework.web.reactive.function.client.ClientResponse#toEntityList(java.lang.Class) - */ - @Override - public Mono>> toEntityList(Class elementType) { - return delegate.toEntityList(elementType); - } - - /* - * (non-Javadoc) - * @see org.springframework.web.reactive.function.client.ClientResponse#toBodilessEntity() - */ - @Override - public Mono> toBodilessEntity() { - return delegate.toBodilessEntity(); - } - - /* - * (non-Javadoc) - * @see org.springframework.web.reactive.function.client.ClientResponse#toEntityList(org.springframework.core.ParameterizedTypeReference) - */ - @Override - public Mono>> toEntityList(ParameterizedTypeReference typeReference) { - return delegate.toEntityList(typeReference); - } - - /* - * (non-Javadoc) - * @see org.springframework.web.reactive.function.client.ClientResponse#createException() - */ - @Override - public Mono createException() { - return delegate.createException(); - } - }