com.aelitis.azureus.plugins.net.buddy.tracker
Class BuddyPluginTracker

java.lang.Object
  extended by com.aelitis.azureus.plugins.net.buddy.tracker.BuddyPluginTracker
All Implemented Interfaces:
BuddyPluginAZ2TrackerListener, BuddyPluginListener, DownloadManagerListener, DownloadPeerListener

public class BuddyPluginTracker
extends Object
implements BuddyPluginListener, DownloadManagerListener, BuddyPluginAZ2TrackerListener, DownloadPeerListener


Field Summary
static int BUDDY_NETWORK_IDLE
           
static int BUDDY_NETWORK_INBOUND
           
static int BUDDY_NETWORK_OUTBOUND
           
 
Constructor Summary
BuddyPluginTracker(BuddyPlugin _plugin, BooleanParameter tracker_enable)
           
 
Method Summary
protected  com.aelitis.azureus.plugins.net.buddy.tracker.BuddyPluginTracker.buddyData addBuddy(BuddyPluginBuddy buddy)
           
 void addListener(BuddyPluginTrackerListener l)
           
 void buddyAdded(BuddyPluginBuddy buddy)
           
protected  com.aelitis.azureus.plugins.net.buddy.tracker.BuddyPluginTracker.buddyData buddyAlive(BuddyPluginBuddy buddy)
           
 void buddyChanged(BuddyPluginBuddy buddy)
           
protected  void buddyDead(BuddyPluginBuddy buddy)
           
 void buddyRemoved(BuddyPluginBuddy buddy)
           
protected  void checkEnabledState()
           
protected  void checkPeers()
           
protected  void checkTracking()
           
protected  void doTracking()
           
 void downloadAdded(Download download)
           
 void downloadRemoved(Download download)
           
 void enabledStateChanged(boolean _enabled)
           
protected  void fireEnabledChanged(boolean enabled)
           
protected  void fireStateChange(int state)
           
protected  com.aelitis.azureus.plugins.net.buddy.tracker.BuddyPluginTracker.buddyData getBuddyData(BuddyPluginBuddy buddy)
           
 long getNetworkReceiveBytesPerSecond()
           
 long getNetworkSendBytesPerSecond()
           
 int getNetworkStatus()
           
 void initialise()
           
 void initialised(boolean available)
           
protected  int isBuddy(Peer peer)
           
 boolean isEnabled()
           
protected  void log(String str)
           
protected  void log(String str, boolean verbose)
           
protected  void log(String str, Throwable e)
           
protected  void markBuddyPeer(Download download, Peer peer)
           
 void messageFailed(BuddyPluginBuddy buddy, Throwable cause)
           
 void messageLogged(String str, boolean error)
           
 Map messageReceived(BuddyPluginBuddy buddy, Map message)
           
protected  boolean okToTrack(Download d)
           
 void peerManagerAdded(Download download, PeerManager peer_manager)
           
 void peerManagerRemoved(Download download, PeerManager peer_manager)
           
protected  void recheckPeers()
           
protected  void removeBuddy(BuddyPluginBuddy buddy)
           
 void removeListener(BuddyPluginTrackerListener l)
           
protected  void sendMessage(BuddyPluginBuddy buddy, int type, Map body)
           
 void tick(int tick_count)
           
protected  void trackDownload(Download download)
           
protected  void trackPeer(Download download, Peer peer)
           
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 updateNetworkStatus()
           
protected  void updateSeedingMode()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUDDY_NETWORK_IDLE

public static final int BUDDY_NETWORK_IDLE
See Also:
Constant Field Values

BUDDY_NETWORK_OUTBOUND

public static final int BUDDY_NETWORK_OUTBOUND
See Also:
Constant Field Values

BUDDY_NETWORK_INBOUND

public static final int BUDDY_NETWORK_INBOUND
See Also:
Constant Field Values
Constructor Detail

BuddyPluginTracker

public BuddyPluginTracker(BuddyPlugin _plugin,
                          BooleanParameter tracker_enable)
Method Detail

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 interface BuddyPluginListener

buddyAdded

public void buddyAdded(BuddyPluginBuddy buddy)
Specified by:
buddyAdded in interface BuddyPluginListener

buddyRemoved

public void buddyRemoved(BuddyPluginBuddy buddy)
Specified by:
buddyRemoved in interface BuddyPluginListener

buddyChanged

public void buddyChanged(BuddyPluginBuddy buddy)
Specified by:
buddyChanged in interface BuddyPluginListener

getBuddyData

protected com.aelitis.azureus.plugins.net.buddy.tracker.BuddyPluginTracker.buddyData getBuddyData(BuddyPluginBuddy buddy)

addBuddy

protected com.aelitis.azureus.plugins.net.buddy.tracker.BuddyPluginTracker.buddyData addBuddy(BuddyPluginBuddy buddy)

removeBuddy

protected void removeBuddy(BuddyPluginBuddy buddy)

isBuddy

protected int isBuddy(Peer peer)

messageLogged

public void messageLogged(String str,
                          boolean error)
Specified by:
messageLogged in interface BuddyPluginListener

enabledStateChanged

public void enabledStateChanged(boolean _enabled)
Specified by:
enabledStateChanged in interface BuddyPluginListener

updated

public void updated()
Specified by:
updated in interface BuddyPluginListener

isEnabled

public boolean isEnabled()

checkEnabledState

protected void checkEnabledState()

updateSeedingMode

protected void updateSeedingMode()

downloadAdded

public void downloadAdded(Download download)
Specified by:
downloadAdded in interface DownloadManagerListener

downloadRemoved

public void downloadRemoved(Download download)
Specified by:
downloadRemoved in interface DownloadManagerListener

trackDownload

protected void trackDownload(Download download)

untrackDownload

protected void untrackDownload(Download download)

trackPeers

protected void trackPeers(Download download)

peerManagerAdded

public void peerManagerAdded(Download download,
                             PeerManager peer_manager)
Specified by:
peerManagerAdded in interface DownloadPeerListener

peerManagerRemoved

public void peerManagerRemoved(Download download,
                               PeerManager peer_manager)
Specified by:
peerManagerRemoved in interface DownloadPeerListener

trackPeers

protected void trackPeers(Download download,
                          PeerManager pm)

trackPeer

protected void trackPeer(Download download,
                         Peer peer)

untrackPeers

protected void untrackPeers(Download download)

markBuddyPeer

protected void markBuddyPeer(Download download,
                             Peer peer)

unmarkBuddyPeer

protected void unmarkBuddyPeer(Peer peer)

checkPeers

protected void checkPeers()

recheckPeers

protected void recheckPeers()

updateNetworkStatus

protected void updateNetworkStatus()

addListener

public void addListener(BuddyPluginTrackerListener l)

removeListener

public void removeListener(BuddyPluginTrackerListener l)

fireStateChange

protected void fireStateChange(int state)

fireEnabledChanged

protected void fireEnabledChanged(boolean enabled)

sendMessage

protected void sendMessage(BuddyPluginBuddy buddy,
                           int type,
                           Map body)

messageReceived

public Map messageReceived(BuddyPluginBuddy buddy,
                           Map message)
Specified by:
messageReceived in interface BuddyPluginAZ2TrackerListener

messageFailed

public void messageFailed(BuddyPluginBuddy buddy,
                          Throwable cause)
Specified by:
messageFailed in interface BuddyPluginAZ2TrackerListener

buddyAlive

protected com.aelitis.azureus.plugins.net.buddy.tracker.BuddyPluginTracker.buddyData buddyAlive(BuddyPluginBuddy buddy)

buddyDead

protected void buddyDead(BuddyPluginBuddy buddy)

okToTrack

protected boolean okToTrack(Download d)

log

protected void log(String str)

log

protected void log(String str,
                   boolean verbose)

log

protected void log(String str,
                   Throwable e)