Search in sources :

Example 6 with RPRequest

use of com.biglybt.pifimpl.remote.RPRequest in project BiglyBT by BiglySoftware.

the class RPTorrentManager method getURLDownloader.

// ************************************************************************
@Override
public TorrentDownloader getURLDownloader(URL url) throws TorrentException {
    try {
        RPTorrentDownloader resp = (RPTorrentDownloader) _dispatcher.dispatch(new RPRequest(this, "getURLDownloader[URL]", new Object[] { url })).getResponse();
        resp._setRemote(_dispatcher);
        return (resp);
    } catch (RPException e) {
        if (e.getCause() instanceof TorrentException) {
            throw ((TorrentException) e.getCause());
        }
        throw (e);
    }
}
Also used : RPRequest(com.biglybt.pifimpl.remote.RPRequest) RPException(com.biglybt.pifimpl.remote.RPException) RPObject(com.biglybt.pifimpl.remote.RPObject)

Example 7 with RPRequest

use of com.biglybt.pifimpl.remote.RPRequest in project BiglyBT by BiglySoftware.

the class RPTracker method host.

// ************************************************************************
@Override
public TrackerTorrent host(Torrent torrent, boolean persistent) throws TrackerException {
    try {
        RPTrackerTorrent resp = (RPTrackerTorrent) _dispatcher.dispatch(new RPRequest(this, "host[Torrent,boolean]", new Object[] { torrent, Boolean.valueOf(persistent) })).getResponse();
        resp._setRemote(_dispatcher);
        return (resp);
    } catch (RPException e) {
        if (e.getCause() instanceof TrackerException) {
            throw ((TrackerException) e.getCause());
        }
        throw (e);
    }
}
Also used : RPRequest(com.biglybt.pifimpl.remote.RPRequest) TrackerException(com.biglybt.pif.tracker.TrackerException) RPException(com.biglybt.pifimpl.remote.RPException) RPObject(com.biglybt.pifimpl.remote.RPObject)

Example 8 with RPRequest

use of com.biglybt.pifimpl.remote.RPRequest in project BiglyBT by BiglySoftware.

the class RPDownloadManager method addDownload.

@Override
public Download addDownload(Torrent torrent, File torrent_location, File data_location) throws DownloadException {
    try {
        RPDownload res = (RPDownload) _dispatcher.dispatch(new RPRequest(this, "addDownload[Torrent,String,String]", new Object[] { torrent, torrent_location == null ? null : torrent_location.toString(), data_location == null ? null : data_location.toString() })).getResponse();
        res._setRemote(_dispatcher);
        return (res);
    } catch (RPException e) {
        if (e.getCause() instanceof DownloadException) {
            throw ((DownloadException) e.getCause());
        }
        throw (e);
    }
}
Also used : RPRequest(com.biglybt.pifimpl.remote.RPRequest) RPException(com.biglybt.pifimpl.remote.RPException) RPObject(com.biglybt.pifimpl.remote.RPObject)

Example 9 with RPRequest

use of com.biglybt.pifimpl.remote.RPRequest in project BiglyBT by BiglySoftware.

the class RPDownloadManager method addDownload.

@Override
public Download addDownload(Torrent torrent) throws DownloadException {
    try {
        RPDownload res = (RPDownload) _dispatcher.dispatch(new RPRequest(this, "addDownload[Torrent]", new Object[] { torrent })).getResponse();
        res._setRemote(_dispatcher);
        return (res);
    } catch (RPException e) {
        if (e.getCause() instanceof DownloadException) {
            throw ((DownloadException) e.getCause());
        }
        throw (e);
    }
}
Also used : RPRequest(com.biglybt.pifimpl.remote.RPRequest) RPException(com.biglybt.pifimpl.remote.RPException) RPObject(com.biglybt.pifimpl.remote.RPObject)

Aggregations

RPRequest (com.biglybt.pifimpl.remote.RPRequest)9 RPException (com.biglybt.pifimpl.remote.RPException)8 RPObject (com.biglybt.pifimpl.remote.RPObject)8 TorrentException (com.biglybt.pif.torrent.TorrentException)2 TrackerException (com.biglybt.pif.tracker.TrackerException)1