Package com.aelitis.azureus.core.networkmanager.admin

Examples of com.aelitis.azureus.core.networkmanager.admin.NetworkAdmin


             
              PrintWriter  pw = new PrintWriter( sw );
                 
              IndentWriter iw = new IndentWriter( pw );
             
              NetworkAdmin admin = NetworkAdmin.getSingleton();
             
              admin.generateDiagnostics( iw );
             
              pw.close();
             
              final String  info = sw.toString();
             
View Full Code Here


      public void
      runSupport()
      {
        try{
          final NetworkAdmin  admin = NetworkAdmin.getSingleton();
         
        NetworkAdminProtocol[] inbound_protocols = admin.getInboundProtocols(core);
       
        NetworkAdminProtocol selected = null;
       
        for ( NetworkAdminProtocol p: inbound_protocols ){
         
          if ( p.getType() == NetworkAdminProtocol.PT_UDP && p.getPort() == udp_port ){
           
            selected = p;
           
            break;
          }
        }
         
        if ( selected == null ){
         
          selected = admin.createInboundProtocol( core, NetworkAdminProtocol.PT_UDP, udp_port );
        }

            if ( selected == null ){
             
              printMessage( "\n" + MessageText.getString("configureWizard.nat.ko") + ". \n( No UDP protocols enabled ).\n");
View Full Code Here

   
                   COConfigurationManager.setParameter( "diags.enable.pending.writes", true );
                  
                   AEDiagnostics.flushPendingLogs();
                  
                   NetworkAdmin na = NetworkAdmin.getSingleton();
   
                   na.runInitialChecks(AzureusCoreImpl.this);
   
                   na.addPropertyChangeListener(
                       new NetworkAdminPropertyChangeListener()
                       {
                         private String  last_as;
   
                         public void
                         propertyChanged(
                             String    property )
                         {
                           NetworkAdmin na = NetworkAdmin.getSingleton();
   
                           if ( property.equals( NetworkAdmin.PR_NETWORK_INTERFACES )){
   
                             boolean  found_usable = false;
   
                             NetworkAdminNetworkInterface[] intf = na.getInterfaces();
   
                             for (int i=0;i<intf.length;i++){
   
                               NetworkAdminNetworkInterfaceAddress[] addresses = intf[i].getAddresses();
   
                               for (int j=0;j<addresses.length;j++){
   
                                 if ( !addresses[j].isLoopback()){
   
                                   found_usable = true;
                                 }
                               }
                             }
   
                             // ignore event if nothing usable
   
                             if ( !found_usable ){
   
                               return;
                             }
   
                             Logger.lognew LogEvent(LOGID, "Network interfaces have changed (new=" + na.getNetworkInterfacesAsString() + ")"));
   
                             announceAll( false );
   
                           }else if ( property.equals( NetworkAdmin.PR_AS )){
   
                             String  as = na.getCurrentASN().getAS();
   
                             if ( last_as == null ){
   
                               last_as = as;
   
View Full Code Here

  {
    final long now = SystemTime.getMonotonousTime();
   
    synchronized( this ){
           
      NetworkAdmin network_admin = NetworkAdmin.getSingleton();
         
      InetAddress latest_v4 = azureus_core.getInstanceManager().getMyInstance().getExternalAddress();
     
      InetAddress temp_v4 = updateAddress( current_v4, latest_v4, false );
     
      InetAddress latest_v6 = network_admin.getDefaultPublicAddressV6();
 
      InetAddress temp_v6 = updateAddress( current_v6, latest_v6, true );
     
      final TreeSet<String>  latest_v4_locals = new TreeSet<String>();
      final TreeSet<String>  latest_v6_locals = new TreeSet<String>();
     
      NetworkAdminNetworkInterface[] interfaces = network_admin.getInterfaces();
     
      List<Runnable>  to_do = new ArrayList<Runnable>();
     
      Set<String> existing_checked = new HashSet<String>( local_address_checks.keySet());
     
View Full Code Here

            }
        }catch( Throwable e ){         
        }
       
        try{
          NetworkAdmin admin = NetworkAdmin.getSingleton();
         
          NetworkAdminHTTPProxy http_proxy = admin.getHTTPProxy();
         
          if ( http_proxy != null ){
           
            payload.put( "hp", http_proxy.getName());
          }
         
          NetworkAdminSocksProxy[] socks_proxies = admin.getSocksProxies();
         
          if ( socks_proxies.length > 0 ){
           
            payload.put( "sp", socks_proxies[0].getName());
          }
View Full Code Here

  protected void
  preProcessReply(
    Map          reply,
    final boolean    v6 )
  {
    NetworkAdmin admin = NetworkAdmin.getSingleton();

    try{
      byte[] address = (byte[])reply.get( "source_ip_address" );

      InetAddress my_ip = InetAddress.getByName( new String( address ));

      NetworkAdminASN old_asn = admin.getCurrentASN();

      NetworkAdminASN new_asn = admin.lookupCurrentASN( my_ip );

      if ( !new_asn.sameAs( old_asn )){

        // kick off a secondary version check to communicate the new information

        if ( !secondary_check_done ){

          secondary_check_done  = true;

          new AEThread( "Secondary version check", true )
          {
            public void
            runSupport()
            {
              getVersionCheckInfoSupport( REASON_SECONDARY_CHECK, false, true, v6 );
            }
          }.start();
        }
      }
    }catch( Throwable e ){

      Debug.printStackTrace(e);
    }

    Long  as_advice = (Long)reply.get( "as_advice" );

    if ( as_advice != null ){

      NetworkAdminASN current_asn = admin.getCurrentASN();

      String  asn = current_asn.getASName();

      if ( asn != null ){
View Full Code Here

        public void
        runSupport()
        {
          try{
            final NetworkAdmin  admin = NetworkAdmin.getSingleton();
           
          NetworkAdminProtocol[] inbound_protocols = admin.getInboundProtocols(core);
         
          NetworkAdminProtocol selected = null;
         
          for ( NetworkAdminProtocol p: inbound_protocols ){
           
            if ( p.getType() == NetworkAdminProtocol.PT_UDP && p.getPort() == udp_port ){
             
              selected = p;
             
              break;
            }
          }
           
          if ( selected == null ){
           
            selected = admin.createInboundProtocol( core, NetworkAdminProtocol.PT_UDP, udp_port );
          }
         
              if ( selected == null ){
               
                printMessage( "\n" + MessageText.getString("configureWizard.nat.ko") + ". \n( No UDP protocols enabled ).\n");
View Full Code Here

      target_bind_ip = explicit_bind_ip;
     
    }else{
     
      InetAddress altAddress = null;
      NetworkAdmin adm = NetworkAdmin.getSingleton();
      try
      {
        if (default_bind_ip instanceof Inet6Address && !default_bind_ip.isAnyLocalAddress() && adm.hasIPV4Potential())
          altAddress = adm.getSingleHomedServiceBindAddress(NetworkAdmin.IP_PROTOCOL_VERSION_REQUIRE_V4);
        else if (default_bind_ip instanceof Inet4Address && adm.hasIPV6Potential())
          altAddress = adm.getSingleHomedServiceBindAddress(NetworkAdmin.IP_PROTOCOL_VERSION_REQUIRE_V6);
      } catch (UnsupportedAddressTypeException e)
      {
      }
     
      if(altProtocolDelegate != null && !altProtocolDelegate.explicit_bind_ip.equals(altAddress))
View Full Code Here

TOP

Related Classes of com.aelitis.azureus.core.networkmanager.admin.NetworkAdmin

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.