Class SuperPeerClient

java.lang.Object
org.drasyl.peer.connection.client.SuperPeerClient
All Implemented Interfaces:
AutoCloseable, DrasylNodeComponent

public class SuperPeerClient extends Object
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 Details

    • doNewConnectionsSupplier

      protected final BooleanSupplier doNewConnectionsSupplier
    • channel

      protected io.netty.channel.Channel channel
  • Constructor Details

  • Method Details

    • getLogger

      protected org.slf4j.Logger getLogger()
    • open

      public void open()
      Description copied from interface: DrasylNodeComponent
      Starts the component.
      Specified by:
      open in interface DrasylNodeComponent
    • shouldRetry

      protected boolean shouldRetry()
      Returns:
      true if the client should attempt to reconnect. Otherwise false is 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: DrasylNodeComponent
      Stops the component.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface DrasylNodeComponent
    • initiateChannelInitializer

      protected static ClientChannelInitializer initiateChannelInitializer(ClientEnvironment environment, Class<? extends io.netty.channel.ChannelInitializer<io.netty.channel.socket.SocketChannel>> clazz) throws ClientException
      Throws:
      ClientException