Package com.aelitis.azureus.core.subs

Examples of com.aelitis.azureus.core.subs.SubscriptionHistory


          result.put( "is_public", new Boolean( shareable && subs.isPublic()));
          result.put( "is_author", new Boolean( subs.isMine()));
          result.put( "is_shareable", new Boolean( shareable ));
          result.put( "auto_dl_supported", new Boolean( subs.isAutoDownloadSupported()));
         
          SubscriptionHistory history = subs.getHistory();
         
          Map  options = new HashMap();

          result.put( "options", options );

          options.put( "is_enabled", new Boolean( history.isEnabled()));
          options.put( "auto_dl", new Boolean( history.isAutoDownload()));
         
          Map  info = new HashMap();

          result.put( "info", info );
         
          info.put( "last_scan", new Long( history.getLastScanTime()));
          info.put( "last_new", new Long( history.getLastNewResultTime()));
          info.put( "num_unread", new Long( history.getNumUnread()));
          info.put( "num_read", new Long( history.getNumRead()));
         
          String json = subs.getJSON();
         
          Map map = JSONUtils.decodeJSON( json );
         
View Full Code Here


     
      for (int i=0;i<subs.length;i++){
       
        Subscription sub = subs[i];
               
        SubscriptionHistory history = sub.getHistory();
       
        if ( !history.isEnabled()){
         
          continue;
        }
       
        long  next_scan = getNextScan( sub );
View Full Code Here

     
    for (int i=0;i<subs.length;i++){
     
      Subscription sub = subs[i];
           
      SubscriptionHistory history = sub.getHistory();
     
      if ( !history.isEnabled()){
       
        continue;
      }
     
      synchronized( this ){
       
        Long  scan_due = (Long)sub.getUserData( SCHEDULER_NEXT_SCAN_KEY );
       
        if ( scan_due == null ){
         
          continue;
        }
       
        long diff = now - scan_due.longValue();
       
        if ( diff < -10*1000 ){
       
          continue;
        }
       
        sub.setUserData( SCHEDULER_NEXT_SCAN_KEY, null );
      }
     
      long  last_scan = history.getLastScanTime();

      try{
         
        download( sub, true );
       
      }catch( Throwable e ){
       
      }finally{
       
        long  new_last_scan = history.getLastScanTime();

        if ( new_last_scan == last_scan ){
         
          scanFailed( sub );
         
View Full Code Here

 
  protected long
  getNextScan(
    Subscription    sub )
  {
    SubscriptionHistory  history = sub.getHistory();
       
    Long fail_count = (Long)sub.getUserData( SCHEDULER_FAILED_SCAN_CONSEC_KEY );
   
    if ( fail_count != null ){
     
      long   fail_time = ((Long)sub.getUserData( SCHEDULER_FAILED_SCAN_TIME_KEY )).longValue();
     
      long  fails = fail_count.longValue();
     
      long  backoff = FAIL_INIT_DELAY;
     
      for (int i=1;i<fails;i++){
       
        backoff <<= 1;
       
        if ( backoff > FAIL_MAX_DELAY ){
         
          backoff = FAIL_MAX_DELAY;
         
          break;
        }
      }
     
      return( fail_time + backoff );
    }

    return( history.getNextScanTime() );
  }
View Full Code Here

  public void refresh(TableCell cell) {
    boolean autoDownload = false;
    Subscription sub = (Subscription) cell.getDataSource();
    if (sub != null) {
      SubscriptionHistory history = sub.getHistory();
      if(history != null) {
        autoDownload = history.isAutoDownload();
      }
    }

    if (!cell.setSortValue(autoDownload) && cell.isValid()) {
      return;
View Full Code Here

TOP

Related Classes of com.aelitis.azureus.core.subs.SubscriptionHistory

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.