mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-07-04 09:42:25 +00:00
DATAES-646 - Adapt to Spring Framework 5.2 RC2.
Un-implement ClientResponse from RawActionResponse to not require us updating the code whenever ClientResponse introduces new methods. Retain only methods from ClientResponse that are actually used. Consistent versions actross netty dependencies.
This commit is contained in:
parent
aae7734bc0
commit
bdee49f815
@ -15,32 +15,22 @@
|
|||||||
*/
|
*/
|
||||||
package org.springframework.data.elasticsearch.client.reactive;
|
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.elasticsearch.action.ActionResponse;
|
||||||
import org.springframework.core.ParameterizedTypeReference;
|
|
||||||
import org.springframework.http.HttpStatus;
|
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.http.client.reactive.ClientHttpResponse;
|
||||||
import org.springframework.util.MultiValueMap;
|
|
||||||
import org.springframework.web.reactive.function.BodyExtractor;
|
import org.springframework.web.reactive.function.BodyExtractor;
|
||||||
import org.springframework.web.reactive.function.client.ClientResponse;
|
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 Christoph Strobl
|
||||||
* @author Peter-Josef Meisch
|
* @author Peter-Josef Meisch
|
||||||
* @author Mark Paluch
|
* @author Mark Paluch
|
||||||
* @since 3.2
|
* @since 3.2
|
||||||
*/
|
*/
|
||||||
class RawActionResponse extends ActionResponse implements ClientResponse {
|
class RawActionResponse extends ActionResponse {
|
||||||
|
|
||||||
private final ClientResponse delegate;
|
private final ClientResponse delegate;
|
||||||
|
|
||||||
@ -52,157 +42,23 @@ class RawActionResponse extends ActionResponse implements ClientResponse {
|
|||||||
return new RawActionResponse(response);
|
return new RawActionResponse(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.springframework.web.reactive.function.client.ClientResponse#statusCode()
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public HttpStatus statusCode() {
|
public HttpStatus statusCode() {
|
||||||
return delegate.statusCode();
|
return delegate.statusCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.springframework.web.reactive.function.client.ClientResponse#rawStatusCode()
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int rawStatusCode() {
|
|
||||||
return delegate.rawStatusCode();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.springframework.web.reactive.function.client.ClientResponse#headers()
|
* @see org.springframework.web.reactive.function.client.ClientResponse#headers()
|
||||||
*/
|
*/
|
||||||
@Override
|
public ClientResponse.Headers headers() {
|
||||||
public Headers headers() {
|
|
||||||
return delegate.headers();
|
return delegate.headers();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.springframework.web.reactive.function.client.ClientResponse#cookies()
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public MultiValueMap<String, ResponseCookie> cookies() {
|
|
||||||
return delegate.cookies();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.springframework.web.reactive.function.client.ClientResponse#strategies()
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public ExchangeStrategies strategies() {
|
|
||||||
return delegate.strategies();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.springframework.web.reactive.function.client.ClientResponse#body(org.springframework.web.reactive.function.BodyExtractor)
|
* @see org.springframework.web.reactive.function.client.ClientResponse#body(org.springframework.web.reactive.function.BodyExtractor)
|
||||||
*/
|
*/
|
||||||
@Override
|
|
||||||
public <T> T body(BodyExtractor<T, ? super ClientHttpResponse> extractor) {
|
public <T> T body(BodyExtractor<T, ? super ClientHttpResponse> extractor) {
|
||||||
return delegate.body(extractor);
|
return delegate.body(extractor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.springframework.web.reactive.function.client.ClientResponse#bodyToMono(java.lang.Class)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public <T> Mono<T> bodyToMono(Class<? extends T> elementClass) {
|
|
||||||
return delegate.bodyToMono(elementClass);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.springframework.web.reactive.function.client.ClientResponse#bodyToMono(org.springframework.core.ParameterizedTypeReference)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public <T> Mono<T> bodyToMono(ParameterizedTypeReference<T> typeReference) {
|
|
||||||
return delegate.bodyToMono(typeReference);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.springframework.web.reactive.function.client.ClientResponse#bodyToFlux(java.lang.Class)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public <T> Flux<T> bodyToFlux(Class<? extends T> elementClass) {
|
|
||||||
return delegate.bodyToFlux(elementClass);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.springframework.web.reactive.function.client.ClientResponse#bodyToFlux(org.springframework.core.ParameterizedTypeReference)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public <T> Flux<T> bodyToFlux(ParameterizedTypeReference<T> typeReference) {
|
|
||||||
return delegate.bodyToFlux(typeReference);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.springframework.web.reactive.function.client.ClientResponse#releaseBody()
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Mono<Void> releaseBody() {
|
|
||||||
return delegate.releaseBody();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.springframework.web.reactive.function.client.ClientResponse#toEntity(java.lang.Class)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public <T> Mono<ResponseEntity<T>> toEntity(Class<T> bodyType) {
|
|
||||||
return delegate.toEntity(bodyType);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.springframework.web.reactive.function.client.ClientResponse#toEntity(org.springframework.core.ParameterizedTypeReference)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public <T> Mono<ResponseEntity<T>> toEntity(ParameterizedTypeReference<T> typeReference) {
|
|
||||||
return delegate.toEntity(typeReference);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.springframework.web.reactive.function.client.ClientResponse#toEntityList(java.lang.Class)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public <T> Mono<ResponseEntity<List<T>>> toEntityList(Class<T> elementType) {
|
|
||||||
return delegate.toEntityList(elementType);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.springframework.web.reactive.function.client.ClientResponse#toBodilessEntity()
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Mono<ResponseEntity<Void>> toBodilessEntity() {
|
|
||||||
return delegate.toBodilessEntity();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.springframework.web.reactive.function.client.ClientResponse#toEntityList(org.springframework.core.ParameterizedTypeReference)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public <T> Mono<ResponseEntity<List<T>>> toEntityList(ParameterizedTypeReference<T> typeReference) {
|
|
||||||
return delegate.toEntityList(typeReference);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.springframework.web.reactive.function.client.ClientResponse#createException()
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Mono<WebClientResponseException> createException() {
|
|
||||||
return delegate.createException();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user