Class TRHostTorrentHostImpl
- java.lang.Object
-
- com.biglybt.core.tracker.host.impl.TRHostTorrentHostImpl
-
- All Implemented Interfaces:
TRHostTorrent
public class TRHostTorrentHostImpl extends java.lang.Object implements TRHostTorrent
-
-
Field Summary
Fields Modifier and Type Field Description private Average
average_announce
private Average
average_bytes_in
private Average
average_bytes_out
private Average
average_downloaded
private Average
average_scrape
private Average
average_uploaded
private java.util.HashMap
data
private long
date_added
private boolean
disable_reply_caching
private TRHostImpl
host
private long
last_announce
private long
last_bytes_in
private long
last_bytes_out
private long
last_downloaded
private long
last_scrape
private long
last_uploaded
private java.util.List
listeners_cow
private boolean
passive
private boolean
persistent
private int
port
private java.util.List
removal_listeners
private TRTrackerServer
server
private TRTrackerServerTorrent
server_torrent
private long
sos_announce
private long
sos_bytes_in
private long
sos_bytes_out
private long
sos_complete
private long
sos_downloaded
private long
sos_scrape
private long
sos_uploaded
private int
status
protected AEMonitor
this_mon
private TOTorrent
torrent
-
Fields inherited from interface com.biglybt.core.tracker.host.TRHostTorrent
TS_FAILED, TS_PUBLISHED, TS_STARTED, TS_STOPPED
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TRHostTorrentHostImpl(TRHostImpl _host, TRTrackerServer _server, TOTorrent _torrent, int _port, long _date_added)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addListener(TRHostTorrentListener l)
void
addRemovalListener(TRHostTorrentWillBeRemovedListener l)
boolean
canBeRemoved()
doesn't guarantee that removal will be successful as conditions may changevoid
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()
-
-
-
Field Detail
-
host
private final TRHostImpl host
-
server
private final TRTrackerServer server
-
server_torrent
private TRTrackerServerTorrent server_torrent
-
torrent
private TOTorrent torrent
-
date_added
private long date_added
-
port
private final int port
-
listeners_cow
private java.util.List listeners_cow
-
removal_listeners
private final java.util.List removal_listeners
-
status
private int status
-
persistent
private boolean persistent
-
passive
private boolean passive
-
sos_uploaded
private long sos_uploaded
-
sos_downloaded
private long sos_downloaded
-
sos_bytes_in
private long sos_bytes_in
-
sos_bytes_out
private long sos_bytes_out
-
sos_announce
private long sos_announce
-
sos_scrape
private long sos_scrape
-
sos_complete
private long sos_complete
-
last_uploaded
private long last_uploaded
-
last_downloaded
private long last_downloaded
-
last_bytes_in
private long last_bytes_in
-
last_bytes_out
private long last_bytes_out
-
last_announce
private long last_announce
-
last_scrape
private long last_scrape
-
average_uploaded
private final Average average_uploaded
-
average_downloaded
private final Average average_downloaded
-
average_bytes_in
private final Average average_bytes_in
-
average_bytes_out
private final Average average_bytes_out
-
average_announce
private final Average average_announce
-
average_scrape
private final Average average_scrape
-
disable_reply_caching
private boolean disable_reply_caching
-
data
private java.util.HashMap data
-
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 interfaceTRHostTorrent
-
start
public void start()
- Specified by:
start
in interfaceTRHostTorrent
-
startSupport
protected void startSupport()
-
stop
public void stop()
- Specified by:
stop
in interfaceTRHostTorrent
-
stopSupport
protected void stopSupport()
-
remove
public void remove() throws TRHostTorrentRemovalVetoException
- Specified by:
remove
in interfaceTRHostTorrent
- 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 interfaceTRHostTorrent
- Returns:
- true if OK, exception thrown otherwise
- Throws:
TRHostTorrentRemovalVetoException
-
getStatus
public int getStatus()
- Specified by:
getStatus
in interfaceTRHostTorrent
-
isPersistent
public boolean isPersistent()
- Specified by:
isPersistent
in interfaceTRHostTorrent
-
setPersistent
protected void setPersistent(boolean _persistent)
-
isPassive
public boolean isPassive()
- Specified by:
isPassive
in interfaceTRHostTorrent
-
setPassive
public void setPassive(boolean b)
- Specified by:
setPassive
in interfaceTRHostTorrent
-
getDateAdded
public long getDateAdded()
- Specified by:
getDateAdded
in interfaceTRHostTorrent
-
getTorrent
public TOTorrent getTorrent()
- Specified by:
getTorrent
in interfaceTRHostTorrent
-
setTorrent
public void setTorrent(TOTorrent _torrent)
- Specified by:
setTorrent
in interfaceTRHostTorrent
-
setTorrentInternal
protected void setTorrentInternal(TOTorrent _torrent)
-
getTrackerTorrent
public TRTrackerServerTorrent getTrackerTorrent()
- Specified by:
getTrackerTorrent
in interfaceTRHostTorrent
-
getPeers
public TRHostPeer[] getPeers()
- Specified by:
getPeers
in interfaceTRHostTorrent
-
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 interfaceTRHostTorrent
-
getLeecherCount
public int getLeecherCount()
- Specified by:
getLeecherCount
in interfaceTRHostTorrent
-
getBadNATCount
public int getBadNATCount()
- Specified by:
getBadNATCount
in interfaceTRHostTorrent
-
updateStats
protected void updateStats()
-
getServer
protected TRTrackerServer getServer()
-
getTotalUploaded
public long getTotalUploaded()
- Specified by:
getTotalUploaded
in interfaceTRHostTorrent
-
getTotalDownloaded
public long getTotalDownloaded()
- Specified by:
getTotalDownloaded
in interfaceTRHostTorrent
-
getTotalLeft
public long getTotalLeft()
- Specified by:
getTotalLeft
in interfaceTRHostTorrent
-
getTotalBytesIn
public long getTotalBytesIn()
- Specified by:
getTotalBytesIn
in interfaceTRHostTorrent
-
getTotalBytesOut
public long getTotalBytesOut()
- Specified by:
getTotalBytesOut
in interfaceTRHostTorrent
-
getAnnounceCount
public long getAnnounceCount()
- Specified by:
getAnnounceCount
in interfaceTRHostTorrent
-
getScrapeCount
public long getScrapeCount()
- Specified by:
getScrapeCount
in interfaceTRHostTorrent
-
getCompletedCount
public long getCompletedCount()
- Specified by:
getCompletedCount
in interfaceTRHostTorrent
-
getAverageBytesIn
public long getAverageBytesIn()
- Specified by:
getAverageBytesIn
in interfaceTRHostTorrent
-
getAverageBytesOut
public long getAverageBytesOut()
- Specified by:
getAverageBytesOut
in interfaceTRHostTorrent
-
getAverageUploaded
public long getAverageUploaded()
- Specified by:
getAverageUploaded
in interfaceTRHostTorrent
-
getAverageDownloaded
public long getAverageDownloaded()
- Specified by:
getAverageDownloaded
in interfaceTRHostTorrent
-
getAverageAnnounceCount
public long getAverageAnnounceCount()
- Specified by:
getAverageAnnounceCount
in interfaceTRHostTorrent
-
getAverageScrapeCount
public long getAverageScrapeCount()
- Specified by:
getAverageScrapeCount
in interfaceTRHostTorrent
-
disableReplyCaching
public void disableReplyCaching()
- Specified by:
disableReplyCaching
in interfaceTRHostTorrent
-
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 interfaceTRHostTorrent
-
removeListener
public void removeListener(TRHostTorrentListener l)
- Specified by:
removeListener
in interfaceTRHostTorrent
-
addRemovalListener
public void addRemovalListener(TRHostTorrentWillBeRemovedListener l)
- Specified by:
addRemovalListener
in interfaceTRHostTorrent
-
removeRemovalListener
public void removeRemovalListener(TRHostTorrentWillBeRemovedListener l)
- Specified by:
removeRemovalListener
in interfaceTRHostTorrent
-
getData
public java.lang.Object getData(java.lang.String key)
To retreive arbitrary objects against this object.- Specified by:
getData
in interfaceTRHostTorrent
-
setData
public void setData(java.lang.String key, java.lang.Object value)
To store arbitrary objects against this object.- Specified by:
setData
in interfaceTRHostTorrent
-
-