java.lang.Object
org.exoplatform.addons.gamification.service.configuration.DomainServiceImpl
All Implemented Interfaces:
DomainService

public class DomainServiceImpl extends Object implements DomainService
  • Field Details

    • domainStorage

      protected final DomainStorage domainStorage
    • listenerService

      protected final org.exoplatform.services.listener.ListenerService listenerService
    • identityManager

      protected final org.exoplatform.social.core.manager.IdentityManager identityManager
    • spaceService

      protected final org.exoplatform.social.core.space.spi.SpaceService spaceService
    • fileService

      protected final org.exoplatform.commons.file.services.FileService fileService
  • Constructor Details

    • DomainServiceImpl

      public DomainServiceImpl(DomainStorage domainStorage, org.exoplatform.services.listener.ListenerService listenerService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, org.exoplatform.commons.file.services.FileService fileService)
  • Method Details

    • getDomainsByFilter

      public List<DomainDTO> getDomainsByFilter(DomainFilter domainFilter, String username, int offset, int limit)
      Description copied from interface: DomainService
      Gets domains by filter.
      Specified by:
      getDomainsByFilter in interface DomainService
      Parameters:
      domainFilter - DomainFilter used to filter results
      username - User name accessing domains
      offset - index of the search
      limit - limit of results to return
      Returns:
      A <DomainDTO> object
    • getEnabledDomains

      public List<DomainDTO> getEnabledDomains()
      Description copied from interface: DomainService
      Return enabled domains within the DB
      Specified by:
      getEnabledDomains in interface DomainService
      Returns:
      A <DomainDTO> object
    • findEnabledDomainByTitle

      public DomainDTO findEnabledDomainByTitle(String domainTitle)
      Description copied from interface: DomainService
      Find an enabled domain by title
      Specified by:
      findEnabledDomainByTitle in interface DomainService
      Parameters:
      domainTitle - : domain title
      Returns:
      found DomainDTO
    • getDomainByTitle

      public DomainDTO getDomainByTitle(String domainTitle)
      Description copied from interface: DomainService
      Find a domain by title
      Specified by:
      getDomainByTitle in interface DomainService
      Parameters:
      domainTitle - : domain title
      Returns:
      found DomainDTO
    • countDomains

      public int countDomains(DomainFilter domainFilter, String username)
      Description copied from interface: DomainService
      Count all domains by filter
      Specified by:
      countDomains in interface DomainService
      Parameters:
      domainFilter - DomainFilter used to filter domains
      username - User name accessing domains
      Returns:
      domains count
    • createDomain

      public DomainDTO createDomain(DomainDTO domain, org.exoplatform.services.security.Identity aclIdentity) throws IllegalAccessException
      Description copied from interface: DomainService
      Creates a new domain
      Specified by:
      createDomain in interface DomainService
      Parameters:
      domain - : an object of type DomainDTO
      aclIdentity - Security identity of user attempting to create a program/domain
      Returns:
      created DomainDTO
      Throws:
      IllegalAccessException - when user is not authorized to create a domain for the designated owner defined in object
    • createDomain

      public DomainDTO createDomain(DomainDTO domain)
      Description copied from interface: DomainService
      Creates a new domain
      Specified by:
      createDomain in interface DomainService
      Parameters:
      domain - : an object of type DomainDTO
      Returns:
      created DomainDTO
    • updateDomain

      public DomainDTO updateDomain(DomainDTO domain, org.exoplatform.services.security.Identity aclIdentity) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Description copied from interface: DomainService
      Update an existing Domain
      Specified by:
      updateDomain in interface DomainService
      Parameters:
      domain - : an instance of type DomainDTO
      aclIdentity - Security identity of user attempting to update a program/domain
      Returns:
      updated object DomainDTO
      Throws:
      IllegalAccessException - when user is not authorized to create a domain for the designated owner defined in object
      org.exoplatform.commons.exception.ObjectNotFoundException - when the domain identified by its technical identifier is not found
    • deleteDomainById

      public DomainDTO deleteDomainById(long domainId, org.exoplatform.services.security.Identity aclIdentity) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Description copied from interface: DomainService
      Deletes an existing domain by id
      Specified by:
      deleteDomainById in interface DomainService
      Parameters:
      domainId - Domain technical identifier to delete
      aclIdentity - Security identity of user attempting to delete a domain
      Returns:
      deleted DomainDTO
      Throws:
      IllegalAccessException - when user is not authorized to delete domain
      org.exoplatform.commons.exception.ObjectNotFoundException - domain not found
    • getDomainById

      public DomainDTO getDomainById(long domainId)
      Description copied from interface: DomainService
      Retrieves a domain identified by its technical identifier.
      Specified by:
      getDomainById in interface DomainService
      Parameters:
      domainId - : domain id
      Returns:
      found DomainDTO
    • getFileDetailAsStream

      public InputStream getFileDetailAsStream(long domainId) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Description copied from interface: DomainService
      Retrieves a cover identified by domain technical identifier.
      Specified by:
      getFileDetailAsStream in interface DomainService
      Parameters:
      domainId - domain unique identifier
      Returns:
      found InputStream
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - domain not found
    • canAddDomain

      public boolean canAddDomain(org.exoplatform.services.security.Identity aclIdentity)
      Description copied from interface: DomainService
      Check whether user can add programs or not
      Specified by:
      canAddDomain in interface DomainService
      Parameters:
      aclIdentity - Security identity of user
      Returns:
      true if user has enough privileges to create a program, else false
    • isDomainOwner

      public boolean isDomainOwner(long domainId, org.exoplatform.services.security.Identity aclIdentity)
      Description copied from interface: DomainService
      Check whether user can add programs or not
      Specified by:
      isDomainOwner in interface DomainService
      Parameters:
      domainId - technical identifier of domain/program
      aclIdentity - Security identity of user
      Returns:
      true if user has enough privileges to create a program, else false