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
Fields Modifier and Type Field Description private java.util.Set<PEPeer>
added_peers
private java.lang.Object
BOOSTED_KEY
private SpeedLimitHandler.PeerSet
ip_set
private java.util.Set<PEPeer>
pending_peers
private int
upload_priority
private java.lang.Object
UPLOAD_PRIORITY_ADDED_KEY
-
Fields inherited from class com.biglybt.core.tag.impl.TagBase
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_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_BOOST, AT_RATELIMIT_DOWN, AT_RATELIMIT_FP_SEEDING, 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_UP, AT_RATELIMIT_UP_PRI, AT_REMOVAL_STRATEGY, AT_RSS_ENABLE, AT_VISIBLE, AT_XCODE_TARGET
-
Fields inherited from interface com.biglybt.core.tag.Tag
FL_IS_FILTER, 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_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 Modifier Constructor Description private
TagPeerImpl(SpeedLimitHandler.PeerSet _ip_set, int tag_id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
add(PeerManager peer_manager, Peer _peer)
void
addTaggable(Taggable t)
private int
canAdd(PEPeer peer)
private int
canAddASN(PEPeer peer, java.util.regex.Pattern asn_pattern)
private int
canAddClient(PEPeer peer, java.util.regex.Pattern client_pattern)
private int
canAddIntf(PEPeer peer, java.util.regex.Pattern intf_pattern)
private boolean
deferEOS()
private void
deferredRemove(PEPeer peer)
boolean
getCanBePublicDefault()
java.lang.String
getDescription()
int
getSupportedActions()
int
getTagCurrentDownloadRate()
int
getTagCurrentUploadRate()
int
getTagDownloadLimit()
int
getTaggableTypes()
java.util.Set<Taggable>
getTagged()
int
getTaggedCount()
java.util.List<PEPeer>
getTaggedPeers()
protected long[]
getTagSessionDownloadTotalCurrent()
protected long[]
getTagSessionUploadTotalCurrent()
int
getTagUploadLimit()
int
getTagUploadPriority()
boolean
hasTaggable(Taggable t)
private void
remove(PeerManager peer_manager, Peer _peer)
private void
removeAll()
void
removeTag()
void
removeTaggable(Taggable t)
void
setActionEnabled(int action, boolean enabled)
private void
setBoost(PEPeer pe_peer, boolean boost)
void
setColor(int[] rgb)
void
setTagBoost(boolean boost)
void
setTagDownloadLimit(int bps)
void
setTagUploadLimit(int bps)
void
setTagUploadPriority(int priority)
boolean
supportsTagDownloadLimit()
boolean
supportsTagRates()
boolean
supportsTagUploadLimit()
private void
update(int tick_count)
-
Methods inherited from class com.biglybt.core.tag.impl.TagBase
addListener, addTag, addTagListener, canBePublic, checkMaximumTaggables, closing, createTagProperty, destroy, exportDataSource, generate, getActionScript, getColor, getColors, getFirstPrioritySeeding, getFlag, getGroup, getGroupContainer, getImageFile, getImageID, getImageSortOrder, getManager, getMaxActiveDownloads, getMaximumTaggables, getNotifyMessageChannel, getOptionsTemplateHandler, getOrdering, getPostingNotifications, getPostMessageChannel, getPreventDelete, getProperty, getPublicDefault, getRecentHistory, getRemovalStrategy, 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, getTagSessionDownloadTotal, getTagSessionUploadTotal, getTagType, getTagUID, getTagUploadTotal, getTransientProperty, getVisibleDefault, getVuzeFile, initialized, isActionEnabled, isAnyActionEnabled, isColorDefault, isPublic, isTagAuto, isTagRSSFeedEnabled, isVisible, readBooleanAttribute, readLongAttribute, readLongListAttribute, readMapAttribute, readStringAttribute, readStringListAttribute, removeListener, removeTagListener, requestAttention, resetTagSessionDownloadTotal, resetTagSessionUploadTotal, setActionScript, setCanBePublic, setColors, setDescription, setFirstPrioritySeeding, setFlag, setGroup, setImageFile, setImageID, setImageSortOrder, setMaxActiveDownloads, setMaximumTaggables, setNotifyMessageChannel, setOrdering, setPostingNotifications, setPostMessageChannel, setPreventDelete, setPublic, setRecentHistoryRetention, setRemovalStrategy, setTagAssigns, setTagCopyOnCompleteFolder, setTagCopyOnCompleteOptions, setTagInitialSaveFolder, setTagInitialSaveOptions, setTagMaxAggregateShareRatio, setTagMaxAggregateShareRatioAction, setTagMaxAggregateShareRatioHasPriority, setTagMaxShareRatio, setTagMaxShareRatioAction, setTagMinShareRatio, setTagMoveOnAssignFolder, setTagMoveOnAssignOptions, setTagMoveOnCompleteFolder, setTagMoveOnCompleteOptions, setTagMoveOnRemoveFolder, setTagMoveOnRemoveOptions, setTagName, setTagRSSFeedEnabled, setTransientProperty, setVisible, 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.tag.Tag
addTagListener, canBePublic, dependsOnTags, getColor, getColors, getFlag, getGroup, getGroupContainer, getImageFile, getImageID, getImageSortOrder, getStatus, getTaggableAddedTime, getTagID, getTagName, getTagType, getTagUID, getTransientProperty, getVuzeFile, isColorDefault, isPublic, isTagAuto, isVisible, removeTagListener, requestAttention, setCanBePublic, setColors, setDescription, setFlag, setGroup, 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, getOptionsTemplateHandler, getPostMessageChannel, getTagAssigns, isActionEnabled, isAnyActionEnabled, setActionScript, setPostMessageChannel, setTagAssigns, supportsAction
-
Methods inherited from interface com.biglybt.core.tag.TagFeatureRateLimit
getFirstPrioritySeeding, getMaxActiveDownloads, getRecentHistory, getTagAggregateShareRatio, getTagBoost, getTagDownloadTotal, getTagMaxAggregateShareRatio, getTagMaxAggregateShareRatioAction, getTagMaxAggregateShareRatioHasPriority, getTagMaxShareRatio, getTagMaxShareRatioAction, getTagMinShareRatio, getTagSessionDownloadTotal, getTagSessionUploadTotal, getTagUploadTotal, resetTagSessionDownloadTotal, resetTagSessionUploadTotal, setFirstPrioritySeeding, setMaxActiveDownloads, setRecentHistoryRetention, setTagMaxAggregateShareRatio, setTagMaxAggregateShareRatioAction, setTagMaxAggregateShareRatioHasPriority, setTagMaxShareRatio, setTagMaxShareRatioAction, setTagMinShareRatio
-
-
-
-
Field Detail
-
ip_set
private final SpeedLimitHandler.PeerSet ip_set
-
UPLOAD_PRIORITY_ADDED_KEY
private final java.lang.Object UPLOAD_PRIORITY_ADDED_KEY
-
BOOSTED_KEY
private final java.lang.Object BOOSTED_KEY
-
upload_priority
private int upload_priority
-
added_peers
private final java.util.Set<PEPeer> added_peers
-
pending_peers
private final java.util.Set<PEPeer> pending_peers
-
-
Constructor Detail
-
TagPeerImpl
private TagPeerImpl(SpeedLimitHandler.PeerSet _ip_set, int tag_id)
-
-
Method Detail
-
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
private void deferredRemove(PEPeer peer)
-
canAdd
private int canAdd(PEPeer peer)
- Parameters:
peer
-- Returns:
- 0=defer, 1=yes, 2=no, 3=remove
-
canAddClient
private int canAddClient(PEPeer peer, java.util.regex.Pattern client_pattern)
-
canAddIntf
private int canAddIntf(PEPeer peer, java.util.regex.Pattern intf_pattern)
-
canAddASN
private int canAddASN(PEPeer peer, java.util.regex.Pattern asn_pattern)
-
add
private void add(PeerManager peer_manager, Peer _peer)
-
remove
private void remove(PeerManager peer_manager, Peer _peer)
-
removeAll
private void removeAll()
-
addTaggable
public void addTaggable(Taggable t)
- Specified by:
addTaggable
in interfaceTag
- Overrides:
addTaggable
in classTagBase
-
removeTaggable
public void removeTaggable(Taggable t)
- Specified by:
removeTaggable
in interfaceTag
- Overrides:
removeTaggable
in classTagBase
-
getTaggedCount
public int getTaggedCount()
- Specified by:
getTaggedCount
in interfaceTag
-
getTaggedPeers
public java.util.List<PEPeer> getTaggedPeers()
- Specified by:
getTaggedPeers
in interfaceTagPeer
-
hasTaggable
public boolean hasTaggable(Taggable t)
- 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
private void setBoost(PEPeer pe_peer, boolean boost)
-
removeTag
public void removeTag()
-
getDescription
public java.lang.String getDescription()
- Specified by:
getDescription
in interfaceTag
- Overrides:
getDescription
in classTagBase
-
-