Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.database
Class DbTagManager

java.lang.Object
  extended by com.jivesoftware.forum.database.DbTagManager
All Implemented Interfaces:
JiveManager, TagManager

public class DbTagManager
extends java.lang.Object
implements TagManager

Database backed implementation of TagManager.

See Also:
TagManager, ContentTag

Method Summary
 void addTag(ContentTag tag, JiveContentObject contentObject)
          Associates a tag with this object
 ContentTag createTag(java.lang.String tagname)
          Creates a tag in the database.
 void destroy()
          Notifies the manager to release any resources that may be holding on too.
 java.lang.String[] getCategoryTags(ForumCategory forumCategory)
           
static DbTagManager getInstance()
           
 java.util.Iterator getPopularTags(ForumCategory forumCategory)
          Returns an iterable collection of popular tags based on the current community and tag set.
 ContentTag getTag(long tagID)
          Returns a tag given a tag ID.
 ContentTag getTag(java.lang.String tagname)
          Returns a tag by tag name.
 long getTagID(java.lang.String tagname)
          Checks cache for tagID, if it does find it, calls lookupTag(String tag), and caches and returns resulting tagID.
 DatabaseObjectIterator getTags(JiveContentObject contentObject)
          Return an Iterable for all the tags associated with this manager.
 void initialize()
          Initialize the manager.
 void removeAllTags(JiveContentObject contentObject)
          Disassociates this object with all tags.
 void removeTag(ContentTag tag, JiveContentObject contentObject)
          Disassociates this object with the given tag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

initialize

public void initialize()
Description copied from interface: JiveManager
Initialize the manager. It is within this method that it is ok to create, access and/or otherwise use external classes (including caches). Until this method is called implementation should not access any external classes that could possibly either access one of the main Factory classes or any caches since doing so can cause deadlocks and possible clustering issues during startup.

This method is used internally by Jive during application startup and should not be called during normal usage of the class.

Specified by:
initialize in interface JiveManager

getInstance

public static DbTagManager getInstance()

destroy

public void destroy()
Description copied from interface: JiveManager
Notifies the manager to release any resources that may be holding on too. This could also be used to clear out the managers caches, etc.

This method is used internally by Jive during application startup and should not be called during normal usage of the class.

Specified by:
destroy in interface JiveManager

getPopularTags

public java.util.Iterator getPopularTags(ForumCategory forumCategory)
Returns an iterable collection of popular tags based on the current community and tag set.

Specified by:
getPopularTags in interface TagManager
Returns:
an iterable collection of popular tags based on the current community and tag set.

getCategoryTags

public java.lang.String[] getCategoryTags(ForumCategory forumCategory)

getTag

public ContentTag getTag(java.lang.String tagname)
                  throws TagObjectNotFoundException
Description copied from interface: TagManager
Returns a tag by tag name.

Specified by:
getTag in interface TagManager
Parameters:
tagname - the name of the tag to lookup.
Returns:
the tag
Throws:
TagObjectNotFoundException - if no tag exists with that name.

getTag

public ContentTag getTag(long tagID)
                  throws TagObjectNotFoundException
Description copied from interface: TagManager
Returns a tag given a tag ID.

Specified by:
getTag in interface TagManager
Returns:
the tag
Throws:
TagObjectNotFoundException - if no tag exists with that ID.

getTagID

public long getTagID(java.lang.String tagname)
              throws TagObjectNotFoundException
Checks cache for tagID, if it does find it, calls lookupTag(String tag), and caches and returns resulting tagID.

Parameters:
tagname - the tag name to lookup the tagID for
Returns:
the tagID corresponding to the tag name
Throws:
TagObjectNotFoundException - if the tag isn't found

createTag

public ContentTag createTag(java.lang.String tagname)
Description copied from interface: TagManager
Creates a tag in the database.

Specified by:
createTag in interface TagManager
Parameters:
tagname - the name of the tag to create.
Returns:
the newly created tag.

addTag

public void addTag(ContentTag tag,
                   JiveContentObject contentObject)
Description copied from interface: TagManager
Associates a tag with this object

Specified by:
addTag in interface TagManager

removeTag

public void removeTag(ContentTag tag,
                      JiveContentObject contentObject)
Description copied from interface: TagManager
Disassociates this object with the given tag.

Specified by:
removeTag in interface TagManager
Parameters:
tag - the tag to remove from this object

removeAllTags

public void removeAllTags(JiveContentObject contentObject)
Description copied from interface: TagManager
Disassociates this object with all tags.

Specified by:
removeAllTags in interface TagManager

getTags

public DatabaseObjectIterator getTags(JiveContentObject contentObject)
Description copied from interface: TagManager
Return an Iterable for all the tags associated with this manager.

Specified by:
getTags in interface TagManager
Returns:
an Iterable for all tags associated with this manager.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.