Class SpeedLimitHandler
java.lang.Object
com.biglybt.core.speedmanager.SpeedLimitHandler
- All Implemented Interfaces:
LongTermStatsListener
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classprivate static classprivate class(package private) classclassprivate classprivate static classprivate classprivate class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate SpeedLimitHandler.ScheduleRuleprivate static final intprivate static final intprivate static final intprivate final FrequencyLimitedDispatcherprivate BuddyPlugin(package private) final TorrentAttributeprivate final FrequencyLimitedDispatcher(package private) final Coreprivate SpeedLimitHandler.DMLprivate Map<String, SpeedLimitHandler.PeerSet> private List<SpeedLimitHandler.Prioritiser> private List<SpeedLimitHandler.ScheduleRule> private List<SpeedLimitHandler.StorageDetails> private final Objectprivate final AsyncDispatcherprivate static final Stringprivate static final IpFilterprivate TimerEventPeriodicprivate static final Objectprivate final Map<String, RateLimiter> private final Map<String, RateLimiter> private final SpeedLimitHandler.IPSetTagTypeprivate booleanprivate final LoggerChannelprivate static final Stringprivate static final Stringprivate static final Stringprivate booleanprivate booleanprivate List<SpeedLimitHandler.NetLimit> private Map<Integer, List<SpeedLimitHandler.NetLimit>> private static final Stringprivate static final intprivate static final intprivate booleanprivate static final Objectprivate static final Object(package private) final PluginInterfaceprivate booleanprivate static final intprivate booleanprivate TimerEventPeriodicprivate static final Objectprivate static final Objectprivate static final Objectprivate booleanprivate TimerEventPeriodicprivate static final intprivate static SpeedLimitHandlerprivate static final intprivate TimerEventPeriodic -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConfigLine(String line, boolean auto_enable) voidaddDownloadsToProfile(String name, List<byte[]> hashes) private voidaddLimiters(PeerManager peer_manager, Peer peer, SpeedLimitHandler.PeerSet set, List<RateLimiter> up_to_be_removed, List<RateLimiter> down_to_be_removed) private voidaddRemoveDownloadsToProfile(String name, List<byte[]> hashes, boolean add) private booleanprivate voidprivate voidprivate voidprivate voidcheckSchedule(boolean start_of_day, int tick_count) private voidprivate voidcheckTagNetLimits(int tick_count) voiddeleteProfile(String name) voiddump(IndentWriter iw) private voidexportBoolean(Map<String, Object> map, String key, boolean b) private voidprivate voidexportLong(Map<String, Object> map, String key, long i) private voidprivate Stringformat(long rate) private Stringformat(List<LimitedRateGroup> groups) private StringformatDown(long rate) private StringformatDown(List<LimitedRateGroup> groups) private StringformatUp(long rate) private StringformatUp(List<LimitedRateGroup> groups) private SpeedLimitHandler.ScheduleRulegetActiveRule(Date date) private intprivate BuddyPluginprivate long[]getLongTermUsage(LongTermStats lts, int type, SpeedLimitHandler.NetLimit net_limit_maybe_null) private intgetProfile(String name) getProfilesForDownload(byte[] hash) getProfileSupport(String name, boolean use_hashes) static SpeedLimitHandlergetSingleton(Core core) private StringgetString(long[] stats, long[] limits, boolean is_rate) private StringgetString(LongTermStats lts, int type, List<SpeedLimitHandler.NetLimit> net_limits) booleanprivate booleanimportBoolean(Map<String, Object> map, String key) private intprivate longimportLong(Map<String, Object> map, String key) private StringimportString(Map<String, Object> map, String key) private voidbooleanprivate Mapprivate voidloadProfile(String name) loadSchedule(boolean start_of_day) private longprivate voidpeerRemoved(Download download, PeerManager peer_manager, Peer peer) private voidpeersAdded(Download download, PeerManager peer_manager, Peer[] peers) private booleanprofileExists(String name) voidremoveDownloadsFromProfile(String name, List<byte[]> hashes) private voidsaveConfig(Map map) saveProfile(String name) private voidsetActiveState(int state) private voidsetNetLimitPauseAllActive(boolean active) private voidsetProfileActive(String profile_name) private voidsetRulePauseAllActive(boolean active) setSchedule(List<String> lines) private List<LimitedRateGroup> trim(LimitedRateGroup[] groups) voidupdated(LongTermStats stats)
-
Field Details
-
singleton
-
RL_TO_BE_REMOVED_LOCK
-
RLD_TO_BE_REMOVED_KEY
-
RLU_TO_BE_REMOVED_KEY
-
PEER_LT_WAIT_START_KEY
-
PEER_ASN_WAIT_START_KEY
-
ip_filter
-
SCHEDULER_PERIOD
private static final int SCHEDULER_PERIOD- See Also:
-
NETLIMIT_TAG_LOG_PERIOD
private static final int NETLIMIT_TAG_LOG_PERIOD- See Also:
-
NETLIMIT_TAG_LOG_TICKS
private static final int NETLIMIT_TAG_LOG_TICKS- See Also:
-
PRIORITISER_CHECK_PERIOD_BASE
private static final int PRIORITISER_CHECK_PERIOD_BASE- See Also:
-
STORAGE_CHECK_PERIOD
private static final int STORAGE_CHECK_PERIOD- See Also:
-
NET_IPV4
- See Also:
-
NET_IPV6
- See Also:
-
NET_LAN
- See Also:
-
NET_WAN
- See Also:
-
AS_UNKOWN
private static final int AS_UNKOWN- See Also:
-
AS_INACTIVE
private static final int AS_INACTIVE- See Also:
-
AS_ACTIVE
private static final int AS_ACTIVE- See Also:
-
core
-
plugin_interface
-
category_attribute
-
logger
-
is_enabled
private boolean is_enabled -
schedule_event
-
current_rules
-
active_rule
-
preserve_inactive_limits
private boolean preserve_inactive_limits -
pause_forced_downloads
private boolean pause_forced_downloads -
prioritiser_enabled
private boolean prioritiser_enabled -
prioritiser_event
-
current_prioritisers
-
storage_event
-
current_storage_details
-
current_ip_sets
-
ip_set_rate_limiters_up
-
ip_set_rate_limiters_down
-
ip_set_event
-
net_limit_listener_added
private boolean net_limit_listener_added -
net_limits_by_type
-
net_limits_all
-
INACTIVE_PROFILE_NAME
- See Also:
-
predefined_profile_names
-
rule_pause_all_active
private boolean rule_pause_all_active -
net_limit_pause_all_active
private boolean net_limit_pause_all_active -
ip_set_tag_type
-
extensions_lock
-
auto_peer_set_queue_client
-
auto_peer_set_queue_intf
-
buddy_plugin
-
gm_dispatcher
-
current_dml
-
ip_set_peer_key
-
check_ip_sets_limiter
-
auto_peer_set_checker
-
-
Constructor Details
-
SpeedLimitHandler
-
-
Method Details
-
getSingleton
-
getActiveState
private int getActiveState() -
setActiveState
private void setActiveState(int state) -
hasAnyProfiles
public boolean hasAnyProfiles() -
loadConfig
-
saveConfig
-
loadPauseAllActive
private void loadPauseAllActive() -
getBuddyPlugin
-
setRulePauseAllActive
private void setRulePauseAllActive(boolean active) -
setNetLimitPauseAllActive
private void setNetLimitPauseAllActive(boolean active) -
clearCurrentLimits
-
resetRules
-
getCurrent
-
getString
-
getLongTermUsage
private long[] getLongTermUsage(LongTermStats lts, int type, SpeedLimitHandler.NetLimit net_limit_maybe_null) -
getString
-
getProfileNames
-
loadProfile
-
profileExists
-
getProfile
-
getProfileSupport
-
getProfilesForDownload
-
addRemoveDownloadsToProfile
-
addDownloadsToProfile
-
removeDownloadsFromProfile
-
deleteProfile
-
saveProfile
-
loadSchedule
-
parseRate
-
isEnabled
public boolean isEnabled() -
addConfigLine
-
getPeerSets
-
getMins
-
checkIPSets
private void checkIPSets() -
initialiseIPSets
-
checkIPSetsSupport
private void checkIPSetsSupport() -
peersAdded
-
peerRemoved
-
addLimiters
private void addLimiters(PeerManager peer_manager, Peer peer, SpeedLimitHandler.PeerSet set, List<RateLimiter> up_to_be_removed, List<RateLimiter> down_to_be_removed) -
checkPrioritisers
private void checkPrioritisers() -
checkStorage
private void checkStorage() -
getActiveRule
-
setProfileActive
-
checkSchedule
private void checkSchedule(boolean start_of_day, int tick_count) -
getSchedule
-
setSchedule
-
trim
-
updated
- Specified by:
updatedin interfaceLongTermStatsListener
-
canPauseAll
private boolean canPauseAll() -
checkTagNetLimits
private void checkTagNetLimits(int tick_count) -
formatUp
-
formatDown
-
format
-
formatUp
-
formatDown
-
format
-
exportBoolean
-
importBoolean
-
exportInt
-
importInt
-
exportLong
-
importLong
-
exportString
-
importString
-
dump
-