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 java.lang.Object
implements BuddyPluginListener, DownloadManagerListener, BuddyPluginAZ2TrackerListener, DownloadPeerListener


Nested Class Summary
 class BuddyPluginTracker.BuddyTrackingData
           
 
Field Summary
static int BUDDY_NETWORK_IDLE
           
static int BUDDY_NETWORK_INBOUND
           
static int BUDDY_NETWORK_INOUTBOUND
           
static int BUDDY_NETWORK_OUTBOUND
           
 
Constructor Summary
BuddyPluginTracker(BuddyPlugin _plugin, BooleanParameter tracker_enable, BooleanParameter tracker_so_enable)
           
 
Method Summary
protected  BuddyPluginTracker.BuddyTrackingData addBuddy(BuddyPluginBuddy buddy)
           
 void addListener(BuddyPluginTrackerListener l)
           
 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 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  BuddyPluginTracker.BuddyTrackingData getBuddyData(BuddyPluginBuddy buddy)
           
 long getNetworkReceiveBytesPerSecond()
           
 long getNetworkSendBytesPerSecond()
           
 int getNetworkStatus()
           
 BuddyPluginTracker.BuddyTrackingData getTrackingData(BuddyPluginBuddy buddy)
           
 java.lang.String getTrackingStatus(BuddyPluginBuddy buddy)
           
 void initialise()
           
 void initialised(boolean available)
           
protected  int isBuddy(Peer peer)
           
 boolean isEnabled()
           
protected  void log(java.lang.String str)
           
protected  void log(java.lang.String str, boolean verbose)
           
protected  void log(java.lang.String str, java.lang.Throwable e)
           
protected  void markBuddyPeer(Download download, Peer peer)
           
 void messageFailed(BuddyPluginBuddy buddy, java.lang.Throwable cause)
           
 void messageLogged(java.lang.String str, boolean error)
           
 java.util.Map<java.lang.String,java.lang.Object> messageReceived(BuddyPluginBuddy buddy, java.util.Map<java.lang.String,java.lang.Object> 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, java.util.Map<java.lang.String,java.lang.Object> 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

BUDDY_NETWORK_INOUTBOUND

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

BuddyPluginTracker

public BuddyPluginTracker(BuddyPlugin _plugin,
                          BooleanParameter tracker_enable,
                          BooleanParameter tracker_so_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 BuddyPluginTracker.BuddyTrackingData getBuddyData(BuddyPluginBuddy buddy)

addBuddy

protected BuddyPluginTracker.BuddyTrackingData addBuddy(BuddyPluginBuddy buddy)

removeBuddy

protected void removeBuddy(BuddyPluginBuddy buddy)

isBuddy

protected int isBuddy(Peer peer)

messageLogged

public void messageLogged(java.lang.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,
                           java.util.Map<java.lang.String,java.lang.Object> body)

messageReceived

public java.util.Map<java.lang.String,java.lang.Object> messageReceived(BuddyPluginBuddy buddy,
                                                                        java.util.Map<java.lang.String,java.lang.Object> message)
Specified by:
messageReceived in interface BuddyPluginAZ2TrackerListener

messageFailed

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

buddyAlive

protected BuddyPluginTracker.BuddyTrackingData buddyAlive(BuddyPluginBuddy buddy)

buddyDead

protected void buddyDead(BuddyPluginBuddy buddy)

getTrackingData

public BuddyPluginTracker.BuddyTrackingData getTrackingData(BuddyPluginBuddy buddy)

getTrackingStatus

public java.lang.String getTrackingStatus(BuddyPluginBuddy buddy)

okToTrack

protected boolean okToTrack(Download d)

log

protected void log(java.lang.String str)

log

protected void log(java.lang.String str,
                   boolean verbose)

log

protected void log(java.lang.String str,
                   java.lang.Throwable e)