|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object speedscheduler.SpeedSchedulerPlugin
public class SpeedSchedulerPlugin
The main plugin class for this plugin. Azureus instantiates and initializes this class, so this class must do all the plugin bootstrapping, including loading the saved user schedules and starting the SpeedSchedulerThread. The file plugin.properties references this class.
Field Summary | |
---|---|
private static java.lang.String |
AUTO_SPEED_ENABLED_CONFIG_VAR
|
private static java.lang.String |
AUTO_SPEED_MAX_UPLOAD_CONFIG_VAR
|
private static java.lang.String |
AUTO_SPEED_PLUGIN_NAME
|
private static java.lang.String |
AUTO_SPEED_WARNED_PARAM
|
private static java.lang.String |
ENABLED_PARAM
The name of the parameter in the Azureus config that tells us if we are enabled or not. |
private static java.lang.String |
MAX_DOWNLOAD_SPEED_PARAM
|
private static java.lang.String |
MAX_UPLOAD_SPEED_PARAM
|
private org.gudy.azureus2.plugins.PluginConfig |
pluginConfig
A reference to the Azureus PluginConfig implementation |
private org.gudy.azureus2.plugins.PluginInterface |
pluginInterface
A reference to the Azureus PluginConfig implementation |
private static SpeedSchedulerPlugin |
speedSchedulerPlugin
A reference to this singleton |
private SpeedSchedulerThread |
speedSchedulerThread
A reference to the thread that powers this whole shindig |
Constructor Summary | |
---|---|
SpeedSchedulerPlugin()
|
Method Summary | |
---|---|
int |
getAutoSpeedMaxUploadSpeed()
Gets auto speed's maximum upload setting. |
private org.gudy.azureus2.plugins.PluginInterface |
getAutoSpeedPluginInterface()
Fetches the AutoSpeed plugin interface. |
int |
getAzureusGlobalDownloadSpeed()
Sets Azureus' maximum global download speed. |
int |
getAzureusGlobalUploadSpeed()
Gets Azureus' maximum global upload speed. |
org.gudy.azureus2.plugins.PluginInterface |
getAzureusPluginInterface()
Gets a reference to the Azureus plugin interface. |
int |
getConfigParameter(java.lang.String name,
int defaultValue)
|
java.lang.String |
getConfigParameter(java.lang.String name,
java.lang.String defaultValue)
|
static SpeedSchedulerPlugin |
getInstance()
Get the singleton instance of the SpeedSchedulerPlugin. |
java.lang.String |
getPluginDirectoryName()
Gets the directory where we are installed. |
boolean |
hasUserBeenWarnedAboutAutoSpeed()
Returns true if the user has already been warned about AutoSpeed/SpeedScheduler behavior. |
void |
initialize(org.gudy.azureus2.plugins.PluginInterface pluginInterface)
This method is called when the plugin is loaded / initialized In our case, it'll simply store the pluginInterface reference and register our PluginView. |
boolean |
isAutoSpeedEnabled()
Figures out if the Auto Speed plugin is installed and enabled. |
boolean |
isEnabled()
If the user has checked the "Enable SpeedSCheduler" in the view, this will return true. |
boolean |
isSwtAvailable()
Checks if SWT is available on the host system. |
void |
setAutoSpeedMaxUploadSpeed(int speed)
Sets auto speed's maximum upload setting. |
void |
setAzureusGlobalDownloadSpeed(int newSpeed)
Sets Azureus' maximum global download speed. |
void |
setAzureusGlobalUploadSpeed(int newSpeed)
Sets Azureus' maximum global upload speed. |
void |
setEnabled(boolean enabled)
Turns on/off the SpeedScheduler. |
void |
setUserHasBeenWarnedAboutAutoSpeed(boolean hasBeenWarned)
Stores whether the user has already been warned about AutoSpeed/SpeedScheduler behavior. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private org.gudy.azureus2.plugins.PluginInterface pluginInterface
private org.gudy.azureus2.plugins.PluginConfig pluginConfig
private static SpeedSchedulerPlugin speedSchedulerPlugin
private static final java.lang.String ENABLED_PARAM
private SpeedSchedulerThread speedSchedulerThread
private static final java.lang.String MAX_UPLOAD_SPEED_PARAM
private static final java.lang.String MAX_DOWNLOAD_SPEED_PARAM
private static final java.lang.String AUTO_SPEED_ENABLED_CONFIG_VAR
private static final java.lang.String AUTO_SPEED_MAX_UPLOAD_CONFIG_VAR
private static final java.lang.String AUTO_SPEED_PLUGIN_NAME
private static final java.lang.String AUTO_SPEED_WARNED_PARAM
Constructor Detail |
---|
public SpeedSchedulerPlugin()
Method Detail |
---|
public void initialize(org.gudy.azureus2.plugins.PluginInterface pluginInterface)
initialize
in interface org.gudy.azureus2.plugins.Plugin
public boolean isSwtAvailable()
public org.gudy.azureus2.plugins.PluginInterface getAzureusPluginInterface()
public boolean isEnabled()
public void setEnabled(boolean enabled)
enabled
- True to turn it on, false to turn it off.this.isEnabled
public static SpeedSchedulerPlugin getInstance()
public void setAzureusGlobalUploadSpeed(int newSpeed)
newSpeed
- The new max upload speed.PluginInterface
,
PluginConfig
public void setAzureusGlobalDownloadSpeed(int newSpeed)
newSpeed
- The new max download speed.PluginInterface
,
PluginConfig
public int getAzureusGlobalDownloadSpeed()
PluginInterface
,
PluginConfig
public int getAzureusGlobalUploadSpeed()
PluginInterface
,
PluginConfig
public int getConfigParameter(java.lang.String name, int defaultValue)
name
- The config entry name whose value to fetch.defaultValue
- The value to return if the property does not exist.
public java.lang.String getConfigParameter(java.lang.String name, java.lang.String defaultValue)
public java.lang.String getPluginDirectoryName()
public boolean isAutoSpeedEnabled()
private org.gudy.azureus2.plugins.PluginInterface getAutoSpeedPluginInterface()
public void setAutoSpeedMaxUploadSpeed(int speed)
speed
- The speed in Kb/sec.public int getAutoSpeedMaxUploadSpeed()
public boolean hasUserBeenWarnedAboutAutoSpeed()
public void setUserHasBeenWarnedAboutAutoSpeed(boolean hasBeenWarned)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |