org.gudy.azureus2.core3.tracker.host.impl
Class TRHostTorrentHostImpl

java.lang.Object
  extended by org.gudy.azureus2.core3.tracker.host.impl.TRHostTorrentHostImpl
All Implemented Interfaces:
TRHostTorrent

public class TRHostTorrentHostImpl
extends java.lang.Object
implements TRHostTorrent


Field Summary
protected  AEMonitor this_mon
           
 
Fields inherited from interface org.gudy.azureus2.core3.tracker.host.TRHostTorrent
TS_FAILED, TS_PUBLISHED, TS_STARTED, TS_STOPPED
 
Constructor Summary
protected TRHostTorrentHostImpl(TRHostImpl _host, TRTrackerServer _server, TOTorrent _torrent, int _port, long _date_added)
           
 
Method Summary
 void addListener(TRHostTorrentListener l)
           
 void addRemovalListener(TRHostTorrentWillBeRemovedListener l)
           
 boolean canBeRemoved()
          doesn't guarantee that removal will be successful as conditions may change
 void disableReplyCaching()
           
 long getAnnounceCount()
           
 long getAverageAnnounceCount()
           
 long getAverageBytesIn()
           
 long getAverageBytesOut()
           
 long getAverageDownloaded()
           
 long getAverageScrapeCount()
           
 long getAverageUploaded()
           
 int getBadNATCount()
           
 long getCompletedCount()
           
 java.lang.Object getData(java.lang.String key)
          To retreive arbitrary objects against this object.
 long getDateAdded()
           
 int getLeecherCount()
           
 TRHostPeer[] getPeers()
           
 int getPort()
           
 long getScrapeCount()
           
 int getSeedCount()
           
protected  TRTrackerServer getServer()
           
protected  TRTrackerServerTorrentStats getStats()
           
 int getStatus()
           
 TOTorrent getTorrent()
           
 long getTotalBytesIn()
           
 long getTotalBytesOut()
           
 long getTotalDownloaded()
           
 long getTotalLeft()
           
 long getTotalUploaded()
           
 TRTrackerServerTorrent getTrackerTorrent()
           
 boolean isPassive()
           
 boolean isPersistent()
           
protected  void postProcess(TRHostTorrentRequest req)
           
protected  void preProcess(TRHostTorrentRequest req)
           
 void remove()
           
 void removeListener(TRHostTorrentListener l)
           
 void removeRemovalListener(TRHostTorrentWillBeRemovedListener l)
           
 void setData(java.lang.String key, java.lang.Object value)
          To store arbitrary objects against this object.
 void setPassive(boolean b)
           
protected  void setPersistent(boolean _persistent)
           
protected  void setStartOfDayValues(long _date_added, long completed, long announces, long scrapes, long uploaded, long downloaded, long bytes_in, long bytes_out)
           
 void setTorrent(TOTorrent _torrent)
           
protected  void setTorrentInternal(TOTorrent _torrent)
           
 void start()
           
protected  void startSupport()
           
 void stop()
           
protected  void stopSupport()
           
protected  void updateStats()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

this_mon

protected final AEMonitor this_mon
Constructor Detail

TRHostTorrentHostImpl

protected TRHostTorrentHostImpl(TRHostImpl _host,
                                TRTrackerServer _server,
                                TOTorrent _torrent,
                                int _port,
                                long _date_added)
Method Detail

getPort

public int getPort()
Specified by:
getPort in interface TRHostTorrent

start

public void start()
Specified by:
start in interface TRHostTorrent

startSupport

protected void startSupport()

stop

public void stop()
Specified by:
stop in interface TRHostTorrent

stopSupport

protected void stopSupport()

remove

public void remove()
            throws TRHostTorrentRemovalVetoException
Specified by:
remove in interface TRHostTorrent
Throws:
TRHostTorrentRemovalVetoException

canBeRemoved

public boolean canBeRemoved()
                     throws TRHostTorrentRemovalVetoException
Description copied from interface: TRHostTorrent
doesn't guarantee that removal will be successful as conditions may change

Specified by:
canBeRemoved in interface TRHostTorrent
Returns:
true if OK, exception thrown otherwise
Throws:
TRHostTorrentRemovalVetoException

getStatus

public int getStatus()
Specified by:
getStatus in interface TRHostTorrent

isPersistent

public boolean isPersistent()
Specified by:
isPersistent in interface TRHostTorrent

setPersistent

protected void setPersistent(boolean _persistent)

isPassive

public boolean isPassive()
Specified by:
isPassive in interface TRHostTorrent

setPassive

public void setPassive(boolean b)
Specified by:
setPassive in interface TRHostTorrent

getDateAdded

public long getDateAdded()
Specified by:
getDateAdded in interface TRHostTorrent

getTorrent

public TOTorrent getTorrent()
Specified by:
getTorrent in interface TRHostTorrent

setTorrent

public void setTorrent(TOTorrent _torrent)
Specified by:
setTorrent in interface TRHostTorrent

setTorrentInternal

protected void setTorrentInternal(TOTorrent _torrent)

getTrackerTorrent

public TRTrackerServerTorrent getTrackerTorrent()
Specified by:
getTrackerTorrent in interface TRHostTorrent

getPeers

public TRHostPeer[] getPeers()
Specified by:
getPeers in interface TRHostTorrent

getStats

protected TRTrackerServerTorrentStats getStats()

setStartOfDayValues

protected void setStartOfDayValues(long _date_added,
                                   long completed,
                                   long announces,
                                   long scrapes,
                                   long uploaded,
                                   long downloaded,
                                   long bytes_in,
                                   long bytes_out)

getSeedCount

public int getSeedCount()
Specified by:
getSeedCount in interface TRHostTorrent

getLeecherCount

public int getLeecherCount()
Specified by:
getLeecherCount in interface TRHostTorrent

getBadNATCount

public int getBadNATCount()
Specified by:
getBadNATCount in interface TRHostTorrent

updateStats

protected void updateStats()

getServer

protected TRTrackerServer getServer()

getTotalUploaded

public long getTotalUploaded()
Specified by:
getTotalUploaded in interface TRHostTorrent

getTotalDownloaded

public long getTotalDownloaded()
Specified by:
getTotalDownloaded in interface TRHostTorrent

getTotalLeft

public long getTotalLeft()
Specified by:
getTotalLeft in interface TRHostTorrent

getTotalBytesIn

public long getTotalBytesIn()
Specified by:
getTotalBytesIn in interface TRHostTorrent

getTotalBytesOut

public long getTotalBytesOut()
Specified by:
getTotalBytesOut in interface TRHostTorrent

getAnnounceCount

public long getAnnounceCount()
Specified by:
getAnnounceCount in interface TRHostTorrent

getScrapeCount

public long getScrapeCount()
Specified by:
getScrapeCount in interface TRHostTorrent

getCompletedCount

public long getCompletedCount()
Specified by:
getCompletedCount in interface TRHostTorrent

getAverageBytesIn

public long getAverageBytesIn()
Specified by:
getAverageBytesIn in interface TRHostTorrent

getAverageBytesOut

public long getAverageBytesOut()
Specified by:
getAverageBytesOut in interface TRHostTorrent

getAverageUploaded

public long getAverageUploaded()
Specified by:
getAverageUploaded in interface TRHostTorrent

getAverageDownloaded

public long getAverageDownloaded()
Specified by:
getAverageDownloaded in interface TRHostTorrent

getAverageAnnounceCount

public long getAverageAnnounceCount()
Specified by:
getAverageAnnounceCount in interface TRHostTorrent

getAverageScrapeCount

public long getAverageScrapeCount()
Specified by:
getAverageScrapeCount in interface TRHostTorrent

disableReplyCaching

public void disableReplyCaching()
Specified by:
disableReplyCaching in interface TRHostTorrent

preProcess

protected void preProcess(TRHostTorrentRequest req)
                   throws TRHostException
Throws:
TRHostException

postProcess

protected void postProcess(TRHostTorrentRequest req)
                    throws TRHostException
Throws:
TRHostException

addListener

public void addListener(TRHostTorrentListener l)
Specified by:
addListener in interface TRHostTorrent

removeListener

public void removeListener(TRHostTorrentListener l)
Specified by:
removeListener in interface TRHostTorrent

addRemovalListener

public void addRemovalListener(TRHostTorrentWillBeRemovedListener l)
Specified by:
addRemovalListener in interface TRHostTorrent

removeRemovalListener

public void removeRemovalListener(TRHostTorrentWillBeRemovedListener l)
Specified by:
removeRemovalListener in interface TRHostTorrent

getData

public java.lang.Object getData(java.lang.String key)
To retreive arbitrary objects against this object.

Specified by:
getData in interface TRHostTorrent

setData

public void setData(java.lang.String key,
                    java.lang.Object value)
To store arbitrary objects against this object.

Specified by:
setData in interface TRHostTorrent