Class TRHostTorrentPublishImpl
- java.lang.Object
-
- com.biglybt.core.tracker.host.impl.TRHostTorrentPublishImpl
-
- All Implemented Interfaces:
TRHostTorrent
public class TRHostTorrentPublishImpl extends java.lang.Object implements TRHostTorrent
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.HashMap
data
private long
date_added
private TRHostImpl
host
private java.util.List
listeners_cow
private int
peer_count
private TRHostPeer[]
peers
private boolean
persistent
private java.util.List
removal_listeners
private int
seed_count
private static 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
TRHostTorrentPublishImpl(TRHostImpl _host, TOTorrent _torrent, long _date_added)
-
Method Summary
-
-
-
Field Detail
-
host
private final TRHostImpl host
-
torrent
private TOTorrent torrent
-
date_added
private final long date_added
-
status
private static final int status
- See Also:
- Constant Field Values
-
persistent
private boolean persistent
-
seed_count
private int seed_count
-
peer_count
private int peer_count
-
peers
private TRHostPeer[] peers
-
listeners_cow
private java.util.List listeners_cow
-
removal_listeners
private final java.util.List removal_listeners
-
data
private java.util.HashMap data
-
this_mon
protected final AEMonitor this_mon
-
-
Constructor Detail
-
TRHostTorrentPublishImpl
protected TRHostTorrentPublishImpl(TRHostImpl _host, TOTorrent _torrent, long _date_added)
-
-
Method Detail
-
start
public void start()
- Specified by:
start
in interfaceTRHostTorrent
-
stop
public void stop()
- Specified by:
stop
in interfaceTRHostTorrent
-
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
public void setPersistent(boolean _persistent)
-
isPassive
public boolean isPassive()
- Specified by:
isPassive
in interfaceTRHostTorrent
-
setPassive
public void setPassive(boolean passive)
- 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 t)
- Specified by:
setTorrent
in interfaceTRHostTorrent
-
getTrackerTorrent
public TRTrackerServerTorrent getTrackerTorrent()
- Specified by:
getTrackerTorrent
in interfaceTRHostTorrent
-
getPort
public int getPort()
- Specified by:
getPort
in interfaceTRHostTorrent
-
getPeers
public TRHostPeer[] getPeers()
- Specified by:
getPeers
in interfaceTRHostTorrent
-
getAnnounceCount
public long getAnnounceCount()
- Specified by:
getAnnounceCount
in interfaceTRHostTorrent
-
getAverageAnnounceCount
public long getAverageAnnounceCount()
- Specified by:
getAverageAnnounceCount
in interfaceTRHostTorrent
-
getScrapeCount
public long getScrapeCount()
- Specified by:
getScrapeCount
in interfaceTRHostTorrent
-
getAverageScrapeCount
public long getAverageScrapeCount()
- Specified by:
getAverageScrapeCount
in interfaceTRHostTorrent
-
getCompletedCount
public long getCompletedCount()
- Specified by:
getCompletedCount
in interfaceTRHostTorrent
-
updateStats
protected void updateStats()
-
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
-
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
-
getAverageUploaded
public long getAverageUploaded()
- Specified by:
getAverageUploaded
in interfaceTRHostTorrent
-
getAverageDownloaded
public long getAverageDownloaded()
- Specified by:
getAverageDownloaded
in interfaceTRHostTorrent
-
getTotalBytesIn
public long getTotalBytesIn()
- Specified by:
getTotalBytesIn
in interfaceTRHostTorrent
-
getTotalBytesOut
public long getTotalBytesOut()
- Specified by:
getTotalBytesOut
in interfaceTRHostTorrent
-
getAverageBytesIn
public long getAverageBytesIn()
- Specified by:
getAverageBytesIn
in interfaceTRHostTorrent
-
getAverageBytesOut
public long getAverageBytesOut()
- Specified by:
getAverageBytesOut
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
-
-