Package org.jivesoftware.openfire.nio
Class NettyOutboundConnectionHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.SimpleChannelInboundHandler<String>
org.jivesoftware.openfire.nio.NettyConnectionHandler
org.jivesoftware.openfire.nio.NettyOutboundConnectionHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
Outbound (S2S) specific ConnectionHandler that knows which subclass of
StanzaHandler should be created
and how to build and configure a NettyConnection.- Author:
- Matthew Vivian, Alex Gidman
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Field Summary
Fields inherited from class org.jivesoftware.openfire.nio.NettyConnectionHandler
configuration, CONNECTION, IDLE_FLAG, PARSER_CACHE, READ_BYTES, sslInitDone, WRITTEN_BYTES -
Constructor Summary
ConstructorsConstructorDescriptionNettyOutboundConnectionHandler(ConnectionConfiguration configuration, DomainPair domainPair, int port) -
Method Summary
Modifier and TypeMethodDescriptionvoidchannelActive(io.netty.channel.ChannelHandlerContext ctx) Returns the time that a connection can be idle before being closed.intgetPort()voidhandlerAdded(io.netty.channel.ChannelHandlerContext ctx) toString()voiduserEventTriggered(io.netty.channel.ChannelHandlerContext ctx, Object evt) Called when SSL Handshake has been completed.Methods inherited from class org.jivesoftware.openfire.nio.NettyConnectionHandler
channelRead0, channelUnregistered, exceptionCaught, handlerRemovedMethods inherited from class io.netty.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelReadMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelInactive, channelReadComplete, channelRegistered, channelWritabilityChangedMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, isSharable
-
Constructor Details
-
NettyOutboundConnectionHandler
public NettyOutboundConnectionHandler(ConnectionConfiguration configuration, DomainPair domainPair, int port)
-
-
Method Details
-
channelActive
- Specified by:
channelActivein interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelActivein classio.netty.channel.ChannelInboundHandlerAdapter- Throws:
Exception
-
getMaxIdleTime
Description copied from class:NettyConnectionHandlerReturns the time that a connection can be idle before being closed.- Specified by:
getMaxIdleTimein classNettyConnectionHandler- Returns:
- the time a connection can be idle.
-
handlerAdded
public void handlerAdded(io.netty.channel.ChannelHandlerContext ctx) - Specified by:
handlerAddedin interfaceio.netty.channel.ChannelHandler- Overrides:
handlerAddedin classNettyConnectionHandler
-
userEventTriggered
public void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx, Object evt) throws Exception Called when SSL Handshake has been completed. If successful, attempts authentication via SASL, or dialback dependent on configuration and certificate validity. If not successful, either attempts dialback on a plain un-encrypted connection, or throws an exception dependent on configuration.- Specified by:
userEventTriggeredin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
userEventTriggeredin classNettyConnectionHandler- Parameters:
ctx- ChannelHandlerContext for the Netty channelevt- Event that has been triggered - this implementation specifically identifies SslHandshakeCompletionEvent- Throws:
Exception
-
getDomainPair
-
getPort
public int getPort() -
toString
- Overrides:
toStringin classNettyConnectionHandler
-