Class RedirectingAsyncDecorator
java.lang.Object
org.apache.hc.client5.testing.async.RedirectingAsyncDecorator
- All Implemented Interfaces:
org.apache.hc.core5.http.nio.AsyncDataConsumer
,org.apache.hc.core5.http.nio.AsyncDataExchangeHandler
,org.apache.hc.core5.http.nio.AsyncDataProducer
,org.apache.hc.core5.http.nio.AsyncServerExchangeHandler
,org.apache.hc.core5.http.nio.ResourceHolder
public class RedirectingAsyncDecorator
extends Object
implements org.apache.hc.core5.http.nio.AsyncServerExchangeHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.apache.hc.core5.http.nio.AsyncServerExchangeHandler
private final AtomicBoolean
private final RedirectResolver
-
Constructor Summary
ConstructorsConstructorDescriptionRedirectingAsyncDecorator
(org.apache.hc.core5.http.nio.AsyncServerExchangeHandler exchangeHandler, RedirectResolver redirectResolver) -
Method Summary
Modifier and TypeMethodDescriptionint
final void
consume
(ByteBuffer src) private org.apache.hc.core5.http.HttpResponse
createRedirectResponse
(Redirect redirect) void
void
handleRequest
(org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.EntityDetails entityDetails, org.apache.hc.core5.http.nio.ResponseChannel responseChannel, org.apache.hc.core5.http.protocol.HttpContext context) void
produce
(org.apache.hc.core5.http.nio.DataStreamChannel channel) void
private Redirect
resolveRedirect
(org.apache.hc.core5.http.HttpRequest request) final void
final void
updateCapacity
(org.apache.hc.core5.http.nio.CapacityChannel capacityChannel)
-
Field Details
-
exchangeHandler
private final org.apache.hc.core5.http.nio.AsyncServerExchangeHandler exchangeHandler -
redirectResolver
-
redirecting
-
-
Constructor Details
-
RedirectingAsyncDecorator
public RedirectingAsyncDecorator(org.apache.hc.core5.http.nio.AsyncServerExchangeHandler exchangeHandler, RedirectResolver redirectResolver)
-
-
Method Details
-
resolveRedirect
private Redirect resolveRedirect(org.apache.hc.core5.http.HttpRequest request) throws org.apache.hc.core5.http.HttpException - Throws:
org.apache.hc.core5.http.HttpException
-
createRedirectResponse
-
handleRequest
public void handleRequest(org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.EntityDetails entityDetails, org.apache.hc.core5.http.nio.ResponseChannel responseChannel, org.apache.hc.core5.http.protocol.HttpContext context) throws org.apache.hc.core5.http.HttpException, IOException - Specified by:
handleRequest
in interfaceorg.apache.hc.core5.http.nio.AsyncServerExchangeHandler
- Throws:
org.apache.hc.core5.http.HttpException
IOException
-
updateCapacity
public final void updateCapacity(org.apache.hc.core5.http.nio.CapacityChannel capacityChannel) throws IOException - Specified by:
updateCapacity
in interfaceorg.apache.hc.core5.http.nio.AsyncDataConsumer
- Throws:
IOException
-
consume
- Specified by:
consume
in interfaceorg.apache.hc.core5.http.nio.AsyncDataConsumer
- Throws:
IOException
-
streamEnd
public final void streamEnd(List<? extends org.apache.hc.core5.http.Header> trailers) throws org.apache.hc.core5.http.HttpException, IOException - Specified by:
streamEnd
in interfaceorg.apache.hc.core5.http.nio.AsyncDataConsumer
- Throws:
org.apache.hc.core5.http.HttpException
IOException
-
available
public int available()- Specified by:
available
in interfaceorg.apache.hc.core5.http.nio.AsyncDataProducer
-
produce
- Specified by:
produce
in interfaceorg.apache.hc.core5.http.nio.AsyncDataProducer
- Throws:
IOException
-
failed
- Specified by:
failed
in interfaceorg.apache.hc.core5.http.nio.AsyncDataExchangeHandler
-
releaseResources
public void releaseResources()- Specified by:
releaseResources
in interfaceorg.apache.hc.core5.http.nio.ResourceHolder
-