Package org.gudy.azureus2.core3.logging

Examples of org.gudy.azureus2.core3.logging.LogEvent


  forceStop(
    final TRTrackerBTAnnouncerImpl    announcer,
    final URL              url )
  {
    if (Logger.isEnabled()) {
      Logger.log(new LogEvent(getTorrent(), LOGID, "Force stopping " + url + " as private torrent" ));
    }
   
    new AEThread2( "TRMux:fs", true )
    {
      public void
View Full Code Here


   
    this.tracker_peer_id_str += URLEncoder.encode(new String(tracker_peer_id, Constants.BYTE_ENCODING), Constants.BYTE_ENCODING).replaceAll("\\+", "%20");
   
  }catch (UnsupportedEncodingException e){

    Logger.log(new LogEvent(torrent, LOGID, "URL encode fails", e));
   
    throw( new TRTrackerAnnouncerException( "TRTrackerAnnouncer: URL encode fails"));
   
  }catch( TOTorrentException e ){
 
    Logger.log(new LogEvent(torrent, LOGID, "Torrent hash retrieval fails", e));
   
    throw( new TRTrackerAnnouncerException( "TRTrackerAnnouncer: URL encode fails"))
  }
    
  timer_event_action = 
    new TimerEventPerformer()
    {
      public void
      perform(
        TimerEvent  this_event )
      {
        if ( manual_control ){
         
          requestUpdateSupport();
         
          return;
        }
       
        long  secs_to_wait = getErrorRetryInterval();
             
        try{
                             
          secs_to_wait = requestUpdateSupport();

          if (Logger.isEnabled())
            Logger.log(new LogEvent(torrent, LOGID,
                "Next tracker announce (unadjusted) will be in " + secs_to_wait
                    + "s"));
               
        }finally{
           
          current_time_to_wait_secs  = secs_to_wait;
             
          if ( tracker_state == TRTrackerAnnouncer.TS_STOPPED ){
           
            // System.out.println( "\tperform: stopped so no more events");
           
          }else{
           
         
            try{
              this_mon.enter();
           
                // it is possible that the current event was being processed
                // when another thread cancelled it and created a further timer
                // event. if this is the case we don't want to go ahead and
                // create another timer as one already exists
               
              if ( this_event.isCancelled()){
               
                // System.out.println( "\tperform: cancelled so no new event");
               
              }else{
               
               
                secs_to_wait = getAdjustedSecsToWait();

                if (Logger.isEnabled())
                  Logger.log(new LogEvent(torrent, LOGID,
                      "Next tracker announce (adjusted) will be in "
                          + secs_to_wait + "s"));
               
                long target_time = SystemTime.getCurrentTime() + (secs_to_wait*1000);
               
                if ( current_timer_event != null && !current_timer_event.isCancelled()){
                 
                  if (   current_timer_event != this_event &&
                      current_timer_event.getWhen() < target_time ){
                 
                      // existing event is earlier then current target, use it
                       
                    return;
                  }
                 
                  current_timer_event.cancel();
                }
               
                if ( !destroyed ){
                 
                  current_timer_event =
                    tracker_timer.addEvent( target_time, this );
                }
              }
            }finally{
             
              this_mon.exit();
            }
          }
        }
      }
    };
   
    if (Logger.isEnabled())
      Logger.log(new LogEvent(torrent, LOGID,
          "Tracker Announcer Created using url : " + trackerURLListToString()));
  }
View Full Code Here

       
        long now = SystemTime.getCurrentTime();
       
        if (Logger.isEnabled()) {
             Logger.log
               new LogEvent(
                 LogIDs.PLUGIN, LogEvent.LT_INFORMATION,
                 "Delayed task '" + getName() +
                   "': queue_time=" + ( run_time - create_time ) +
                   ", exec_time=" + ( now - run_time )));
        }
View Full Code Here

        //there's no "min interval" returned, so start the re-announce backoff timings at 15min
        if( failure_added_time < 900 failure_added_time = 900;
        secs_to_wait = getErrorRetryInterval();
       
        if (Logger.isEnabled()) {
          Logger.log(new LogEvent(torrent, LOGID,
              "MIN INTERVAL CALC: tracker reported error, " +
              "adjusting to error retry interval"));
        }
      }
      else //tracker is OFFLINE
        secs_to_wait = getErrorRetryInterval();
        if (Logger.isEnabled()) {
          Logger.log(new LogEvent(torrent, LOGID,
              "MIN INTERVAL CALC: tracker seems to be offline, " +
              "adjusting to error retry interval"));
        }
      }
             
    }
    else{
       
      if( rd_override_percentage == 0 ) {
        if (Logger.isEnabled())
          Logger.log(new LogEvent(torrent, LOGID,
              "MIN INTERVAL CALC: override, perc = 0"));
        return TRTrackerAnnouncer.REFRESH_MINIMUM_SECS;
      }

      if (rd_override_percentage != 100) {
        secs_to_wait = (secs_to_wait * rd_override_percentage) /100;
        if (Logger.isEnabled()) {
          Logger.log(new LogEvent(torrent, LOGID,
              "MIN INTERVAL CALC: override, perc = " + rd_override_percentage));
        }
      }
                 
      if ( secs_to_wait < TRTrackerAnnouncer.REFRESH_MINIMUM_SECS ){
         
        secs_to_wait = TRTrackerAnnouncer.REFRESH_MINIMUM_SECS;
      }
     
      //use 'min interval' for calculation
      if( min_interval != 0 && secs_to_wait < min_interval ) {
        float percentage = (float)min_interval / current_time_to_wait_secs;  //percentage of original interval
       
        //long orig_override = secs_to_wait;
       
        int added_secs = (int)((min_interval - secs_to_wait) * percentage)//increase by x percentage of difference
        secs_to_wait += added_secs;
       
        if (Logger.isEnabled())
          Logger.log(new LogEvent(torrent, LOGID,
              "MIN INTERVAL CALC: min_interval=" + min_interval + ", interval="
                  + current_time_to_wait_secs + ", orig=" +  current_time_to_wait_secs
                  + ", new=" + secs_to_wait + ", added=" + added_secs
                  + ", perc=" + percentage));
      }
View Full Code Here

            current_timer_event.cancel();
           
            if ( !destroyed ){
             
              if (Logger.isEnabled())
                Logger.log(new LogEvent(torrent, LOGID,
                    "Changed next tracker announce to " + secs_to_wait
                        + "s via " + Debug.getStackTrace(true, false, 0, 3)));
             
              current_timer_event =
                tracker_timer.addEvent(
View Full Code Here

      rd_last_override = SystemTime.getCurrentTime()//"pause" overrides for 10s
     
      if ( !destroyed ){
       
        if (Logger.isEnabled())
          Logger.log(new LogEvent(torrent, LOGID,
              "Forcing tracker announce now via "
                  + Debug.getStackTrace(true, false, 0, 3)));

        current_timer_event =
          tracker_timer.addEvent(
View Full Code Here

    }
  }
 
  protected TRTrackerAnnouncerResponseImpl startSupport() {
    if (Logger.isEnabled())
      Logger.log(new LogEvent(torrent, LOGID, "Tracker Announcer is sending "
          + "a start Request"));

    return (update("started"));
  }
View Full Code Here

    return (update("started"));
  }

  protected TRTrackerAnnouncerResponseImpl completeSupport() {
    if (Logger.isEnabled())
      Logger.log(new LogEvent(torrent, LOGID, "Tracker Announcer is sending "
          + "a completed Request"));

    return (update("completed"));
  }
View Full Code Here

    return (update("completed"));
  }

  protected TRTrackerAnnouncerResponseImpl stopSupport() {
    if (Logger.isEnabled())
      Logger.log(new LogEvent(torrent, LOGID, "Tracker Announcer is sending "
          + "a stopped Request"));

    return (update("stopped"));
  }
View Full Code Here

    return (update("stopped"));
  }

  protected TRTrackerAnnouncerResponseImpl updateSupport() {
    if (Logger.isEnabled())
      Logger.log(new LogEvent(torrent, LOGID, "Tracker Announcer is sending "
          + "an update Request"));

    return update("");
  }
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.core3.logging.LogEvent

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.