Class InternetDiscoverySuperPeerHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
org.drasyl.handler.remote.internet.InternetDiscoverySuperPeerHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler,io.netty.channel.ChannelOutboundHandler
- Direct Known Subclasses:
TraversingInternetDiscoverySuperPeerHandler
public class InternetDiscoverySuperPeerHandler
extends io.netty.channel.ChannelDuplexHandler
Operates as a super peer allowing other nodes to join as children. Relays inbound/Route outbound
messages to children.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<DrasylAddress,org.drasyl.handler.remote.internet.InternetDiscoverySuperPeerHandler.ChildrenPeer> protected final intprotected final ProofOfWorkprotected final IdentityPublicKey -
Constructor Summary
ConstructorsConstructorDescriptionInternetDiscoverySuperPeerHandler(int myNetworkId, IdentityPublicKey myPublicKey, ProofOfWork myProofOfWork, long pingIntervalMillis, long pingTimeoutMillis, long maxTimeOffsetMillis, HopCount hopLimit) -
Method Summary
Modifier and TypeMethodDescriptionvoidchannelActive(io.netty.channel.ChannelHandlerContext ctx) voidchannelInactive(io.netty.channel.ChannelHandlerContext ctx) voidchannelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg) protected voidrelayMessage(io.netty.channel.ChannelHandlerContext ctx, InetAddressedMessage<RemoteMessage> addressedMsg, InetSocketAddress inetAddress) voidwrite(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) Methods inherited from class io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, readMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Field Details
-
myNetworkId
protected final int myNetworkId -
myPublicKey
-
myProofOfWork
-
childrenPeers
protected final Map<DrasylAddress,org.drasyl.handler.remote.internet.InternetDiscoverySuperPeerHandler.ChildrenPeer> childrenPeers
-
-
Constructor Details
-
InternetDiscoverySuperPeerHandler
public InternetDiscoverySuperPeerHandler(int myNetworkId, IdentityPublicKey myPublicKey, ProofOfWork myProofOfWork, long pingIntervalMillis, long pingTimeoutMillis, long maxTimeOffsetMillis, HopCount hopLimit)
-
-
Method Details
-
channelActive
public void channelActive(io.netty.channel.ChannelHandlerContext ctx) - Specified by:
channelActivein interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelActivein classio.netty.channel.ChannelInboundHandlerAdapter
-
channelInactive
public void channelInactive(io.netty.channel.ChannelHandlerContext ctx) - Specified by:
channelInactivein interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelInactivein classio.netty.channel.ChannelInboundHandlerAdapter
-
channelRead
- Specified by:
channelReadin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelReadin classio.netty.channel.ChannelInboundHandlerAdapter
-
write
public void write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) - Specified by:
writein interfaceio.netty.channel.ChannelOutboundHandler- Overrides:
writein classio.netty.channel.ChannelDuplexHandler
-
relayMessage
protected void relayMessage(io.netty.channel.ChannelHandlerContext ctx, InetAddressedMessage<RemoteMessage> addressedMsg, InetSocketAddress inetAddress)
-