package com.wizzardo.jrt;

import com.wizzardo.http.framework.di.Service;

import java.util.Collection;
import java.util.List;

/**
 * Created by wizzardo on 07.12.15.
 */
public class RTorrentService implements Service {

    private RTorrentClient client;

    public RTorrentService() {
        client = new RTorrentClient("localhost", 5000);
    }

    public List<TorrentInfo> list() {
        return client.getTorrents();
    }

    public Collection<TorrentEntry> entries(TorrentInfo ti) {
        return client.getEntries(ti);
    }

    public Collection<TorrentEntry> entries(String hash) {
        return client.getEntries(hash);
    }
}

@@ -59,289 +59,621 @@
 ork.
-di.Service;%0A%0Aimport java.util.Collection;%0Aimport java.util.List;%0A%0A/**%0A * Created by wizzardo on 07.12.15.%0A */%0Apublic class RTorrentService implements Service %7B%0A%0A    private RTorrentClient client;%0A%0A    public RTorrentService() %7B%0A        client = new RTorrentClient(%22localhost%22, 5000
+Holders;%0Aimport com.wizzardo.http.framework.di.Service;%0Aimport com.wizzardo.tools.evaluation.Config;%0A%0Aimport java.util.Collection;%0Aimport java.util.HashMap;%0Aimport java.util.List;%0Aimport java.util.Map;%0A%0A/**%0A * Created by wizzardo on 07.12.15.%0A */%0Apublic class RTorrentService implements Service %7B%0A%0A    private RTorrentClient client;%0A%0A    public RTorrentService() %7B%0A        Config rtorrentConfig = Holders.getConfig().config(%22jrt%22).config(%22rtorrent%22);%0A        String host = rtorrentConfig.get(%22host%22, %22localhost%22);%0A        int port = rtorrentConfig.get(%22port%22, 5000);%0A        client = new RTorrentClient(host, port
 );%0A 
@@ -922,24 +922,24 @@
 ing hash) %7B%0A
-
         retu
@@ -971,11 +971,241 @@
 );%0A    %7D
+%0A%0A    public void load(String torrent) %7B%0A        client.load(torrent);%0A    %7D%0A%0A    public void start(String torrent) %7B%0A        client.start(torrent);%0A    %7D%0A%0A    public void stop(String torrent) %7B%0A        client.stop(torrent);%0A    %7D
 %0A%7D%0A

improve service