Class AnnouncementServiceImpl
java.lang.Object
io.meeds.gamification.service.impl.AnnouncementServiceImpl
- All Implemented Interfaces:
AnnouncementService
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAnnouncementServiceImpl(AnnouncementStorage announcementStorage, RuleService ruleService, RealizationService realizationService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.manager.ActivityManager activityManager, org.exoplatform.services.listener.ListenerService listenerService) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanAnnounce(RuleDTO rule, long earnerIdentityId) createAnnouncement(Announcement announcement, Map<String, String> templateParams, String username) Creates a new announcementdeleteAnnouncement(long announcementId, String username) Deletes announcementgetAnnouncementById(long announcementId) Retrieves a announcement identified by its technical identifier.updateAnnouncementComment(long announcementId, String comment) Update announcement
-
Field Details
-
MILLIS_IN_A_DAY
public static final long MILLIS_IN_A_DAY- See Also:
-
-
Constructor Details
-
AnnouncementServiceImpl
public AnnouncementServiceImpl(AnnouncementStorage announcementStorage, RuleService ruleService, RealizationService realizationService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.manager.ActivityManager activityManager, org.exoplatform.services.listener.ListenerService listenerService)
-
-
Method Details
-
createAnnouncement
public Announcement createAnnouncement(Announcement announcement, Map<String, String> templateParams, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessExceptionDescription copied from interface:AnnouncementServiceCreates a new announcement- Specified by:
createAnnouncementin interfaceAnnouncementService- Parameters:
announcement-Announcementobject to createtemplateParams- Activity Template paramsusername- User name accessing announcement- 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 object
-
canAnnounce
- Specified by:
canAnnouncein interfaceAnnouncementService- Parameters:
rule-RuleDTOearnerIdentityId- User identityId willing to announce a realization- Returns:
- true if can announce it else returns false
-
deleteAnnouncement
public Announcement deleteAnnouncement(long announcementId, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException Description copied from interface:AnnouncementServiceDeletes announcement- Specified by:
deleteAnnouncementin interfaceAnnouncementService- Parameters:
announcementId- technical identifier of announcementusername- Username who want to delete announcement- Returns:
- a
AnnouncementObject - Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the announcement identified by its technical identifier is not foundIllegalAccessException- when user is not allowed to delete the announce
-
getAnnouncementById
Description copied from interface:AnnouncementServiceRetrieves a announcement identified by its technical identifier.- Specified by:
getAnnouncementByIdin interfaceAnnouncementService- Parameters:
announcementId- technical identifier of aRealizationDTO- Returns:
- A
Announcementobject
-
updateAnnouncementComment
public Announcement updateAnnouncementComment(long announcementId, String comment) throws org.exoplatform.commons.exception.ObjectNotFoundException Description copied from interface:AnnouncementServiceUpdate announcement- Specified by:
updateAnnouncementCommentin interfaceAnnouncementService- Parameters:
announcementId-Announcementid which references theRealizationDTOidcomment- new user comment- Returns:
- a
AnnouncementObject - Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the announcement identified by its technical identifier is not found
-