Package com.biglybt.core.category.impl
Class CategoryManagerImpl
- java.lang.Object
-
- com.biglybt.core.tag.impl.TagTypeBase
-
- com.biglybt.core.category.impl.CategoryManagerImpl
-
- All Implemented Interfaces:
CategoryListener
,TagListener
,TagType
,TrackerWebPageGenerator
,RSSGeneratorPlugin.Provider
public class CategoryManagerImpl extends TagTypeBase implements RSSGeneratorPlugin.Provider, CategoryListener
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.biglybt.core.tag.impl.TagTypeBase
TagTypeBase.TagGroupImpl
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
ALL_NAME
private CategoryImpl
catAll
private java.util.Map<java.lang.String,CategoryImpl>
categories
private AEMonitor
categories_mon
private ListenerManager
category_listeners
private static CategoryManagerImpl
catMan
private CategoryImpl
catUncategorized
private static AEMonitor
class_mon
private static int[]
color_default
private java.util.concurrent.atomic.AtomicInteger
dms_with_cats
private boolean
doneLoading
private static int
LDT_CATEGORY_ADDED
private static int
LDT_CATEGORY_CHANGED
private static int
LDT_CATEGORY_REMOVED
private static java.lang.String
PROVIDER
private static java.lang.String
UNCAT_NAME
-
Fields inherited from class com.biglybt.core.tag.impl.TagTypeBase
AT_COLOR_ID
-
Fields inherited from interface com.biglybt.core.tag.TagType
TT_DOWNLOAD_CATEGORY, TT_DOWNLOAD_INTERNAL, TT_DOWNLOAD_MANUAL, TT_DOWNLOAD_STATE, TT_PEER_IPSET, TT_TAG_SUGGESTION
-
-
Constructor Summary
Constructors Modifier Constructor Description private
CategoryManagerImpl()
-
Method Summary
-
Methods inherited from class com.biglybt.core.tag.impl.TagTypeBase
addTag, addTagListener, addTagType, addTagTypeListener, closing, createTag, fireChanged, fireMembershipChanged, fireMetadataChanged, generate, generateConfig, getResolver, getTag, getTag, getTagGroup, getTagManager, getTagsForTaggable, getTagType, getTagTypeFeatures, getTagTypeName, hasTagTypeFeature, isTagTypeAuto, isTagTypePersistent, readBooleanAttribute, readLongAttribute, readLongListAttribute, readMapAttribute, readStringAttribute, readStringListAttribute, removeTag, removeTaggable, removeTagListener, removeTagType, removeTagTypeListener, requestAttention, resolveTaggable, setTagGroup, taggableAdded, taggableRemoved, taggableSync, writeBooleanAttribute, writeLongAttribute, writeLongListAttribute, writeMapAttribute, writeStringAttribute, writeStringListAttribute
-
-
-
-
Field Detail
-
color_default
private static final int[] color_default
-
PROVIDER
private static final java.lang.String PROVIDER
- See Also:
- Constant Field Values
-
UNCAT_NAME
private static final java.lang.String UNCAT_NAME
- See Also:
- Constant Field Values
-
ALL_NAME
private static final java.lang.String ALL_NAME
- See Also:
- Constant Field Values
-
catMan
private static CategoryManagerImpl catMan
-
class_mon
private static final AEMonitor class_mon
-
catAll
private CategoryImpl catAll
-
catUncategorized
private CategoryImpl catUncategorized
-
doneLoading
private boolean doneLoading
-
categories
private final java.util.Map<java.lang.String,CategoryImpl> categories
-
categories_mon
private final AEMonitor categories_mon
-
dms_with_cats
private final java.util.concurrent.atomic.AtomicInteger dms_with_cats
-
LDT_CATEGORY_ADDED
private static final int LDT_CATEGORY_ADDED
- See Also:
- Constant Field Values
-
LDT_CATEGORY_REMOVED
private static final int LDT_CATEGORY_REMOVED
- See Also:
- Constant Field Values
-
LDT_CATEGORY_CHANGED
private static final int LDT_CATEGORY_CHANGED
- See Also:
- Constant Field Values
-
category_listeners
private final ListenerManager category_listeners
-
-
Method Detail
-
addCategoryManagerListener
public void addCategoryManagerListener(CategoryManagerListener l)
-
removeCategoryManagerListener
public void removeCategoryManagerListener(CategoryManagerListener l)
-
getInstance
public static CategoryManagerImpl getInstance()
-
loadCategories
protected void loadCategories()
-
saveCategories
protected void saveCategories(Category category)
-
saveCategories
protected void saveCategories()
-
createCategory
public Category createCategory(java.lang.String name)
-
removeCategory
public void removeCategory(Category category)
-
getCategories
public Category[] getCategories()
-
getCategory
public CategoryImpl getCategory(java.lang.String name)
-
getCategory
public Category getCategory(int type)
-
makeSpecialCategories
private void makeSpecialCategories()
-
downloadManagerAdded
public void downloadManagerAdded(Category cat, DownloadManager manager)
Description copied from interface:CategoryListener
A DownloadManager has been added to a Category- Specified by:
downloadManagerAdded
in interfaceCategoryListener
- Parameters:
cat
- Category that the DownloadManager has been added tomanager
- DownloadManager that was added
-
downloadManagerRemoved
public void downloadManagerRemoved(Category cat, DownloadManager manager)
Description copied from interface:CategoryListener
A DownloadManager has been removed from a Category- Specified by:
downloadManagerRemoved
in interfaceCategoryListener
- Parameters:
cat
- Category that the DownloadManager was removed frommanager
- The DownloadManager that was removed
-
getCategorisedDownloadCount
public int getCategorisedDownloadCount()
-
getColorDefault
public int[] getColorDefault()
- Specified by:
getColorDefault
in interfaceTagType
- Overrides:
getColorDefault
in classTagTypeBase
-
getTagCount
public int getTagCount()
- Specified by:
getTagCount
in interfaceTagType
-
sync
protected void sync()
- Overrides:
sync
in classTagTypeBase
-
checkConfig
private void checkConfig()
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabled
in interfaceRSSGeneratorPlugin.Provider
-
generate
public boolean generate(TrackerWebPageRequest request, TrackerWebPageResponse response) throws java.io.IOException
- Specified by:
generate
in interfaceTrackerWebPageGenerator
- Returns:
- true if the request was handled
- Throws:
java.io.IOException
-
getDisplayName
private java.lang.String getDisplayName(CategoryImpl c)
-
getAddedTime
protected long getAddedTime(Download download)
-
escape
protected java.lang.String escape(java.lang.String str)
-
-