Package com.biglybt.core.tag.impl
Class TagManagerImpl
java.lang.Object
com.biglybt.core.tag.impl.TagManagerImpl
- All Implemented Interfaces:
TagManager
,AEDiagnosticsEvidenceGenerator
,DataSourceResolver.DataSourceImporter
,DownloadCompletionListener
public class TagManagerImpl
extends Object
implements TagManager, DownloadCompletionListener, AEDiagnosticsEvidenceGenerator, DataSourceResolver.DataSourceImporter
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final Set<DownloadManager>
(package private) final AsyncDispatcher
private TagPropertyTrackerHandler
private boolean
private static final String
private WeakReference<Map<String,
Object>> private TagPropertyConstraintHandler
private static final int
private static final int
private static final int
private static final int
private final FrequencyLimitedDispatcher
private static final boolean
private final CopyOnWriteList<Object[]>
private boolean
private static Object
private final Map<Long,
TagManagerImpl.LifecycleHandlerImpl> private final CopyOnWriteList<TagManagerListener>
(package private) final AsyncDispatcher
private final RSSGeneratorPlugin.Provider
private static final String
private static TagManagerImpl
(package private) final CopyOnWriteList<TagTypeBase>
private TagPropertyUntaggedHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addConfigUpdate
(int type, TagWithState tag) void
addTagFeatureListener
(int features, TagFeatureListener listener) void
addTaggableLifecycleListener
(long taggable_type, TaggableLifecycleListener listener) void
addTagManagerListener
(TagManagerListener listener, boolean fire_for_existing) void
addTagType
(TagTypeBase tag_type) private void
applyConfigUpdates
(Map config) protected void
checkRSSFeeds
(TagBase tag, boolean enable) compileConstraint
(String expression) private void
destroy()
protected Object
evalScript
(Tag tag, String script, List<DownloadManager> dms, String intent_key) protected String[]
explain
(Tag tag, TagFeatureProperties.TagProperty property, Taggable taggable) exportTags
(List<Tag> tags) protected void
featureChanged
(Tag tag, int feature) void
generate
(IndentWriter writer) void
generate
(IndentWriter writer, TagTypeBase tag_type) void
generate
(IndentWriter writer, TagTypeBase tag_type, TagBase tag) getConf
(TagTypeBase tag_type, boolean create) getConf
(TagTypeBase tag_type, TagBase tag, boolean create) getDependsOnTags
(Tag tag) getResolver
(long taggable_type) static TagManagerImpl
boolean
getTagsByName
(String name, boolean is_localized) getTagsForTaggable
(int[] tts, Taggable taggable) getTagsForTaggable
(int tag_type, Taggable taggable) getTagsForTaggable
(Taggable taggable) protected String
getTagStatus
(Tag tag) getTagType
(int tag_type) getVuzeFile
(TagBase tag) importDataSource
(Map map) private Tag
importVuzeFile
(Map content) private void
init()
private void
boolean
private void
loadTags
(TagTypeWithState tt_with_state) lookupTagByUID
(long tag_uid) lookupTagsByName
(String tag_name) private void
moveOnAssign
(DownloadManager dm, File location, long options) void
Called when a download enters a complete state (previously being incomplete).protected Boolean
readBooleanAttribute
(TagTypeBase tag_type, TagBase tag, String attr, Boolean def) private Map
protected Long
readLongAttribute
(TagTypeBase tag_type, TagBase tag, String attr, Long def) protected long[]
readLongListAttribute
(TagTypeBase tag_type, TagBase tag, String attr, long[] def) readMapAttribute
(TagTypeBase tag_type, TagBase tag, String attr, Map<String, Object> def) protected String
readStringAttribute
(TagTypeBase tag_type, TagBase tag, String attr, String def) protected String[]
readStringListAttribute
(TagTypeBase tag_type, TagBase tag, String attr, String[] def) registerTaggableResolver
(TaggableResolver resolver) protected void
removeConfig
(Tag tag) protected void
removeConfig
(TagType tag_type) void
removeTagFeatureListener
(TagFeatureListener listener) private void
removeTaggable
(TaggableResolver resolver, Taggable taggable) void
removeTaggableLifecycleListener
(long taggable_type, TaggableLifecycleListener listener) void
removeTagManagerListener
(TagManagerListener listener) protected void
removeTagType
(TagTypeBase tag_type) private void
resolverInitialized
(TaggableResolver resolver) protected void
private void
setDirty()
void
setProcessingEnabled
(boolean enabled) void
setTagPublicDefault
(boolean pub) protected void
tagChanged
(TagWithState tag) protected void
protected void
tagCreated
(TagWithState tag) void
taggableAdded
(TagType tag_type, Tag tag, Taggable tagged) void
taggableRemoved
(TagType tag_type, Tag tag, Taggable tagged) protected void
tagGroupCreated
(TagTypeBase tag_type, TagTypeBase.TagGroupImpl group, TagTypeBase.TagGroupImpl old_group) protected void
tagGroupDeleted
(TagTypeBase tag_type, TagTypeBase.TagGroupImpl group) protected void
tagGroupRenamed
(TagTypeBase tag_type, TagTypeBase.TagGroupImpl old_group, TagTypeBase.TagGroupImpl new_group) protected void
tagGroupUpdated
(TagTypeBase tag_type, TagTypeBase.TagGroupImpl group) protected void
tagRemoved
(TagWithState tag) protected boolean
writeBooleanAttribute
(TagTypeBase tag_type, TagBase tag, String attr, Boolean value) private void
protected boolean
writeLongAttribute
(TagTypeBase tag_type, TagBase tag, String attr, Long value) protected boolean
writeLongListAttribute
(TagTypeBase tag_type, TagBase tag, String attr, long[] value) protected void
writeMapAttribute
(TagTypeBase tag_type, TagBase tag, String attr, Map<String, Object> value) protected boolean
writeStringAttribute
(TagTypeBase tag_type, TagBase tag, String attr, String value) protected boolean
writeStringListAttribute
(TagTypeBase tag_type, TagBase tag, String attr, String[] value)
-
Field Details
-
CONFIG_FILE
- See Also:
-
CU_TAG_CREATE
private static final int CU_TAG_CREATE- See Also:
-
CU_TAG_CHANGE
private static final int CU_TAG_CHANGE- See Also:
-
CU_TAG_CONTENTS
private static final int CU_TAG_CONTENTS- See Also:
-
CU_TAG_REMOVE
private static final int CU_TAG_REMOVE- See Also:
-
enabled
private static final boolean enabled -
singleton
-
KEY_TG_COLUMNS
-
tag_types
-
tag_type_map
-
RSS_PROVIDER
- See Also:
-
rss_tags
-
active_copy_on_complete
-
rss_generator
-
async_dispatcher
-
move_on_assign_dispatcher
-
dirty_dispatcher
-
config
-
config_ref
-
config_dirty
private boolean config_dirty -
config_change_queue
-
listeners
-
feature_listeners
-
lifecycle_handlers
-
auto_tracker
-
untagged_handler
-
constraint_handler
-
js_plugin_install_tried
private boolean js_plugin_install_tried
-
-
Constructor Details
-
TagManagerImpl
private TagManagerImpl()
-
-
Method Details
-
getSingleton
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceTagManager
-
init
private void init() -
setProcessingEnabled
public void setProcessingEnabled(boolean enabled) - Specified by:
setProcessingEnabled
in interfaceTagManager
-
onCompletion
Description copied from interface:DownloadCompletionListener
Called when a download enters a complete state (previously being incomplete).- Specified by:
onCompletion
in interfaceDownloadCompletionListener
- Parameters:
d
- Download which has been completed.
-
evalScript
-
loadTags
-
initializeSwarmTags
private void initializeSwarmTags() -
resolverInitialized
-
removeTaggable
-
addTagType
-
getTagType
- Specified by:
getTagType
in interfaceTagManager
-
removeTagType
-
getTagTypes
- Specified by:
getTagTypes
in interfaceTagManager
-
taggableAdded
-
moveOnAssign
-
taggableRemoved
-
getTagsForTaggable
- Specified by:
getTagsForTaggable
in interfaceTagManager
-
getTagsForTaggable
- Specified by:
getTagsForTaggable
in interfaceTagManager
-
getTagsForTaggable
- Specified by:
getTagsForTaggable
in interfaceTagManager
-
getTagsByName
- Specified by:
getTagsByName
in interfaceTagManager
-
lookupTagByUID
- Specified by:
lookupTagByUID
in interfaceTagManager
-
lookupTagsByName
- Specified by:
lookupTagsByName
in interfaceTagManager
-
importDataSource
- Specified by:
importDataSource
in interfaceDataSourceResolver.DataSourceImporter
-
registerTaggableResolver
- Specified by:
registerTaggableResolver
in interfaceTagManager
-
setTagPublicDefault
public void setTagPublicDefault(boolean pub) - Specified by:
setTagPublicDefault
in interfaceTagManager
-
getTagPublicDefault
public boolean getTagPublicDefault()- Specified by:
getTagPublicDefault
in interfaceTagManager
-
tagGroupCreated
protected void tagGroupCreated(TagTypeBase tag_type, TagTypeBase.TagGroupImpl group, TagTypeBase.TagGroupImpl old_group) -
tagGroupUpdated
-
tagGroupDeleted
-
tagGroupRenamed
protected void tagGroupRenamed(TagTypeBase tag_type, TagTypeBase.TagGroupImpl old_group, TagTypeBase.TagGroupImpl new_group) -
checkRSSFeeds
-
getTagStatus
-
getDependsOnTags
-
addTagManagerListener
- Specified by:
addTagManagerListener
in interfaceTagManager
-
removeTagManagerListener
- Specified by:
removeTagManagerListener
in interfaceTagManager
-
addTagFeatureListener
- Specified by:
addTagFeatureListener
in interfaceTagManager
-
removeTagFeatureListener
- Specified by:
removeTagFeatureListener
in interfaceTagManager
-
featureChanged
-
getResolver
-
addTaggableLifecycleListener
- Specified by:
addTaggableLifecycleListener
in interfaceTagManager
-
removeTaggableLifecycleListener
- Specified by:
removeTaggableLifecycleListener
in interfaceTagManager
-
tagCreated
-
tagChanged
-
tagRemoved
-
tagContentsChanged
-
addConfigUpdate
-
applyConfigUpdates
-
destroy
private void destroy() -
setDirty
private void setDirty() -
readConfig
-
getConfig
-
writeConfig
private void writeConfig() -
getConf
-
getConf
-
setConf
-
readBooleanAttribute
-
writeBooleanAttribute
protected boolean writeBooleanAttribute(TagTypeBase tag_type, TagBase tag, String attr, Boolean value) -
readLongAttribute
-
writeLongAttribute
-
readStringAttribute
-
writeStringAttribute
protected boolean writeStringAttribute(TagTypeBase tag_type, TagBase tag, String attr, String value) - Returns:
- Whether attribute was changed from existing value
-
readMapAttribute
-
writeMapAttribute
-
readStringListAttribute
protected String[] readStringListAttribute(TagTypeBase tag_type, TagBase tag, String attr, String[] def) -
writeStringListAttribute
protected boolean writeStringListAttribute(TagTypeBase tag_type, TagBase tag, String attr, String[] value) -
readLongListAttribute
-
writeLongListAttribute
protected boolean writeLongListAttribute(TagTypeBase tag_type, TagBase tag, String attr, long[] value) -
removeConfig
-
removeConfig
-
importVuzeFile
-
getVuzeFile
-
compileConstraint
- Specified by:
compileConstraint
in interfaceTagManager
-
exportTags
- Specified by:
exportTags
in interfaceTagManager
-
duplicate
- Specified by:
duplicate
in interfaceTagManager
-
explain
-
generate
- Specified by:
generate
in interfaceAEDiagnosticsEvidenceGenerator
-
generate
-
generate
-