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

📄 rppluginconfig.java

📁 java 文件下载器。可自定义
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
// 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:   RPPluginConfig.java

package org.gudy.azureus2.pluginsimpl.remote;

import java.io.File;
import java.util.*;
import org.gudy.azureus2.plugins.*;
import org.gudy.azureus2.plugins.config.ConfigParameter;
import org.gudy.azureus2.plugins.config.PluginConfigSource;

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

public class RPPluginConfig extends RPObject
	implements PluginConfig
{

	protected transient PluginConfig delegate;
	protected transient Properties property_cache;
	public String cached_property_names[];
	public Object cached_property_values[];

	public static PluginConfig create(PluginConfig _delegate)
	{
		RPPluginConfig res = (RPPluginConfig)_lookupLocal(_delegate);
		if (res == null)
			res = new RPPluginConfig(_delegate);
		return res;
	}

	protected RPPluginConfig(PluginConfig _delegate)
	{
		super(_delegate);
	}

	protected void _setDelegate(Object _delegate)
	{
		delegate = (PluginConfig)_delegate;
		cached_property_names = (new String[] {
			"Max Upload Speed KBs", "Max Upload Speed When Only Seeding KBs", "Max Download Speed KBs", "Max Connections Per Torrent", "Max Connections Global", "Max Downloads", "Max Active Torrents", "Max Active Torrents When Only Seeding", "Max Uploads", "Max Uploads Seeding"
		});
		cached_property_values = (new Object[] {
			new Integer(delegate.getIntParameter(cached_property_names[0])), new Integer(delegate.getIntParameter(cached_property_names[1])), new Integer(delegate.getIntParameter(cached_property_names[2])), new Integer(delegate.getIntParameter(cached_property_names[3])), new Integer(delegate.getIntParameter(cached_property_names[4])), new Integer(delegate.getIntParameter(cached_property_names[5])), new Integer(delegate.getIntParameter(cached_property_names[6])), new Integer(delegate.getIntParameter(cached_property_names[7])), new Integer(delegate.getIntParameter(cached_property_names[8])), new Integer(delegate.getIntParameter(cached_property_names[9]))
		});
	}

	public Object _setLocal()
		throws RPException
	{
		return _fixupLocal();
	}

	public void _setRemote(RPRequestDispatcher _dispatcher)
	{
		super._setRemote(_dispatcher);
		property_cache = new Properties();
		for (int i = 0; i < cached_property_names.length; i++)
			property_cache.put(cached_property_names[i], cached_property_values[i]);

	}

	public RPReply _process(RPRequest request)
	{
		String method;
		method = request.getMethod();
		Object params[] = (Object[])request.getParams();
		if (method.equals("getPluginIntParameter[String,int]"))
			return new RPReply(new Integer(delegate.getPluginIntParameter((String)params[0], ((Integer)params[1]).intValue())));
		if (method.equals("getPluginStringParameter[String,String]"))
			return new RPReply(delegate.getPluginStringParameter((String)params[0], (String)params[1]));
		if (method.equals("setPluginParameter[String,int]"))
		{
			delegate.setPluginParameter((String)params[0], ((Integer)params[1]).intValue());
			return null;
		}
		if (method.equals("getIntParameter[String,int]") || method.equals("getParameter[String,int]"))
			return new RPReply(new Integer(delegate.getIntParameter((String)params[0], ((Integer)params[1]).intValue())));
		if (method.equals("setParameter[String,int]"))
		{
			delegate.setIntParameter((String)params[0], ((Integer)params[1]).intValue());
			return null;
		}
		if (!method.equals("save"))
			break MISSING_BLOCK_LABEL_258;
		delegate.save();
		return null;
		PluginException e;
		e;
		return new RPReply(e);
		throw new RPException((new StringBuilder()).append("Unknown method: ").append(method).toString());
	}

	public boolean isNewInstall()
	{
		notSupported();
		return false;
	}

	public String getPluginConfigKeyPrefix()
	{
		notSupported();
		return null;
	}

	public float getFloatParameter(String key)
	{
		notSupported();
		return 0.0F;
	}

	public int getIntParameter(String key)
	{
		notSupported();
		return 0;
	}

	public int getIntParameter(String key, int default_value)
	{
		Integer res = (Integer)property_cache.get(key);
		if (res == null)
			res = (Integer)_dispatcher.dispatch(new RPRequest(this, "getIntParameter[String,int]", new Object[] {
				key, new Integer(default_value)
			})).getResponse();
		return res.intValue();
	}

	public void setIntParameter(String key, int value)
	{
		property_cache.put(key, new Integer(value));
		_dispatcher.dispatch(new RPRequest(this, "setParameter[String,int]", new Object[] {
			key, new Integer(value)
		})).getResponse();
	}

	public String getStringParameter(String key)
	{
		notSupported();
		return null;
	}

	public String getStringParameter(String name, String _default)
	{
		notSupported();
		return null;
	}

	public boolean getBooleanParameter(String key)
	{
		notSupported();
		return false;
	}

	public boolean getBooleanParameter(String key, boolean _default)
	{
		notSupported();
		return false;
	}

	public void setBooleanParameter(String key, boolean value)
	{
		notSupported();
	}

	public byte[] getByteParameter(String name, byte _default[])
	{
		notSupported();
		return null;
	}

	public List getPluginListParameter(String key, List default_value)
	{
		notSupported();
		return null;
	}

	public void setPluginListParameter(String key, List value)
	{
		notSupported();
	}

	public Map getPluginMapParameter(String key, Map default_value)
	{
		notSupported();
		return null;
	}

	public void setPluginMapParameter(String key, Map value)
	{
		notSupported();
	}

	public int getPluginIntParameter(String key)
	{
		notSupported();
		return 0;
	}

	public int getPluginIntParameter(String key, int defaultValue)
	{
		Integer res = (Integer)_dispatcher.dispatch(new RPRequest(this, "getPluginIntParameter[String,int]", new Object[] {
			key, new Integer(defaultValue)
		})).getResponse();
		return res.intValue();
	}

	public String getPluginStringParameter(String key)
	{
		notSupported();
		return null;
	}

	public String getPluginStringParameter(String key, String defaultValue)
	{
		String res = (String)_dispatcher.dispatch(new RPRequest(this, "getPluginStringParameter[String,String]", new Object[] {
			key, defaultValue
		})).getResponse();
		return res;
	}

	public boolean getPluginBooleanParameter(String key)
	{
		notSupported();
		return false;
	}

	public byte[] getPluginByteParameter(String key, byte defaultValue[])
	{
		notSupported();
		return null;
	}

	public boolean getPluginBooleanParameter(String key, boolean defaultValue)
	{
		notSupported();
		return false;
	}

	public void setPluginParameter(String key, int value)
	{
		_dispatcher.dispatch(new RPRequest(this, "setPluginParameter[String,int]", new Object[] {
			key, new Integer(value)
		}));
	}

	public void setPluginParameter(String key, int value, boolean global)
	{
		notSupported();
	}

	public void setPluginParameter(String key, String value)
	{
		notSupported();
	}

	public void setPluginParameter(String key, boolean value)
	{
		notSupported();
	}

	public void setPluginParameter(String key, byte value[])
	{
		notSupported();
	}

	public ConfigParameter getParameter(String key)
	{
		notSupported();
		return null;
	}

	public ConfigParameter getPluginParameter(String key)
	{
		notSupported();
		return null;
	}

	public boolean getUnsafeBooleanParameter(String key, boolean default_value)
	{
		notSupported();
		return false;
	}

	public void setUnsafeBooleanParameter(String key, boolean value)
	{
		notSupported();
	}

	public int getUnsafeIntParameter(String key, int default_value)
	{
		notSupported();
		return 0;
	}

	public void setUnsafeIntParameter(String key, int value)
	{
		notSupported();
	}

	public long getUnsafeLongParameter(String key, long default_value)
	{
		notSupported();
		return 0L;
	}

	public void setUnsafeLongParameter(String key, long value)
	{
		notSupported();
	}

	public float getUnsafeFloatParameter(String key, float default_value)
	{
		notSupported();
		return 0.0F;
	}

	public void setUnsafeFloatParameter(String key, float value)
	{
		notSupported();
	}

	public String getUnsafeStringParameter(String key, String default_value)
	{
		notSupported();
		return null;
	}

	public void setUnsafeStringParameter(String key, String value)
	{
		notSupported();
	}

	public Map getUnsafeParameterList()
	{
		notSupported();
		return null;
	}

	public void save()
		throws PluginException
	{
		try
		{
			_dispatcher.dispatch(new RPRequest(this, "save", null)).getResponse();
		}
		catch (RPException e)
		{
			Throwable cause = e.getCause();
			if (cause instanceof PluginException)
				throw (PluginException)cause;
			else
				throw e;
		}
	}

	public File getPluginUserFile(String name)
	{
		notSupported();
		return null;
	}

	public void addListener(PluginConfigListener l)
	{

⌨️ 快捷键说明

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