Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.proxy
Class AnnouncementManagerProxy

java.lang.Object
  extended by com.jivesoftware.forum.proxy.AnnouncementManagerProxy
All Implemented Interfaces:
AnnouncementManager

public class AnnouncementManagerProxy
extends java.lang.Object
implements AnnouncementManager

Proxy class for AnnouncementManager objects.


Constructor Summary
AnnouncementManagerProxy(AnnouncementManager manager, AuthToken authToken, Permissions permissions)
          Creates a new AnnouncementManager to protect the supplied manager with the specified permissions.
 
Method Summary
 void addAnnouncement(Announcement announcement)
          Adds an an announcement to the database.
 Announcement createAnnouncement(User user)
          Creates a new system announcement.
 Announcement createAnnouncement(User user, Forum forum)
          Creates a new forum announcement.
 Announcement createAnnouncement(User user, ForumCategory category)
          Creates a new category announcement.
 void deleteAnnouncement(Announcement announcement)
          Deletes an announcement.
 Announcement getAnnouncement(long announcementID)
          Returns an announcement by announcement ID.
 int getAnnouncementCount(java.lang.Object container)
          Returns the count of all currently viewable announcements in a container.
 int getAnnouncementCount(java.lang.Object container, java.util.Date startDate, java.util.Date endDate)
          Returns the count of all announcements in a container that are viewable within the specified date range.
 java.util.Iterator getAnnouncements(java.lang.Object container)
          Returns all currently viewable announcements in a container.
 java.util.Iterator getAnnouncements(java.lang.Object container, java.util.Date startDate, java.util.Date endDate)
          Returns the announcements in a container that are viewable within a specified date range.If container is null then system announcements will be returned.
 int getRecursiveAnnouncementCount(ForumCategory category)
          Returns the count of all currently viewable announcements in a ForumCategory and its child Forums and SubCategories.
 java.util.Iterator getRecursiveAnnouncements(ForumCategory category, int startIndex, int numResults)
          Returns all currently viewable announcements in a ForumCategory and its child Forums and SubCategories.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnouncementManagerProxy

public AnnouncementManagerProxy(AnnouncementManager manager,
                                AuthToken authToken,
                                Permissions permissions)
Creates a new AnnouncementManager to protect the supplied manager with the specified permissions.

Method Detail

createAnnouncement

public Announcement createAnnouncement(User user)
                                throws UnauthorizedException
Description copied from interface: AnnouncementManager
Creates a new system announcement. After an announcement is created and the appropriate values are set, it must be added to the database by calling the AnnouncementManager.addAnnouncement(Announcement) method.

Specified by:
createAnnouncement in interface AnnouncementManager
Parameters:
user - the user creating the announcement.
Returns:
a new Announcement.
Throws:
UnauthorizedException - if not allowed to create a system annoucement.

createAnnouncement

public Announcement createAnnouncement(User user,
                                       ForumCategory category)
                                throws UnauthorizedException
Description copied from interface: AnnouncementManager
Creates a new category announcement. After an announcement is created and the appropriate values are set, it must be added to the database by calling the AnnouncementManager.addAnnouncement(Announcement) method.

Specified by:
createAnnouncement in interface AnnouncementManager
Parameters:
user - the user creating the announcement.
category - the category to add the announcement to.
Returns:
a new Announcement.
Throws:
UnauthorizedException - if not allowed to create a system annoucement.

createAnnouncement

public Announcement createAnnouncement(User user,
                                       Forum forum)
                                throws UnauthorizedException
Description copied from interface: AnnouncementManager
Creates a new forum announcement. After an announcement is created and the appropriate values are set, it must be added to the database by calling the AnnouncementManager.addAnnouncement(Announcement) method.

Specified by:
createAnnouncement in interface AnnouncementManager
Parameters:
user - the user creating the announcement.
forum - the forum to add the announcement to.
Returns:
a new Announcement.
Throws:
UnauthorizedException - if not allowed to create a system annoucement.

addAnnouncement

public void addAnnouncement(Announcement announcement)
                     throws UnauthorizedException
Description copied from interface: AnnouncementManager
Adds an an announcement to the database. This method must be called after the announcement is created and all appropriate values on it have been set. After this method is called, the announcement will be immediately viewable to others (assuming the start date permits this).

Specified by:
addAnnouncement in interface AnnouncementManager
Parameters:
announcement - the announcement to add to the database.
Throws:
UnauthorizedException - if not allowed to create a system annoucement.

getAnnouncement

public Announcement getAnnouncement(long announcementID)
                             throws AnnouncementNotFoundException,
                                    UnauthorizedException
Description copied from interface: AnnouncementManager
Returns an announcement by announcement ID.

Specified by:
getAnnouncement in interface AnnouncementManager
Parameters:
announcementID - the ID of the announcement to return.
Returns:
the announcement.
Throws:
AnnouncementNotFoundException - if the announcement could not be loaded or does not exist.
UnauthorizedException - if not allowed to get the announcement.

getAnnouncementCount

public int getAnnouncementCount(java.lang.Object container)
Description copied from interface: AnnouncementManager
Returns the count of all currently viewable announcements in a container. If container is null than the count of system announcements will be returned. Otherwise, the container should be a ForumCategory or Forum object.

Specified by:
getAnnouncementCount in interface AnnouncementManager
Parameters:
container - a forum, category, or null for system announcements.
Returns:
the count of all currently viewable announcements in the container.

getRecursiveAnnouncementCount

public int getRecursiveAnnouncementCount(ForumCategory category)
Description copied from interface: AnnouncementManager
Returns the count of all currently viewable announcements in a ForumCategory and its child Forums and SubCategories. If the category is null then the count of all announcements in the system will be returned, including System Announcements.

Specified by:
getRecursiveAnnouncementCount in interface AnnouncementManager
Parameters:
category - a category, or null for system announcements.
Returns:
the recursive count of all currently viewable announcements in the category and its children.

getAnnouncementCount

public int getAnnouncementCount(java.lang.Object container,
                                java.util.Date startDate,
                                java.util.Date endDate)
Description copied from interface: AnnouncementManager
Returns the count of all announcements in a container that are viewable within the specified date range. If container is null than the count of system announcements will be returned. Otherwise, the container should be a ForumCategory or Forum object. If startDate or endDate are null than the date range will be unbounded in that direction. For example, to get a count of all announcements regardless of starting and ending dates, pass in null as the value for both parameters.

Specified by:
getAnnouncementCount in interface AnnouncementManager
Parameters:
container - a forum, category, or null for system announcements.
startDate - the start date of announcements, or null to leave this value unbounded.
endDate - the end date of announcements, or null to leave this value unbounded.
Returns:
the count of all announcements in the container that are viewable within the specified date range.

getAnnouncements

public java.util.Iterator getAnnouncements(java.lang.Object container)
Description copied from interface: AnnouncementManager
Returns all currently viewable announcements in a container. If container is null than system announcements will be returned. Otherwise, the container should be a ForumCategory or Forum object.

Specified by:
getAnnouncements in interface AnnouncementManager
Parameters:
container - a forum, category, or null for system announcements.
Returns:
the count of all currently viewable announcements in the container.

getAnnouncements

public java.util.Iterator getAnnouncements(java.lang.Object container,
                                           java.util.Date startDate,
                                           java.util.Date endDate)
Description copied from interface: AnnouncementManager
Returns the announcements in a container that are viewable within a specified date range.If container is null then system announcements will be returned. Otherwise, the container should be a ForumCategory or Forum object. If startDate or endDate are null than the date range will be unbounded in that direction. For example, to get all announcements regardless of starting and ending dates, pass in null as the value for both parameters.

Specified by:
getAnnouncements in interface AnnouncementManager
Parameters:
container - a forum, category, or null for system announcements.
startDate - the start date of announcements, or null to leave this value unbounded.
endDate - the end date of announcements, or null to leave this value unbounded.
Returns:
all announcements in the container that are viewable within the the specified date range.

getRecursiveAnnouncements

public java.util.Iterator getRecursiveAnnouncements(ForumCategory category,
                                                    int startIndex,
                                                    int numResults)
Description copied from interface: AnnouncementManager
Returns all currently viewable announcements in a ForumCategory and its child Forums and SubCategories. If the category is null then the all viewable announcements in the system will be returned, including the System Announcements.

Specified by:
getRecursiveAnnouncements in interface AnnouncementManager
Parameters:
category - a category, or null for system announcements.
Returns:
the recursive count of all currently viewable announcements in the category and its children.

deleteAnnouncement

public void deleteAnnouncement(Announcement announcement)
                        throws UnauthorizedException
Description copied from interface: AnnouncementManager
Deletes an announcement.

Specified by:
deleteAnnouncement in interface AnnouncementManager
Parameters:
announcement - the announcement to delete.
Throws:
UnauthorizedException - if not allowed to delete the announcement.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.