public class EventBus extends Object implements EventSink, EventSource
Constructor and Description |
---|
EventBus() |
Modifier and Type | Method and Description |
---|---|
void |
fireMetadataAvailable(TorrentId torrentId,
Torrent torrent)
Generate event, that torrent's metadata has been fetched.
|
void |
firePeerBitfieldUpdated(TorrentId torrentId,
ConnectionKey connectionKey,
Bitfield bitfield)
Generate event, that local information about some peer's data has been updated.
|
void |
firePeerConnected(ConnectionKey connectionKey)
Generate event, that a new connection with some peer has been established.
|
void |
firePeerDisconnected(ConnectionKey connectionKey)
Generate event, that a connection with some peer has been terminated.
|
void |
firePeerDiscovered(TorrentId torrentId,
Peer peer)
Generate event, that a new peer has been discovered for some torrent.
|
void |
firePieceVerified(TorrentId torrentId,
int pieceIndex)
Generate event, that the downloading and verification
of one of torrent's pieces has been finished.
|
void |
fireTorrentStarted(TorrentId torrentId)
Generate event, that processing of some torrent has begun.
|
void |
fireTorrentStopped(TorrentId torrentId)
Generate event, that processing of some torrent has finished.
|
EventSource |
onMetadataAvailable(TorrentId torrentId,
Consumer<MetadataAvailableEvent> listener)
Fired, when torrent's metadata has been fetched.
|
EventSource |
onPeerBitfieldUpdated(TorrentId torrentId,
Consumer<PeerBitfieldUpdatedEvent> listener)
Fired, when local information about some peer's data has been updated.
|
EventSource |
onPeerConnected(TorrentId torrentId,
Consumer<PeerConnectedEvent> listener)
Fired, when a new connection with some peer has been established.
|
EventSource |
onPeerDisconnected(TorrentId torrentId,
Consumer<PeerDisconnectedEvent> listener)
Fired, when a connection with some peer has been terminated.
|
EventSource |
onPeerDiscovered(TorrentId torrentId,
Consumer<PeerDiscoveredEvent> listener)
Fired, when a new peer has been discovered for some torrent.
|
EventSource |
onPieceVerified(TorrentId torrentId,
Consumer<PieceVerifiedEvent> listener)
Fired, when downloading and verification of one of torrent's pieces has been finished.
|
EventSource |
onTorrentStarted(TorrentId torrentId,
Consumer<TorrentStartedEvent> listener)
Fired, when processing of some torrent has begun.
|
EventSource |
onTorrentStopped(TorrentId torrentId,
Consumer<TorrentStoppedEvent> listener)
Fired, when processing of some torrent has finished.
|
public void firePeerDiscovered(TorrentId torrentId, Peer peer)
EventSink
firePeerDiscovered
in interface EventSink
public void firePeerConnected(ConnectionKey connectionKey)
EventSink
firePeerConnected
in interface EventSink
public void firePeerDisconnected(ConnectionKey connectionKey)
EventSink
firePeerDisconnected
in interface EventSink
public void firePeerBitfieldUpdated(TorrentId torrentId, ConnectionKey connectionKey, Bitfield bitfield)
EventSink
firePeerBitfieldUpdated
in interface EventSink
public void fireTorrentStarted(TorrentId torrentId)
EventSink
fireTorrentStarted
in interface EventSink
public void fireMetadataAvailable(TorrentId torrentId, Torrent torrent)
EventSink
fireMetadataAvailable
in interface EventSink
public void fireTorrentStopped(TorrentId torrentId)
EventSink
fireTorrentStopped
in interface EventSink
public void firePieceVerified(TorrentId torrentId, int pieceIndex)
EventSink
firePieceVerified
in interface EventSink
public EventSource onPeerDiscovered(TorrentId torrentId, Consumer<PeerDiscoveredEvent> listener)
EventSource
onPeerDiscovered
in interface EventSource
public EventSource onPeerConnected(TorrentId torrentId, Consumer<PeerConnectedEvent> listener)
EventSource
onPeerConnected
in interface EventSource
public EventSource onPeerDisconnected(TorrentId torrentId, Consumer<PeerDisconnectedEvent> listener)
EventSource
onPeerDisconnected
in interface EventSource
public EventSource onPeerBitfieldUpdated(TorrentId torrentId, Consumer<PeerBitfieldUpdatedEvent> listener)
EventSource
onPeerBitfieldUpdated
in interface EventSource
public EventSource onTorrentStarted(TorrentId torrentId, Consumer<TorrentStartedEvent> listener)
EventSource
onTorrentStarted
in interface EventSource
public EventSource onMetadataAvailable(TorrentId torrentId, Consumer<MetadataAvailableEvent> listener)
EventSource
onMetadataAvailable
in interface EventSource
public EventSource onTorrentStopped(TorrentId torrentId, Consumer<TorrentStoppedEvent> listener)
EventSource
onTorrentStopped
in interface EventSource
public EventSource onPieceVerified(TorrentId torrentId, Consumer<PieceVerifiedEvent> listener)
EventSource
onPieceVerified
in interface EventSource
Copyright © 2016–2021. All rights reserved.