public class HttpServerChannelHandler
extends org.apache.camel.component.netty.handlers.ServerChannelHandler
ServerChannelHandler
that handles the incoming HTTP requests and routes
the received message in Camel.Constructor and Description |
---|
HttpServerChannelHandler(NettyHttpConsumer consumer) |
Modifier and Type | Method and Description |
---|---|
protected Subject |
authenticate(SecurityAuthenticator authenticator,
org.apache.camel.LoggingLevel deniedLoggingLevel,
HttpPrincipal principal)
Authenticates the http basic auth subject.
|
protected void |
beforeProcess(org.apache.camel.Exchange exchange,
io.netty.channel.ChannelHandlerContext ctx,
Object message) |
protected void |
channelRead0(io.netty.channel.ChannelHandlerContext ctx,
Object msg) |
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause) |
protected static HttpPrincipal |
extractBasicAuthSubject(io.netty.handler.codec.http.HttpRequest request)
Extracts the username and password details from the HTTP basic header Authorization.
|
NettyHttpConsumer |
getConsumer() |
protected Object |
getResponseBody(org.apache.camel.Exchange exchange) |
protected boolean |
matchesRoles(String roles,
String userRoles) |
channelActive, channelInactive, createResponseFutureListener
acceptInboundMessage, channelRead
channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
public HttpServerChannelHandler(NettyHttpConsumer consumer)
public NettyHttpConsumer getConsumer()
protected void channelRead0(io.netty.channel.ChannelHandlerContext ctx, Object msg) throws Exception
channelRead0
in class org.apache.camel.component.netty.handlers.ServerChannelHandler
Exception
protected static HttpPrincipal extractBasicAuthSubject(io.netty.handler.codec.http.HttpRequest request)
HttpPrincipal
with username and password details, or null if not possible to extractprotected Subject authenticate(SecurityAuthenticator authenticator, org.apache.camel.LoggingLevel deniedLoggingLevel, HttpPrincipal principal)
authenticator
- the authenticatorprincipal
- the principalprotected void beforeProcess(org.apache.camel.Exchange exchange, io.netty.channel.ChannelHandlerContext ctx, Object message)
beforeProcess
in class org.apache.camel.component.netty.handlers.ServerChannelHandler
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) throws Exception
exceptionCaught
in interface io.netty.channel.ChannelHandler
exceptionCaught
in interface io.netty.channel.ChannelInboundHandler
exceptionCaught
in class org.apache.camel.component.netty.handlers.ServerChannelHandler
Exception
Apache Camel