org.gudy.azureus2.core3.config.impl
Class TransferSpeedValidator

java.lang.Object
  extended by org.gudy.azureus2.core3.config.impl.TransferSpeedValidator

public final class TransferSpeedValidator
extends Object

Provides validation for transfer speed settings

Since:
1.4
Version:
1.0
Author:
James Yeh

Field Summary
static String AUTO_UPLOAD_ENABLED_CONFIGKEY
           
static String AUTO_UPLOAD_SEEDING_ENABLED_CONFIGKEY
           
static String[] CONFIG_PARAMS
           
static String DOWNLOAD_CONFIGKEY
           
static String UPLOAD_CONFIGKEY
           
static String UPLOAD_SEEDING_CONFIGKEY
           
static String UPLOAD_SEEDING_ENABLED_CONFIGKEY
           
 
Constructor Summary
TransferSpeedValidator(String configKey, Number value)
          Creates a TransferSpeedValidator with the given configuration key and value
 
Method Summary
static String getActiveAutoUploadParameter(GlobalManager gm)
           
static String getActiveUploadParameter(GlobalManager gm)
           
static String getDownloadParameter()
           
static int getGlobalDownloadRateLimitBytesPerSecond()
           
 Object getValue()
          Validates the given configuration key/value pair and returns the validated value
static boolean isAutoSpeedActive(GlobalManager gm)
           
static boolean isAutoUploadAvailable(AzureusCore core)
           
static void setGlobalDownloadRateLimitBytesPerSecond(int bytes_per_second)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AUTO_UPLOAD_ENABLED_CONFIGKEY

public static final String AUTO_UPLOAD_ENABLED_CONFIGKEY
See Also:
Constant Field Values

AUTO_UPLOAD_SEEDING_ENABLED_CONFIGKEY

public static final String AUTO_UPLOAD_SEEDING_ENABLED_CONFIGKEY
See Also:
Constant Field Values

UPLOAD_CONFIGKEY

public static final String UPLOAD_CONFIGKEY
See Also:
Constant Field Values

UPLOAD_SEEDING_CONFIGKEY

public static final String UPLOAD_SEEDING_CONFIGKEY
See Also:
Constant Field Values

DOWNLOAD_CONFIGKEY

public static final String DOWNLOAD_CONFIGKEY
See Also:
Constant Field Values

UPLOAD_SEEDING_ENABLED_CONFIGKEY

public static final String UPLOAD_SEEDING_ENABLED_CONFIGKEY
See Also:
Constant Field Values

CONFIG_PARAMS

public static final String[] CONFIG_PARAMS
Constructor Detail

TransferSpeedValidator

public TransferSpeedValidator(String configKey,
                              Number value)
Creates a TransferSpeedValidator with the given configuration key and value

Parameters:
configKey - Configuration key; must be "Max Upload Speed KBs" or "Max Download Speed KBs"
value - Configuration value to be validated
Method Detail

getValue

public Object getValue()
Validates the given configuration key/value pair and returns the validated value

Returns:
Modified configuration value that conforms to validation as an Integer

getActiveUploadParameter

public static String getActiveUploadParameter(GlobalManager gm)

getDownloadParameter

public static String getDownloadParameter()

getGlobalDownloadRateLimitBytesPerSecond

public static int getGlobalDownloadRateLimitBytesPerSecond()

setGlobalDownloadRateLimitBytesPerSecond

public static void setGlobalDownloadRateLimitBytesPerSecond(int bytes_per_second)

isAutoUploadAvailable

public static boolean isAutoUploadAvailable(AzureusCore core)

isAutoSpeedActive

public static boolean isAutoSpeedActive(GlobalManager gm)

getActiveAutoUploadParameter

public static String getActiveAutoUploadParameter(GlobalManager gm)