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 java.lang.Object implements org.apache.hc.core5.http.nio.AsyncServerExchangeHandler
-
-
Field Summary
Fields Modifier and Type Field Description private AuthenticationHandler<java.lang.String>authenticationHandlerprivate Authenticatorauthenticatorprivate org.apache.hc.core5.http.nio.AsyncServerExchangeHandlerexchangeHandlerprivate java.util.concurrent.atomic.AtomicReference<org.apache.hc.core5.http.nio.AsyncResponseProducer>responseProducerRef
-
Constructor Summary
Constructors Constructor Description AuthenticatingAsyncDecorator(org.apache.hc.core5.http.nio.AsyncServerExchangeHandler exchangeHandler, AuthenticationHandler<java.lang.String> authenticationHandler, Authenticator authenticator)AuthenticatingAsyncDecorator(org.apache.hc.core5.http.nio.AsyncServerExchangeHandler exchangeHandler, Authenticator authenticator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidconsume(java.nio.ByteBuffer src)protected voidcustomizeUnauthorizedResponse(org.apache.hc.core5.http.HttpResponse unauthorized)voidfailed(java.lang.Exception cause)voidhandleRequest(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)voidproduce(org.apache.hc.core5.http.nio.DataStreamChannel channel)voidreleaseResources()voidstreamEnd(java.util.List<? extends org.apache.hc.core5.http.Header> trailers)voidupdateCapacity(org.apache.hc.core5.http.nio.CapacityChannel capacityChannel)
-
-
-
Field Detail
-
exchangeHandler
private final org.apache.hc.core5.http.nio.AsyncServerExchangeHandler exchangeHandler
-
authenticationHandler
private final AuthenticationHandler<java.lang.String> authenticationHandler
-
authenticator
private final Authenticator authenticator
-
responseProducerRef
private final java.util.concurrent.atomic.AtomicReference<org.apache.hc.core5.http.nio.AsyncResponseProducer> responseProducerRef
-
-
Constructor Detail
-
AuthenticatingAsyncDecorator
public AuthenticatingAsyncDecorator(org.apache.hc.core5.http.nio.AsyncServerExchangeHandler exchangeHandler, AuthenticationHandler<java.lang.String> authenticationHandler, Authenticator authenticator)- Since:
- 5.3
-
AuthenticatingAsyncDecorator
public AuthenticatingAsyncDecorator(org.apache.hc.core5.http.nio.AsyncServerExchangeHandler exchangeHandler, Authenticator authenticator)
-
-
Method Detail
-
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, java.io.IOException- Specified by:
handleRequestin interfaceorg.apache.hc.core5.http.nio.AsyncServerExchangeHandler- Throws:
org.apache.hc.core5.http.HttpExceptionjava.io.IOException
-
updateCapacity
public final void updateCapacity(org.apache.hc.core5.http.nio.CapacityChannel capacityChannel) throws java.io.IOException- Specified by:
updateCapacityin interfaceorg.apache.hc.core5.http.nio.AsyncDataConsumer- Throws:
java.io.IOException
-
consume
public final void consume(java.nio.ByteBuffer src) throws java.io.IOException- Specified by:
consumein interfaceorg.apache.hc.core5.http.nio.AsyncDataConsumer- Throws:
java.io.IOException
-
streamEnd
public final void streamEnd(java.util.List<? extends org.apache.hc.core5.http.Header> trailers) throws org.apache.hc.core5.http.HttpException, java.io.IOException- Specified by:
streamEndin interfaceorg.apache.hc.core5.http.nio.AsyncDataConsumer- Throws:
org.apache.hc.core5.http.HttpExceptionjava.io.IOException
-
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 java.io.IOException- Specified by:
producein interfaceorg.apache.hc.core5.http.nio.AsyncDataProducer- Throws:
java.io.IOException
-
failed
public final void failed(java.lang.Exception cause)
- 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
-
-