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 java.lang.Object

Provides validation for transfer speed settings

Since:
1.4
Version:
1.0
Author:
James Yeh

Field Summary
static java.lang.String AUTO_UPLOAD_ENABLED_CONFIGKEY
           
static java.lang.String AUTO_UPLOAD_SEEDING_ENABLED_CONFIGKEY
           
static java.lang.String[] CONFIG_PARAMS
           
static java.lang.String DOWNLOAD_CONFIGKEY
           
static java.lang.String UPLOAD_CONFIGKEY
           
static java.lang.String UPLOAD_SEEDING_CONFIGKEY
           
static java.lang.String UPLOAD_SEEDING_ENABLED_CONFIGKEY
           
 
Constructor Summary
TransferSpeedValidator(java.lang.String configKey, java.lang.Number value)
          Creates a TransferSpeedValidator with the given configuration key and value
 
Method Summary
static java.lang.String getActiveAutoUploadParameter(GlobalManager gm)
           
static java.lang.String getActiveUploadParameter(GlobalManager gm)
           
static java.lang.String getDownloadParameter()
           
static int getGlobalDownloadRateLimitBytesPerSecond()
           
 java.lang.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 java.lang.String AUTO_UPLOAD_ENABLED_CONFIGKEY
See Also:
Constant Field Values

AUTO_UPLOAD_SEEDING_ENABLED_CONFIGKEY

public static final java.lang.String AUTO_UPLOAD_SEEDING_ENABLED_CONFIGKEY
See Also:
Constant Field Values

UPLOAD_CONFIGKEY

public static final java.lang.String UPLOAD_CONFIGKEY
See Also:
Constant Field Values

UPLOAD_SEEDING_CONFIGKEY

public static final java.lang.String UPLOAD_SEEDING_CONFIGKEY
See Also:
Constant Field Values

DOWNLOAD_CONFIGKEY

public static final java.lang.String DOWNLOAD_CONFIGKEY
See Also:
Constant Field Values

UPLOAD_SEEDING_ENABLED_CONFIGKEY

public static final java.lang.String UPLOAD_SEEDING_ENABLED_CONFIGKEY
See Also:
Constant Field Values

CONFIG_PARAMS

public static final java.lang.String[] CONFIG_PARAMS
Constructor Detail

TransferSpeedValidator

public TransferSpeedValidator(java.lang.String configKey,
                              java.lang.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 java.lang.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 java.lang.String getActiveUploadParameter(GlobalManager gm)

getDownloadParameter

public static java.lang.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 java.lang.String getActiveAutoUploadParameter(GlobalManager gm)