Package org.gudy.azureus2.core3.util

Examples of org.gudy.azureus2.core3.util.HashWrapper


    URL        unused_target_url )
  {
    if ( torrent != null ){

      try{
        HashWrapper hw = torrent.getHashWrapper();
       
        return( responses.get( hw ));
       
      }catch( TOTorrentException e ){
       
View Full Code Here


 
    throws DistributedDatabaseException
  {
    throwIfNotAvailable();
   
    final HashWrapper  type_key = DDBaseHelpers.getKey( type.getClass());
   
    if ( transfer_map.get( type_key ) != null ){
     
      throw( new DistributedDatabaseException( "Handler for class '" + type.getClass().getName() + "' already defined" ));
    }
   
    transfer_map.put( type_key, handler );
   
    final String  handler_name;
   
    if ( type == torrent_transfer ){
     
      handler_name = "Torrent Transfer";
     
    }else{
     
      String class_name = type.getClass().getName();
     
      int  pos = class_name.indexOf( '$' );
     
      if ( pos != -1 ){
       
        class_name = class_name.substring( pos+1 );
       
      }else{
     
        pos = class_name.lastIndexOf( '.' );
       
        if ( pos != -1 ){
         
          class_name = class_name.substring( pos+1 );
        }
      }
     
      handler_name = "Plugin Defined (" + class_name + ")";
    }
   
    getDHT().registerHandler(
      type_key.getHash(),
      new DHTPluginTransferHandler()
      {
        public String
        getName()
        {
View Full Code Here

    if ( name == null ){
     
      throw( new DistributedDatabaseException( "name doesn't exist for '" + c.getName() + "'" ));
    }
     
    return( new HashWrapper(new SHA1Simple().calculateHash(name.getBytes())));
  }
View Full Code Here

             
      downloadData download_data = new downloadData( download );
       
      download.setUserData( BuddyPluginTracker.class, download_data );
     
      HashWrapper  full_id    = download_data.getID();
     
      HashWrapper short_id   = new HashWrapper( full_id.getHash(), 0, 4 );
     
      full_id_map.put( full_id, download );
     
      List  dls = (List)short_id_map.get( short_id );
     
View Full Code Here

       
        downloadData download_data = (downloadData)download.getUserData( BuddyPluginTracker.class );
               
        download.setUserData( BuddyPluginTracker.class, null );
       
        HashWrapper  full_id    = download_data.getID();
       
        full_id_map.remove( full_id );
       
        HashWrapper short_id   = new HashWrapper( full_id.getHash(), 0, SHORT_ID_SIZE );
       
        List  dls = (List)short_id_map.get( short_id );

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

       
        synchronized( tracked_downloads ){

          for (int i=0;i<ids.length;i+= SHORT_ID_SIZE ){
         
            List dls = (List)short_id_map.get( new HashWrapper( ids, i, SHORT_ID_SIZE ));
           
            if ( dls != null ){
             
              res.addAll( dls );
            }
View Full Code Here

       
        synchronized( tracked_downloads ){

          for (int i=0;i<ids.length;i+= FULL_ID_SIZE ){
         
            Download dl = (Download)full_id_map.get( new HashWrapper( ids, i, FULL_ID_SIZE ));
           
            if ( dl != null ){
             
              buddyDownloadData bdd = new buddyDownloadData( dl );
             
View Full Code Here

        SHA1  sha1 = new SHA1();
     
        sha1.update( ByteBuffer.wrap( IV ));
        sha1.update( ByteBuffer.wrap( hash ));
       
        id = new HashWrapper( sha1.digest() );
      }
    }
View Full Code Here

      handleWrite(
        DHTTransportContact  originator,
        byte[]        key,
        byte[]        value )
      {
        HashWrapper  key_wrapper = new HashWrapper( key );
       
          // see if this is the response to an outstanding call
       
        try{
          this_mon.enter();
View Full Code Here

    }
   
    Long ulOnly = (Long)root.get("upload_only");
    boolean uploadOnly = ulOnly != null && ulOnly.longValue() > 0L ? true : false;

    return new AZHandshake( id, session == null ? null : new HashWrapper(session),reconnect == null ? null : new HashWrapper(reconnect), name, client_version, tcp_lport.intValue(), udp_lport.intValue(), udp2_lport.intValue(), ipv6 ,ids, vers, h_type.intValue(), version , uploadOnly);
  }
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.core3.util.HashWrapper

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.