Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.webservices.server
Class AnnouncementServiceImpl

java.lang.Object
  extended by com.jivesoftware.forum.webservices.server.AnnouncementServiceImpl
All Implemented Interfaces:
AnnouncementService

public class AnnouncementServiceImpl
extends java.lang.Object
implements AnnouncementService


Constructor Summary
AnnouncementServiceImpl()
           
 
Method Summary
 Announcement createForumAnnouncement(long userID, long forumID, java.lang.String subject, java.lang.String body, java.util.Date startDate, java.util.Date endDate)
          Creates a new category or forum announcement.
 Announcement createForumCategoryAnnouncement(long userID, long categoryID, java.lang.String subject, java.lang.String body, java.util.Date startDate, java.util.Date endDate)
          Creates a new category announcement.
 Announcement createNonExpiringForumAnnouncement(long userID, long forumID, java.lang.String subject, java.lang.String body, java.util.Date startDate)
          Creates a new non-expiring forum announcement.
 Announcement createNonExpiringForumCategoryAnnouncement(long userID, long categoryID, java.lang.String subject, java.lang.String body, java.util.Date startDate)
          Creates a new non-expiring category announcement.
 Announcement createNonExpiringSystemAnnouncement(long userID, java.lang.String subject, java.lang.String body, java.util.Date startDate)
          Creates a new non-expiring system announcement.
 Announcement createSystemAnnouncement(long userID, java.lang.String subject, java.lang.String body, java.util.Date startDate, java.util.Date endDate)
          Creates a new system announcement.
 void deleteAnnouncement(long announcementID)
          Deletes an announcement.
 void editAnnouncement(Announcement announcement)
          Updates an existing announcement.
 void expireAnnouncement(long announcementID)
          Expires an announcement.
 Announcement getAnnouncement(long announcementID)
          Returns an announcement by announcement ID.
 int getAnnouncementCount(int objectType, long objectID)
          Returns the count of all currently viewable announcements in a container.
 int getAnnouncementCount(int objectType, long objectID, 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.
 Announcement[] getAnnouncements(int objectType, long objectID)
          Returns all currently viewable announcements in a container.
 Announcement[] getAnnouncements(int objectType, long objectID, 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 than system announcements will be returned.
 int getForumAnnouncementCountWithFilter(long forumID, AnnouncementFilter filter)
          Returns the number of viewable announcements using the specified forumID and AnnouncementFilter.
 Announcement[] getForumAnnouncementsWithFilter(long forumID, AnnouncementFilter filter)
          Returns the viewable announcements using the specified forumID and AnnouncementFilter.
 int getRecursiveCategoryAnnouncementCount(long categoryID)
          Returns the number of viewable announcements recursively using the categoryID provided.
 int getRecursiveCategoryAnnouncementCountWithFilter(long categoryID, AnnouncementFilter filter)
          Returns the number of viewable announcements recursively using the specified categoryID and AnnouncementFilter.
 Announcement[] getRecursiveCategoryAnnouncements(long categoryID, int startIndex, int numResults)
          Returns the viewable announcements recursively using the categoryID provided.
 Announcement[] getRecursiveCategoryAnnouncementsWithFilter(long categoryID, AnnouncementFilter filter)
          Returns the viewable announcements recursively using the specified categoryID and AnnouncementFilter.
 int getSystemAnnouncementCountWithFilter(AnnouncementFilter filter)
          Returns the number of viewable system announcements using the specified AnnouncementFilter.
 Announcement[] getSystemAnnouncementsWithFilter(AnnouncementFilter filter)
          Returns the viewable system announcements using the specified AnnouncementFilter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnouncementServiceImpl

public AnnouncementServiceImpl()
Method Detail

createSystemAnnouncement

public Announcement createSystemAnnouncement(long userID,
                                             java.lang.String subject,
                                             java.lang.String body,
                                             java.util.Date startDate,
                                             java.util.Date endDate)
                                      throws UserNotFoundException,
                                             UnauthorizedException
Description copied from interface: AnnouncementService
Creates a new system announcement.

Specified by:
createSystemAnnouncement in interface AnnouncementService
Parameters:
userID - the ID of the user creating the announcement.
subject - the subject of the announcement.
body - the body of the announcement.
startDate - the start date for the announcement. Cannot be null.
endDate - the end date for the announcement. Cannot be null.
Returns:
a new Announcement.
Throws:
UnauthorizedException - if not allowed to create a system annoucement.
UserNotFoundException

createNonExpiringSystemAnnouncement

public Announcement createNonExpiringSystemAnnouncement(long userID,
                                                        java.lang.String subject,
                                                        java.lang.String body,
                                                        java.util.Date startDate)
                                                 throws UserNotFoundException,
                                                        UnauthorizedException
Description copied from interface: AnnouncementService
Creates a new non-expiring system announcement.

Specified by:
createNonExpiringSystemAnnouncement in interface AnnouncementService
Parameters:
userID - the ID of the user creating the announcement.
subject - the subject of the announcement.
body - the body of the announcement.
startDate - the start date for the announcement. Cannot be null.
Returns:
a new Announcement.
Throws:
UnauthorizedException - if not allowed to create a system annoucement.
UserNotFoundException

createForumAnnouncement

public Announcement createForumAnnouncement(long userID,
                                            long forumID,
                                            java.lang.String subject,
                                            java.lang.String body,
                                            java.util.Date startDate,
                                            java.util.Date endDate)
                                     throws ForumNotFoundException,
                                            UserNotFoundException,
                                            UnauthorizedException
Description copied from interface: AnnouncementService
Creates a new category or forum announcement.

Specified by:
createForumAnnouncement in interface AnnouncementService
Parameters:
userID - the user ID creating the announcement.
subject - the subject of the announcement.
body - the body of the announcement.
startDate - the start date for the announcement. Cannot be null.
endDate - the end date for the announcement. Cannot be null.
Returns:
a new Announcement.
Throws:
ForumNotFoundException - if the forum is not found.
UnauthorizedException - if not allowed to create a system annoucement.
UserNotFoundException

createNonExpiringForumAnnouncement

public Announcement createNonExpiringForumAnnouncement(long userID,
                                                       long forumID,
                                                       java.lang.String subject,
                                                       java.lang.String body,
                                                       java.util.Date startDate)
                                                throws UserNotFoundException,
                                                       ForumNotFoundException,
                                                       UnauthorizedException
Description copied from interface: AnnouncementService
Creates a new non-expiring forum announcement.

Specified by:
createNonExpiringForumAnnouncement in interface AnnouncementService
Parameters:
userID - the user ID creating the announcement.
subject - the subject of the announcement.
body - the body of the announcement.
startDate - the start date for the announcement. Cannot be null.
Returns:
a new Announcement.
Throws:
ForumNotFoundException - if the forum is not found.
UnauthorizedException - if not allowed to create a system annoucement.
UserNotFoundException

createForumCategoryAnnouncement

public Announcement createForumCategoryAnnouncement(long userID,
                                                    long categoryID,
                                                    java.lang.String subject,
                                                    java.lang.String body,
                                                    java.util.Date startDate,
                                                    java.util.Date endDate)
                                             throws UserNotFoundException,
                                                    ForumCategoryNotFoundException,
                                                    UnauthorizedException
Description copied from interface: AnnouncementService
Creates a new category announcement.

Specified by:
createForumCategoryAnnouncement in interface AnnouncementService
Parameters:
userID - the user ID creating the announcement.
subject - the subject of the announcement.
body - the body of the announcement.
startDate - the start date for the announcement. Cannot be null.
endDate - the end date for the announcement. Cannot be null.
Returns:
a new Announcement.
Throws:
ForumCategoryNotFoundException - if the category is not found.
UnauthorizedException - if not allowed to create a system annoucement.
UserNotFoundException

createNonExpiringForumCategoryAnnouncement

public Announcement createNonExpiringForumCategoryAnnouncement(long userID,
                                                               long categoryID,
                                                               java.lang.String subject,
                                                               java.lang.String body,
                                                               java.util.Date startDate)
                                                        throws UserNotFoundException,
                                                               ForumCategoryNotFoundException,
                                                               UnauthorizedException
Description copied from interface: AnnouncementService
Creates a new non-expiring category announcement.

Specified by:
createNonExpiringForumCategoryAnnouncement in interface AnnouncementService
Parameters:
userID - the user ID creating the announcement.
subject - the subject of the announcement.
body - the body of the announcement.
startDate - the start date for the announcement. Cannot be null.
Returns:
a new Announcement.
Throws:
ForumCategoryNotFoundException - if the category is not found.
UnauthorizedException - if not allowed to create a system annoucement.
UserNotFoundException

getAnnouncement

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

Specified by:
getAnnouncement in interface AnnouncementService
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.

editAnnouncement

public void editAnnouncement(Announcement announcement)
                      throws AnnouncementNotFoundException
Description copied from interface: AnnouncementService
Updates an existing announcement. Use an Announcement object retrieved from a prior webservice call as an argument, in order to maintain database consistancy for all attributes in the Announcement object. Fields that can be changed include subject, body, startDate, and endDate. The Announcement is not returned since no attributes will change within the service call.

Specified by:
editAnnouncement in interface AnnouncementService
Parameters:
announcement - the announcement to update.
Throws:
AnnouncementNotFoundException

getAnnouncementCount

public int getAnnouncementCount(int objectType,
                                long objectID)
                         throws ForumNotFoundException,
                                ForumCategoryNotFoundException
Description copied from interface: AnnouncementService
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 AnnouncementService
Parameters:
objectType - a forum, category, or -1 for system announcements.
objectID - an ID of a forums, category, or -1 for system announcmenents.
Returns:
the count of all currently viewable announcements in the container.
Throws:
ForumNotFoundException
ForumCategoryNotFoundException

getAnnouncementCount

public int getAnnouncementCount(int objectType,
                                long objectID,
                                java.util.Date startDate,
                                java.util.Date endDate)
                         throws ForumNotFoundException,
                                ForumCategoryNotFoundException
Description copied from interface: AnnouncementService
Returns the count of all announcements in a container that are viewable within the specified date range. If objectType and objectID is -1 then the count of system announcements will be returned. Otherwise, the objectType and objectID should reference 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 AnnouncementService
Parameters:
objectType - a forum, category, or -1 for system announcements.
objectID - an ID of a forums, category, or -1 for system announcmenents.
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.
Throws:
ForumNotFoundException
ForumCategoryNotFoundException

getAnnouncements

public Announcement[] getAnnouncements(int objectType,
                                       long objectID)
                                throws ForumNotFoundException,
                                       ForumCategoryNotFoundException
Description copied from interface: AnnouncementService
Returns all currently viewable announcements in a container. If objectType and objectID is -1 than system announcements will be returned. Otherwise, the container should be a ForumCategory or Forum object.

Specified by:
getAnnouncements in interface AnnouncementService
Parameters:
objectType - a forum, category, or -1 for system announcements.
objectID - an ID of a forums, category, or -1 for system announcmenents.
Returns:
the currently viewable announcements in the container.
Throws:
ForumNotFoundException
ForumCategoryNotFoundException

getAnnouncements

public Announcement[] getAnnouncements(int objectType,
                                       long objectID,
                                       java.util.Date startDate,
                                       java.util.Date endDate)
                                throws ForumNotFoundException,
                                       ForumCategoryNotFoundException
Description copied from interface: AnnouncementService
Returns the announcements in a container that are viewable within a specified date range.If container is null than 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 AnnouncementService
Parameters:
objectType - a forum, category, or -1 for system announcements.
objectID - an ID of a forums, category, or -1 for system announcmenents.
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.
Throws:
ForumNotFoundException
ForumCategoryNotFoundException

getSystemAnnouncementCountWithFilter

public int getSystemAnnouncementCountWithFilter(AnnouncementFilter filter)
Description copied from interface: AnnouncementService
Returns the number of viewable system announcements using the specified AnnouncementFilter.

Specified by:
getSystemAnnouncementCountWithFilter in interface AnnouncementService
Parameters:
filter - the AnnouncementFilter
Returns:
the number of system Announcements.

getSystemAnnouncementsWithFilter

public Announcement[] getSystemAnnouncementsWithFilter(AnnouncementFilter filter)
Description copied from interface: AnnouncementService
Returns the viewable system announcements using the specified AnnouncementFilter.

Specified by:
getSystemAnnouncementsWithFilter in interface AnnouncementService
Parameters:
filter - the AnnouncementFilter
Returns:
the system Announcements.

getForumAnnouncementCountWithFilter

public int getForumAnnouncementCountWithFilter(long forumID,
                                               AnnouncementFilter filter)
                                        throws ForumNotFoundException
Description copied from interface: AnnouncementService
Returns the number of viewable announcements using the specified forumID and AnnouncementFilter.

Specified by:
getForumAnnouncementCountWithFilter in interface AnnouncementService
Parameters:
forumID - the forum ID
filter - the AnnouncementFilter
Returns:
the number of Announcements in the forum.
Throws:
ForumNotFoundException - if the forum is not found.

getForumAnnouncementsWithFilter

public Announcement[] getForumAnnouncementsWithFilter(long forumID,
                                                      AnnouncementFilter filter)
                                               throws ForumNotFoundException
Description copied from interface: AnnouncementService
Returns the viewable announcements using the specified forumID and AnnouncementFilter.

Specified by:
getForumAnnouncementsWithFilter in interface AnnouncementService
Parameters:
forumID - the forum ID
filter - the AnnouncementFilter
Returns:
the Announcements in the forum.
Throws:
ForumNotFoundException - if the forum is not found.

getRecursiveCategoryAnnouncementCount

public int getRecursiveCategoryAnnouncementCount(long categoryID)
                                          throws ForumCategoryNotFoundException
Description copied from interface: AnnouncementService
Returns the number of viewable announcements recursively using the categoryID provided. This can include System Announcments, Category Announcement, and Forum Announcements. To include System Announcements, use -1.

Specified by:
getRecursiveCategoryAnnouncementCount in interface AnnouncementService
Parameters:
categoryID - the category ID, or -1 to start with System Announcements
Returns:
the number of Announcements at or below the category ID in the hierarchy.
Throws:
ForumCategoryNotFoundException - if the category is not found.

getRecursiveCategoryAnnouncementCountWithFilter

public int getRecursiveCategoryAnnouncementCountWithFilter(long categoryID,
                                                           AnnouncementFilter filter)
                                                    throws ForumCategoryNotFoundException
Description copied from interface: AnnouncementService
Returns the number of viewable announcements recursively using the specified categoryID and AnnouncementFilter. This can include System Announcements, Category Announcements, and Forum Announcements. To include System Announcements, use -1.

Specified by:
getRecursiveCategoryAnnouncementCountWithFilter in interface AnnouncementService
Parameters:
categoryID - the category ID, or -1 to start with System Announcements
filter - the AnnouncementFilter
Returns:
the number of Announcements at or below the category ID in the hierarchy.
Throws:
ForumCategoryNotFoundException - if the category is not found.

getRecursiveCategoryAnnouncements

public Announcement[] getRecursiveCategoryAnnouncements(long categoryID,
                                                        int startIndex,
                                                        int numResults)
                                                 throws ForumCategoryNotFoundException
Description copied from interface: AnnouncementService
Returns the viewable announcements recursively using the categoryID provided. This can include System Announcments, Category Announcement, and Forum Announcements. To include System Announcements, use -1. To control the number of results returned, user the startIndex (0 or greater) and numResults (0 to Integer.MAX_VALUE).

Specified by:
getRecursiveCategoryAnnouncements in interface AnnouncementService
Parameters:
categoryID - the category ID, or -1 to start with System Announcements
startIndex - the 0 based index to start at.
numResults - the number of results to returned, or Integer.MAX_VALUE for all results.
Returns:
the Announcements at or below the category ID in the hierarchy.
Throws:
ForumCategoryNotFoundException - if the category is not found.

getRecursiveCategoryAnnouncementsWithFilter

public Announcement[] getRecursiveCategoryAnnouncementsWithFilter(long categoryID,
                                                                  AnnouncementFilter filter)
                                                           throws ForumCategoryNotFoundException
Description copied from interface: AnnouncementService
Returns the viewable announcements recursively using the specified categoryID and AnnouncementFilter. This can include System Announcements, Category Announcements, and Forum Announcements. To include System Announcements, use -1.

Specified by:
getRecursiveCategoryAnnouncementsWithFilter in interface AnnouncementService
Parameters:
categoryID - the category ID, or -1 to start with System Announcements
filter - the AnnouncementFilter
Returns:
the Announcements at or below the category ID in the hierarchy.
Throws:
ForumCategoryNotFoundException - if the category is not found.

deleteAnnouncement

public void deleteAnnouncement(long announcementID)
                        throws UnauthorizedException,
                               AnnouncementNotFoundException
Description copied from interface: AnnouncementService
Deletes an announcement.

Specified by:
deleteAnnouncement in interface AnnouncementService
Parameters:
announcementID - the ID of the announcement to delete.
Throws:
UnauthorizedException - if not allowed to delete the announcement.
AnnouncementNotFoundException

expireAnnouncement

public void expireAnnouncement(long announcementID)
                        throws UnauthorizedException,
                               AnnouncementNotFoundException
Description copied from interface: AnnouncementService
Expires an announcement.

Specified by:
expireAnnouncement in interface AnnouncementService
Parameters:
announcementID - the ID of the announcement to delete.
Throws:
UnauthorizedException - if not allowed to delete the announcement.
AnnouncementNotFoundException

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.