|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PluginConfig
This class provides a way for a plugin to get and set configuration settings - both for the plugin itself and for core settings as well.
This class interface contains four different variations of get and set parameter methods:
The second set of methods do what the first set of methods were primarily intended for - you can use these
methods to get or set some core parameters. You should use the parameter names defined as constants in this interface
(the ones labelled CORE_PARAM). These parameters will be properly supported by Azureus, even if the way these
values are stored or handled differently in the Azureus core itself.
Attempting to set or get parameters not mentioned here should raise an error (in some cases in the past, this wasn't
always enforced by the first set of methods.
The third set of methods allow you to modify configuration settings which are stored directly inside Azureus. These settings may change (without warning) between versions, so there is no guarantee that plugins that use these values will behave properly in different versions of Azureus.
The last set of methods are used to store and retrieve data intended exclusively for the use of the plugin itself, which is what you will be using most of the time.
Method Summary | |
---|---|
void |
addListener(PluginConfigListener l)
|
PluginConfigSource |
enableExternalConfigSource()
Enable the plugin to store configuration parameters into a separate external configuration file. |
boolean |
getBooleanParameter(java.lang.String key)
Deprecated. Use getUnsafeBooleanParameter(String) for internal core parameters, or getCoreBooleanParameter(String) for core parameters defined here. |
boolean |
getBooleanParameter(java.lang.String key,
boolean default_value)
Deprecated. Use getUnsafeBooleanParameter(String, boolean) for internal core parameters, or getCoreBooleanParameter(String, boolean) for core parameters defined here. |
byte[] |
getByteParameter(java.lang.String key)
Deprecated. Use getUnsafeByteParameter(String) for internal core parameters, or getCoreByteParameter(String) for core parameters defined here. |
byte[] |
getByteParameter(java.lang.String key,
byte[] default_value)
Deprecated. Use getUnsafeByteParameter(String, byte[]) for internal core parameters, or getCoreByteParameter(String, byte[]) for core parameters defined here. |
boolean |
getCoreBooleanParameter(java.lang.String key)
Returns the value of a core boolean parameter. |
boolean |
getCoreBooleanParameter(java.lang.String key,
boolean default_value)
Returns the value of a core boolean parameter. |
byte[] |
getCoreByteParameter(java.lang.String key)
Returns the value of a core byte array parameter. |
byte[] |
getCoreByteParameter(java.lang.String key,
byte[] default_value)
Returns the value of a core byte array parameter. |
int[] |
getCoreColorParameter(java.lang.String key)
Returns the value of a core color parameter. |
int[] |
getCoreColorParameter(java.lang.String key,
int[] default_value)
Returns the value of a core color parameter. |
float |
getCoreFloatParameter(java.lang.String key)
Returns the value of a core float parameter. |
float |
getCoreFloatParameter(java.lang.String key,
float default_value)
Returns the value of a core float parameter. |
int |
getCoreIntParameter(java.lang.String key)
Returns the value of a core int parameter. |
int |
getCoreIntParameter(java.lang.String key,
int default_value)
Returns the value of a core int parameter. |
long |
getCoreLongParameter(java.lang.String key)
Returns the value of a core long parameter. |
long |
getCoreLongParameter(java.lang.String key,
long default_value)
Returns the value of a core long parameter. |
java.lang.String |
getCoreStringParameter(java.lang.String key)
Returns the value of a core string parameter. |
java.lang.String |
getCoreStringParameter(java.lang.String key,
java.lang.String default_value)
Returns the value of a core string parameter. |
float |
getFloatParameter(java.lang.String key)
Deprecated. Use getUnsafeFloatParameter(String) for internal core parameters, or getCoreFloatParameter(String) for core parameters defined here. |
float |
getFloatParameter(java.lang.String key,
float default_value)
Deprecated. Use getUnsafeFloatParameter(String, float) for internal core parameters, or getCoreFloatParameter(String, float) for core parameters defined here. |
int |
getIntParameter(java.lang.String key)
Deprecated. Use getUnsafeIntParameter(String) for internal core parameters, or getCoreIntParameter(String) for core parameters defined here. |
int |
getIntParameter(java.lang.String key,
int default_value)
Deprecated. Use getUnsafeIntParameter(String, int) for internal core parameters, or getCoreIntParameter(String, int) for core parameters defined here. |
long |
getLongParameter(java.lang.String key)
Deprecated. Use getUnsafeLongParameter(String) for internal core parameters, or getCoreLongParameter(String) for core parameters defined here. |
long |
getLongParameter(java.lang.String key,
long default_value)
Deprecated. Use getUnsafeLongParameter(String, long) for internal core parameters, or getCoreLongParameter(String, long) for core parameters defined here. |
ConfigParameter |
getParameter(java.lang.String key)
|
boolean |
getPluginBooleanParameter(java.lang.String key)
Returns the value of a plugin boolean parameter. |
boolean |
getPluginBooleanParameter(java.lang.String key,
boolean default_value)
Returns the value of a plugin boolean parameter. |
byte[] |
getPluginByteParameter(java.lang.String key)
Returns the value of a plugin byte array parameter. |
byte[] |
getPluginByteParameter(java.lang.String key,
byte[] default_value)
Returns the value of a plugin byte array parameter. |
int[] |
getPluginColorParameter(java.lang.String key)
Returns the value of a plugin color parameter. |
int[] |
getPluginColorParameter(java.lang.String key,
int[] default_value)
Returns the value of a plugin color parameter. |
java.lang.String |
getPluginConfigKeyPrefix()
|
PluginConfigSource |
getPluginConfigSource()
Returns the PluginConfigSource object used for this plugin configuration (or null if an external configuration object isn't used). |
float |
getPluginFloatParameter(java.lang.String key)
Returns the value of a plugin float parameter. |
float |
getPluginFloatParameter(java.lang.String key,
float default_value)
Returns the value of a plugin float parameter. |
int |
getPluginIntParameter(java.lang.String key)
Returns the value of a plugin int parameter. |
int |
getPluginIntParameter(java.lang.String key,
int default_value)
Returns the value of a plugin int parameter. |
java.util.List |
getPluginListParameter(java.lang.String key,
java.util.List default_value)
Returns the value of a plugin list parameter. |
long |
getPluginLongParameter(java.lang.String key)
Returns the value of a plugin long parameter. |
long |
getPluginLongParameter(java.lang.String key,
long default_value)
Returns the value of a plugin long parameter. |
java.util.Map |
getPluginMapParameter(java.lang.String key,
java.util.Map default_value)
Returns the value of a plugin map parameter. |
ConfigParameter |
getPluginParameter(java.lang.String key)
|
java.lang.String[] |
getPluginStringListParameter(java.lang.String key)
Returns the value of a plugin string-list parameter. |
java.lang.String |
getPluginStringParameter(java.lang.String key)
Returns the value of a plugin string parameter. |
java.lang.String |
getPluginStringParameter(java.lang.String key,
java.lang.String default_value)
Returns the value of a plugin string parameter. |
java.io.File |
getPluginUserFile(java.lang.String name)
Returns a file that can be used by the plugin to save user-specific state. |
java.lang.String |
getStringParameter(java.lang.String key)
Deprecated. Use getUnsafeStringParameter(String) for internal core parameters, or getCoreStringParameter(String) for core parameters defined here. |
java.lang.String |
getStringParameter(java.lang.String key,
java.lang.String default_value)
Deprecated. Use getUnsafeStringParameter(String, String) for internal core parameters, or getCoreStringParameter(String, String) for core parameters defined here. |
boolean |
getUnsafeBooleanParameter(java.lang.String key)
Returns the value of a core boolean parameter. |
boolean |
getUnsafeBooleanParameter(java.lang.String key,
boolean default_value)
Returns the value of a core boolean parameter. |
byte[] |
getUnsafeByteParameter(java.lang.String key)
Returns the value of a core byte array parameter. |
byte[] |
getUnsafeByteParameter(java.lang.String key,
byte[] default_value)
Returns the value of a core byte array parameter. |
int[] |
getUnsafeColorParameter(java.lang.String key)
Returns the value of a core color parameter. |
int[] |
getUnsafeColorParameter(java.lang.String key,
int[] default_value)
Returns the value of a core color parameter. |
float |
getUnsafeFloatParameter(java.lang.String key)
Returns the value of a core float parameter. |
float |
getUnsafeFloatParameter(java.lang.String key,
float default_value)
Returns the value of a core float parameter. |
int |
getUnsafeIntParameter(java.lang.String key)
Returns the value of a core int parameter. |
int |
getUnsafeIntParameter(java.lang.String key,
int default_value)
Returns the value of a core int parameter. |
long |
getUnsafeLongParameter(java.lang.String key)
Returns the value of a core long parameter. |
long |
getUnsafeLongParameter(java.lang.String key,
long default_value)
Returns the value of a core long parameter. |
java.util.Map |
getUnsafeParameterList()
Returns a map |
java.lang.String |
getUnsafeStringParameter(java.lang.String key)
Returns the value of a core string parameter. |
java.lang.String |
getUnsafeStringParameter(java.lang.String key,
java.lang.String default_value)
Returns the value of a core string parameter. |
boolean |
hasParameter(java.lang.String param_name)
Returns true if a core parameter with the given name exists. |
boolean |
hasPluginParameter(java.lang.String param_name)
Returns true if a plugin parameter with the given name exists. |
boolean |
isNewInstall()
|
boolean |
removePluginColorParameter(java.lang.String key)
Removes the plugin color parameter with the given name. |
boolean |
removePluginParameter(java.lang.String key)
Removes the plugin parameter with the given name. |
void |
save()
make sure you save it after making changes! |
void |
setBooleanParameter(java.lang.String key,
boolean value)
Deprecated. Use setUnsafeBooleanParameter(String, boolean) for internal core parameters, or setCoreBooleanParameter(String, boolean) for core parameters defined here. |
void |
setByteParameter(java.lang.String key,
byte[] value)
Deprecated. Use setUnsafeByteParameter(String, byte[]) for internal core parameters, or setCoreByteParameter(String, byte[]) for core parameters defined here. |
void |
setCoreBooleanParameter(java.lang.String key,
boolean value)
Sets the value of a core boolean parameter. |
void |
setCoreByteParameter(java.lang.String key,
byte[] value)
Sets the value of a core byte array parameter. |
void |
setCoreColorParameter(java.lang.String key,
int[] value)
Sets the value of a core byte array parameter. |
void |
setCoreColorParameter(java.lang.String key,
int[] value,
boolean override)
Sets the value of a core byte array parameter. |
void |
setCoreFloatParameter(java.lang.String key,
float value)
Sets the value of a core float parameter. |
void |
setCoreIntParameter(java.lang.String key,
int value)
Sets the value of a core int parameter. |
void |
setCoreLongParameter(java.lang.String key,
long value)
Sets the value of a core long parameter. |
void |
setCoreStringParameter(java.lang.String key,
java.lang.String value)
Sets the value of a core string parameter. |
void |
setFloatParameter(java.lang.String key,
float value)
Deprecated. Use setUnsafeFloatParameter(String, float) for internal core parameters, or setCoreFloatParameter(String, float) for core parameters defined here. |
void |
setIntParameter(java.lang.String key,
int value)
Deprecated. Use setUnsafeIntParameter(String, int) for internal core parameters, or setCoreIntParameter(String, int) for core parameters defined here. |
void |
setLongParameter(java.lang.String key,
long value)
Deprecated. Use setUnsafeLongParameter(String, long) for internal core parameters, or setCoreLongParameter(String, long) for core parameters defined here. |
void |
setPluginColorParameter(java.lang.String key,
int[] value)
Sets the value of a plugin color parameter. |
void |
setPluginColorParameter(java.lang.String key,
int[] value,
boolean override)
Sets the value of a plugin color parameter. |
void |
setPluginConfigKeyPrefix(java.lang.String _key)
|
void |
setPluginConfigSource(PluginConfigSource source)
Sets the plugin configuration source object to use for storing parameters for this plugin config object. |
void |
setPluginListParameter(java.lang.String key,
java.util.List value)
Sets the value of a plugin list parameter. |
void |
setPluginMapParameter(java.lang.String key,
java.util.Map value)
Sets the value of a plugin map parameter. |
void |
setPluginParameter(java.lang.String key,
boolean value)
Sets the value of a plugin boolean parameter. |
void |
setPluginParameter(java.lang.String key,
byte[] value)
Sets the value of a plugin byte array parameter. |
void |
setPluginParameter(java.lang.String key,
float value)
Sets the value of a plugin float parameter. |
void |
setPluginParameter(java.lang.String key,
int value)
Sets the value of a plugin int parameter. |
void |
setPluginParameter(java.lang.String key,
int value,
boolean global)
Sets the value of a plugin int parameter. |
void |
setPluginParameter(java.lang.String key,
long value)
Sets the value of a plugin long parameter. |
void |
setPluginParameter(java.lang.String key,
java.lang.String value)
Sets the value of a plugin string parameter. |
void |
setPluginStringListParameter(java.lang.String key,
java.lang.String[] value)
Sets the value of a plugin string-list parameter. |
void |
setStringParameter(java.lang.String key,
java.lang.String value)
Deprecated. Use setUnsafeStringParameter(String, String) for internal core parameters, or setCoreStringParameter(String, String) for core parameters defined here. |
void |
setUnsafeBooleanParameter(java.lang.String key,
boolean value)
Sets the value of a core boolean parameter. |
void |
setUnsafeByteParameter(java.lang.String key,
byte[] value)
Sets the value of a core byte array parameter. |
void |
setUnsafeColorParameter(java.lang.String key,
int[] value)
Returns the value of a core color parameter. |
void |
setUnsafeColorParameter(java.lang.String key,
int[] value,
boolean override)
Returns the value of a core color parameter. |
void |
setUnsafeFloatParameter(java.lang.String key,
float value)
Sets the value of a core float parameter. |
void |
setUnsafeIntParameter(java.lang.String key,
int value)
Sets the value of a core int parameter. |
void |
setUnsafeLongParameter(java.lang.String key,
long value)
Sets the value of a core long parameter. |
void |
setUnsafeStringParameter(java.lang.String key,
java.lang.String value)
Sets the value of a core string parameter. |
Field Detail |
---|
static final java.lang.String CORE_PARAM_INT_MAX_UPLOAD_SPEED_KBYTES_PER_SEC
static final java.lang.String CORE_PARAM_INT_MAX_UPLOAD_SPEED_SEEDING_KBYTES_PER_SEC
static final java.lang.String CORE_PARAM_INT_MAX_DOWNLOAD_SPEED_KBYTES_PER_SEC
static final java.lang.String CORE_PARAM_INT_MAX_CONNECTIONS_PER_TORRENT
static final java.lang.String CORE_PARAM_INT_MAX_CONNECTIONS_GLOBAL
static final java.lang.String CORE_PARAM_INT_MAX_DOWNLOADS
static final java.lang.String CORE_PARAM_INT_MAX_ACTIVE
static final java.lang.String CORE_PARAM_INT_MAX_ACTIVE_SEEDING
static final java.lang.String CORE_PARAM_INT_MAX_UPLOADS
static final java.lang.String CORE_PARAM_INT_MAX_UPLOADS_SEEDING
static final java.lang.String CORE_PARAM_BOOLEAN_AUTO_SPEED_ON
static final java.lang.String CORE_PARAM_BOOLEAN_AUTO_SPEED_SEEDING_ON
static final java.lang.String CORE_PARAM_BOOLEAN_MAX_UPLOAD_SPEED_SEEDING
static final java.lang.String CORE_PARAM_BOOLEAN_MAX_ACTIVE_SEEDING
static final java.lang.String CORE_PARAM_BOOLEAN_SOCKS_PROXY_NO_INWARD_CONNECTION
static final java.lang.String CORE_PARAM_BOOLEAN_NEW_SEEDS_START_AT_TOP
static final java.lang.String CORE_PARAM_STRING_LOCAL_BIND_IP
NetworkInterface
name (ex. eth10)
static final java.lang.String CORE_PARAM_BOOLEAN_FRIENDLY_HASH_CHECKING
static final java.lang.String GUI_PARAM_INT_SWT_REFRESH_IN_MS
static final java.lang.String CORE_PARAM_BOOLEAN_NEW_TORRENTS_START_AS_STOPPED
static final java.lang.String CORE_PARAM_INT_INCOMING_TCP_PORT
static final java.lang.String CORE_PARAM_INT_INCOMING_UDP_PORT
static final java.lang.String CORE_PARAM_STRING_DEFAULT_SAVE_PATH
Method Detail |
---|
boolean getBooleanParameter(java.lang.String key)
getUnsafeBooleanParameter(String)
for internal core parameters, or getCoreBooleanParameter(String)
for core parameters defined here.
key
- The parameter name.
boolean getBooleanParameter(java.lang.String key, boolean default_value)
getUnsafeBooleanParameter(String, boolean)
for internal core parameters, or getCoreBooleanParameter(String, boolean)
for core parameters defined here.
key
- The parameter name.default_value
- The default value to return if one is not defined.
byte[] getByteParameter(java.lang.String key)
getUnsafeByteParameter(String)
for internal core parameters, or getCoreByteParameter(String)
for core parameters defined here.
key
- The parameter name.
byte[] getByteParameter(java.lang.String key, byte[] default_value)
getUnsafeByteParameter(String, byte[])
for internal core parameters, or getCoreByteParameter(String, byte[])
for core parameters defined here.
key
- The parameter name.default_value
- The default value to return if one is not defined.
float getFloatParameter(java.lang.String key)
getUnsafeFloatParameter(String)
for internal core parameters, or getCoreFloatParameter(String)
for core parameters defined here.
key
- The parameter name.
float getFloatParameter(java.lang.String key, float default_value)
getUnsafeFloatParameter(String, float)
for internal core parameters, or getCoreFloatParameter(String, float)
for core parameters defined here.
key
- The parameter name.default_value
- The default value to return if one is not defined.
int getIntParameter(java.lang.String key)
getUnsafeIntParameter(String)
for internal core parameters, or getCoreIntParameter(String)
for core parameters defined here.
key
- The parameter name.
int getIntParameter(java.lang.String key, int default_value)
getUnsafeIntParameter(String, int)
for internal core parameters, or getCoreIntParameter(String, int)
for core parameters defined here.
key
- The parameter name.default_value
- The default value to return if one is not defined.
long getLongParameter(java.lang.String key)
getUnsafeLongParameter(String)
for internal core parameters, or getCoreLongParameter(String)
for core parameters defined here.
key
- The parameter name.
long getLongParameter(java.lang.String key, long default_value)
getUnsafeLongParameter(String, long)
for internal core parameters, or getCoreLongParameter(String, long)
for core parameters defined here.
key
- The parameter name.default_value
- The default value to return if one is not defined.
java.lang.String getStringParameter(java.lang.String key)
getUnsafeStringParameter(String)
for internal core parameters, or getCoreStringParameter(String)
for core parameters defined here.
key
- The parameter name.
java.lang.String getStringParameter(java.lang.String key, java.lang.String default_value)
getUnsafeStringParameter(String, String)
for internal core parameters, or getCoreStringParameter(String, String)
for core parameters defined here.
key
- The parameter name.default_value
- The default value to return if one is not defined.
void setBooleanParameter(java.lang.String key, boolean value)
setUnsafeBooleanParameter(String, boolean)
for internal core parameters, or setCoreBooleanParameter(String, boolean)
for core parameters defined here.
key
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.void setByteParameter(java.lang.String key, byte[] value)
setUnsafeByteParameter(String, byte[])
for internal core parameters, or setCoreByteParameter(String, byte[])
for core parameters defined here.
key
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.void setFloatParameter(java.lang.String key, float value)
setUnsafeFloatParameter(String, float)
for internal core parameters, or setCoreFloatParameter(String, float)
for core parameters defined here.
key
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.void setIntParameter(java.lang.String key, int value)
setUnsafeIntParameter(String, int)
for internal core parameters, or setCoreIntParameter(String, int)
for core parameters defined here.
key
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.void setLongParameter(java.lang.String key, long value)
setUnsafeLongParameter(String, long)
for internal core parameters, or setCoreLongParameter(String, long)
for core parameters defined here.
key
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.void setStringParameter(java.lang.String key, java.lang.String value)
setUnsafeStringParameter(String, String)
for internal core parameters, or setCoreStringParameter(String, String)
for core parameters defined here.
key
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.boolean getCoreBooleanParameter(java.lang.String key)
key
- The parameter name.
boolean getCoreBooleanParameter(java.lang.String key, boolean default_value)
key
- The parameter name.default_value
- The default value to return if one is not defined.
byte[] getCoreByteParameter(java.lang.String key)
key
- The parameter name.
byte[] getCoreByteParameter(java.lang.String key, byte[] default_value)
key
- The parameter name.default_value
- The default value to return if one is not defined.
int[] getCoreColorParameter(java.lang.String key)
It will return null if no color parameter is stored, or an integer array of size 4 representing the red, green and blue values, and a flag indicating if the color is an override of the default or not (0 indicates no override, 1 means it is overridden).
In many cases, the override flag can just be ignored.
key
- The parameter name.
int[] getCoreColorParameter(java.lang.String key, int[] default_value)
It will return null if no color parameter is stored, or an integer array of size 4 representing the red, green and blue values, and a flag indicating if the color is an override of the default or not (0 indicates no override, 1 means it is overridden).
In many cases, the override flag can just be ignored.
key
- The parameter name.default_value
- The default value to return if one is not defined.
float getCoreFloatParameter(java.lang.String key)
key
- The parameter name.
float getCoreFloatParameter(java.lang.String key, float default_value)
key
- The parameter name.default_value
- The default value to return if one is not defined.
int getCoreIntParameter(java.lang.String key)
key
- The parameter name.
int getCoreIntParameter(java.lang.String key, int default_value)
key
- The parameter name.default_value
- The default value to return if one is not defined.
long getCoreLongParameter(java.lang.String key)
key
- The parameter name.
long getCoreLongParameter(java.lang.String key, long default_value)
key
- The parameter name.default_value
- The default value to return if one is not defined.
java.lang.String getCoreStringParameter(java.lang.String key)
key
- The parameter name.
java.lang.String getCoreStringParameter(java.lang.String key, java.lang.String default_value)
key
- The parameter name.default_value
- The default value to return if one is not defined.
void setCoreBooleanParameter(java.lang.String key, boolean value)
key
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.void setCoreByteParameter(java.lang.String key, byte[] value)
key
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.void setCoreColorParameter(java.lang.String key, int[] value)
The value should be an integer array of size 3 representing the red, green and blue values - or null to disable it.
key
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.void setCoreColorParameter(java.lang.String key, int[] value, boolean override)
The value should be an integer array of size 3 representing the red, green and blue values - or null to disable it.
The override flag is used to indicate if the value being set is overriding the default value. This is mainly used for interface purposes.
key
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.override
- true if the value is overridden from the default.void setCoreFloatParameter(java.lang.String key, float value)
key
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.void setCoreIntParameter(java.lang.String key, int value)
key
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.void setCoreLongParameter(java.lang.String key, long value)
key
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.void setCoreStringParameter(java.lang.String key, java.lang.String value)
key
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.boolean getPluginBooleanParameter(java.lang.String key)
key
- The parameter name.
boolean getPluginBooleanParameter(java.lang.String key, boolean default_value)
key
- The parameter name.default_value
- The default value to return if one is not defined.
byte[] getPluginByteParameter(java.lang.String key)
key
- The parameter name.
byte[] getPluginByteParameter(java.lang.String key, byte[] default_value)
key
- The parameter name.default_value
- The default value to return if one is not defined.
int[] getPluginColorParameter(java.lang.String key)
It will return null if no color parameter is stored, or an integer array of size 4 representing the red, green and blue values, and a flag indicating if the color is an override of the default or not (0 indicates no override, 1 means it is overridden).
In many cases, the override flag can just be ignored.
key
- The parameter name.
int[] getPluginColorParameter(java.lang.String key, int[] default_value)
It will return null if no color parameter is stored, or an integer array of size 4 representing the red, green and blue values, and a flag indicating if the color is an override of the default or not (0 indicates no override, 1 means it is overridden).
In many cases, the override flag can just be ignored.
key
- The parameter name.default_value
- The default value to return if one is not defined.
float getPluginFloatParameter(java.lang.String key)
key
- The parameter name.
float getPluginFloatParameter(java.lang.String key, float default_value)
key
- The parameter name.default_value
- The default value to return if one is not defined.
int getPluginIntParameter(java.lang.String key)
key
- The parameter name.
int getPluginIntParameter(java.lang.String key, int default_value)
key
- The parameter name.default_value
- The default value to return if one is not defined.
java.util.List getPluginListParameter(java.lang.String key, java.util.List default_value)
key
- The parameter name.default_value
- The default value to return if one is not defined.
long getPluginLongParameter(java.lang.String key)
key
- The parameter name.
long getPluginLongParameter(java.lang.String key, long default_value)
key
- The parameter name.default_value
- The default value to return if one is not defined.
java.util.Map getPluginMapParameter(java.lang.String key, java.util.Map default_value)
key
- The parameter name.default_value
- The default value to return if one is not defined.
java.lang.String getPluginStringParameter(java.lang.String key)
key
- The parameter name.
java.lang.String getPluginStringParameter(java.lang.String key, java.lang.String default_value)
key
- The parameter name.default_value
- The default value to return if one is not defined.
java.lang.String[] getPluginStringListParameter(java.lang.String key)
key
- The parameter name.
void setPluginParameter(java.lang.String key, boolean value)
key
- The parameter name.value
- The new value for the parameter.void setPluginParameter(java.lang.String key, byte[] value)
key
- The parameter name.value
- The new value for the parameter.void setPluginParameter(java.lang.String key, float value)
key
- The parameter name.value
- The new value for the parameter.void setPluginParameter(java.lang.String key, int value)
key
- The parameter name.value
- The new value for the parameter.void setPluginParameter(java.lang.String key, int value, boolean global)
key
- The parameter name.value
- The new value for the parameter.global
- Whether or not this parameter should be made externally accessible.void setPluginParameter(java.lang.String key, long value)
key
- The parameter name.value
- The new value for the parameter.void setPluginParameter(java.lang.String key, java.lang.String value)
key
- The parameter name.value
- The new value for the parameter.void setPluginStringListParameter(java.lang.String key, java.lang.String[] value)
key
- The parameter name.value
- The new value of the parameter.void setPluginColorParameter(java.lang.String key, int[] value)
The value should be an integer array of size 3 representing the red, green and blue values - or null to disable it.
key
- The parameter name.value
- The new value for the parameter.void setPluginColorParameter(java.lang.String key, int[] value, boolean override)
The value should be an integer array of size 3 representing the red, green and blue values - or null to disable it.
The override flag is used to indicate if the value being set is overriding the default value. This is mainly used for interface purposes.
key
- The parameter name.value
- The new value for the parameter.override
- true if the value is overridden from the default.void setPluginListParameter(java.lang.String key, java.util.List value)
key
- The parameter name.value
- The new value for the parameter.void setPluginMapParameter(java.lang.String key, java.util.Map value)
key
- The parameter name.value
- The new value for the parameter.boolean getUnsafeBooleanParameter(java.lang.String key)
key
- The parameter name.default_value
- The default value to return if one is not defined.
boolean getUnsafeBooleanParameter(java.lang.String key, boolean default_value)
key
- The parameter name.default_value
- The default value to return if one is not defined.
byte[] getUnsafeByteParameter(java.lang.String key)
key
- The parameter name.
byte[] getUnsafeByteParameter(java.lang.String key, byte[] default_value)
key
- The parameter name.default_value
- The default value to return if one is not defined.
int[] getUnsafeColorParameter(java.lang.String key)
It will return null if no color parameter is stored, or an integer array of size 4 representing the red, green and blue values, and a flag indicating if the color is an override of the default or not (0 indicates no override, 1 means it is overridden).
In many cases, the override flag can just be ignored.
key
- The parameter name.
int[] getUnsafeColorParameter(java.lang.String key, int[] default_value)
It will return null if no color parameter is stored, or an integer array of size 4 representing the red, green and blue values, and a flag indicating if the color is an override of the default or not (0 indicates no override, 1 means it is overridden).
In many cases, the override flag can just be ignored.
key
- The parameter name.default_value
- The default value to return if one is not defined.
float getUnsafeFloatParameter(java.lang.String key)
key
- The parameter name.
float getUnsafeFloatParameter(java.lang.String key, float default_value)
key
- The parameter name.default_value
- The default value to return if one is not defined.
int getUnsafeIntParameter(java.lang.String key)
key
- The parameter name.
int getUnsafeIntParameter(java.lang.String key, int default_value)
key
- The parameter name.default_value
- The default value to return if one is not defined.
long getUnsafeLongParameter(java.lang.String key)
key
- The parameter name.
long getUnsafeLongParameter(java.lang.String key, long default_value)
key
- The parameter name.default_value
- The default value to return if one is not defined.
java.lang.String getUnsafeStringParameter(java.lang.String key)
key
- The parameter name.
java.lang.String getUnsafeStringParameter(java.lang.String key, java.lang.String default_value)
key
- The parameter name.default_value
- The default value to return if one is not defined.
void setUnsafeBooleanParameter(java.lang.String key, boolean value)
key
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.void setUnsafeByteParameter(java.lang.String key, byte[] value)
key
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.void setUnsafeColorParameter(java.lang.String key, int[] value)
The value should be an integer array of size 3 representing the red, green and blue values - or null to disable it.
key
- The parameter name.value
- The new value for the parameter.void setUnsafeColorParameter(java.lang.String key, int[] value, boolean override)
The value should be an integer array of size 3 representing the red, green and blue values - or null to disable it.
The override flag is used to indicate if the value being set is overriding the default value. This is mainly used for interface purposes.
key
- The parameter name.value
- The default value to return if one is not defined.override
- true if the value is overridden from the default.void setUnsafeFloatParameter(java.lang.String key, float value)
key
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.void setUnsafeIntParameter(java.lang.String key, int value)
key
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.void setUnsafeLongParameter(java.lang.String key, long value)
key
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.void setUnsafeStringParameter(java.lang.String key, java.lang.String value)
key
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.boolean removePluginParameter(java.lang.String key)
key
- Name of the parameter.
boolean removePluginColorParameter(java.lang.String key)
key
- Name of the parameter.
java.lang.String getPluginConfigKeyPrefix()
ConfigParameter getParameter(java.lang.String key)
ConfigParameter getPluginParameter(java.lang.String key)
boolean isNewInstall()
java.util.Map getUnsafeParameterList()
void save() throws PluginException
PluginException
java.io.File getPluginUserFile(java.lang.String name)
This will be azureus-user-dir/plugins/plugin-name/name.
name
-
boolean hasParameter(java.lang.String param_name)
key
- The name of the parameter to check.boolean hasPluginParameter(java.lang.String param_name)
key
- The name of the parameter to check.void addListener(PluginConfigListener l)
void setPluginConfigKeyPrefix(java.lang.String _key)
_key
- PluginConfigSource enableExternalConfigSource()
PluginConfigSource.initialize()
for the
external configuration file to be properly integrated with Azureus.
When a plugin is first initialised, it should call this method as soon as possible during the initialization stage. This then configures the PluginConfig object to store any parameter values into an external configuration file (rather than storing it directly with the main configuration file used by Azureus).
When this method is invoked, it will return an object which allows the filename to be chosen - it allows a limited amount of manipulation of the configuration file. This method only needs to be invoked once.
All methods which get and set plugin parameters on this object will store
data in the external configuration file. The use of classes like
BasicPluginConfigModel
will automatically integrate parameters to the external configuration
source.
However, if you use any other mechanism to store parameter data, you may need to call
the registerParameter
to integrate the parameter properly.
PluginConfigSource getPluginConfigSource()
void setPluginConfigSource(PluginConfigSource source)
This method should only be used as an alternative to enableExternalConfigSource()
.
You will only need to use this method if you use the
getLocalPluginInterface
method to store data in a separate namespace, but want to use the same configuration file to
store data in.
source
- The PluginConfigSource object to use.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |