Package com.aelitis.azureus.core.tracker

Examples of com.aelitis.azureus.core.tracker.TrackerPeerSourceAdapter


 
  public TrackerPeerSource
  getTrackerPeerSource()
  {
    return(
      new TrackerPeerSourceAdapter()
      {
        public int
        getType()
        {
          return( TP_PEX );
View Full Code Here


 
  public TrackerPeerSource
  getCacheTrackerPeerSource()
  {
    return(
      new TrackerPeerSourceAdapter()
      {
        public String
        getName()
        {
          return( MessageText.getString( "tps.tracker.cache1", new String[]{ String.valueOf( cache_peers_used )}));
View Full Code Here

          }
         
            // cache peer source
         
          tps.add(
              new TrackerPeerSourceAdapter()
              {
                private TrackerPeerSource _delegate;
               
                 private TRTrackerAnnouncer    ta;
                 private boolean          enabled;
                  private long          ta_fixup;

                private TrackerPeerSource
                fixup()
                {
                  long  now = SystemTime.getMonotonousTime();
                 
                  if ( now - ta_fixup > 1000 ){
                   
                    TRTrackerAnnouncer current_ta = getTrackerClient();
                   
                    if ( current_ta == ta ){
                     
                      if ( current_ta != null && _delegate == null ){
                       
                        _delegate = current_ta.getCacheTrackerPeerSource();
                      }
                    }else{
                     
                      if ( current_ta == null ){
                       
                        _delegate = null;
                       
                      }else{
                       
                        _delegate = current_ta.getCacheTrackerPeerSource();
                      }
                     
                      ta = current_ta;
                    }
                   
                    enabled = controller.isPeerSourceEnabled( PEPeerSource.PS_BT_TRACKER );
                   
                    ta_fixup  = now;
                  }
                 
                  return( _delegate );
                }
               
                public int
                getType()
                {
                  return( TrackerPeerSource.TP_TRACKER );
                }
               
                public String
                getName()
                {
                  TrackerPeerSource delegate = fixup();
                 
                  if ( delegate == null ){
                 
                    return( MessageText.getString( "tps.tracker.cache" ));
                  }
                 
                  return( delegate.getName());
                }
               
                public int
                getStatus()
                {
                  TrackerPeerSource delegate = fixup();
                 
                  if ( !enabled ){
                   
                    return( ST_DISABLED );
                  }
                 
                  if ( delegate == null ){
                 
                    return( ST_STOPPED );
                  }
                 
                  return( ST_ONLINE );
                }
 
                public int
                getPeers()
                {
                  TrackerPeerSource delegate = fixup();
                 
                  if ( delegate == null || !enabled ){
                 
                    return( -1 );
                  }
                 
                  return( delegate.getPeers());             
                }
              });
          }
       
            // http seeds
         
          try{
            ExternalSeedPlugin esp = DownloadManagerController.getExternalSeedPlugin();
           
            if ( esp != null ){
                         
            tps.add( esp.getTrackerPeerSource( PluginCoreUtils.wrap( this ) ));
           }
          }catch( Throwable e ){
          }
         
            // dht
         
          try{
           
          PluginInterface dht_pi = AzureusCoreFactory.getSingleton().getPluginManager().getPluginInterfaceByClass(DHTTrackerPlugin.class);
 
              if ( dht_pi != null ){
               
                tps.add(((DHTTrackerPlugin)dht_pi.getPlugin()).getTrackerPeerSource( PluginCoreUtils.wrap( this )));
              }
        }catch( Throwable e ){
          }
         
          // LAN
       
        try{
         
          PluginInterface lt_pi = AzureusCoreFactory.getSingleton().getPluginManager().getPluginInterfaceByClass(LocalTrackerPlugin.class);
 
          if ( lt_pi != null ){
           
                tps.add(((LocalTrackerPlugin)lt_pi.getPlugin()).getTrackerPeerSource( PluginCoreUtils.wrap( this )));
         
          }
         
        }catch( Throwable e ){
         
        }
       
          // Plugin
       
        try{
       
          tps.add(((DownloadImpl)PluginCoreUtils.wrap( this )).getTrackerPeerSource());
         
        }catch( Throwable e ){
         
        }
       
          // PEX...
       
        tps.add(
          new TrackerPeerSourceAdapter()
          {
            private PEPeerManager    _pm;
            private TrackerPeerSource  _delegate;
           
            private TrackerPeerSource
            fixup()
            {
              PEPeerManager pm = getPeerManager();
             
              if ( pm == null ){
               
                _delegate   = null;
                _pm      = null;
               
              }else if ( pm != _pm ){
               
                _pm  = pm;
               
                _delegate = pm.getTrackerPeerSource();
              }
             
              return( _delegate );
            }
           
            public int
            getType()
            {
              return( TP_PEX );
            }
           
            public int
            getStatus()
            {
              TrackerPeerSource delegate = fixup();
             
              if ( delegate == null ){
               
                return( ST_STOPPED );
               
              }else{
               
                return( delegate.getStatus());
              }
            }
           
            public String
            getName()
            {
              TrackerPeerSource delegate = fixup();
             
              if ( delegate == null ){
               
                return( "" );
               
              }else{
               
                return( delegate.getName());
             
            }
           
            public int
            getPeers()
            {
              TrackerPeerSource delegate = fixup();
             
              if ( delegate == null ){
               
                return( -1 );
               
              }else{
               
                return( delegate.getPeers());
             
            }
          });
       
          // incoming
       
        tps.add(
            new TrackerPeerSourceAdapter()
            {
              private long        fixup_time;
           
              private PEPeerManager    _pm;
              private int          tcp;
View Full Code Here

  public TrackerPeerSource
  getTrackerPeerSource(
    final Download    download )
  {
    return(
      new TrackerPeerSourceAdapter()
      {
        private long  last_fixup;
        private boolean  updating;
        private int    status    = ST_UNKNOWN;
        private long  next_time  = -1;
View Full Code Here

  public TrackerPeerSource
  getTrackerPeerSource(
    final Download    download )
  {
    return(
      new TrackerPeerSourceAdapter()
      {
        private long  fixup_time;
       
        private ExternalSeedManualPeer[]  peers;           
        private boolean            running;
View Full Code Here

 
  public TrackerPeerSource
  getTrackerPeerSource()
  {
    return(
      new TrackerPeerSourceAdapter()
      {
        private long  fixup;
        private int    state;
        private String   details = "";
        private int    seeds;
View Full Code Here

  public TrackerPeerSource
  getTrackerPeerSource(
    final Download    download )
  {
    return(
      new TrackerPeerSourceAdapter()
      {
        private long[]     _last_data;
        private boolean    enabled;
        private boolean    running;
        private long    fixup_time;
View Full Code Here

TOP

Related Classes of com.aelitis.azureus.core.tracker.TrackerPeerSourceAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.