Package com.biglybt.core.speedmanager
Class SpeedLimitHandler.PeerSet.TagPeerImpl
java.lang.Object
com.biglybt.core.tag.impl.TagBase
com.biglybt.core.speedmanager.SpeedLimitHandler.PeerSet.TagPeerImpl
- All Implemented Interfaces:
Tag
,TagFeature
,TagFeatureExecOnAssign
,TagFeatureRateLimit
,TagPeer
,DataSourceResolver.ExportableDataSource
,SimpleTimer.TimerTickReceiver
,Tag
- Enclosing class:
SpeedLimitHandler.PeerSet
private class SpeedLimitHandler.PeerSet.TagPeerImpl
extends TagBase
implements TagPeer, TagFeatureExecOnAssign
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.biglybt.core.tag.TagFeatureExecOnAssign
TagFeatureExecOnAssign.OptionsTemplateHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Object
private final SpeedLimitHandler.PeerSet
private int
private final Object
Fields inherited from class com.biglybt.core.tag.impl.TagBase
AT_AUTO_APPLY_SORT_INTERVAL, AT_BYTES_DOWN, AT_BYTES_UP, AT_CAN_BE_PUBLIC, AT_COLOR_ID, AT_COLORS_ID, AT_DESCRIPTION, AT_EOS_ASSIGN_TAGS, AT_EOS_OPTIONS_TEMPLATE, AT_EOS_PM, AT_EOS_REMOVE_TAGS, AT_EOS_SCRIPT, AT_FL_COPY_COMP, AT_FL_COPY_COMP_OPT, AT_FL_INIT_LOC, AT_FL_INIT_LOC_OPT, AT_FL_MOVE_ASSIGN, AT_FL_MOVE_ASSIGN_OPT, AT_FL_MOVE_COMP, AT_FL_MOVE_COMP_OPT, AT_FL_MOVE_REM, AT_FL_MOVE_REM_OPT, AT_FL_PREVENT_DELETE, AT_FLAGS, AT_GROUP, AT_IMAGE_FILE, AT_IMAGE_ID, AT_IMAGE_SORT_ORDER, AT_LIMIT_ORDERING, AT_MAX_TAGGABLES, AT_NOTIFICATION_POST, AT_NOTIFICATION_PUBLISH, AT_ORIGINAL_NAME, AT_PROPERTY_PREFIX, AT_PUBLIC, AT_RATELIMIT_ACTIVE_LIMITS_STRICT, AT_RATELIMIT_BOOST, AT_RATELIMIT_DOWN, AT_RATELIMIT_FP_SEEDING, AT_RATELIMIT_MAX_ACTIVE_CD, AT_RATELIMIT_MAX_ACTIVE_DL, AT_RATELIMIT_MAX_AGGREGATE_SR, AT_RATELIMIT_MAX_AGGREGATE_SR_ACTION, AT_RATELIMIT_MAX_AGGREGATE_SR_PRIORITY, AT_RATELIMIT_MAX_SR, AT_RATELIMIT_MAX_SR_ACTION, AT_RATELIMIT_MIN_SR, AT_RATELIMIT_NOT_FP_SEEDING, AT_RATELIMIT_UP, AT_RATELIMIT_UP_PRI, AT_REMOVAL_STRATEGY, AT_RSS_ENABLE, AT_VISIBLE, AT_WEIGHT, AT_XCODE_TARGET
Fields inherited from interface com.biglybt.core.util.DataSourceResolver.ExportableDataSource
OPT_CAN_MINIMIZE, OPT_ON_TOP
Fields inherited from interface com.biglybt.core.tag.Tag
FL_IS_FILTER, FL_IS_HIDDEN_WHEN_EMPTY, FL_NONE, TP_CONSTRAINT_ERROR, TP_SETTINGS_REQUESTED
Fields inherited from interface com.biglybt.core.tag.TagFeature
TF_EXEC_ON_ASSIGN, TF_FILE_LOCATION, TF_LIMITS, TF_NONE, TF_NOTIFICATIONS, TF_PROPERTIES, TF_RATE_LIMIT, TF_RSS_FEED, TF_RUN_STATE, TF_XCODE
Fields inherited from interface com.biglybt.core.tag.TagFeatureExecOnAssign
ACTION_APPLY_OPTIONS_TEMPLATE, ACTION_ASSIGN_TAGS, ACTION_DESTROY, ACTION_FORCE_START, ACTION_HOST, ACTION_MOVE_INIT_SAVE_LOC, ACTION_NONE, ACTION_NOT_FORCE_START, ACTION_PAUSE, ACTION_POST_MAGNET_URI, ACTION_PUBLISH, ACTION_QUEUE, ACTION_REMOVE_TAGS, ACTION_RESUME, ACTION_SCRIPT, ACTION_START, ACTION_STOP, ACTIONS
Fields inherited from interface com.biglybt.core.tag.TagFeatureRateLimit
AT_RATELIMIT_MAX_AGGREGATE_SR_PRIORITY_DEFAULT, SR_ACTION_ARCHIVE, SR_ACTION_PAUSE, SR_ACTION_QUEUE, SR_ACTION_REMOVE_FROM_COMPUTER, SR_ACTION_REMOVE_FROM_LIBRARY, SR_ACTION_STOP, SR_AGGREGATE_ACTION_DEFAULT, SR_INDIVIDUAL_ACTION_DEFAULT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
add
(PeerManager peer_manager, Peer _peer) void
private int
private int
private int
canAddClient
(PEPeer peer, Pattern client_pattern) private int
canAddIntf
(PEPeer peer, Pattern intf_pattern) private boolean
deferEOS()
private void
deferredRemove
(PEPeer peer) boolean
int
int
int
int
int
int
protected long[]
protected long[]
int
int
boolean
private void
remove
(PeerManager peer_manager, Peer _peer) private void
void
void
void
setActionEnabled
(int action, boolean enabled) private void
void
setColor
(int[] rgb) void
setTagBoost
(boolean boost) void
setTagDownloadLimit
(int bps) void
setTagUploadLimit
(int bps) void
setTagUploadPriority
(int priority) boolean
boolean
boolean
private void
update
(int tick_count) Methods inherited from class com.biglybt.core.tag.impl.TagBase
addListener, addTag, addTaggableBatch, addTagListener, applySort, canBePublic, checkMaximumTaggables, closing, createTagProperty, destroy, exportDataSource, generate, getActionScript, getAutoApplySortInterval, getColor, getColors, getEOAString, getFirstPrioritySeeding, getFlag, getGroup, getGroupContainer, getImageFile, getImageID, getImageSortOrder, getManager, getMaxActiveDownloads, getMaxActiveSeeds, getMaximumTaggables, getNotFirstPrioritySeeding, getNotifyMessageChannel, getOptionsTemplateHandler, getOrdering, getPostingNotifications, getPostMessageChannel, getPreventDelete, getPropertiesString, getProperty, getPublicDefault, getRecentHistory, getRemovalStrategy, getStrictActivityLimits, getSupportedProperties, getTag, getTagAggregateShareRatio, getTagAssigns, getTagBoost, getTagCopyOnCompleteFolder, getTagCopyOnCompleteOptions, getTagDownloadTotal, getTaggableAddedTime, getTaggables, getTagID, getTagInitialSaveFolder, getTagInitialSaveOptions, getTagMaxAggregateShareRatio, getTagMaxAggregateShareRatioAction, getTagMaxAggregateShareRatioHasPriority, getTagMaxShareRatio, getTagMaxShareRatioAction, getTagMinShareRatio, getTagMoveOnAssignFolder, getTagMoveOnAssignOptions, getTagMoveOnCompleteFolder, getTagMoveOnCompleteOptions, getTagMoveOnRemoveFolder, getTagMoveOnRemoveOptions, getTagName, getTagName, getTagNameRaw, getTagRemoves, getTagSessionDownloadTotal, getTagSessionUploadTotal, getTagType, getTagUID, getTagUploadTotal, getTransientProperty, getVisibleDefault, getVuzeFile, getWeight, initialized, isActionEnabled, isAnyActionEnabled, isColorDefault, isPublic, isTagAuto, isTagRSSFeedEnabled, isVisible, readBooleanAttribute, readLongAttribute, readLongListAttribute, readMapAttribute, readStringAttribute, readStringListAttribute, removeListener, removeTagListener, requestAttention, resetTagSessionDownloadTotal, resetTagSessionUploadTotal, setActionScript, setAutoApplySortInterval, setCanBePublic, setColors, setDescription, setFirstPrioritySeeding, setFlag, setGroup, setImageFile, setImageID, setImageSortOrder, setMaxActiveDownloads, setMaxActiveSeeds, setMaximumTaggables, setNotFirstPrioritySeeding, setNotifyMessageChannel, setOrdering, setPostingNotifications, setPostMessageChannel, setPreventDelete, setPublic, setRecentHistoryRetention, setRemovalStrategy, setStrictActivityLimits, setTagAssigns, setTagCopyOnCompleteFolder, setTagCopyOnCompleteOptions, setTagInitialSaveFolder, setTagInitialSaveOptions, setTagMaxAggregateShareRatio, setTagMaxAggregateShareRatioAction, setTagMaxAggregateShareRatioHasPriority, setTagMaxShareRatio, setTagMaxShareRatioAction, setTagMinShareRatio, setTagMoveOnAssignFolder, setTagMoveOnAssignOptions, setTagMoveOnCompleteFolder, setTagMoveOnCompleteOptions, setTagMoveOnRemoveFolder, setTagMoveOnRemoveOptions, setTagName, setTagRemoves, setTagRSSFeedEnabled, setTransientProperty, setVisible, setWeight, supportsAction, supportsTagCopyOnComplete, supportsTagInitialSaveFolder, supportsTagMoveOnAssign, supportsTagMoveOnComplete, supportsTagMoveOnRemove, sync, tick, writeBooleanAttribute, writeLongAttribute, writeLongListAttribute, writeMapAttribute, writeStringAttribute, writeStringListAttribute
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.biglybt.core.util.DataSourceResolver.ExportableDataSource
getBooleanOption
Methods inherited from interface com.biglybt.core.tag.Tag
addTaggableBatch, addTagListener, canBePublic, dependsOnTags, getColor, getColors, getFlag, getGroup, getGroupContainer, getImageFile, getImageID, getImageSortOrder, getStatus, getTaggableAddedTime, getTagID, getTagName, getTagType, getTagUID, getTransientProperty, getVuzeFile, isColorDefault, isHiddenWhenEmpty, isPublic, isTagAuto, isVisible, removeTagListener, requestAttention, setCanBePublic, setColors, setDescription, setFlag, setGroup, setHiddenWhenEmpty, setImageFile, setImageID, setImageSortOrder, setPublic, setTagName, setTransientProperty, setVisible
Methods inherited from interface com.biglybt.pif.tag.Tag
addListener, getTaggables, getTagName, removeListener
Methods inherited from interface com.biglybt.core.tag.TagFeature
getTag
Methods inherited from interface com.biglybt.core.tag.TagFeatureExecOnAssign
getActionScript, getEOAString, getOptionsTemplateHandler, getPostMessageChannel, getTagAssigns, getTagRemoves, isActionEnabled, isAnyActionEnabled, setActionScript, setPostMessageChannel, setTagAssigns, setTagRemoves, supportsAction
Methods inherited from interface com.biglybt.core.tag.TagFeatureRateLimit
getFirstPrioritySeeding, getMaxActiveDownloads, getMaxActiveSeeds, getNotFirstPrioritySeeding, getRecentHistory, getStrictActivityLimits, getTagAggregateShareRatio, getTagBoost, getTagDownloadTotal, getTagMaxAggregateShareRatio, getTagMaxAggregateShareRatioAction, getTagMaxAggregateShareRatioHasPriority, getTagMaxShareRatio, getTagMaxShareRatioAction, getTagMinShareRatio, getTagSessionDownloadTotal, getTagSessionUploadTotal, getTagUploadTotal, resetTagSessionDownloadTotal, resetTagSessionUploadTotal, setFirstPrioritySeeding, setMaxActiveDownloads, setMaxActiveSeeds, setNotFirstPrioritySeeding, setRecentHistoryRetention, setStrictActivityLimits, setTagMaxAggregateShareRatio, setTagMaxAggregateShareRatioAction, setTagMaxAggregateShareRatioHasPriority, setTagMaxShareRatio, setTagMaxShareRatioAction, setTagMinShareRatio
-
Field Details
-
ip_set
-
UPLOAD_PRIORITY_ADDED_KEY
-
BOOSTED_KEY
-
upload_priority
private int upload_priority -
added_peers
-
pending_peers
-
-
Constructor Details
-
TagPeerImpl
-
-
Method Details
-
getTaggableTypes
public int getTaggableTypes()- Specified by:
getTaggableTypes
in interfaceTag
-
getSupportedActions
public int getSupportedActions()- Specified by:
getSupportedActions
in interfaceTagFeatureExecOnAssign
- Overrides:
getSupportedActions
in classTagBase
-
setActionEnabled
public void setActionEnabled(int action, boolean enabled) - Specified by:
setActionEnabled
in interfaceTagFeatureExecOnAssign
- Overrides:
setActionEnabled
in classTagBase
-
setColor
public void setColor(int[] rgb) -
update
private void update(int tick_count) -
deferEOS
private boolean deferEOS() -
deferredRemove
-
canAdd
- Parameters:
peer
-- Returns:
- 0=defer, 1=yes, 2=no, 3=remove
-
canAddClient
-
canAddIntf
-
canAddASN
-
add
-
remove
-
removeAll
private void removeAll() -
addTaggable
- Specified by:
addTaggable
in interfaceTag
- Overrides:
addTaggable
in classTagBase
-
removeTaggable
- Specified by:
removeTaggable
in interfaceTag
- Overrides:
removeTaggable
in classTagBase
-
getTaggedCount
public int getTaggedCount()- Specified by:
getTaggedCount
in interfaceTag
-
getTaggedPeers
- Specified by:
getTaggedPeers
in interfaceTagPeer
-
getTagged
-
hasTaggable
- Specified by:
hasTaggable
in interfaceTag
-
supportsTagRates
public boolean supportsTagRates()- Specified by:
supportsTagRates
in interfaceTagFeatureRateLimit
-
supportsTagUploadLimit
public boolean supportsTagUploadLimit()- Specified by:
supportsTagUploadLimit
in interfaceTagFeatureRateLimit
-
supportsTagDownloadLimit
public boolean supportsTagDownloadLimit()- Specified by:
supportsTagDownloadLimit
in interfaceTagFeatureRateLimit
-
getTagUploadLimit
public int getTagUploadLimit()- Specified by:
getTagUploadLimit
in interfaceTagFeatureRateLimit
- Returns:
- Max Upload Speed in bytes/sec
-
setTagUploadLimit
public void setTagUploadLimit(int bps) - Specified by:
setTagUploadLimit
in interfaceTagFeatureRateLimit
-
getTagCurrentUploadRate
public int getTagCurrentUploadRate()- Specified by:
getTagCurrentUploadRate
in interfaceTagFeatureRateLimit
-
getTagSessionUploadTotalCurrent
protected long[] getTagSessionUploadTotalCurrent()- Overrides:
getTagSessionUploadTotalCurrent
in classTagBase
-
getTagSessionDownloadTotalCurrent
protected long[] getTagSessionDownloadTotalCurrent()- Overrides:
getTagSessionDownloadTotalCurrent
in classTagBase
-
getTagDownloadLimit
public int getTagDownloadLimit()- Specified by:
getTagDownloadLimit
in interfaceTagFeatureRateLimit
- Returns:
- Max Download Speed in bytes/sec
-
setTagDownloadLimit
public void setTagDownloadLimit(int bps) - Specified by:
setTagDownloadLimit
in interfaceTagFeatureRateLimit
-
getTagCurrentDownloadRate
public int getTagCurrentDownloadRate()- Specified by:
getTagCurrentDownloadRate
in interfaceTagFeatureRateLimit
-
getCanBePublicDefault
public boolean getCanBePublicDefault()- Overrides:
getCanBePublicDefault
in classTagBase
-
getTagUploadPriority
public int getTagUploadPriority()- Specified by:
getTagUploadPriority
in interfaceTagFeatureRateLimit
-
setTagUploadPriority
public void setTagUploadPriority(int priority) - Specified by:
setTagUploadPriority
in interfaceTagFeatureRateLimit
-
setTagBoost
public void setTagBoost(boolean boost) - Specified by:
setTagBoost
in interfaceTagFeatureRateLimit
- Overrides:
setTagBoost
in classTagBase
-
setBoost
-
removeTag
public void removeTag() -
getDescription
- Specified by:
getDescription
in interfaceTag
- Overrides:
getDescription
in classTagBase
-