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

📄 rprequesthandler.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:   RPRequestHandler.java

package org.gudy.azureus2.pluginsimpl.remote;

import java.util.HashMap;
import java.util.Map;
import org.gudy.azureus2.plugins.PluginConfig;
import org.gudy.azureus2.plugins.PluginInterface;
import org.gudy.azureus2.plugins.ipfilter.IPFilter;
import org.gudy.azureus2.plugins.ipfilter.IPRange;
import org.gudy.azureus2.plugins.logging.Logger;
import org.gudy.azureus2.plugins.logging.LoggerChannel;
import org.gudy.azureus2.pluginsimpl.remote.rpexceptions.RPInternalProcessException;
import org.gudy.azureus2.pluginsimpl.remote.rpexceptions.RPNoObjectIDException;

// Referenced classes of package org.gudy.azureus2.pluginsimpl.remote:
//			RPException, RPObject, RPPluginInterface, RPReply, 
//			RPRequest, RPRequestAccessController

public class RPRequestHandler
{
	protected static class replyCache
	{

		protected long id;
		protected RPReply reply;

		protected long getId()
		{
			return id;
		}

		protected RPReply getReply()
		{
			return reply;
		}

		protected replyCache(long _id, RPReply _reply)
		{
			id = _id;
			reply = _reply;
		}
	}


	protected PluginInterface plugin_interface;
	protected Map reply_cache;

	public RPRequestHandler(PluginInterface _pi)
	{
		reply_cache = new HashMap();
		plugin_interface = _pi;
	}

	public RPReply processRequest(RPRequest request)
	{
		return processRequest(request, null);
	}

	public RPReply processRequest(RPRequest request, RPRequestAccessController access_controller)
	{
		Long connection_id = new Long(request.getConnectionId());
		replyCache cached_reply = connection_id.longValue() != 0L ? (replyCache)reply_cache.get(connection_id) : null;
		if (cached_reply != null && cached_reply.getId() == request.getRequestId())
			return cached_reply.getReply();
		RPReply reply = processRequestSupport(request, access_controller);
		if (reply == null)
			reply = new RPReply(null);
		reply_cache.put(connection_id, new replyCache(request.getRequestId(), reply));
		return reply;
	}

	protected RPReply processRequestSupport(RPRequest request, RPRequestAccessController access_controller)
	{
		RPObject object;
		String method;
		RPReply reply;
		object = request.getObject();
		method = request.getMethod();
		if (object != null || !method.equals("getSingleton"))
			break MISSING_BLOCK_LABEL_49;
		RPObject pi = request.createRemotePluginInterface(plugin_interface);
		reply = new RPReply(pi);
		return reply;
		RPReply rep;
		if (object != null || !method.equals("getDownloads"))
			break MISSING_BLOCK_LABEL_142;
		RPPluginInterface pi = request.createRemotePluginInterface(plugin_interface);
		RPObject dm = (RPObject)pi._process(new RPRequest(null, "getDownloadManager", null)).getResponse();
		rep = dm._process(new RPRequest(null, "getDownloads", null));
		rep.setProperty("azureus_name", pi.azureus_name);
		rep.setProperty("azureus_version", pi.azureus_version);
		return rep;
		RPReply reply;
		if (object == null)
			throw new RPNoObjectIDException();
		object = RPObject._lookupLocal(object._getOID());
		object._setLocal();
		if (!method.equals("_refresh"))
			break MISSING_BLOCK_LABEL_190;
		reply = new RPReply(object);
		return reply;
		String name = object._getName();
		if (access_controller != null)
			access_controller.checkAccess(name, request);
		dm = object._process(request);
		if (name.equals("IPFilter") && method.equals("setInRangeAddressesAreAllowed[boolean]") && request.getClientIP() != null)
		{
			String client_ip = request.getClientIP();
			boolean b = ((Boolean)request.getParams()[0]).booleanValue();
			LoggerChannel channels[] = plugin_interface.getLogger().getChannels();
			IPFilter filter = plugin_interface.getIPFilter();
			if (b)
			{
				if (filter.isInRange(client_ip))
				{
					for (int i = 0; i < channels.length; i++)
						channels[i].log(1, (new StringBuilder()).append("Adding range for client '").append(client_ip).append("' as allow/deny flag changed to allow").toString());

					filter.createAndAddRange("auto-added for remote interface", client_ip, client_ip, false);
					filter.save();
					plugin_interface.getPluginconfig().save();
				}
			} else
			{
				IPRange ranges[] = filter.getRanges();
				for (int i = 0; i < ranges.length; i++)
				{
					if (!ranges[i].isInRange(client_ip))
						continue;
					for (int j = 0; j < channels.length; j++)
						channels[j].log(1, (new StringBuilder()).append("deleting range '").append(ranges[i].getStartIP()).append("-").append(ranges[i].getEndIP()).append("' for client '").append(client_ip).append("' as allow/deny flag changed to deny").toString());

					ranges[i].delete();
				}

				filter.save();
				plugin_interface.getPluginconfig().save();
			}
		}
		return dm;
		RPException e;
		e;
		return new RPReply(e);
		e;
		throw new RPInternalProcessException(e);
	}
}

⌨️ 快捷键说明

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