Package com.biglybt.core.speedmanager
Class SpeedLimitHandler
java.lang.Object
com.biglybt.core.speedmanager.SpeedLimitHandler
- All Implemented Interfaces:
LongTermStatsListener
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
private static class
private class
(package private) class
class
private class
private static class
private class
private class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate SpeedLimitHandler.ScheduleRule
private static final int
private static final int
private static final int
private final FrequencyLimitedDispatcher
private BuddyPlugin
(package private) final TorrentAttribute
private final FrequencyLimitedDispatcher
(package private) final Core
private SpeedLimitHandler.DML
private Map
<String, SpeedLimitHandler.PeerSet> private List
<SpeedLimitHandler.Prioritiser> private List
<SpeedLimitHandler.ScheduleRule> private List
<SpeedLimitHandler.StorageDetails> private final Object
private final AsyncDispatcher
private static final String
private TimerEventPeriodic
private static final Object
private final Map
<String, RateLimiter> private final Map
<String, RateLimiter> private final SpeedLimitHandler.IPSetTagType
private boolean
private final LoggerChannel
private static final String
private static final String
private static final String
private boolean
private boolean
private List
<SpeedLimitHandler.NetLimit> private Map
<Integer, List<SpeedLimitHandler.NetLimit>> private static final String
private static final int
private static final int
private boolean
private static final Object
private static final Object
(package private) final PluginInterface
private boolean
private static final int
private boolean
private TimerEventPeriodic
private static final Object
private static final Object
private static final Object
private boolean
private TimerEventPeriodic
private static final int
private static SpeedLimitHandler
private static final int
private TimerEventPeriodic
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addConfigLine
(String line, boolean auto_enable) void
addDownloadsToProfile
(String name, List<byte[]> hashes) private void
addLimiters
(PeerManager peer_manager, Peer peer, SpeedLimitHandler.PeerSet set, List<RateLimiter> up_to_be_removed, List<RateLimiter> down_to_be_removed) private void
addRemoveDownloadsToProfile
(String name, List<byte[]> hashes, boolean add) private boolean
private void
private void
private void
private void
checkSchedule
(boolean start_of_day, int tick_count) private void
private void
checkTagNetLimits
(int tick_count) void
deleteProfile
(String name) void
dump
(IndentWriter iw) private void
exportBoolean
(Map<String, Object> map, String key, boolean b) private void
private void
private String
format
(int rate) private String
format
(List<LimitedRateGroup> groups) private String
formatDown
(int rate) private String
formatDown
(List<LimitedRateGroup> groups) private String
formatUp
(int rate) private String
formatUp
(List<LimitedRateGroup> groups) private SpeedLimitHandler.ScheduleRule
getActiveRule
(Date date) private int
private BuddyPlugin
private long[]
getLongTermUsage
(LongTermStats lts, int type, SpeedLimitHandler.NetLimit net_limit_maybe_null) private int
getProfile
(String name) getProfilesForDownload
(byte[] hash) getProfileSupport
(String name, boolean use_hashes) static SpeedLimitHandler
getSingleton
(Core core) private String
getString
(long[] stats, long[] limits, boolean is_rate) private String
getString
(LongTermStats lts, int type, List<SpeedLimitHandler.NetLimit> net_limits) boolean
private boolean
importBoolean
(Map<String, Object> map, String key) private int
private String
importString
(Map<String, Object> map, String key) private void
boolean
private Map
private void
loadProfile
(String name) loadSchedule
(boolean start_of_day) private long
private void
peerRemoved
(Download download, PeerManager peer_manager, Peer peer) private void
peersAdded
(Download download, PeerManager peer_manager, Peer[] peers) private boolean
profileExists
(String name) void
removeDownloadsFromProfile
(String name, List<byte[]> hashes) private void
saveConfig
(Map map) saveProfile
(String name) private void
setActiveState
(int state) private void
setNetLimitPauseAllActive
(boolean active) private void
setProfileActive
(String profile_name) private void
setRulePauseAllActive
(boolean active) setSchedule
(List<String> lines) private List
<LimitedRateGroup> trim
(LimitedRateGroup[] groups) void
updated
(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
-
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:
updated
in interfaceLongTermStatsListener
-
canPauseAll
private boolean canPauseAll() -
checkTagNetLimits
private void checkTagNetLimits(int tick_count) -
formatUp
-
formatDown
-
format
-
formatUp
-
formatDown
-
format
-
exportBoolean
-
importBoolean
-
exportInt
-
importInt
-
exportString
-
importString
-
dump
-