Search in sources :

Example 1 with DistributedDatabaseException

use of com.biglybt.pif.ddb.DistributedDatabaseException in project BiglyBT by BiglySoftware.

the class DDBaseHelpers method getKey.

protected static HashWrapper getKey(DistributedDatabaseTransferType transfer_type) throws DistributedDatabaseException {
    Class<?> c = transfer_type.getClass();
    String new_name = c.getName();
    String old_name = xfer_migration.get(new_name);
    if (old_name == null) {
        Debug.out("Missing xfer name map entry for '" + new_name + "'");
        old_name = new_name;
    }
    if (old_name == null) {
        throw (new DistributedDatabaseException("name doesn't exist for '" + c.getName() + "'"));
    }
    return (new HashWrapper(new SHA1Simple().calculateHash(old_name.getBytes())));
}
Also used : HashWrapper(com.biglybt.core.util.HashWrapper) DistributedDatabaseException(com.biglybt.pif.ddb.DistributedDatabaseException) SHA1Simple(com.biglybt.core.util.SHA1Simple)

Aggregations

HashWrapper (com.biglybt.core.util.HashWrapper)1 SHA1Simple (com.biglybt.core.util.SHA1Simple)1 DistributedDatabaseException (com.biglybt.pif.ddb.DistributedDatabaseException)1