📄 trtrackerdhtscraperimpl.java
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space
// Source File Name: TRTrackerDHTScraperImpl.java
package org.gudy.azureus2.core3.tracker.client.impl.dht;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import org.gudy.azureus2.core3.torrent.TOTorrent;
import org.gudy.azureus2.core3.torrent.TOTorrentException;
import org.gudy.azureus2.core3.tracker.client.TRTrackerAnnouncer;
import org.gudy.azureus2.core3.tracker.client.TRTrackerScraperResponse;
import org.gudy.azureus2.core3.tracker.client.impl.TRTrackerScraperImpl;
import org.gudy.azureus2.core3.tracker.client.impl.TRTrackerScraperResponseImpl;
import org.gudy.azureus2.core3.util.AEMonitor;
import org.gudy.azureus2.core3.util.Debug;
import org.gudy.azureus2.plugins.download.DownloadScrapeResult;
// Referenced classes of package org.gudy.azureus2.core3.tracker.client.impl.dht:
// TRTrackerDHTScraperResponseImpl
public class TRTrackerDHTScraperImpl
{
protected static TRTrackerDHTScraperImpl singleton;
protected static AEMonitor class_mon = new AEMonitor("TRTrackerDHTScraper");
private TRTrackerScraperImpl scraper;
private Map responses;
public static TRTrackerDHTScraperImpl create(TRTrackerScraperImpl _scraper)
{
TRTrackerDHTScraperImpl trtrackerdhtscraperimpl;
class_mon.enter();
if (singleton == null)
singleton = new TRTrackerDHTScraperImpl(_scraper);
trtrackerdhtscraperimpl = singleton;
class_mon.exit();
return trtrackerdhtscraperimpl;
Exception exception;
exception;
class_mon.exit();
throw exception;
}
protected TRTrackerDHTScraperImpl(TRTrackerScraperImpl _scraper)
{
responses = new HashMap();
scraper = _scraper;
}
public void setScrape(TOTorrent torrent, URL url, DownloadScrapeResult result)
{
if (torrent != null && result != null)
try
{
TRTrackerScraperResponseImpl resp = new TRTrackerDHTScraperResponseImpl(torrent.getHashWrapper(), result.getURL());
resp.setSeedsPeers(result.getSeedCount(), result.getNonSeedCount());
resp.setScrapeStartTime(result.getScrapeStartTime());
resp.setNextScrapeStartTime(result.getNextScrapeStartTime());
resp.setStatus(result.getResponseType() != 1 ? 1 : 2, result.getStatus());
responses.put(torrent.getHashWrapper(), resp);
scraper.scrapeReceived(resp);
}
catch (TOTorrentException e)
{
Debug.printStackTrace(e);
}
}
public TRTrackerScraperResponse scrape(TOTorrent torrent, URL target_url, boolean force)
{
if (torrent == null)
break MISSING_BLOCK_LABEL_30;
return (TRTrackerScraperResponse)responses.get(torrent.getHashWrapper());
TOTorrentException e;
e;
Debug.printStackTrace(e);
return null;
}
public TRTrackerScraperResponse scrape(TRTrackerAnnouncer tracker_client)
{
TOTorrent torrent;
torrent = tracker_client.getTorrent();
if (torrent == null)
break MISSING_BLOCK_LABEL_35;
return (TRTrackerScraperResponse)responses.get(torrent.getHashWrapper());
TOTorrentException e;
e;
Debug.printStackTrace(e);
return null;
}
public void remove(TOTorrent torrent)
{
try
{
responses.remove(torrent.getHashWrapper());
}
catch (TOTorrentException e)
{
Debug.printStackTrace(e);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -