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

bt.torrent.stub.StubSession Maven / Gradle / Ivy

There is a newer version: 1.10
Show newest version
package bt.torrent.stub;

import bt.metainfo.Torrent;
import bt.metainfo.TorrentId;
import bt.net.Peer;
import bt.torrent.TorrentSession;
import bt.torrent.TorrentSessionState;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class StubSession implements TorrentSession {
    private static final Logger LOGGER = LoggerFactory.getLogger(StubSession.class);

    private static final StubSession instance = new StubSession();

    public static StubSession instance() {
        return instance;
    }

    @Override
    public Torrent getTorrent() {
        return StubTorrent.instance();
    }

    @Override
    public TorrentId getTorrentId() {
        return StubTorrent.instance().getTorrentId();
    }

    @Override
    public TorrentSessionState getState() {
        return StubSessionState.instance();
    }

    @Override
    public void onPeerDiscovered(Peer peer) {
        LOGGER.warn("onPeerDiscovered called on stub session");
    }

    @Override
    public void onPeerConnected(TorrentId torrentId, Peer peer) {
        LOGGER.warn("onPeerConnected called on stub session");
    }

    @Override
    public void onPeerDisconnected(TorrentId torrentId, Peer peer) {
        LOGGER.warn("onPeerDisconnected called on stub session");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy