Package org.gudy.azureus2.core3.peer

Examples of org.gudy.azureus2.core3.peer.PEPeer


      CAT_BYTES,
    });
  }

  public void refresh(TableCell cell) {
    PEPeer peer = (PEPeer)cell.getDataSource();
    long data_value  = 0;
    long prot_value  = 0;
   
    if ( peer != null ){
      data_value = peer.getStats().getDataSendRate();
         prot_value = peer.getStats().getProtocolSendRate();
    }
    long  sort_value = ( data_value<<32 ) + prot_value;
   
    if (!cell.setSortValue(sort_value) && cell.isValid())
      return;
View Full Code Here


    super(COLUMN_ID, ALIGN_TRAIL, POSITION_INVISIBLE, 70, table_id);
    setRefreshInterval(INTERVAL_LIVE);
  }

  public void refresh(TableCell cell) {
    PEPeer peer = (PEPeer)cell.getDataSource();
    long value = (peer == null) ? 0 : peer.getStats().getTotalBytesDownloadedByPeer() - peer.getStats().getTotalDataBytesSent();
    // Just because we sent data doesn't mean the peer has told us the piece is done yet
    if (value < 0) value = 0;
   
    if ( peer != null ){
      Long prev_value = (Long)peer.getData( "DLedFromOther_prev" );
     
      if( prev_value != null ) {
        if( value < prev_value.longValue() ) {  //dont show decrement while we're actively uploading
          value = prev_value.longValue();
        }
        else if( value > prev_value.longValue() ) {
          peer.setData( "DLedFromOther_prev", new Long( value ) );
        }
      }
      else {
        peer.setData( "DLedFromOther_prev", new Long( value ) );
      }
    }
   
    if (!cell.setSortValue(value) && cell.isValid())
      return;
View Full Code Here

    super(COLUMN_ID, POSITION_LAST, 100, table_id);
    setRefreshInterval(INTERVAL_LIVE);
  }

  public void refresh(TableCell cell) {
    PEPeer peer = (PEPeer)cell.getDataSource();

    cell.setText( peer == null ? "" : peer.getClient() );
  }
View Full Code Here

      CAT_CONTENT,
    });
  }

  public void refresh(TableCell cell) {
    PEPeer peer = (PEPeer)cell.getDataSource();
    long value = (peer == null) ? Long.MAX_VALUE : peer.getStats().getEstimatedSecondsToCompletion();

    if (!cell.setSortValue(value) && cell.isValid())
      return;

    if ( value > 7*24*60*60 ){
View Full Code Here

      CAT_SHARING,
    });
  }

  public void refresh(TableCell cell) {
    PEPeer peer = (PEPeer)cell.getDataSource();
    float value = 0;
    long lDivisor = 0;
    long lDivident = 0;
    if (peer != null) {
      lDivisor = peer.getStats().getTotalDataBytesReceived() -peer.getStats().getTotalBytesDiscarded();
      lDivident = peer.getStats().getTotalDataBytesSent();
      // skip if divisor is small (most likely handshake) or 0 (DivisionByZero)
      if (lDivisor > 1024) {
        value = lDivident / (float)lDivisor;
        if (value == 0)
          value = -1;
View Full Code Here

    super(COLUMN_ID, ALIGN_TRAIL, POSITION_LAST, 65, table_id);
    setRefreshInterval(INTERVAL_LIVE);
  }

  public void refresh(TableCell cell) {
    PEPeer peer = (PEPeer)cell.getDataSource();
    long data_value  = 0;
    long prot_value  = 0;
   
    if ( peer != null ){
      data_value = peer.getStats().getDataReceiveRate();
         prot_value = peer.getStats().getProtocolReceiveRate();
    }
    long  sort_value = ( data_value<<32 ) + prot_value;
   
    if (!cell.setSortValue(sort_value) && cell.isValid())
      return;
View Full Code Here

      CAT_PEER_IDENTIFICATION,
    });
  }

  public void refresh(TableCell cell) {
    final PEPeer peer = (PEPeer)cell.getDataSource();
  
    String  text = "";
   
    if ( peer != null ){
     
      text = (String)peer.getUserData( ASItem.class );
     
      if ( text == null ){
 
        text = "";
       
        peer.setUserData( ASItem.class, text );
     
        try{
          NetworkAdmin.getSingleton().lookupASN(
            InetAddress.getByName( peer.getIp()),
            new NetworkAdminASNListener()
            {
              public void
              success(
                NetworkAdminASN    asn )
              {
                peer.setUserData( ASItem.class, asn.getAS() + " - " + asn.getASName());
              }
             
              public void
              failed(
                NetworkAdminException  error )
View Full Code Here

    super(COLUMN_ID, ALIGN_TRAIL, POSITION_INVISIBLE, 60, table_id);
    setRefreshInterval(INTERVAL_LIVE);
  }

  public void refresh(TableCell cell) {
    PEPeer peer = (PEPeer)cell.getDataSource();
    long value = (peer == null) ? 0 : peer.getIncomingRequestCount();

    if (!cell.setSortValue(value) && cell.isValid())
      return;

    cell.setText("" + value);
View Full Code Here

    super(COLUMN_ID, POSITION_INVISIBLE, 80, table_id);
    setRefreshInterval(INTERVAL_LIVE);
  }

  public void refresh(TableCell cell) {
      PEPeer peer = (PEPeer)cell.getDataSource();
      byte[] handshake_reserved = null;
      if (peer != null) {handshake_reserved = peer.getHandshakeReservedBytes();}
     
      if (handshake_reserved == null) {
        cell.setText(""); return;
      }
      cell.setText(ByteFormatter.nicePrint(handshake_reserved, false));
View Full Code Here

    super("outgoingreqcount", ALIGN_TRAIL, POSITION_INVISIBLE, 60, table_id);
    setRefreshInterval(INTERVAL_LIVE);
  }

  public void refresh(TableCell cell) {
    PEPeer peer = (PEPeer)cell.getDataSource();
    long value = (peer == null) ? 0 : peer.getOutgoingRequestCount();

    if (!cell.setSortValue(value) && cell.isValid())
      return;

    cell.setText("" + value);
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.core3.peer.PEPeer

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.