Package com.aelitis.azureus.plugins.dht

Examples of com.aelitis.azureus.plugins.dht.DHTPlugin


        ci.out.println( "\tDHT isn't present" );
       
        return;
      }
     
      DHTPlugin  dht_plugin = (DHTPlugin)dht_pi.getPlugin();
     
      if ( dht_plugin.getStatus() != DHTPlugin.STATUS_RUNNING ){
       
        ci.out.println( "\tDHT isn't running yet (disabled or initialising)" );
       
        return;
      }
     
      DHT[]  dhts = dht_plugin.getDHTs();
     
      for (int i=0;i<dhts.length;i++){
       
        if ( i > 0 ){
          ci.out.println("");
View Full Code Here


  }
 
  public boolean
  isAvailable()
  {
    DHTPlugin  dht = grabDHT();
   
    if ( dht == null ){
     
      return( false );
    }
   
    return( dht.isEnabled());
  }
View Full Code Here

  }
 
  public boolean
  isExtendedUseAllowed()
  {
    DHTPlugin  dht = grabDHT();
   
    if ( dht == null ){
     
      return( false );
    }
   
    return( dht.isExtendedUseAllowed())
  }
View Full Code Here

  }
 
  public DistributedDatabaseContact
  getLocalContact()
  {
    DHTPlugin  dht = grabDHT();
   
    if ( dht == null ){
     
      return( null );
    }
   
    return( new DDBaseContactImpl( this, dht.getLocalAddress()))
  }
View Full Code Here

 
  protected void
  log(
    String  str )
  {
    DHTPlugin  dht = grabDHT();
   
    if ( dht != null ){
     
      dht.log( str );
    }
  }
View Full Code Here

      new AZInstanceManagerAdapter.StateListener()
      {
        public void
        started()
        {             
            DHTPlugin dht = adapter.getDHTPlugin();
           
            if ( dht != null ){
             
                dht.addListener(
                  new DHTPluginListener()
                  {
                    public void
                    localAddressChanged(
                      DHTPluginContact  local_contact )
View Full Code Here

      }
     
      return( external_address );
    }
             
      DHTPlugin dht = adapter.getDHTPlugin();
           
        // if DHT has informed us of an address then we use this - most reliable up to date one
        // unless the version server cache time is more recent
     
      if ( dht_address != null && dht_address_time <= SystemTime.getCurrentTime()){
       
        AZInstanceManagerAdapter.VCPublicAddress a = adapter.getVCPublicAddress();

        if ( a != null ){
         
          long cache_time = a.getCacheTime();
         
          if ( cache_time <= dht_address_time ){
           
            external_address = dht_address;
          }
        }
      }

      if (   external_address == null &&
          ( dht == null || dht.getStatus() != DHTPlugin.STATUS_RUNNING )){
   
          // use cached version if available and the DHT isn't

        AZInstanceManagerAdapter.VCPublicAddress a = adapter.getVCPublicAddress();
           
      if ( a != null ){
       
        try{
         
          external_address  = InetAddress.getByName( a.getAddress());
         
        }catch( Throwable e ){
         
          Debug.printStackTrace(e);
        }
      }
    }
   
    if ( external_address == null && dht != null  ){
     
        // no cache, use DHT (this will hang during initialisation, hence the use of cached
        // version above
     
      try{
        InetAddress latest_dht_address = dht.getLocalAddress().getAddress().getAddress();
       
          // ignore any v6 addresses from DHT
       
        if ( sameFamily( internal_address, latest_dht_address )){
         
View Full Code Here

 
  public long
  getClockSkew()
  {
    try{       
        DHTPlugin dht = adapter.getDHTPlugin();
       
        if ( dht != null ){
         
          return( dht.getClockSkew());
        }
    }catch( Throwable e ){
     
      Debug.printStackTrace(e);
    }
View Full Code Here

          PluginInterface dht_pi =
            core.getPluginManager().getPluginInterfaceByClass( DHTPlugin.class );
         
          if ( dht_pi != null ){
           
            DHTPlugin dht_plugin = (DHTPlugin)dht_pi.getPlugin();
           
            if ( dht_plugin.isEnabled()){
             
              DHT dht = dht_plugin.getDHT( DHT.NW_MAIN );
             
              if ( dht == null ){
               
                dht = dht_plugin.getDHT( DHT.NW_CVS );
              }
             
              if ( dht != null ){
               
                puncher = dht.getNATPuncher();
View Full Code Here

TOP

Related Classes of com.aelitis.azureus.plugins.dht.DHTPlugin

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.