Class DomainServiceImpl
java.lang.Object
org.exoplatform.addons.gamification.service.configuration.DomainServiceImpl
- All Implemented Interfaces:
DomainService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DomainStorageprotected final org.exoplatform.commons.file.services.FileServiceprotected final org.exoplatform.social.core.manager.IdentityManagerprotected final org.exoplatform.services.listener.ListenerServiceprotected final org.exoplatform.social.core.space.spi.SpaceServiceFields inherited from interface org.exoplatform.addons.gamification.service.configuration.DomainService
GAMIFICATION_DOMAIN_DELETE_LISTENER, GAMIFICATION_DOMAIN_DISABLE_LISTENER, GAMIFICATION_DOMAIN_ENABLE_LISTENER -
Constructor Summary
ConstructorsConstructorDescriptionDomainServiceImpl(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 Summary
Modifier and TypeMethodDescriptionbooleancanAddDomain(org.exoplatform.services.security.Identity aclIdentity) Check whether user can add programs or notintcountDomains(DomainFilter domainFilter, String username) Count all domains by filtercreateDomain(DomainDTO domain) Creates a new domaincreateDomain(DomainDTO domain, org.exoplatform.services.security.Identity aclIdentity) Creates a new domaindeleteDomainById(long domainId, org.exoplatform.services.security.Identity aclIdentity) Deletes an existing domain by idfindEnabledDomainByTitle(String domainTitle) Find an enabled domain by titlegetDomainById(long domainId) Retrieves a domain identified by its technical identifier.getDomainByTitle(String domainTitle) Find a domain by titlegetDomainsByFilter(DomainFilter domainFilter, String username, int offset, int limit) Gets domains by filter.Return enabled domains within the DBgetFileDetailAsStream(long domainId) Retrieves a cover identified by domain technical identifier.booleanisDomainOwner(long domainId, org.exoplatform.services.security.Identity aclIdentity) Check whether user can add programs or notupdateDomain(DomainDTO domain, org.exoplatform.services.security.Identity aclIdentity) Update an existing Domain
-
Field Details
-
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:DomainServiceGets domains by filter.- Specified by:
getDomainsByFilterin interfaceDomainService- Parameters:
domainFilter-DomainFilterused to filter resultsusername- User name accessing domainsoffset- index of the searchlimit- limit of results to return- Returns:
- A
<DomainDTO>object
-
getEnabledDomains
Description copied from interface:DomainServiceReturn enabled domains within the DB- Specified by:
getEnabledDomainsin interfaceDomainService- Returns:
- A
<DomainDTO>object
-
findEnabledDomainByTitle
Description copied from interface:DomainServiceFind an enabled domain by title- Specified by:
findEnabledDomainByTitlein interfaceDomainService- Parameters:
domainTitle- : domain title- Returns:
- found
DomainDTO
-
getDomainByTitle
Description copied from interface:DomainServiceFind a domain by title- Specified by:
getDomainByTitlein interfaceDomainService- Parameters:
domainTitle- : domain title- Returns:
- found
DomainDTO
-
countDomains
Description copied from interface:DomainServiceCount all domains by filter- Specified by:
countDomainsin interfaceDomainService- Parameters:
domainFilter-DomainFilterused to filter domainsusername- 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:DomainServiceCreates a new domain- Specified by:
createDomainin interfaceDomainService- Parameters:
domain- : an object of type DomainDTOaclIdentity- 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
Description copied from interface:DomainServiceCreates a new domain- Specified by:
createDomainin interfaceDomainService- 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:DomainServiceUpdate an existing Domain- Specified by:
updateDomainin interfaceDomainService- Parameters:
domain- : an instance of type DomainDTOaclIdentity- 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 objectorg.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:DomainServiceDeletes an existing domain by id- Specified by:
deleteDomainByIdin interfaceDomainService- Parameters:
domainId- Domain technical identifier to deleteaclIdentity- Security identity of user attempting to delete a domain- Returns:
- deleted
DomainDTO - Throws:
IllegalAccessException- when user is not authorized to delete domainorg.exoplatform.commons.exception.ObjectNotFoundException- domain not found
-
getDomainById
Description copied from interface:DomainServiceRetrieves a domain identified by its technical identifier.- Specified by:
getDomainByIdin interfaceDomainService- Parameters:
domainId- : domain id- Returns:
- found
DomainDTO
-
getFileDetailAsStream
public InputStream getFileDetailAsStream(long domainId) throws org.exoplatform.commons.exception.ObjectNotFoundException Description copied from interface:DomainServiceRetrieves a cover identified by domain technical identifier.- Specified by:
getFileDetailAsStreamin interfaceDomainService- 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:DomainServiceCheck whether user can add programs or not- Specified by:
canAddDomainin interfaceDomainService- 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:DomainServiceCheck whether user can add programs or not- Specified by:
isDomainOwnerin interfaceDomainService- Parameters:
domainId- technical identifier of domain/programaclIdentity- Security identity of user- Returns:
- true if user has enough privileges to create a program, else false
-