Package com.privatechain.core.event
Class BlockchainEvent.PeerDisconnectedEvent
java.lang.Object
com.privatechain.core.event.BlockchainEvent
com.privatechain.core.event.BlockchainEvent.PeerDisconnectedEvent
- Enclosing class:
BlockchainEvent
Fired when a peer connection is closed, either gracefully or due to an error.
Consumers can inspect getReason() to distinguish between normal
disconnections and failures. A null reason means the cause is unknown.
- Since:
- 1.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class com.privatechain.core.event.BlockchainEvent
BlockchainEvent.BlockAddedEvent, BlockchainEvent.ForkDetectedEvent, BlockchainEvent.PeerConnectedEvent, BlockchainEvent.PeerDisconnectedEvent, BlockchainEvent.TransactionSubmittedEvent -
Constructor Summary
ConstructorsConstructorDescriptionPeerDisconnectedEvent(String peerId, String reason) Constructs aPeerDisconnectedEvent. -
Method Summary
Methods inherited from class com.privatechain.core.event.BlockchainEvent
getOccurredAt
-
Constructor Details
-
PeerDisconnectedEvent
Constructs aPeerDisconnectedEvent.- Parameters:
peerId- unique peer identifier (non-null, non-blank)reason- disconnection reason; may be null if unknown- Throws:
NullPointerException- if peerId is nullIllegalArgumentException- if peerId is blank
-
-
Method Details