FileDocCategorySizeDatePackage
PeerClassifier.javaAPI DocAzureus 3.0.3.42144Sun Jul 08 13:26:36 BST 2007com.aelitis.azureus.core.peermanager.utils

PeerClassifier

public class PeerClassifier extends Object
Handles peer client identification and banning.

Fields Summary
public static final String
CACHE_LOGIC
Constructors Summary
Methods Summary
public static java.lang.StringgetClientDescription(byte[] peer_id)
Get a client description (name and version) from the given peerID byte array.

param
peer_id peerID sent in handshake
return
description


                           
         
    return BTPeerIDByteDecoder.decode( peer_id );
  
public static java.lang.StringgetPrintablePeerID(byte[] peer_id)
Get a printable representation of the given raw peerID byte array, i.e. filter out the first 32 non-printing ascii chars.

param
peer_id peerID sent in handshake
return
printable peerID

    return BTPeerIDByteDecoder.getPrintablePeerID(peer_id);
  
public static booleanisClientTypeAllowed(java.lang.String client_description)
Check if the client type is allowed to connect.

param
client_description given by getClientDescription
return
true if allowed, false if banned

    //if( client_description.startsWith( "BitComet" ) ) return false;
    return true;