Methods Summary |
---|
public void | addListener(TRHostTorrentListener l)
try{
this_mon.enter();
List new_listeners = new ArrayList( listeners_cow );
new_listeners.add(l);
listeners_cow = new_listeners;
}finally{
this_mon.exit();
}
host.torrentListenerRegistered();
|
public void | addRemovalListener(TRHostTorrentWillBeRemovedListener l)
try{
this_mon.enter();
removal_listeners.add(l);
}finally{
this_mon.exit();
}
|
public boolean | canBeRemoved()
for (int i=0;i<removal_listeners.size();i++){
((TRHostTorrentWillBeRemovedListener)removal_listeners.get(i)).torrentWillBeRemoved( this );
}
return( true );
|
public void | disableReplyCaching()
|
public long | getAnnounceCount()
return( 0 );
|
public long | getAverageAnnounceCount()
return( 0 );
|
public long | getAverageBytesIn()
return( 0 );
|
public long | getAverageBytesOut()
return( 0 );
|
public long | getAverageDownloaded()
return( 0 );
|
public long | getAverageScrapeCount()
return( 0 );
|
public long | getAverageUploaded()
return( 0 );
|
public int | getBadNATCount()
return( 0 );
|
public long | getCompletedCount()
return( 0 );
|
public java.lang.Object | getData(java.lang.String key)To retreive arbitrary objects against this object.
if (data == null) return null;
return data.get(key);
|
public long | getDateAdded()
return( date_added );
|
public int | getLeecherCount()
return( peer_count );
|
public TRHostPeer[] | getPeers()
try{
this_mon.enter();
return( peers );
}finally{
this_mon.exit();
}
|
public int | getPort()
return( -1 );
|
public long | getScrapeCount()
return( 0 );
|
public int | getSeedCount()
return( seed_count );
|
public int | getStatus()
return( status );
|
public TOTorrent | getTorrent()
return( torrent );
|
public long | getTotalBytesIn()
return( 0 );
|
public long | getTotalBytesOut()
return( 0 );
|
public long | getTotalDownloaded()
return( 0 );
|
public long | getTotalLeft()
return( 0 );
|
public long | getTotalUploaded()
return( 0 );
|
public boolean | isPassive()
return( false );
|
public boolean | isPersistent()
return( persistent );
|
protected void | postProcess(TRHostTorrentRequest req)
List listeners_ref = listeners_cow;
for (int i=0;i<listeners_ref.size();i++){
try{
((TRHostTorrentListener)listeners_ref.get(i)).postProcess(req);
}catch( Throwable e ){
Debug.printStackTrace(e);
}
}
|
protected void | preProcess(TRHostTorrentRequest req)
List listeners_ref = listeners_cow;
for (int i=0;i<listeners_ref.size();i++){
try{
((TRHostTorrentListener)listeners_ref.get(i)).preProcess(req);
}catch( Throwable e ){
Debug.printStackTrace(e);
}
}
|
public void | remove()
try{
this_mon.enter();
canBeRemoved();
host.remove( this );
}finally{
this_mon.exit();
}
|
public void | removeListener(TRHostTorrentListener l)
try{
this_mon.enter();
List new_listeners = new ArrayList( listeners_cow );
new_listeners.remove(l);
listeners_cow = new_listeners;
}finally{
this_mon.exit();
}
|
public void | removeRemovalListener(TRHostTorrentWillBeRemovedListener l)
try{
this_mon.enter();
removal_listeners.remove(l);
}finally{
this_mon.exit();
}
|
public void | setData(java.lang.String key, java.lang.Object value)To store arbitrary objects against this object.
try{
this_mon.enter();
if (data == null) {
data = new HashMap();
}
if (value == null) {
if (data.containsKey(key))
data.remove(key);
} else {
data.put(key, value);
}
}finally{
this_mon.exit();
}
|
public void | setPassive(boolean passive)
|
public void | setPersistent(boolean _persistent)
persistent = _persistent;
|
public void | start()
|
public void | stop()
|
protected void | updateStats()
TRTrackerScraperResponse resp = null;
TRTrackerAnnouncer tc = host.getTrackerClient( this );
if ( tc != null ){
resp = TRTrackerScraperFactory.getSingleton().scrape( tc );
}
if ( resp == null ){
resp = TRTrackerScraperFactory.getSingleton().scrape( torrent );
}
try{
this_mon.enter();
if ( resp != null && resp.isValid()){
peer_count = resp.getPeers();
seed_count = resp.getSeeds();
peers = new TRHostPeer[ peer_count + seed_count ];
for (int i=0;i<peers.length;i++){
peers[i] = new TRHostPeerPublishImpl( i<seed_count );
}
}else{
peers = new TRHostPeer[0];
}
}finally{
this_mon.exit();
}
|