Class AuthenticatingAsyncDecorator
java.lang.Object
org.apache.hc.client5.testing.async.AuthenticatingAsyncDecorator
- 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 AuthenticatingAsyncDecorator
extends Object
implements org.apache.hc.core5.http.nio.AsyncServerExchangeHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AuthenticationHandler<String> private final Authenticatorprivate final org.apache.hc.core5.http.nio.AsyncServerExchangeHandlerprivate final AtomicReference<org.apache.hc.core5.http.nio.AsyncResponseProducer> -
Constructor Summary
ConstructorsConstructorDescriptionAuthenticatingAsyncDecorator(org.apache.hc.core5.http.nio.AsyncServerExchangeHandler exchangeHandler, AuthenticationHandler<String> authenticationHandler, Authenticator authenticator) AuthenticatingAsyncDecorator(org.apache.hc.core5.http.nio.AsyncServerExchangeHandler exchangeHandler, Authenticator authenticator) -
Method Summary
Modifier and TypeMethodDescriptionfinal intfinal voidconsume(ByteBuffer src) protected voidcustomizeUnauthorizedResponse(org.apache.hc.core5.http.HttpResponse unauthorized) final voidvoidhandleRequest(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) final voidproduce(org.apache.hc.core5.http.nio.DataStreamChannel channel) final voidfinal voidfinal voidupdateCapacity(org.apache.hc.core5.http.nio.CapacityChannel capacityChannel)
-
Field Details
-
exchangeHandler
private final org.apache.hc.core5.http.nio.AsyncServerExchangeHandler exchangeHandler -
authenticationHandler
-
authenticator
-
responseProducerRef
private final AtomicReference<org.apache.hc.core5.http.nio.AsyncResponseProducer> responseProducerRef
-
-
Constructor Details
-
AuthenticatingAsyncDecorator
public AuthenticatingAsyncDecorator(org.apache.hc.core5.http.nio.AsyncServerExchangeHandler exchangeHandler, AuthenticationHandler<String> authenticationHandler, Authenticator authenticator) - Since:
- 5.3
-
AuthenticatingAsyncDecorator
public AuthenticatingAsyncDecorator(org.apache.hc.core5.http.nio.AsyncServerExchangeHandler exchangeHandler, Authenticator authenticator)
-
-
Method Details
-
customizeUnauthorizedResponse
protected void customizeUnauthorizedResponse(org.apache.hc.core5.http.HttpResponse unauthorized) -
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:
handleRequestin interfaceorg.apache.hc.core5.http.nio.AsyncServerExchangeHandler- Throws:
org.apache.hc.core5.http.HttpExceptionIOException
-
updateCapacity
public final void updateCapacity(org.apache.hc.core5.http.nio.CapacityChannel capacityChannel) throws IOException - Specified by:
updateCapacityin interfaceorg.apache.hc.core5.http.nio.AsyncDataConsumer- Throws:
IOException
-
consume
- Specified by:
consumein 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:
streamEndin interfaceorg.apache.hc.core5.http.nio.AsyncDataConsumer- Throws:
org.apache.hc.core5.http.HttpExceptionIOException
-
available
public final int available()- Specified by:
availablein interfaceorg.apache.hc.core5.http.nio.AsyncDataProducer
-
produce
public final void produce(org.apache.hc.core5.http.nio.DataStreamChannel channel) throws IOException - Specified by:
producein interfaceorg.apache.hc.core5.http.nio.AsyncDataProducer- Throws:
IOException
-
failed
- Specified by:
failedin interfaceorg.apache.hc.core5.http.nio.AsyncDataExchangeHandler
-
releaseResources
public final void releaseResources()- Specified by:
releaseResourcesin interfaceorg.apache.hc.core5.http.nio.ResourceHolder
-