dev.vality.http.client.callback.LogFutureCallback Maven / Gradle / Ivy
The newest version!
package dev.vality.http.client.callback;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.concurrent.FutureCallback;
@Slf4j
@RequiredArgsConstructor
public class LogFutureCallback implements FutureCallback {
private final HttpRequestBase httpRequestBase;
public void completed(final HttpResponse response2) {
log.debug(httpRequestBase.getRequestLine() + " -> " + response2.getStatusLine());
}
public void failed(final Exception ex) {
log.error(httpRequestBase.getRequestLine() + " e: ", ex);
}
public void cancelled() {
log.warn(httpRequestBase.getRequestLine() + " cancelled");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy