com.aelitis.azureus.core.tag.impl
Class TagBase

java.lang.Object
  extended by com.aelitis.azureus.core.tag.impl.TagBase
All Implemented Interfaces:
SimpleTimer.TimerTickReceiver, Tag
Direct Known Subclasses:
CategoryImpl, TagWithState

public abstract class TagBase
extends Object
implements Tag, SimpleTimer.TimerTickReceiver


Field Summary
protected static String AT_BYTES_DOWN
           
protected static String AT_BYTES_UP
           
protected static String AT_CAN_BE_PUBLIC
           
protected static String AT_COLOR_ID
           
protected static String AT_DESCRIPTION
           
protected static String AT_EOA_PREFIX
           
protected static String AT_EOS_SCRIPT
           
protected static String AT_FL_COPY_COMP
           
protected static String AT_FL_COPY_COMP_OPT
           
protected static String AT_FL_INIT_LOC
           
protected static String AT_FL_INIT_LOC_OPT
           
protected static String AT_FL_MOVE_COMP
           
protected static String AT_FL_MOVE_COMP_OPT
           
protected static String AT_GROUP
           
protected static String AT_IMAGE_ID
           
protected static String AT_LIMIT_ORDERING
           
protected static String AT_MAX_TAGGABLES
           
protected static String AT_NOTIFICATION_POST
           
protected static String AT_ORIGINAL_NAME
           
protected static String AT_PROPERTY_PREFIX
           
protected static String AT_PUBLIC
           
protected static String AT_RATELIMIT_DOWN
           
protected static String AT_RATELIMIT_MAX_AGGREGATE_SR
           
protected static String AT_RATELIMIT_MAX_AGGREGATE_SR_ACTION
           
protected static String AT_RATELIMIT_MAX_AGGREGATE_SR_PRIORITY
           
protected static String AT_RATELIMIT_MAX_SR
           
protected static String AT_RATELIMIT_MAX_SR_ACTION
           
protected static String AT_RATELIMIT_MIN_SR
           
protected static String AT_RATELIMIT_UP
           
protected static String AT_RATELIMIT_UP_PRI
           
protected static String AT_REMOVAL_STRATEGY
           
protected static String AT_RSS_ENABLE
           
protected static String AT_VISIBLE
           
protected static String AT_XCODE_TARGET
           
 
Fields inherited from interface com.aelitis.azureus.core.tag.Tag
TP_SETTINGS_REQUESTED
 
Constructor Summary
protected TagBase(TagTypeBase _tag_type, int _tag_id, String _tag_name)
           
 
Method Summary
 void addListener(TagListener listener)
           
protected  void addTag()
           
 void addTaggable(Taggable t)
           
 void addTagListener(TagListener listener, boolean fire_for_existing)
           
 boolean canBePublic()
           
protected  void checkMaximumTaggables()
           
protected  void closing()
           
protected  TagFeatureProperties.TagProperty createTagProperty(String name, int type)
           
protected  void destroy()
           
 void generate(IndentWriter writer)
           
 String getActionScript()
           
protected  boolean getCanBePublicDefault()
           
 int[] getColor()
           
 String getDescription()
           
 String getGroup()
           
 String getImageID()
           
protected  TagManagerImpl getManager()
           
 int getMaximumTaggables()
           
 int getOrdering()
           
 int getPostingNotifications()
           
 TagFeatureProperties.TagProperty getProperty(String name)
           
protected  boolean getPublicDefault()
           
 int[][] getRecentHistory()
           
 int getRemovalStrategy()
           
 int getSupportedActions()
           
 TagFeatureProperties.TagProperty[] getSupportedProperties()
           
 Tag getTag()
           
 int getTagAggregateShareRatio()
           
 File getTagCopyOnCompleteFolder()
           
 long getTagCopyOnCompleteOptions()
           
 long[] getTagDownloadTotal()
           
 long getTaggableAddedTime(Taggable taggble)
           
 List<Taggable> getTaggables()
           
 int getTagID()
          Unique ID within this tag type
 File getTagInitialSaveFolder()
           
 long getTagInitialSaveOptions()
           
 int getTagMaxAggregateShareRatio()
           
 int getTagMaxAggregateShareRatioAction()
           
 boolean getTagMaxAggregateShareRatioHasPriority()
           
 int getTagMaxShareRatio()
           
 int getTagMaxShareRatioAction()
           
 int getTagMinShareRatio()
           
 File getTagMoveOnCompleteFolder()
           
 long getTagMoveOnCompleteOptions()
           
 String getTagName()
           
 String getTagName(boolean localize)
           
protected  String getTagNameRaw()
           
 long[] getTagSessionDownloadTotal()
           
protected  long[] getTagSessionDownloadTotalCurrent()
           
 long[] getTagSessionUploadTotal()
           
protected  long[] getTagSessionUploadTotalCurrent()
           
 TagTypeBase getTagType()
          Unique type denoting this species of tag
 long getTagUID()
          Unique across tag types and can be used to lookup by TagManager::lookuptagByUID
 long[] getTagUploadTotal()
           
 Object getTransientProperty(String property)
           
protected  boolean getVisibleDefault()
           
protected  void initialized()
           
 boolean isActionEnabled(int action)
           
 boolean isColorDefault()
           
 boolean isPublic()
           
 boolean[] isTagAuto()
           
 boolean isTagRSSFeedEnabled()
           
 boolean isVisible()
           
protected  Boolean readBooleanAttribute(String attr, Boolean def)
           
protected  Long readLongAttribute(String attr, Long def)
           
protected  String readStringAttribute(String attr, String def)
           
protected  String[] readStringListAttribute(String attr, String[] def)
           
 void removeListener(TagListener listener)
           
 void removeTag()
           
 void removeTaggable(Taggable t)
           
 void removeTagListener(TagListener listener)
           
 void requestAttention()
           
 void resetTagSessionDownloadTotal()
           
 void resetTagSessionUploadTotal()
           
 void setActionEnabled(int action, boolean enabled)
           
 void setActionScript(String script)
           
 void setCanBePublic(boolean can_be_public)
           
 void setColor(int[] rgb)
           
 void setDescription(String str)
           
 void setGroup(String new_group)
           
 void setImageID(String id)
           
 void setMaximumTaggables(int max)
           
 void setOrdering(int id)
           
 void setPostingNotifications(int flags)
           
 void setPublic(boolean v)
           
 void setRecentHistoryRetention(boolean required)
           
 void setRemovalStrategy(int id)
           
 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 setTagMoveOnCompleteFolder(File folder)
           
 void setTagMoveOnCompleteOptions(long options)
           
 void setTagName(String name)
           
 void setTagRSSFeedEnabled(boolean enable)
           
 void setTransientProperty(String property, Object value)
           
 void setVisible(boolean v)
           
 boolean supportsAction(int action)
           
 boolean supportsTagCopyOnComplete()
           
 boolean supportsTagInitialSaveFolder()
           
 boolean supportsTagMoveOnComplete()
           
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  void 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.aelitis.azureus.core.tag.Tag
getTaggableTypes, getTagged, getTaggedCount, hasTaggable
 

Field Detail

AT_RATELIMIT_UP

protected static final String AT_RATELIMIT_UP
See Also:
Constant Field Values

AT_RATELIMIT_DOWN

protected static final String AT_RATELIMIT_DOWN
See Also:
Constant Field Values

AT_VISIBLE

protected static final String AT_VISIBLE
See Also:
Constant Field Values

AT_PUBLIC

protected static final String AT_PUBLIC
See Also:
Constant Field Values

AT_GROUP

protected static final String AT_GROUP
See Also:
Constant Field Values

AT_CAN_BE_PUBLIC

protected static final String AT_CAN_BE_PUBLIC
See Also:
Constant Field Values

AT_ORIGINAL_NAME

protected static final String AT_ORIGINAL_NAME
See Also:
Constant Field Values

AT_IMAGE_ID

protected static final String AT_IMAGE_ID
See Also:
Constant Field Values

AT_COLOR_ID

protected static final String AT_COLOR_ID
See Also:
Constant Field Values

AT_RSS_ENABLE

protected static final String AT_RSS_ENABLE
See Also:
Constant Field Values

AT_RATELIMIT_UP_PRI

protected static final String AT_RATELIMIT_UP_PRI
See Also:
Constant Field Values

AT_XCODE_TARGET

protected static final String AT_XCODE_TARGET
See Also:
Constant Field Values

AT_FL_MOVE_COMP

protected static final String AT_FL_MOVE_COMP
See Also:
Constant Field Values

AT_FL_MOVE_COMP_OPT

protected static final String AT_FL_MOVE_COMP_OPT
See Also:
Constant Field Values

AT_FL_COPY_COMP

protected static final String AT_FL_COPY_COMP
See Also:
Constant Field Values

AT_FL_COPY_COMP_OPT

protected static final String AT_FL_COPY_COMP_OPT
See Also:
Constant Field Values

AT_FL_INIT_LOC

protected static final String AT_FL_INIT_LOC
See Also:
Constant Field Values

AT_FL_INIT_LOC_OPT

protected static final String AT_FL_INIT_LOC_OPT
See Also:
Constant Field Values

AT_RATELIMIT_MIN_SR

protected static final String AT_RATELIMIT_MIN_SR
See Also:
Constant Field Values

AT_RATELIMIT_MAX_SR

protected static final String AT_RATELIMIT_MAX_SR
See Also:
Constant Field Values

AT_RATELIMIT_MAX_SR_ACTION

protected static final String AT_RATELIMIT_MAX_SR_ACTION
See Also:
Constant Field Values

AT_RATELIMIT_MAX_AGGREGATE_SR

protected static final String AT_RATELIMIT_MAX_AGGREGATE_SR
See Also:
Constant Field Values

AT_RATELIMIT_MAX_AGGREGATE_SR_ACTION

protected static final String AT_RATELIMIT_MAX_AGGREGATE_SR_ACTION
See Also:
Constant Field Values

AT_RATELIMIT_MAX_AGGREGATE_SR_PRIORITY

protected static final String AT_RATELIMIT_MAX_AGGREGATE_SR_PRIORITY
See Also:
Constant Field Values

AT_PROPERTY_PREFIX

protected static final String AT_PROPERTY_PREFIX
See Also:
Constant Field Values

AT_EOA_PREFIX

protected static final String AT_EOA_PREFIX
See Also:
Constant Field Values

AT_BYTES_UP

protected static final String AT_BYTES_UP
See Also:
Constant Field Values

AT_BYTES_DOWN

protected static final String AT_BYTES_DOWN
See Also:
Constant Field Values

AT_DESCRIPTION

protected static final String AT_DESCRIPTION
See Also:
Constant Field Values

AT_MAX_TAGGABLES

protected static final String AT_MAX_TAGGABLES
See Also:
Constant Field Values

AT_REMOVAL_STRATEGY

protected static final String AT_REMOVAL_STRATEGY
See Also:
Constant Field Values

AT_EOS_SCRIPT

protected static final String AT_EOS_SCRIPT
See Also:
Constant Field Values

AT_NOTIFICATION_POST

protected static final String AT_NOTIFICATION_POST
See Also:
Constant Field Values

AT_LIMIT_ORDERING

protected static final String AT_LIMIT_ORDERING
See Also:
Constant Field Values
Constructor Detail

TagBase

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

initialized

protected void initialized()

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

Returns:

getTagID

public int getTagID()
Description copied from interface: Tag
Unique ID within this tag type

Returns:

getTagUID

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

Returns:

getTagName

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

getTagNameRaw

protected String getTagNameRaw()

getTagName

public String getTagName(boolean localize)

setTagName

public void setTagName(String name)
                throws TagException
Throws:
TagException

isPublic

public boolean isPublic()

setPublic

public void setPublic(boolean v)

getPublicDefault

protected boolean getPublicDefault()

setCanBePublic

public void setCanBePublic(boolean can_be_public)

canBePublic

public boolean canBePublic()

getCanBePublicDefault

protected boolean getCanBePublicDefault()

isTagAuto

public boolean[] isTagAuto()
Returns:
[auto_add,auto_remove]

isVisible

public boolean isVisible()

setVisible

public void setVisible(boolean v)

getGroup

public String getGroup()

setGroup

public void setGroup(String new_group)

getVisibleDefault

protected boolean getVisibleDefault()

getImageID

public String getImageID()

setImageID

public void setImageID(String id)

isColorDefault

public boolean isColorDefault()

getColor

public int[] getColor()

setColor

public void setColor(int[] rgb)

isTagRSSFeedEnabled

public boolean isTagRSSFeedEnabled()

setTagRSSFeedEnabled

public void setTagRSSFeedEnabled(boolean enable)

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)

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)

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)

isActionEnabled

public boolean isActionEnabled(int action)

setActionEnabled

public void setActionEnabled(int action,
                             boolean enabled)

getActionScript

public String getActionScript()

setActionScript

public void setActionScript(String script)

getPostingNotifications

public int getPostingNotifications()

setPostingNotifications

public void setPostingNotifications(int flags)

addTaggable

public void addTaggable(Taggable t)

removeTaggable

public void removeTaggable(Taggable t)

sync

protected void sync()

closing

protected void closing()

removeTag

public void removeTag()

getDescription

public String getDescription()

setDescription

public void setDescription(String str)

setTransientProperty

public void setTransientProperty(String property,
                                 Object value)

getTransientProperty

public Object getTransientProperty(String property)

addTagListener

public void addTagListener(TagListener listener,
                           boolean fire_for_existing)

destroy

protected void destroy()

removeTagListener

public void removeTagListener(TagListener listener)

getTaggables

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

requestAttention

public void requestAttention()

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 void writeStringAttribute(String attr,
                                    String value)

readStringListAttribute

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

writeStringListAttribute

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

getTagUploadTotal

public long[] getTagUploadTotal()

getTagSessionUploadTotal

public long[] getTagSessionUploadTotal()

resetTagSessionUploadTotal

public void resetTagSessionUploadTotal()

getTagSessionUploadTotalCurrent

protected long[] getTagSessionUploadTotalCurrent()

getTagDownloadTotal

public long[] getTagDownloadTotal()

getTagSessionDownloadTotal

public long[] getTagSessionDownloadTotal()

resetTagSessionDownloadTotal

public void resetTagSessionDownloadTotal()

getTagSessionDownloadTotalCurrent

protected long[] getTagSessionDownloadTotalCurrent()

setRecentHistoryRetention

public void setRecentHistoryRetention(boolean required)

getRecentHistory

public int[][] getRecentHistory()

getTaggableAddedTime

public long getTaggableAddedTime(Taggable taggble)

tick

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

generate

public void generate(IndentWriter writer)