Class BuddyPluginTracker
java.lang.Object
com.biglybt.plugin.net.buddy.tracker.BuddyPluginTracker
- All Implemented Interfaces:
DownloadManagerListener
,DownloadPeerListener
,BuddyPluginAZ2TrackerListener
,BuddyPluginListener
public class BuddyPluginTracker
extends Object
implements BuddyPluginListener, DownloadManagerListener, BuddyPluginAZ2TrackerListener, DownloadPeerListener
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
class
private static class
private static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final String[]
private static final int
private static final int
private static final int
static final int
static final int
static final int
static final int
private static final int
private CopyOnWriteSet
<Peer> private Average
private Average
private TimerEventPeriodic
private static final int
private int
private Map
<HashWrapper, Download> private static final int
private int
private int
private boolean
private boolean
private boolean
private Set
<BuddyPluginBuddy> private Map
<String, List<BuddyPluginBuddy>> private Map
<String, BuddyPluginTracker.PartialBuddyData> private static final int
private static final int
private static final Object
private static final int
private static final int
private static final int
private static final Object
private static final int
private static final int
private static final Object
private static final Object
private final BuddyPlugin
private boolean
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private boolean
private Map
<HashWrapper, List<Download>> private static final int
private final TorrentAttribute
private static final int
private static final int
private boolean
private boolean
private static final int
-
Constructor Summary
ConstructorsConstructorDescriptionBuddyPluginTracker
(BuddyPlugin _plugin, BooleanParameter tracker_enable, BooleanParameter tracker_so_enable) -
Method Summary
Modifier and TypeMethodDescriptionprotected BuddyPluginTracker.BuddyTrackingData
addBuddy
(BuddyPluginBuddy buddy) void
void
addPartialBuddy
(Download download, Peer peer, boolean manual) void
buddyAdded
(BuddyPluginBuddy buddy) protected BuddyPluginTracker.BuddyTrackingData
buddyAlive
(BuddyPluginBuddy buddy) void
buddyChanged
(BuddyPluginBuddy buddy) protected void
buddyDead
(BuddyPluginBuddy buddy) void
buddyRemoved
(BuddyPluginBuddy buddy) protected void
private void
private void
protected void
protected void
void
downloadAdded
(Download download) void
downloadRemoved
(Download download) void
enabledStateChanged
(boolean classic_enabled, boolean beta_enabled) protected void
fireEnabledChanged
(boolean enabled) protected void
fireStateChange
(int state) protected BuddyPluginTracker.BuddyTrackingData
getBuddyData
(BuddyPluginBuddy buddy) long
long
int
void
getProperties
(BuddyPluginBuddy buddy, IndentWriter writer) getTrackingData
(BuddyPluginBuddy buddy) void
void
initialised
(boolean available) protected int
boolean
boolean
isFullBuddy
(Peer peer) boolean
isPartialBuddy
(Download download, Peer peer) protected void
protected void
protected void
protected void
markBuddyPeer
(Download download, Peer peer, boolean is_partial) void
messageFailed
(BuddyPluginBuddy buddy, Throwable cause) void
messageLogged
(String str, boolean error) messageReceived
(BuddyPluginBuddy buddy, Map<String, Object> message) protected boolean
void
peerManagerAdded
(Download download, PeerManager peer_manager) void
peerManagerRemoved
(Download download, PeerManager peer_manager) protected void
protected void
removeBuddy
(BuddyPluginBuddy buddy) void
void
removePartialBuddy
(Download download, Peer peer, boolean manual) void
protected void
sendMessage
(BuddyPluginBuddy buddy, int type, Map<String, Object> body) void
tick
(int tick_count) protected void
trackDownload
(Download download) protected void
protected void
trackPeers
(Download download) protected void
trackPeers
(Download download, PeerManager pm) protected void
unmarkBuddyPeer
(Peer peer) protected void
untrackDownload
(Download download) protected void
untrackPeers
(Download download) void
updated()
protected void
protected void
-
Field Details
-
PEER_DOWNLOAD_KEY
-
PEER_UPLOAD_PRIORITY_KEY
-
PEER_STATS_KEY
-
PB_PEER_KEY
-
BUDDY_NETWORK_IDLE
public static final int BUDDY_NETWORK_IDLE- See Also:
-
BUDDY_NETWORK_OUTBOUND
public static final int BUDDY_NETWORK_OUTBOUND- See Also:
-
BUDDY_NETWORK_INBOUND
public static final int BUDDY_NETWORK_INBOUND- See Also:
-
BUDDY_NETWORK_INOUTBOUND
public static final int BUDDY_NETWORK_INOUTBOUND- See Also:
-
VERSION
private static final int VERSION- See Also:
-
TRACK_CHECK_PERIOD
private static final int TRACK_CHECK_PERIOD- See Also:
-
TRACK_CHECK_TICKS
private static final int TRACK_CHECK_TICKS- See Also:
-
PARTIAL_PEER_CHECK_PERIOD
private static final int PARTIAL_PEER_CHECK_PERIOD- See Also:
-
PARTIAL_PEER_CHECK_TICKS
private static final int PARTIAL_PEER_CHECK_TICKS- See Also:
-
PEER_CHECK_PERIOD
private static final int PEER_CHECK_PERIOD- See Also:
-
PEER_CHECK_TICKS
private static final int PEER_CHECK_TICKS- See Also:
-
PEER_RECHECK_PERIOD
private static final int PEER_RECHECK_PERIOD- See Also:
-
PEER_RECHECK_TICKS
private static final int PEER_RECHECK_TICKS- See Also:
-
PEER_CHECK_INTERVAL
private static final int PEER_CHECK_INTERVAL- See Also:
-
SHORT_ID_SIZE
private static final int SHORT_ID_SIZE- See Also:
-
FULL_ID_SIZE
private static final int FULL_ID_SIZE- See Also:
-
REQUEST_TRACKER_SUMMARY
private static final int REQUEST_TRACKER_SUMMARY- See Also:
-
REPLY_TRACKER_SUMMARY
private static final int REPLY_TRACKER_SUMMARY- See Also:
-
REQUEST_TRACKER_STATUS
private static final int REQUEST_TRACKER_STATUS- See Also:
-
REPLY_TRACKER_STATUS
private static final int REPLY_TRACKER_STATUS- See Also:
-
REQUEST_TRACKER_CHANGE
private static final int REQUEST_TRACKER_CHANGE- See Also:
-
REPLY_TRACKER_CHANGE
private static final int REPLY_TRACKER_CHANGE- See Also:
-
REQUEST_TRACKER_ADD
private static final int REQUEST_TRACKER_ADD- See Also:
-
REPLY_TRACKER_ADD
private static final int REPLY_TRACKER_ADD- See Also:
-
RETRY_SEND_MIN
private static final int RETRY_SEND_MIN- See Also:
-
RETRY_SEND_MAX
private static final int RETRY_SEND_MAX- See Also:
-
BUDDY_NO
private static final int BUDDY_NO- See Also:
-
BUDDY_MAYBE
private static final int BUDDY_MAYBE- See Also:
-
BUDDY_YES
private static final int BUDDY_YES- See Also:
-
ACTIVE_UNKNOWN
private static final int ACTIVE_UNKNOWN- See Also:
-
ACTIVE_NO
private static final int ACTIVE_NO- See Also:
-
ACTIVE_YES
private static final int ACTIVE_YES- See Also:
-
ACTIVE_STRS
-
plugin
-
ta_networks
-
plugin_enabled
private boolean plugin_enabled -
tracker_enabled
private boolean tracker_enabled -
seeding_only
private boolean seeding_only -
tracker_so_enabled
private boolean tracker_so_enabled -
old_plugin_enabled
private boolean old_plugin_enabled -
old_tracker_enabled
private boolean old_tracker_enabled -
old_seeding_only
private boolean old_seeding_only -
network_status
private int network_status -
online_buddies
-
online_buddy_ips
-
partial_buddies
-
tracked_downloads
-
download_set_id
private int download_set_id -
last_processed_download_set
-
last_processed_download_set_id
private int last_processed_download_set_id -
short_id_map
-
full_id_map
-
actively_tracking
-
buddy_peers
-
listeners
-
buddy_stats_timer
-
buddy_receive_speed
-
buddy_send_speed
-
-
Constructor Details
-
BuddyPluginTracker
public BuddyPluginTracker(BuddyPlugin _plugin, BooleanParameter tracker_enable, BooleanParameter tracker_so_enable)
-
-
Method Details
-
initialise
public void initialise() -
tick
public void tick(int tick_count) -
getNetworkStatus
public int getNetworkStatus() -
getNetworkReceiveBytesPerSecond
public long getNetworkReceiveBytesPerSecond() -
getNetworkSendBytesPerSecond
public long getNetworkSendBytesPerSecond() -
doTracking
protected void doTracking() -
checkTracking
protected void checkTracking() -
initialised
public void initialised(boolean available) - Specified by:
initialised
in interfaceBuddyPluginListener
-
buddyAdded
- Specified by:
buddyAdded
in interfaceBuddyPluginListener
-
buddyRemoved
- Specified by:
buddyRemoved
in interfaceBuddyPluginListener
-
buddyChanged
- Specified by:
buddyChanged
in interfaceBuddyPluginListener
-
getBuddyData
-
addBuddy
-
removeBuddy
-
isBuddy
-
getPartialBuddies
-
addPartialBuddy
-
isFullBuddy
-
isPartialBuddy
-
getDownloadsSummary
-
removePartialBuddy
-
removePartialBuddy
-
messageLogged
- Specified by:
messageLogged
in interfaceBuddyPluginListener
-
enabledStateChanged
public void enabledStateChanged(boolean classic_enabled, boolean beta_enabled) - Specified by:
enabledStateChanged
in interfaceBuddyPluginListener
-
updated
public void updated()- Specified by:
updated
in interfaceBuddyPluginListener
-
isEnabled
public boolean isEnabled() -
checkEnabledState
protected void checkEnabledState() -
updateSeedingMode
protected void updateSeedingMode() -
downloadAdded
- Specified by:
downloadAdded
in interfaceDownloadManagerListener
-
downloadRemoved
- Specified by:
downloadRemoved
in interfaceDownloadManagerListener
-
trackDownload
-
untrackDownload
-
trackPeers
-
peerManagerAdded
- Specified by:
peerManagerAdded
in interfaceDownloadPeerListener
-
peerManagerRemoved
- Specified by:
peerManagerRemoved
in interfaceDownloadPeerListener
-
trackPeers
-
trackPeer
-
untrackPeers
-
markBuddyPeer
-
unmarkBuddyPeer
-
checkPartialPeers
private void checkPartialPeers() -
checkPeers
private void checkPeers() -
recheckPeers
protected void recheckPeers() -
updateNetworkStatus
protected void updateNetworkStatus() -
addListener
-
removeListener
-
fireStateChange
protected void fireStateChange(int state) -
fireEnabledChanged
protected void fireEnabledChanged(boolean enabled) -
sendMessage
-
messageReceived
- Specified by:
messageReceived
in interfaceBuddyPluginAZ2TrackerListener
-
messageFailed
- Specified by:
messageFailed
in interfaceBuddyPluginAZ2TrackerListener
-
buddyAlive
-
buddyDead
-
getTrackingData
-
getTrackingStatus
-
getProperties
-
okToTrack
-
log
-
log
-
log
-