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
  • Field Details

  • Constructor Details

    • TagBase

      protected TagBase(TagTypeBase _tag_type, int _tag_id, String _tag_name)
  • Method Details

    • initialized

      protected void initialized()
    • exportDataSource

      public DataSourceResolver.ExportedDataSource exportDataSource()
      Specified by:
      exportDataSource in interface DataSourceResolver.ExportableDataSource
    • getTag

      public Tag getTag()
    • addTag

      protected void addTag()
    • getManager

      protected TagManagerImpl getManager()
    • getTagType

      public TagTypeBase getTagType()
      Description copied from interface: Tag
      Unique type denoting this species of tag
      Specified by:
      getTagType in interface Tag
      Returns:
    • getTagID

      public int getTagID()
      Description copied from interface: Tag
      Unique ID within this tag type
      Specified by:
      getTagID in interface Tag
      Returns:
    • getTagUID

      public long getTagUID()
      Description copied from interface: Tag
      Unique across tag types and can be used to lookup by TagManager::lookuptagByUID
      Specified by:
      getTagUID in interface Tag
      Returns:
    • getTagName

      public String getTagName()
      Specified by:
      getTagName in interface Tag
    • getTagNameRaw

      protected String getTagNameRaw()
    • getTagName

      public String getTagName(boolean localize)
      Specified by:
      getTagName in interface Tag
    • setTagName

      public void setTagName(String name) throws TagException
      Specified by:
      setTagName in interface Tag
      Throws:
      TagException
    • isPublic

      public boolean isPublic()
      Specified by:
      isPublic in interface Tag
    • setPublic

      public void setPublic(boolean v)
      Specified by:
      setPublic in interface Tag
    • getPublicDefault

      protected boolean getPublicDefault()
    • setCanBePublic

      public void setCanBePublic(boolean can_be_public)
      Specified by:
      setCanBePublic in interface Tag
    • canBePublic

      public boolean canBePublic()
      Specified by:
      canBePublic in interface Tag
    • getCanBePublicDefault

      protected boolean getCanBePublicDefault()
    • setFlag

      public void setFlag(long flag, boolean value)
      Specified by:
      setFlag in interface Tag
    • getFlag

      public boolean getFlag(long flag)
      Specified by:
      getFlag in interface Tag
    • isTagAuto

      public boolean[] isTagAuto()
      Specified by:
      isTagAuto in interface Tag
      Returns:
      [ auto_add, auto_remove, auto_new_download_only (tag constraint) ]
    • isVisible

      public boolean isVisible()
      Specified by:
      isVisible in interface Tag
    • setVisible

      public void setVisible(boolean v)
      Specified by:
      setVisible in interface Tag
    • getGroup

      public String getGroup()
      Specified by:
      getGroup in interface Tag
    • setGroup

      public void setGroup(String new_group)
      Specified by:
      setGroup in interface Tag
    • getGroupContainer

      public TagGroup getGroupContainer()
      Specified by:
      getGroupContainer in interface Tag
    • getVisibleDefault

      protected boolean getVisibleDefault()
    • getImageID

      public String getImageID()
      Specified by:
      getImageID in interface Tag
    • setImageID

      public void setImageID(String id)
      Specified by:
      setImageID in interface Tag
    • getImageFile

      public String getImageFile()
      Specified by:
      getImageFile in interface Tag
    • setImageFile

      public void setImageFile(String id)
      Specified by:
      setImageFile in interface Tag
    • setImageSortOrder

      public void setImageSortOrder(int order)
      Specified by:
      setImageSortOrder in interface Tag
    • getImageSortOrder

      public int getImageSortOrder()
      Specified by:
      getImageSortOrder in interface Tag
    • decodeRGB

      private int[] decodeRGB(String str)
    • encodeRGB

      private String encodeRGB(int[] rgb)
    • isColorDefault

      public boolean isColorDefault()
      Specified by:
      isColorDefault in interface Tag
    • getColor

      public int[] getColor()
      Specified by:
      getColor in interface Tag
    • setColor

      public void setColor(int[] rgb)
      Specified by:
      setColor in interface Tag
    • getColors

      public long[] getColors()
      Specified by:
      getColors in interface Tag
    • setColors

      public void setColors(long[] params)
      Specified by:
      setColors in interface Tag
    • 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

      public File getTagInitialSaveFolder()
    • setTagInitialSaveFolder

      public void setTagInitialSaveFolder(File folder)
    • getTagInitialSaveOptions

      public long getTagInitialSaveOptions()
    • setTagInitialSaveOptions

      public void setTagInitialSaveOptions(long options)
    • supportsTagMoveOnComplete

      public boolean supportsTagMoveOnComplete()
    • getTagMoveOnCompleteFolder

      public File getTagMoveOnCompleteFolder()
    • setTagMoveOnCompleteFolder

      public void setTagMoveOnCompleteFolder(File folder)
    • getTagMoveOnCompleteOptions

      public long getTagMoveOnCompleteOptions()
    • setTagMoveOnCompleteOptions

      public void setTagMoveOnCompleteOptions(long options)
    • supportsTagCopyOnComplete

      public boolean supportsTagCopyOnComplete()
    • getTagCopyOnCompleteFolder

      public File getTagCopyOnCompleteFolder()
    • setTagCopyOnCompleteFolder

      public void setTagCopyOnCompleteFolder(File folder)
    • getTagCopyOnCompleteOptions

      public long getTagCopyOnCompleteOptions()
    • setTagCopyOnCompleteOptions

      public void setTagCopyOnCompleteOptions(long options)
    • supportsTagMoveOnRemove

      public boolean supportsTagMoveOnRemove()
    • getTagMoveOnRemoveFolder

      public File getTagMoveOnRemoveFolder()
    • setTagMoveOnRemoveFolder

      public void setTagMoveOnRemoveFolder(File folder)
    • getTagMoveOnRemoveOptions

      public long getTagMoveOnRemoveOptions()
    • setTagMoveOnRemoveOptions

      public void setTagMoveOnRemoveOptions(long options)
    • supportsTagMoveOnAssign

      public boolean supportsTagMoveOnAssign()
    • getTagMoveOnAssignFolder

      public File getTagMoveOnAssignFolder()
    • setTagMoveOnAssignFolder

      public void setTagMoveOnAssignFolder(File folder)
    • getTagMoveOnAssignOptions

      public long getTagMoveOnAssignOptions()
    • setTagMoveOnAssignOptions

      public void setTagMoveOnAssignOptions(long options)
    • getTagMinShareRatio

      public int getTagMinShareRatio()
    • setTagMinShareRatio

      public void setTagMinShareRatio(int sr)
    • getTagMaxShareRatio

      public int getTagMaxShareRatio()
    • setTagMaxShareRatio

      public void setTagMaxShareRatio(int sr)
    • getTagMaxShareRatioAction

      public int getTagMaxShareRatioAction()
    • setTagMaxShareRatioAction

      public void setTagMaxShareRatioAction(int action)
    • getTagAggregateShareRatio

      public int getTagAggregateShareRatio()
    • getTagMaxAggregateShareRatio

      public int getTagMaxAggregateShareRatio()
    • setTagMaxAggregateShareRatio

      public void setTagMaxAggregateShareRatio(int sr)
    • getTagMaxAggregateShareRatioAction

      public int getTagMaxAggregateShareRatioAction()
    • setTagMaxAggregateShareRatioAction

      public void setTagMaxAggregateShareRatioAction(int action)
    • getTagMaxAggregateShareRatioHasPriority

      public boolean getTagMaxAggregateShareRatioHasPriority()
    • setTagMaxAggregateShareRatioHasPriority

      public void setTagMaxAggregateShareRatioHasPriority(boolean priority)
    • getFirstPrioritySeeding

      public boolean getFirstPrioritySeeding()
    • setFirstPrioritySeeding

      public void setFirstPrioritySeeding(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

      public TagFeatureProperties.TagProperty[] getSupportedProperties()
    • getProperty

      public TagFeatureProperties.TagProperty getProperty(String name)
    • createTagProperty

      protected TagFeatureProperties.TagProperty createTagProperty(String name, int type)
    • 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

      public String getActionScript()
    • setActionScript

      public void setActionScript(String script)
    • getPostMessageChannel

      public String getPostMessageChannel()
    • setPostMessageChannel

      public void setPostMessageChannel(String channel)
    • getOptionsTemplateHandler

      public TagFeatureExecOnAssign.OptionsTemplateHandler 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

      public String getNotifyMessageChannel()
    • setNotifyMessageChannel

      public void setNotifyMessageChannel(String channel)
    • getTagAssigns

      public List<Tag> getTagAssigns()
    • setTagAssigns

      public void setTagAssigns(List<Tag> tags)
    • getTagRemoves

      public List<Tag> getTagRemoves()
    • setTagRemoves

      public void setTagRemoves(List<Tag> tags)
    • getPropertiesString

      public String getPropertiesString()
    • getEOAString

      public String getEOAString()
    • addTaggableBatch

      public void addTaggableBatch(boolean starts)
      Specified by:
      addTaggableBatch in interface Tag
    • addTaggable

      public void addTaggable(Taggable t)
      Specified by:
      addTaggable in interface Tag
    • removeTaggable

      public void removeTaggable(Taggable t)
      Specified by:
      removeTaggable in interface Tag
    • sync

      protected void sync()
    • closing

      protected void closing()
    • removeTag

      public void removeTag()
      Specified by:
      removeTag in interface Tag
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface Tag
    • setDescription

      public void setDescription(String str)
      Specified by:
      setDescription in interface Tag
    • setTransientProperty

      public void setTransientProperty(String property, Object value)
      Specified by:
      setTransientProperty in interface Tag
    • getTransientProperty

      public Object getTransientProperty(String property)
      Specified by:
      getTransientProperty in interface Tag
    • addTagListener

      public void addTagListener(TagListener listener, boolean fire_for_existing)
      Specified by:
      addTagListener in interface Tag
    • destroy

      protected void destroy()
    • removeTagListener

      public void removeTagListener(TagListener listener)
      Specified by:
      removeTagListener in interface Tag
    • getTaggables

      public List<Taggable> getTaggables()
      Specified by:
      getTaggables in interface Tag
    • requestAttention

      public void requestAttention()
      Specified by:
      requestAttention in interface Tag
    • addListener

      public void addListener(TagListener listener)
      Specified by:
      addListener in interface Tag
    • removeListener

      public void removeListener(TagListener listener)
      Specified by:
      removeListener in interface Tag
    • readBooleanAttribute

      protected Boolean readBooleanAttribute(String attr, Boolean def)
    • writeBooleanAttribute

      protected boolean writeBooleanAttribute(String attr, Boolean value)
    • readLongAttribute

      protected Long readLongAttribute(String attr, Long def)
    • writeLongAttribute

      protected boolean writeLongAttribute(String attr, long value)
    • readStringAttribute

      protected String readStringAttribute(String attr, String def)
    • writeStringAttribute

      protected boolean writeStringAttribute(String attr, String value)
      Returns:
      Whether attribute was changed from existing value
    • readMapAttribute

      protected Map<String,Object> readMapAttribute(String attr, Map<String,Object> def)
    • writeMapAttribute

      protected void writeMapAttribute(String attr, Map<String,Object> value)
    • readStringListAttribute

      protected String[] readStringListAttribute(String attr, String[] def)
    • writeStringListAttribute

      protected boolean writeStringListAttribute(String attr, String[] value)
    • readLongListAttribute

      protected long[] readLongListAttribute(String attr, long[] def)
    • writeLongListAttribute

      protected boolean writeLongListAttribute(String attr, long[] value)
    • 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

      public long getTaggableAddedTime(Taggable taggble)
      Specified by:
      getTaggableAddedTime in interface Tag
    • tick

      public void tick(long mono_now, int count)
      Specified by:
      tick in interface SimpleTimer.TimerTickReceiver
    • getVuzeFile

      public VuzeFile getVuzeFile()
      Specified by:
      getVuzeFile in interface Tag
    • generate

      public void generate(IndentWriter writer)