Class AnnouncementServiceImpl

java.lang.Object
org.exoplatform.addons.gamification.service.configuration.AnnouncementServiceImpl
All Implemented Interfaces:
AnnouncementService

public class AnnouncementServiceImpl extends Object implements AnnouncementService
  • 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, IllegalAccessException
      Description copied from interface: AnnouncementService
      Creates a new announcement
      Specified by:
      createAnnouncement in interface AnnouncementService
      Parameters:
      announcement - Announcement object to create
      templateParams - Activity Template params
      currentUser - User name accessing announcement
      system - check if announcement created by system
      Returns:
      created Announcement with generated technical identifier
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException - when user is not authorized to create a announcement for the designated owner defined in object
      IllegalArgumentException
    • findAllAnnouncementByChallenge

      public List<Announcement> findAllAnnouncementByChallenge(long challengeId, int offset, int limit, PeriodType periodType, IdentityType earnerType)
      Description copied from interface: AnnouncementService
      Retrieves all Announcements by challengeId.
      Specified by:
      findAllAnnouncementByChallenge in interface AnnouncementService
      Parameters:
      challengeId - technical identifier of a challenge
      offset - Offset
      limit - Limit
      periodType - periodType
      earnerType - earnerType
      Returns:
      A <Announcement> object
    • countAllAnnouncementsByChallenge

      public Long countAllAnnouncementsByChallenge(long challengeId) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Description copied from interface: AnnouncementService
      Retrieves number of all Announcements by challenge identifier.
      Specified by:
      countAllAnnouncementsByChallenge in interface AnnouncementService
      Parameters:
      challengeId - Challenge technical identifier
      Returns:
      A Long number 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: AnnouncementService
      Retrieves number of all Announcements by challenge identifier.
      Specified by:
      countAnnouncementsByChallengeAndEarnerType in interface AnnouncementService
      Parameters:
      challengeId - Challenge technical identifier
      earnerType - the earner identity type
      Returns:
      A Long number 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: AnnouncementService
      Update announcement
      Specified by:
      updateAnnouncement in interface AnnouncementService
      Parameters:
      announcement - Announcement object to Update
      Returns:
      a Announcement Object
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when the announcement identified by its technical identifier is not found
    • getAnnouncementById

      public Announcement getAnnouncementById(Long announcementId)
      Description copied from interface: AnnouncementService
      Retrieves a announcement identified by its technical identifier.
      Specified by:
      getAnnouncementById in interface AnnouncementService
      Parameters:
      announcementId - technical identifier of a challenge
      Returns:
      A Announcement object