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

📄 trhosttorrentpublishimpl.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:   TRHostTorrentPublishImpl.java

package org.gudy.azureus2.core3.tracker.host.impl;

import java.util.*;
import org.gudy.azureus2.core3.torrent.TOTorrent;
import org.gudy.azureus2.core3.tracker.client.*;
import org.gudy.azureus2.core3.tracker.host.*;
import org.gudy.azureus2.core3.tracker.server.TRTrackerServerTorrent;
import org.gudy.azureus2.core3.util.AEMonitor;
import org.gudy.azureus2.core3.util.Debug;

// Referenced classes of package org.gudy.azureus2.core3.tracker.host.impl:
//			TRHostImpl, TRHostPeerPublishImpl

public class TRHostTorrentPublishImpl
	implements TRHostTorrent
{

	private TRHostImpl host;
	private TOTorrent torrent;
	private long date_added;
	private int status;
	private boolean persistent;
	private int seed_count;
	private int peer_count;
	private TRHostPeer peers[];
	private List listeners_cow;
	private List removal_listeners;
	private HashMap data;
	protected AEMonitor this_mon;

	protected TRHostTorrentPublishImpl(TRHostImpl _host, TOTorrent _torrent, long _date_added)
	{
		status = 3;
		peers = new TRHostPeer[0];
		listeners_cow = new ArrayList();
		removal_listeners = new ArrayList();
		this_mon = new AEMonitor("TRHostTorrentPublish");
		host = _host;
		torrent = _torrent;
		date_added = _date_added;
	}

	public void start()
	{
	}

	public void stop()
	{
	}

	public void remove()
		throws TRHostTorrentRemovalVetoException
	{
		this_mon.enter();
		canBeRemoved();
		host.remove(this);
		this_mon.exit();
		break MISSING_BLOCK_LABEL_40;
		Exception exception;
		exception;
		this_mon.exit();
		throw exception;
	}

	public boolean canBeRemoved()
		throws TRHostTorrentRemovalVetoException
	{
		for (int i = 0; i < removal_listeners.size(); i++)
			((TRHostTorrentWillBeRemovedListener)removal_listeners.get(i)).torrentWillBeRemoved(this);

		return true;
	}

	public int getStatus()
	{
		return status;
	}

	public boolean isPersistent()
	{
		return persistent;
	}

	public void setPersistent(boolean _persistent)
	{
		persistent = _persistent;
	}

	public boolean isPassive()
	{
		return false;
	}

	public void setPassive(boolean flag)
	{
	}

	public long getDateAdded()
	{
		return date_added;
	}

	public TOTorrent getTorrent()
	{
		return torrent;
	}

	public TRTrackerServerTorrent getTrackerTorrent()
	{
		return null;
	}

	public int getPort()
	{
		return -1;
	}

	public TRHostPeer[] getPeers()
	{
		TRHostPeer atrhostpeer[];
		this_mon.enter();
		atrhostpeer = peers;
		this_mon.exit();
		return atrhostpeer;
		Exception exception;
		exception;
		this_mon.exit();
		throw exception;
	}

	public long getAnnounceCount()
	{
		return 0L;
	}

	public long getAverageAnnounceCount()
	{
		return 0L;
	}

	public long getScrapeCount()
	{
		return 0L;
	}

	public long getAverageScrapeCount()
	{
		return 0L;
	}

	public long getCompletedCount()
	{
		return 0L;
	}

	protected void updateStats()
	{
		TRTrackerScraperResponse resp;
		resp = null;
		org.gudy.azureus2.core3.tracker.client.TRTrackerAnnouncer tc = host.getTrackerClient(this);
		if (tc != null)
			resp = TRTrackerScraperFactory.getSingleton().scrape(tc);
		if (resp == null)
			resp = TRTrackerScraperFactory.getSingleton().scrape(torrent);
		this_mon.enter();
		if (resp != null && resp.isValid())
		{
			peer_count = resp.getPeers();
			seed_count = resp.getSeeds();
			peers = new TRHostPeer[peer_count + seed_count];
			for (int i = 0; i < peers.length; i++)
				peers[i] = new TRHostPeerPublishImpl(i < seed_count);

		} else
		{
			peers = new TRHostPeer[0];
		}
		this_mon.exit();
		break MISSING_BLOCK_LABEL_174;
		Exception exception;
		exception;
		this_mon.exit();
		throw exception;
	}

	public int getSeedCount()
	{
		return seed_count;
	}

	public int getLeecherCount()
	{
		return peer_count;
	}

	public int getBadNATCount()
	{
		return 0;
	}

	public long getTotalUploaded()
	{
		return 0L;
	}

	public long getTotalDownloaded()
	{
		return 0L;
	}

	public long getTotalLeft()
	{
		return 0L;
	}

	public long getAverageUploaded()
	{
		return 0L;
	}

	public long getAverageDownloaded()
	{
		return 0L;
	}

	public long getTotalBytesIn()
	{
		return 0L;
	}

	public long getTotalBytesOut()
	{
		return 0L;
	}

	public long getAverageBytesIn()
	{
		return 0L;
	}

	public long getAverageBytesOut()
	{
		return 0L;
	}

	public void disableReplyCaching()
	{
	}

	protected void preProcess(TRHostTorrentRequest req)
		throws TRHostException
	{
		List listeners_ref = listeners_cow;
		for (int i = 0; i < listeners_ref.size(); i++)
			try
			{
				((TRHostTorrentListener)listeners_ref.get(i)).preProcess(req);
			}
			catch (Throwable e)
			{
				Debug.printStackTrace(e);
			}

	}

	protected void postProcess(TRHostTorrentRequest req)
		throws TRHostException
	{
		List listeners_ref = listeners_cow;
		for (int i = 0; i < listeners_ref.size(); i++)
			try
			{
				((TRHostTorrentListener)listeners_ref.get(i)).postProcess(req);
			}
			catch (Throwable e)
			{
				Debug.printStackTrace(e);
			}

	}

	public void addListener(TRHostTorrentListener l)
	{
		this_mon.enter();
		List new_listeners = new ArrayList(listeners_cow);
		new_listeners.add(l);
		listeners_cow = new_listeners;
		this_mon.exit();
		break MISSING_BLOCK_LABEL_52;
		Exception exception;
		exception;
		this_mon.exit();
		throw exception;
		host.torrentListenerRegistered();
		return;
	}

	public void removeListener(TRHostTorrentListener l)
	{
		this_mon.enter();
		List new_listeners = new ArrayList(listeners_cow);
		new_listeners.remove(l);
		listeners_cow = new_listeners;
		this_mon.exit();
		break MISSING_BLOCK_LABEL_52;
		Exception exception;
		exception;
		this_mon.exit();
		throw exception;
	}

	public void addRemovalListener(TRHostTorrentWillBeRemovedListener l)
	{
		this_mon.enter();
		removal_listeners.add(l);
		this_mon.exit();
		break MISSING_BLOCK_LABEL_38;
		Exception exception;
		exception;
		this_mon.exit();
		throw exception;
	}

	public void removeRemovalListener(TRHostTorrentWillBeRemovedListener l)
	{
		this_mon.enter();
		removal_listeners.remove(l);
		this_mon.exit();
		break MISSING_BLOCK_LABEL_38;
		Exception exception;
		exception;
		this_mon.exit();
		throw exception;
	}

	public Object getData(String key)
	{
		if (data == null)
			return null;
		else
			return data.get(key);
	}

	public void setData(String key, Object value)
	{
		this_mon.enter();
		if (data == null)
			data = new HashMap();
		if (value == null)
		{
			if (data.containsKey(key))
				data.remove(key);
		} else
		{
			data.put(key, value);
		}
		this_mon.exit();
		break MISSING_BLOCK_LABEL_82;
		Exception exception;
		exception;
		this_mon.exit();
		throw exception;
	}
}

⌨️ 快捷键说明

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