public void readFromPersistentMap(){
//get persistent mapper.
SpeedManager sm = AzureusCoreFactory.getSingleton().getSpeedManager();
//get upload estimate.
SpeedManagerLimitEstimate uEst = SMConst.filterEstimate(
sm.getEstimatedUploadCapacityBytesPerSec(),
SMConst.START_UPLOAD_RATE_MAX );
int upPingMapLimit = uEst.getBytesPerSec();
if(upPingMapLimit<SMConst.START_UPLOAD_RATE_MAX){
//will find upload limit via slow search.
uploadLimitMax = SMConst.START_UPLOAD_RATE_MAX;
}else{
uploadLimitMax = upPingMapLimit;
}
uploadLimitMin = SMConst.calculateMinUpload( uploadLimitMax );
//get download estimate.
SpeedManagerLimitEstimate dEst = SMConst.filterEstimate(
sm.getEstimatedDownloadCapacityBytesPerSec(),
SMConst.START_DOWNLOAD_RATE_MAX );
int downPingMapLimit = dEst.getBytesPerSec();
if( isSettingDownloadUnlimited() ){
slider.setDownloadUnlimitedMode(true);
}else{
slider.setDownloadUnlimitedMode(false);
}
if(downPingMapLimit<SMConst.START_DOWNLOAD_RATE_MAX){
downloadLimitMax = SMConst.START_DOWNLOAD_RATE_MAX;
}else{
downloadLimitMax = downPingMapLimit;
}
downloadLimitMin = SMConst.calculateMinDownload( downloadLimitMax );
uploadLimitConf = SpeedLimitConfidence.convertType( uEst.getEstimateType() );
downloadLimitConf = SpeedLimitConfidence.convertType( dEst.getEstimateType() );
percentUploadCapacityDownloadMode = (float)
COConfigurationManager.getIntParameter(SpeedLimitMonitor.USED_UPLOAD_CAPACITY_DOWNLOAD_MODE, 60)/100.0f;
saveToCOConfiguration();