All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.frostwire.jlibtorrent.alerts.DhtImmutableItemAlert Maven / Gradle / Ivy

There is a newer version: 1.2.0.18
Show newest version
package com.frostwire.jlibtorrent.alerts;

import com.frostwire.jlibtorrent.Entry;
import com.frostwire.jlibtorrent.Session;
import com.frostwire.jlibtorrent.Sha1Hash;
import com.frostwire.jlibtorrent.swig.dht_immutable_item_alert;

/**
 * This alert is posted as a response to a call to {@link Session#dhtGetItem(Sha1Hash)},
 * looking up immutable items in the DHT.
 *
 * @author gubatron
 * @author aldenml
 */
public final class DhtImmutableItemAlert extends AbstractAlert {

    public DhtImmutableItemAlert(dht_immutable_item_alert alert) {
        super(alert);
    }

    /**
     * The target hash of the immutable item. This must
     * match the sha-1 hash of the bencoded form of the item.
     *
     * @return
     */
    public Sha1Hash getTarget() {
        return new Sha1Hash(alert.getTarget());
    }

    /**
     * the data for this item
     *
     * @return
     */
    public Entry getItem() {
        return new Entry(alert.getItem());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy