Methods Summary |
---|
public void | addListener(TrackerTorrentListener listener)
try{
this_mon.enter();
List new_listeners = new ArrayList( listeners_cow );
new_listeners.add( listener );
if ( new_listeners.size() == 1 ){
host_torrent.addListener( this );
}
listeners_cow = new_listeners;
}finally{
this_mon.exit();
}
|
public void | addRemovalListener(TrackerTorrentWillBeRemovedListener listener)
try{
this_mon.enter();
removal_listeners.add( listener );
if ( removal_listeners.size() == 1 ){
host_torrent.addRemovalListener( this );
}
}finally{
this_mon.exit();
}
|
public boolean | canBeRemoved()
try{
host_torrent.canBeRemoved();
}catch( TRHostTorrentRemovalVetoException e ){
throw( new TrackerTorrentRemovalVetoException(e.getMessage()));
}
return( true );
|
public void | disableReplyCaching()
host_torrent.disableReplyCaching();
|
public boolean | equals(java.lang.Object other)
// as we're lazy and create new instances of this on demand we need to
// do something sensible about equivalence
if ( other instanceof TrackerTorrentImpl ){
return( host_torrent == ((TrackerTorrentImpl)other).host_torrent );
}
return( false );
|
public long | getAnnounceCount()
return( host_torrent.getAnnounceCount());
|
public long | getAverageAnnounceCount()
return( host_torrent.getAverageAnnounceCount());
|
public long | getAverageBytesIn()
return( host_torrent.getAverageBytesIn());
|
public long | getAverageBytesOut()
return( host_torrent.getAverageBytesOut());
|
public long | getAverageDownloaded()
return( host_torrent.getAverageDownloaded());
|
public long | getAverageScrapeCount()
return( host_torrent.getAverageScrapeCount());
|
public long | getAverageUploaded()
return( host_torrent.getAverageUploaded());
|
public int | getBadNATCount()
return( host_torrent.getBadNATCount());
|
public long | getCompletedCount()
return( host_torrent.getCompletedCount());
|
public long | getDateAdded()
return( host_torrent.getDateAdded());
|
protected TRHostTorrent | getHostTorrent()
return( host_torrent );
|
public int | getLeecherCount()
return( host_torrent.getLeecherCount());
|
public TrackerPeer[] | getPeers()
TRHostPeer[] peers = host_torrent.getPeers();
TrackerPeer[] res = new TrackerPeer[peers.length];
for (int i=0;i<peers.length;i++){
res[i] = new TrackerPeerImpl( peers[i]);
}
return( res );
|
public long | getScrapeCount()
return( host_torrent.getScrapeCount());
|
public int | getSeedCount()
return( host_torrent.getSeedCount());
|
public int | getStatus()
int status = host_torrent.getStatus();
switch(status){
case TRHostTorrent.TS_STARTED:
return( TS_STARTED );
case TRHostTorrent.TS_STOPPED:
return( TS_STOPPED );
case TRHostTorrent.TS_PUBLISHED:
return( TS_PUBLISHED );
default:
throw( new RuntimeException( "TrackerTorrent: status invalid"));
}
|
public Torrent | getTorrent()
return( new TorrentImpl( host_torrent.getTorrent()));
|
public long | getTotalBytesIn()
return( host_torrent.getTotalBytesIn());
|
public long | getTotalBytesOut()
return( host_torrent.getTotalBytesOut());
|
public long | getTotalDownloaded()
return( host_torrent.getTotalDownloaded());
|
public long | getTotalLeft()
return( host_torrent.getTotalLeft());
|
public long | getTotalUploaded()
return( host_torrent.getTotalUploaded());
|
public int | hashCode()
return( host_torrent.hashCode());
|
public boolean | isPassive()
return( host_torrent.isPassive());
|
public void | postProcess(TRHostTorrentRequest request)
List listeners_ref = listeners_cow;
for (int i=0;i<listeners_ref.size();i++){
try{
((TrackerTorrentListener)listeners_ref.get(i)).postProcess(new TrackerTorrentRequestImpl(request));
}catch( TrackerException e ){
throw( new TRHostException( e.getMessage(), e ));
}catch( Throwable e ){
throw( new TRHostException( "Post-process fails", e ));
}
}
|
public void | preProcess(TRHostTorrentRequest request)
List listeners_ref = listeners_cow;
for (int i=0;i<listeners_ref.size();i++){
try{
((TrackerTorrentListener)listeners_ref.get(i)).preProcess(new TrackerTorrentRequestImpl(request));
}catch( TrackerException e ){
throw( new TRHostException( e.getMessage(), e ));
}catch( Throwable e ){
throw( new TRHostException( "Pre-process fails", e ));
}
}
|
public void | remove()
try{
host_torrent.remove();
}catch( TRHostTorrentRemovalVetoException e ){
throw( new TrackerTorrentRemovalVetoException(e.getMessage()));
}
|
public void | removeListener(TrackerTorrentListener listener)
try{
this_mon.enter();
List new_listeners = new ArrayList( listeners_cow );
new_listeners.remove( listener );
if ( new_listeners.size() == 0 ){
host_torrent.removeListener(this);
}
listeners_cow = new_listeners;
}finally{
this_mon.exit();
}
|
public void | removeRemovalListener(TrackerTorrentWillBeRemovedListener listener)
try{
this_mon.enter();
removal_listeners.remove( listener );
if ( removal_listeners.size() == 0 ){
host_torrent.removeRemovalListener(this);
}
}finally{
this_mon.exit();
}
|
public void | start()
try{
host_torrent.start();
}catch( Throwable e ){
throw( new TrackerException("Start failed", e ));
}
|
public void | stop()
try{
host_torrent.stop();
}catch( Throwable e ){
throw( new TrackerException("Start failed", e ));
}
|
public void | torrentWillBeRemoved(TRHostTorrent t)
for (int i=0;i<removal_listeners.size();i++){
try{
((TrackerTorrentWillBeRemovedListener)removal_listeners.get(i)).torrentWillBeRemoved( this );
}catch( TrackerTorrentRemovalVetoException e ){
throw( new TRHostTorrentRemovalVetoException( e.getMessage()));
}
}
|