Class BlockchainEvent.PeerConnectedEvent

java.lang.Object
com.privatechain.core.event.BlockchainEvent
com.privatechain.core.event.BlockchainEvent.PeerConnectedEvent
Enclosing class:
BlockchainEvent

public static final class BlockchainEvent.PeerConnectedEvent extends BlockchainEvent
Fired when a new peer successfully establishes a TCP connection to this node.

The peer has already passed the allowlist check at this point; the event signals that the connection is active and the peer is ready to exchange messages.

Since:
1.0.0
  • Constructor Details

    • PeerConnectedEvent

      public PeerConnectedEvent(String peerId, String address)
      Constructs a PeerConnectedEvent.
      Parameters:
      peerId - unique peer identifier (non-null, non-blank)
      address - network address string (non-null, non-blank)
      Throws:
      NullPointerException - if peerId or address is null
      IllegalArgumentException - if peerId or address is blank
  • Method Details

    • getPeerId

      public String getPeerId()
      Returns the unique identifier of the connected peer.
      Returns:
      non-null, non-blank peer ID
    • getAddress

      public String getAddress()
      Returns the network address of the connected peer.
      Returns:
      non-null, non-blank address string
    • toString

      public String toString()
      Overrides:
      toString in class Object