⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 trtrackerbtscraperimpl.java

📁 java 文件下载器。可自定义
💻 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:   TRTrackerBTScraperImpl.java

package org.gudy.azureus2.core3.tracker.client.impl.bt;

import java.net.URL;
import org.gudy.azureus2.core3.torrent.TOTorrent;
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.plugins.download.DownloadScrapeResult;

// Referenced classes of package org.gudy.azureus2.core3.tracker.client.impl.bt:
//			TrackerChecker

public class TRTrackerBTScraperImpl
{

	protected static TRTrackerBTScraperImpl singleton;
	protected static AEMonitor class_mon = new AEMonitor("TRTrackerBTScraper");
	private TRTrackerScraperImpl scraper;
	private TrackerChecker tracker_checker;

	public static TRTrackerBTScraperImpl create(TRTrackerScraperImpl _scraper)
	{
		TRTrackerBTScraperImpl trtrackerbtscraperimpl;
		class_mon.enter();
		if (singleton == null)
			singleton = new TRTrackerBTScraperImpl(_scraper);
		trtrackerbtscraperimpl = singleton;
		class_mon.exit();
		return trtrackerbtscraperimpl;
		Exception exception;
		exception;
		class_mon.exit();
		throw exception;
	}

	protected TRTrackerBTScraperImpl(TRTrackerScraperImpl _scraper)
	{
		scraper = _scraper;
		tracker_checker = new TrackerChecker(this);
	}

	protected TRTrackerScraperImpl getScraper()
	{
		return scraper;
	}

	public void setScrape(TOTorrent torrent, URL url, DownloadScrapeResult result)
	{
		if (torrent != null && result != null)
		{
			TRTrackerScraperResponseImpl resp = tracker_checker.getHashData(torrent, url);
			if (resp != null && resp.getStatus() == 1)
			{
				resp.setSeedsPeers(result.getSeedCount(), result.getNonSeedCount());
				resp.setScrapeStartTime(result.getScrapeStartTime());
				resp.setStatus(result.getResponseType() != 1 ? 1 : 2, (new StringBuilder()).append(result.getStatus()).append(" (").append(result.getURL()).append(")").toString());
				scraper.scrapeReceived(resp);
			}
		}
	}

	public TRTrackerScraperResponse scrape(TOTorrent torrent, URL target_url, boolean force)
	{
		if (torrent == null)
			return null;
		if (force)
			tracker_checker.syncUpdate(torrent, target_url);
		TRTrackerScraperResponse res = tracker_checker.getHashData(torrent, target_url);
		return res;
	}

	public TRTrackerScraperResponse scrape(TRTrackerAnnouncer tracker_client)
	{
		TRTrackerScraperResponse res = tracker_checker.getHashData(tracker_client);
		return res;
	}

	public void remove(TOTorrent torrent)
	{
		tracker_checker.removeHash(torrent);
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -