Examples of DistributedDatabaseValue


Examples of org.gudy.azureus2.plugins.ddb.DistributedDatabaseValue

    try{
      log( "Sending DDB request to " + contact.getName() + " - " + request );
     
      DistributedDatabaseKey key = ddb.createKey( BEncoder.encode( request ));
     
      DistributedDatabaseValue value =
        contact.read(
          new DistributedDatabaseProgressListener()
          {
            public void
            reportSize(
              long  size )
            { 
            }
           
            public void
            reportActivity(
              String  str )
            { 
            }
           
            public void
            reportCompleteness(
              int    percent )
            {
            }
          },
          transfer_type,
          key,
          10000 );
     
      if ( value == null ){
       
        return( null );
      }
     
      Map reply = BDecoder.decode((byte[])value.getValue( byte[].class ));
     
      log( "    received reply - " + reply );
     
      return( reply );
     
View Full Code Here

Examples of org.gudy.azureus2.plugins.ddb.DistributedDatabaseValue

        }
       
        try{
          listener.reportActivity( getMessageText( "report.downloading", contact.getName()));
         
          DistributedDatabaseValue  value =
            contact.read(
                new DistributedDatabaseProgressListener()
                {
                  public void
                  reportSize(
                    long  size )
                  {
                    listener.reportSize( size );
                  }
                  public void
                  reportActivity(
                    String  str )
                  {
                    listener.reportActivity( str );
                  }
                 
                  public void
                  reportCompleteness(
                    int    percent )
                  {
                    listener.reportCompleteness( percent );
                  }
                },
                db.getStandardTransferType( DistributedDatabaseTransferType.ST_TORRENT ),
                db.createKey ( hash , "Torrent download content for '" + ByteFormatter.encodeString( hash ) + "'"),
                timeout );
                   
          if ( value != null ){
           
              // let's verify the torrent
           
            byte[]  data = (byte[])value.getValue(byte[].class);

            try{
              TOTorrent torrent = TOTorrentFactory.deserialiseFromBEncodedByteArray( data );
             
              if ( Arrays.equals( hash, torrent.getHash())){
View Full Code Here

Examples of org.gudy.azureus2.plugins.ddb.DistributedDatabaseValue

     
      request.put( "t", term );
   
      DistributedDatabaseKey key = ddb.createKey( BEncoder.encode( request ));
     
      DistributedDatabaseValue value =
        contact.read(
          new DistributedDatabaseProgressListener()
          {
            public void
            reportSize(
              long  size )
            { 
            }
           
            public void
            reportActivity(
              String  str )
            { 
            }
           
            public void
            reportCompleteness(
              int    percent )
            {
            }
          },
          transfer_type,
          key,
          10000 );
     
      // System.out.println( "search result=" + value );
     
      if ( value == null ){
       
        return;
      }
     
      Map<String,Object> reply = (Map<String,Object>)BDecoder.decode((byte[])value.getValue( byte[].class ));
     
      List<Map<String,Object>>  list = (List<Map<String,Object>>)reply.get( "l" );
     
      for ( final Map<String,Object> map: list ){
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.