Skip to content

Commit

Permalink
Add a bit more explanatory Javadoc to Interceptor
Browse files Browse the repository at this point in the history
  • Loading branch information
SamBarker committed Jul 21, 2024
1 parent cbc78b1 commit c48e929
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
import java.util.List;
import java.util.concurrent.CompletableFuture;

/**
* A collection of callback methods invoked through the various stages of the HTTP request lifecycle.
* Callbacks that lead to a request being sent allow for that request to be customised.
*/
public interface Interceptor {

interface RequestTags {
Expand Down Expand Up @@ -63,7 +67,10 @@ default AsyncBody.Consumer<List<ByteBuffer>> consumer(AsyncBody.Consumer<List<By
}

/**
* Called after a websocket failure or by default from a normal request
* Called after a websocket failure or by default from a normal request.
* <p>
* Failure is determined by HTTP status code and will be invoked in addition to {@see Interceptor#after(HttpRequest,
* HttpResponse, AsyncBody.Consumer)}
*
* @param builder used to modify the request
* @param response the failed response
Expand All @@ -75,7 +82,10 @@ default CompletableFuture<Boolean> afterFailure(BasicBuilder builder, HttpRespon

/**
* Called after a non-websocket failure
*
* <p>
* Failure is determined by HTTP status code and will be invoked in addition to {@see Interceptor#after(HttpRequest,
* HttpResponse, AsyncBody.Consumer)}
*
* @param builder used to modify the request
* @param response the failed response
* @return true if the builder should be used to execute a new request
Expand Down

0 comments on commit c48e929

Please sign in to comment.