Package org.drasyl.handler.monitoring
Class TopologyHandler
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- org.drasyl.handler.monitoring.TopologyHandler
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
- Direct Known Subclasses:
TelemetryHandler
public abstract class TopologyHandler extends io.netty.channel.ChannelInboundHandlerAdapter
Uses emittedPathEvent
s to build the node's current world view of the overlay network. Other handler can implement this call and retrieve the topology by callingtopology(ChannelHandlerContext)
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TopologyHandler.Topology
-
Field Summary
Fields Modifier and Type Field Description protected Map<DrasylAddress,InetSocketAddress>
childrenPeers
protected Map<DrasylAddress,InetSocketAddress>
peers
protected Map<DrasylAddress,InetSocketAddress>
superPeers
-
Constructor Summary
Constructors Modifier Constructor Description protected
TopologyHandler()
protected
TopologyHandler(Map<DrasylAddress,InetSocketAddress> superPeers, Map<DrasylAddress,InetSocketAddress> childrenPeers, Map<DrasylAddress,InetSocketAddress> peers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TopologyHandler.Topology
topology(io.netty.channel.ChannelHandlerContext ctx)
void
userEventTriggered(io.netty.channel.ChannelHandlerContext ctx, Object evt)
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelRead, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
-
-
-
-
Field Detail
-
superPeers
protected final Map<DrasylAddress,InetSocketAddress> superPeers
-
childrenPeers
protected final Map<DrasylAddress,InetSocketAddress> childrenPeers
-
peers
protected final Map<DrasylAddress,InetSocketAddress> peers
-
-
Constructor Detail
-
TopologyHandler
protected TopologyHandler(Map<DrasylAddress,InetSocketAddress> superPeers, Map<DrasylAddress,InetSocketAddress> childrenPeers, Map<DrasylAddress,InetSocketAddress> peers)
-
TopologyHandler
protected TopologyHandler()
-
-
Method Detail
-
userEventTriggered
public void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx, Object evt) throws Exception
- Specified by:
userEventTriggered
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
userEventTriggered
in classio.netty.channel.ChannelInboundHandlerAdapter
- Throws:
Exception
-
topology
protected TopologyHandler.Topology topology(io.netty.channel.ChannelHandlerContext ctx)
-
-