Class AnnouncementServiceImpl
java.lang.Object
org.exoplatform.addons.gamification.service.configuration.AnnouncementServiceImpl
- All Implemented Interfaces:
AnnouncementService
-
Constructor Summary
ConstructorsConstructorDescriptionAnnouncementServiceImpl(AnnouncementStorage announcementStorage, ChallengeService challengeService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.services.listener.ListenerService listenerService) -
Method Summary
Modifier and TypeMethodDescriptioncountAllAnnouncementsByChallenge(long challengeId) Retrieves number of all Announcements by challenge identifier.countAnnouncementsByChallengeAndEarnerType(long challengeId, IdentityType earnerType) Retrieves number of all Announcements by challenge identifier.createAnnouncement(Announcement announcement, Map<String, String> templateParams, String currentUser, boolean system) Creates a new announcementfindAllAnnouncementByChallenge(long challengeId, int offset, int limit, PeriodType periodType, IdentityType earnerType) Retrieves all Announcements by challengeId.getAnnouncementById(Long announcementId) Retrieves a announcement identified by its technical identifier.updateAnnouncement(Announcement announcement) Update announcement
-
Constructor Details
-
AnnouncementServiceImpl
public AnnouncementServiceImpl(AnnouncementStorage announcementStorage, ChallengeService challengeService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.services.listener.ListenerService listenerService)
-
-
Method Details
-
createAnnouncement
public Announcement createAnnouncement(Announcement announcement, Map<String, String> templateParams, String currentUser, boolean system) throws IllegalArgumentException, org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessExceptionDescription copied from interface:AnnouncementServiceCreates a new announcement- Specified by:
createAnnouncementin interfaceAnnouncementService- Parameters:
announcement-Announcementobject to createtemplateParams- Activity Template paramscurrentUser- User name accessing announcementsystem- check if announcement created by system- Returns:
- created
Announcementwith generated technical identifier - Throws:
org.exoplatform.commons.exception.ObjectNotFoundExceptionIllegalAccessException- when user is not authorized to create a announcement for the designated owner defined in objectIllegalArgumentException
-
findAllAnnouncementByChallenge
public List<Announcement> findAllAnnouncementByChallenge(long challengeId, int offset, int limit, PeriodType periodType, IdentityType earnerType) Description copied from interface:AnnouncementServiceRetrieves all Announcements by challengeId.- Specified by:
findAllAnnouncementByChallengein interfaceAnnouncementService- Parameters:
challengeId- technical identifier of a challengeoffset- Offsetlimit- LimitperiodType- periodTypeearnerType- earnerType- Returns:
- A
<Announcement>object
-
countAllAnnouncementsByChallenge
public Long countAllAnnouncementsByChallenge(long challengeId) throws org.exoplatform.commons.exception.ObjectNotFoundException Description copied from interface:AnnouncementServiceRetrieves number of all Announcements by challenge identifier.- Specified by:
countAllAnnouncementsByChallengein interfaceAnnouncementService- Parameters:
challengeId- Challenge technical identifier- Returns:
- A
Longnumber of announcements - Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the challenge identified by its technical identifier is not found
-
countAnnouncementsByChallengeAndEarnerType
public Long countAnnouncementsByChallengeAndEarnerType(long challengeId, IdentityType earnerType) throws org.exoplatform.commons.exception.ObjectNotFoundException Description copied from interface:AnnouncementServiceRetrieves number of all Announcements by challenge identifier.- Specified by:
countAnnouncementsByChallengeAndEarnerTypein interfaceAnnouncementService- Parameters:
challengeId- Challenge technical identifierearnerType- the earner identity type- 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 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 found
-
getAnnouncementById
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
-