Class AnnouncementServiceImpl
- java.lang.Object
-
- org.exoplatform.addons.gamification.service.configuration.AnnouncementServiceImpl
-
- All Implemented Interfaces:
AnnouncementService
public class AnnouncementServiceImpl extends Object implements AnnouncementService
-
-
Constructor Summary
Constructors Constructor Description AnnouncementServiceImpl(AnnouncementStorage announcementStorage, RuleStorage challengeStorage, org.exoplatform.services.listener.ListenerService listenerService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LongcountAllAnnouncementsByChallenge(long challengeId)Retrieves number of all Announcements by challengeId.AnnouncementcreateAnnouncement(Announcement announcement, String currentUser, boolean system)Creates a new announcementList<Announcement>findAllAnnouncementByChallenge(long challengeId, int offset, int limit)Retrieves all Announcements by challengeId.AnnouncementgetAnnouncementById(Long announcementId)Retrieves a announcement identified by its technical identifier.AnnouncementupdateAnnouncement(Announcement announcement)Update announcement
-
-
-
Constructor Detail
-
AnnouncementServiceImpl
public AnnouncementServiceImpl(AnnouncementStorage announcementStorage, RuleStorage challengeStorage, org.exoplatform.services.listener.ListenerService listenerService)
-
-
Method Detail
-
createAnnouncement
public Announcement createAnnouncement(Announcement announcement, String currentUser, boolean system) throws IllegalArgumentException, org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
Description copied from interface:AnnouncementServiceCreates a new announcement- Specified by:
createAnnouncementin interfaceAnnouncementService- Parameters:
announcement-Announcementobject to createcurrentUser- User name accessing announcementsystem- check if announcement created by system- Returns:
- created
Announcementwith generated technical identifier - Throws:
IllegalAccessException- when user is not authorized to create a announcement for the designated owner defined in objectIllegalArgumentExceptionorg.exoplatform.commons.exception.ObjectNotFoundException
-
findAllAnnouncementByChallenge
public List<Announcement> findAllAnnouncementByChallenge(long challengeId, int offset, int limit) throws org.exoplatform.commons.exception.ObjectNotFoundException
Description copied from interface:AnnouncementServiceRetrieves all Announcements by challengeId.- Specified by:
findAllAnnouncementByChallengein interfaceAnnouncementServiceoffset- Offsetlimit- Limit- Returns:
- A
object - Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the challenge identified by its technical identifier is not found
-
countAllAnnouncementsByChallenge
public Long countAllAnnouncementsByChallenge(long challengeId) throws org.exoplatform.commons.exception.ObjectNotFoundException
Description copied from interface:AnnouncementServiceRetrieves number of all Announcements by challengeId.- Specified by:
countAllAnnouncementsByChallengein interfaceAnnouncementService- Returns:
- A
Longnumber of announcements - Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the challenge identified by its technical identifier is not found
-
updateAnnouncement
public Announcement updateAnnouncement(Announcement announcement) throws IllegalArgumentException, org.exoplatform.commons.exception.ObjectNotFoundException
Description copied from interface:AnnouncementServiceUpdate announcement- Specified by:
updateAnnouncementin interfaceAnnouncementService- Parameters:
announcement-Announcementobject to Update- Returns:
- a
AnnouncementObject - Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the announcement identified by its technical identifier is not foundIllegalArgumentException
-
getAnnouncementById
public Announcement getAnnouncementById(Long announcementId) throws IllegalArgumentException
Description copied from interface:AnnouncementServiceRetrieves a announcement identified by its technical identifier.- Specified by:
getAnnouncementByIdin interfaceAnnouncementService- Parameters:
announcementId- technical identifier of a challenge- Returns:
- A
Announcementobject - Throws:
IllegalArgumentException
-
-