Class SuperPeerClient
java.lang.Object
org.drasyl.peer.connection.client.SuperPeerClient
- All Implemented Interfaces:
 AutoCloseable,DrasylNodeComponent
This class represents the link between 
DrasylNode and the super peer. It is
 responsible for maintaining the connection to the super peer and updates the data of the super
 peer in PeersManager.- 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected io.netty.channel.Channelprotected final BooleanSupplier - 
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSuperPeerClient(DrasylConfig config, io.netty.channel.EventLoopGroup workerGroup, BooleanSupplier doNewConnectionsSupplier, DrasylFunction<Endpoint, io.netty.bootstrap.Bootstrap, ClientException> bootstrapSupplier) SuperPeerClient(DrasylConfig config, Identity identity, PeersManager peersManager, Pipeline pipeline, PeerChannelGroup channelGroup, io.netty.channel.EventLoopGroup workerGroup, BooleanSupplier doNewConnectionsSupplier)  - 
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Stops the component.protected voidfailed()This method is called if a connection was not possible and no further connection attempts will be made.protected org.slf4j.Loggerprotected static ClientChannelInitializerinitiateChannelInitializer(ClientEnvironment environment, Class<? extends io.netty.channel.ChannelInitializer<io.netty.channel.socket.SocketChannel>> clazz) voidopen()Starts the component.protected boolean 
- 
Field Details
- 
doNewConnectionsSupplier
 - 
channel
protected io.netty.channel.Channel channel 
 - 
 - 
Constructor Details
- 
SuperPeerClient
protected SuperPeerClient(DrasylConfig config, io.netty.channel.EventLoopGroup workerGroup, BooleanSupplier doNewConnectionsSupplier, DrasylFunction<Endpoint, io.netty.bootstrap.Bootstrap, ClientException> bootstrapSupplier)  - 
SuperPeerClient
public SuperPeerClient(DrasylConfig config, Identity identity, PeersManager peersManager, Pipeline pipeline, PeerChannelGroup channelGroup, io.netty.channel.EventLoopGroup workerGroup, BooleanSupplier doNewConnectionsSupplier)  
 - 
 - 
Method Details
- 
getLogger
protected org.slf4j.Logger getLogger() - 
open
public void open()Description copied from interface:DrasylNodeComponentStarts the component.- Specified by:
 openin interfaceDrasylNodeComponent
 - 
shouldRetry
protected boolean shouldRetry()- Returns:
 trueif the client should attempt to reconnect. Otherwisefalseis returned
 - 
failed
protected void failed()This method is called if a connection was not possible and no further connection attempts will be made. - 
close
public void close()Description copied from interface:DrasylNodeComponentStops the component.- Specified by:
 closein interfaceAutoCloseable- Specified by:
 closein interfaceDrasylNodeComponent
 - 
initiateChannelInitializer
protected static ClientChannelInitializer initiateChannelInitializer(ClientEnvironment environment, Class<? extends io.netty.channel.ChannelInitializer<io.netty.channel.socket.SocketChannel>> clazz) throws ClientException - Throws:
 ClientException
 
 -