Package com.biglybt.core.tag.impl
Class TagBase
java.lang.Object
com.biglybt.core.tag.impl.TagBase
- All Implemented Interfaces:
Tag
,DataSourceResolver.ExportableDataSource
,SimpleTimer.TimerTickReceiver
,Tag
- Direct Known Subclasses:
CategoryImpl
,OpenTorrentOptionsWindow.DiscoveredTag
,SpeedLimitHandler.PeerSet.TagPeerImpl
,TagWithState
public abstract class TagBase
extends Object
implements Tag, SimpleTimer.TimerTickReceiver, DataSourceResolver.ExportableDataSource
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
private int[]
private long[]
private String
private static final String[]
private long
private String
private long[]
private static final int
private int
private boolean
private boolean
private int
private Boolean
private boolean
private Boolean
private final Map
<TagListener, TagListener> private long[]
private long[]
private long[]
private long[]
private final ListenerManager
<TagListener> private TagFeatureFileLocation
private final int
private TagFeatureLimits
private String
private TagFeatureRateLimit
private TagFeatureRSSFeed
(package private) final TagTypeBase
private boolean
private static final int
private static final int
private static final int
private long[]
private long[]
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
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
TagBase
(TagTypeBase _tag_type, int _tag_id, String _tag_name) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(TagListener listener) protected void
addTag()
void
void
addTaggableBatch
(boolean starts) void
addTagListener
(TagListener listener, boolean fire_for_existing) void
boolean
protected void
protected void
closing()
protected TagFeatureProperties.TagProperty
createTagProperty
(String name, int type) private int[]
protected void
destroy()
private String
encodeRGB
(int[] rgb) void
generate
(IndentWriter writer) int
protected boolean
int[]
getColor()
long[]
boolean
boolean
getFlag
(long flag) getGroup()
int
protected TagManagerImpl
int
int
int
boolean
int
int
boolean
getProperty
(String name) protected boolean
int[][]
int
boolean
int
getTag()
int
boolean
long
long[]
long
getTaggableAddedTime
(Taggable taggble) int
getTagID()
Unique ID within this tag typelong
int
int
boolean
int
int
int
long
long
long
getTagName
(boolean localize) protected String
long[]
protected long[]
private long[]
long[]
protected long[]
private long[]
Unique type denoting this species of taglong
Unique across tag types and can be used to lookup by TagManager::lookuptagByUIDlong[]
getTransientProperty
(String property) protected boolean
int
protected void
boolean
isActionEnabled
(int action) boolean
boolean
boolean
isPublic()
boolean[]
boolean
boolean
boolean
private void
private void
protected Boolean
readBooleanAttribute
(String attr, Boolean def) protected Long
readLongAttribute
(String attr, Long def) protected long[]
readLongListAttribute
(String attr, long[] def) readMapAttribute
(String attr, Map<String, Object> def) protected String
readStringAttribute
(String attr, String def) protected String[]
readStringListAttribute
(String attr, String[] def) void
removeListener
(TagListener listener) void
void
void
removeTagListener
(TagListener listener) void
void
void
private void
private void
void
setActionEnabled
(int action, boolean enabled) void
setActionScript
(String script) void
setAutoApplySortInterval
(int secs) void
setCanBePublic
(boolean can_be_public) void
setColor
(int[] rgb) void
setColors
(long[] params) void
setDescription
(String str) void
setFirstPrioritySeeding
(boolean priority) void
setFlag
(long flag, boolean value) void
void
setImageFile
(String id) void
setImageID
(String id) void
setImageSortOrder
(int order) void
setMaxActiveDownloads
(int max) void
setMaxActiveSeeds
(int max) void
setMaximumTaggables
(int max) void
setNotFirstPrioritySeeding
(boolean priority) void
setNotifyMessageChannel
(String channel) void
setOrdering
(int id) void
setPostingNotifications
(int flags) void
setPostMessageChannel
(String channel) void
setPreventDelete
(boolean b) void
setPublic
(boolean v) void
setRecentHistoryRetention
(boolean required) void
setRemovalStrategy
(int id) void
setStrictActivityLimits
(boolean b) void
setTagAssigns
(List<Tag> tags) void
setTagBoost
(boolean boost) void
setTagCopyOnCompleteFolder
(File folder) void
setTagCopyOnCompleteOptions
(long options) void
setTagInitialSaveFolder
(File folder) void
setTagInitialSaveOptions
(long options) void
setTagMaxAggregateShareRatio
(int sr) void
setTagMaxAggregateShareRatioAction
(int action) void
setTagMaxAggregateShareRatioHasPriority
(boolean priority) void
setTagMaxShareRatio
(int sr) void
setTagMaxShareRatioAction
(int action) void
setTagMinShareRatio
(int sr) void
setTagMoveOnAssignFolder
(File folder) void
setTagMoveOnAssignOptions
(long options) void
setTagMoveOnCompleteFolder
(File folder) void
setTagMoveOnCompleteOptions
(long options) void
setTagMoveOnRemoveFolder
(File folder) void
setTagMoveOnRemoveOptions
(long options) void
setTagName
(String name) void
setTagRemoves
(List<Tag> tags) void
setTagRSSFeedEnabled
(boolean enable) void
setTransientProperty
(String property, Object value) void
setVisible
(boolean v) void
setWeight
(int weight) boolean
supportsAction
(int action) boolean
boolean
boolean
boolean
boolean
protected void
sync()
void
tick
(long mono_now, int count) protected boolean
writeBooleanAttribute
(String attr, Boolean value) protected boolean
writeLongAttribute
(String attr, long value) protected boolean
writeLongListAttribute
(String attr, long[] value) protected void
writeMapAttribute
(String attr, Map<String, Object> value) protected boolean
writeStringAttribute
(String attr, String value) protected boolean
writeStringListAttribute
(String attr, String[] value) 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
dependsOnTags, getStatus, getTaggableTypes, getTagged, getTaggedCount, hasTaggable, isHiddenWhenEmpty, setHiddenWhenEmpty
-
Field Details
-
AT_RATELIMIT_UP
- See Also:
-
AT_RATELIMIT_DOWN
- See Also:
-
AT_VISIBLE
- See Also:
-
AT_PUBLIC
- See Also:
-
AT_FLAGS
- See Also:
-
AT_GROUP
- See Also:
-
AT_CAN_BE_PUBLIC
- See Also:
-
AT_ORIGINAL_NAME
- See Also:
-
AT_IMAGE_ID
- See Also:
-
AT_IMAGE_FILE
- See Also:
-
AT_IMAGE_SORT_ORDER
- See Also:
-
AT_COLOR_ID
- See Also:
-
AT_COLORS_ID
- See Also:
-
AT_RSS_ENABLE
- See Also:
-
AT_RATELIMIT_UP_PRI
- See Also:
-
AT_XCODE_TARGET
- See Also:
-
AT_FL_PREVENT_DELETE
- See Also:
-
AT_FL_MOVE_COMP
- See Also:
-
AT_FL_MOVE_COMP_OPT
- See Also:
-
AT_FL_MOVE_REM
- See Also:
-
AT_FL_MOVE_REM_OPT
- See Also:
-
AT_FL_COPY_COMP
- See Also:
-
AT_FL_COPY_COMP_OPT
- See Also:
-
AT_FL_INIT_LOC
- See Also:
-
AT_FL_INIT_LOC_OPT
- See Also:
-
AT_FL_MOVE_ASSIGN
- See Also:
-
AT_FL_MOVE_ASSIGN_OPT
- See Also:
-
AT_RATELIMIT_MIN_SR
- See Also:
-
AT_RATELIMIT_MAX_SR
- See Also:
-
AT_RATELIMIT_MAX_SR_ACTION
- See Also:
-
AT_RATELIMIT_MAX_AGGREGATE_SR
- See Also:
-
AT_RATELIMIT_MAX_AGGREGATE_SR_ACTION
- See Also:
-
AT_RATELIMIT_MAX_AGGREGATE_SR_PRIORITY
- See Also:
-
AT_RATELIMIT_FP_SEEDING
- See Also:
-
AT_RATELIMIT_NOT_FP_SEEDING
- See Also:
-
AT_RATELIMIT_BOOST
- See Also:
-
AT_RATELIMIT_MAX_ACTIVE_DL
- See Also:
-
AT_RATELIMIT_MAX_ACTIVE_CD
- See Also:
-
AT_RATELIMIT_ACTIVE_LIMITS_STRICT
- See Also:
-
AT_PROPERTY_PREFIX
- See Also:
-
AT_BYTES_UP
- See Also:
-
AT_BYTES_DOWN
- See Also:
-
AT_DESCRIPTION
- See Also:
-
AT_MAX_TAGGABLES
- See Also:
-
AT_REMOVAL_STRATEGY
- See Also:
-
AT_EOS_SCRIPT
- See Also:
-
AT_EOS_OPTIONS_TEMPLATE
- See Also:
-
AT_EOS_PM
- See Also:
-
AT_NOTIFICATION_POST
- See Also:
-
AT_NOTIFICATION_PUBLISH
- See Also:
-
AT_LIMIT_ORDERING
- See Also:
-
AT_EOS_ASSIGN_TAGS
- See Also:
-
AT_EOS_REMOVE_TAGS
- See Also:
-
AT_AUTO_APPLY_SORT_INTERVAL
- See Also:
-
AT_WEIGHT
- See Also:
-
EMPTY_STRING_LIST
-
tag_type
-
tag_id
private final int tag_id -
tag_name
-
TL_ADD
private static final int TL_ADD- See Also:
-
TL_REMOVE
private static final int TL_REMOVE- See Also:
-
TL_SYNC
private static final int TL_SYNC- See Also:
-
t_listeners
-
listener_map
-
is_visible
-
is_public
-
flags
private long flags -
group
-
colour
private int[] colour -
colours
private long[] colours -
description
-
image_sort_order
private int image_sort_order -
tag_rl
-
tag_rss
-
tag_fl
-
tag_limits
-
transient_properties
-
is_removed
private boolean is_removed -
session_cache
-
total_up_at_start
private long[] total_up_at_start -
total_down_at_start
private long[] total_down_at_start -
session_up
private long[] session_up -
session_down
private long[] session_down -
session_up_reset
private long[] session_up_reset -
session_down_reset
private long[] session_down_reset -
HISTORY_MAX_SECS
private static final int HISTORY_MAX_SECS- See Also:
-
history_retention_required
private volatile boolean history_retention_required -
history
private long[] history -
history_pos
private int history_pos -
history_wrapped
private boolean history_wrapped -
timer_registered
private boolean timer_registered
-
-
Constructor Details
-
TagBase
-
-
Method Details
-
initialized
protected void initialized() -
exportDataSource
- Specified by:
exportDataSource
in interfaceDataSourceResolver.ExportableDataSource
-
getTag
-
addTag
protected void addTag() -
getManager
-
getTagType
Description copied from interface:Tag
Unique type denoting this species of tag- Specified by:
getTagType
in interfaceTag
- Returns:
-
getTagID
public int getTagID()Description copied from interface:Tag
Unique ID within this tag type -
getTagUID
public long getTagUID()Description copied from interface:Tag
Unique across tag types and can be used to lookup by TagManager::lookuptagByUID -
getTagName
- Specified by:
getTagName
in interfaceTag
-
getTagNameRaw
-
getTagName
- Specified by:
getTagName
in interfaceTag
-
setTagName
- Specified by:
setTagName
in interfaceTag
- Throws:
TagException
-
isPublic
public boolean isPublic() -
setPublic
public void setPublic(boolean v) -
getPublicDefault
protected boolean getPublicDefault() -
setCanBePublic
public void setCanBePublic(boolean can_be_public) - Specified by:
setCanBePublic
in interfaceTag
-
canBePublic
public boolean canBePublic()- Specified by:
canBePublic
in interfaceTag
-
getCanBePublicDefault
protected boolean getCanBePublicDefault() -
setFlag
public void setFlag(long flag, boolean value) -
getFlag
public boolean getFlag(long flag) -
isTagAuto
public boolean[] isTagAuto() -
isVisible
public boolean isVisible() -
setVisible
public void setVisible(boolean v) - Specified by:
setVisible
in interfaceTag
-
getGroup
-
setGroup
-
getGroupContainer
- Specified by:
getGroupContainer
in interfaceTag
-
getVisibleDefault
protected boolean getVisibleDefault() -
getImageID
- Specified by:
getImageID
in interfaceTag
-
setImageID
- Specified by:
setImageID
in interfaceTag
-
getImageFile
- Specified by:
getImageFile
in interfaceTag
-
setImageFile
- Specified by:
setImageFile
in interfaceTag
-
setImageSortOrder
public void setImageSortOrder(int order) - Specified by:
setImageSortOrder
in interfaceTag
-
getImageSortOrder
public int getImageSortOrder()- Specified by:
getImageSortOrder
in interfaceTag
-
decodeRGB
-
encodeRGB
-
isColorDefault
public boolean isColorDefault()- Specified by:
isColorDefault
in interfaceTag
-
getColor
public int[] getColor() -
setColor
public void setColor(int[] rgb) -
getColors
public long[] getColors() -
setColors
public void setColors(long[] params) -
isTagRSSFeedEnabled
public boolean isTagRSSFeedEnabled() -
setTagRSSFeedEnabled
public void setTagRSSFeedEnabled(boolean enable) -
getPreventDelete
public boolean getPreventDelete() -
setPreventDelete
public void setPreventDelete(boolean b) -
getTagBoost
public boolean getTagBoost() -
setTagBoost
public void setTagBoost(boolean boost) -
getMaxActiveDownloads
public int getMaxActiveDownloads() -
setMaxActiveDownloads
public void setMaxActiveDownloads(int max) -
getMaxActiveSeeds
public int getMaxActiveSeeds() -
setMaxActiveSeeds
public void setMaxActiveSeeds(int max) -
getStrictActivityLimits
public boolean getStrictActivityLimits() -
setStrictActivityLimits
public void setStrictActivityLimits(boolean b) -
supportsTagInitialSaveFolder
public boolean supportsTagInitialSaveFolder() -
getTagInitialSaveFolder
-
setTagInitialSaveFolder
-
getTagInitialSaveOptions
public long getTagInitialSaveOptions() -
setTagInitialSaveOptions
public void setTagInitialSaveOptions(long options) -
supportsTagMoveOnComplete
public boolean supportsTagMoveOnComplete() -
getTagMoveOnCompleteFolder
-
setTagMoveOnCompleteFolder
-
getTagMoveOnCompleteOptions
public long getTagMoveOnCompleteOptions() -
setTagMoveOnCompleteOptions
public void setTagMoveOnCompleteOptions(long options) -
supportsTagCopyOnComplete
public boolean supportsTagCopyOnComplete() -
getTagCopyOnCompleteFolder
-
setTagCopyOnCompleteFolder
-
getTagCopyOnCompleteOptions
public long getTagCopyOnCompleteOptions() -
setTagCopyOnCompleteOptions
public void setTagCopyOnCompleteOptions(long options) -
supportsTagMoveOnRemove
public boolean supportsTagMoveOnRemove() -
getTagMoveOnRemoveFolder
-
setTagMoveOnRemoveFolder
-
getTagMoveOnRemoveOptions
public long getTagMoveOnRemoveOptions() -
setTagMoveOnRemoveOptions
public void setTagMoveOnRemoveOptions(long options) -
supportsTagMoveOnAssign
public boolean supportsTagMoveOnAssign() -
getTagMoveOnAssignFolder
-
setTagMoveOnAssignFolder
-
getTagMoveOnAssignOptions
public long getTagMoveOnAssignOptions() -
setTagMoveOnAssignOptions
public void setTagMoveOnAssignOptions(long options) -
getFirstPrioritySeeding
public boolean getFirstPrioritySeeding() -
setFirstPrioritySeeding
public void setFirstPrioritySeeding(boolean priority) -
getNotFirstPrioritySeeding
public boolean getNotFirstPrioritySeeding() -
setNotFirstPrioritySeeding
public void setNotFirstPrioritySeeding(boolean priority) -
getMaximumTaggables
public int getMaximumTaggables() -
setMaximumTaggables
public void setMaximumTaggables(int max) -
checkMaximumTaggables
protected void checkMaximumTaggables() -
getRemovalStrategy
public int getRemovalStrategy() -
setRemovalStrategy
public void setRemovalStrategy(int id) -
getOrdering
public int getOrdering() -
setOrdering
public void setOrdering(int id) -
getSupportedProperties
-
getProperty
-
createTagProperty
-
getSupportedActions
public int getSupportedActions() -
supportsAction
public boolean supportsAction(int action) -
isAnyActionEnabled
public boolean isAnyActionEnabled() -
isActionEnabled
public boolean isActionEnabled(int action) -
setActionEnabled
public void setActionEnabled(int action, boolean enabled) -
getActionScript
-
setActionScript
-
getPostMessageChannel
-
setPostMessageChannel
-
getOptionsTemplateHandler
-
getAutoApplySortInterval
public int getAutoApplySortInterval() -
setAutoApplySortInterval
public void setAutoApplySortInterval(int secs) -
applySort
public void applySort() -
getWeight
public int getWeight() -
setWeight
public void setWeight(int weight) -
getPostingNotifications
public int getPostingNotifications() -
setPostingNotifications
public void setPostingNotifications(int flags) -
getNotifyMessageChannel
-
setNotifyMessageChannel
-
getTagAssigns
-
setTagAssigns
-
getTagRemoves
-
setTagRemoves
-
getPropertiesString
-
getEOAString
-
addTaggableBatch
public void addTaggableBatch(boolean starts) - Specified by:
addTaggableBatch
in interfaceTag
-
addTaggable
- Specified by:
addTaggable
in interfaceTag
-
removeTaggable
- Specified by:
removeTaggable
in interfaceTag
-
sync
protected void sync() -
closing
protected void closing() -
removeTag
public void removeTag() -
isTagRemoved
public boolean isTagRemoved()- Specified by:
isTagRemoved
in interfaceTag
-
getDescription
- Specified by:
getDescription
in interfaceTag
-
setDescription
- Specified by:
setDescription
in interfaceTag
-
setTransientProperty
- Specified by:
setTransientProperty
in interfaceTag
-
getTransientProperty
- Specified by:
getTransientProperty
in interfaceTag
-
addTagListener
- Specified by:
addTagListener
in interfaceTag
-
destroy
protected void destroy() -
removeTagListener
- Specified by:
removeTagListener
in interfaceTag
-
getTaggables
- Specified by:
getTaggables
in interfaceTag
-
requestAttention
public void requestAttention()- Specified by:
requestAttention
in interfaceTag
-
addListener
- Specified by:
addListener
in interfaceTag
-
removeListener
- Specified by:
removeListener
in interfaceTag
-
readBooleanAttribute
-
writeBooleanAttribute
-
readLongAttribute
-
writeLongAttribute
-
readStringAttribute
-
writeStringAttribute
- Returns:
- Whether attribute was changed from existing value
-
readMapAttribute
-
writeMapAttribute
-
readStringListAttribute
-
writeStringListAttribute
-
readLongListAttribute
-
writeLongListAttribute
-
loadTransientStuff
private void loadTransientStuff() -
saveTransientStuff
private void saveTransientStuff() -
loadPersistentStuff
private void loadPersistentStuff() -
savePersistentStuff
private void savePersistentStuff() -
getTagUploadTotal
public long[] getTagUploadTotal() -
getTagSessionUploadTotal
public long[] getTagSessionUploadTotal() -
resetTagSessionUploadTotal
public void resetTagSessionUploadTotal() -
getTagSessionUploadTotalRaw
private long[] getTagSessionUploadTotalRaw() -
getTagSessionUploadTotalCurrent
protected long[] getTagSessionUploadTotalCurrent() -
getTagDownloadTotal
public long[] getTagDownloadTotal() -
getTagSessionDownloadTotal
public long[] getTagSessionDownloadTotal() -
resetTagSessionDownloadTotal
public void resetTagSessionDownloadTotal() -
getTagSessionDownloadTotalRaw
private long[] getTagSessionDownloadTotalRaw() -
getTagSessionDownloadTotalCurrent
protected long[] getTagSessionDownloadTotalCurrent() -
setRecentHistoryRetention
public void setRecentHistoryRetention(boolean required) -
getRecentHistory
public int[][] getRecentHistory() -
getTaggableAddedTime
- Specified by:
getTaggableAddedTime
in interfaceTag
-
tick
public void tick(long mono_now, int count) - Specified by:
tick
in interfaceSimpleTimer.TimerTickReceiver
-
getVuzeFile
- Specified by:
getVuzeFile
in interfaceTag
-
generate
-