Class ExternalIdentityMappingServiceImpl
- java.lang.Object
-
- org.bonitasoft.engine.external.identity.mapping.impl.ExternalIdentityMappingServiceImpl
-
- All Implemented Interfaces:
ExternalIdentityMappingService
public class ExternalIdentityMappingServiceImpl extends java.lang.Object implements ExternalIdentityMappingService
- Author:
- Emmanuel Duchastenier, Celine Souchet
-
-
Constructor Summary
Constructors Constructor Description ExternalIdentityMappingServiceImpl(ReadPersistenceService persistenceService, Recorder recorder, EventService eventService, QueriableLoggerService queriableLoggerService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SExternalIdentityMappingcreateExternalIdentityMapping(SExternalIdentityMapping externalIdentityMapping)Create externalIdentityMapping in DB for given externalIdentityMappingvoiddeleteAllExternalIdentityMappings()Delete all external identity mapping for the connected tenantvoiddeleteExternalIdentityMapping(long mappingId)Delete the id specified externalIdentityMappingvoiddeleteExternalIdentityMapping(SExternalIdentityMapping externalIdentityMapping)Delete the specific externalIdentityMappingSExternalIdentityMappinggetExternalIdentityMappingById(long mappingId)Get externalIdentityMapping by its idSExternalIdentityMappinggetExternalIdentityMappingById(long mappingId, java.lang.String suffix, java.lang.String messageSuffix)SExternalIdentityMappinggetExternalIdentityMappingForGroup(long mappingId)Get externalIdentityMapping by its id with displayNamePart having group related informationsSExternalIdentityMappinggetExternalIdentityMappingForRole(long mappingId)Get externalIdentityMapping by its id with displayNamePart having role related informationsSExternalIdentityMappinggetExternalIdentityMappingForRoleAndGroup(long mappingId)Get externalIdentityMapping by its id with displayNamePart having role and group related informationsSExternalIdentityMappinggetExternalIdentityMappingForUser(long mappingId)Get externalIdentityMapping by its id with displayNamePart having user related informationslonggetNumberOfExternalIdentityMappings(java.lang.String kind, QueryOptions searchOptions, java.lang.String querySuffix)Get total number of externalIdentityMappings for specific kind according to the queryOptions.longgetNumberOfExternalIdentityMappingsForUser(java.lang.String kind, long userId, java.lang.String externalId, QueryOptions searchOptions, java.lang.String querySuffix)Get total number ofSExternalIdentityMappingobjects associated with the specified externalId and kind for the specific user.java.util.List<SExternalIdentityMapping>searchExternalIdentityMappings(java.lang.String kind, java.lang.String externalId, QueryOptions queryOptions)Search allSExternalIdentityMappingobjects associated with the specified externalId and kind.java.util.List<SExternalIdentityMapping>searchExternalIdentityMappings(java.lang.String kind, QueryOptions queryOptions, java.lang.String querySuffix)Get all externalIdentityMappings for specific kind according to the queryOptions.java.util.List<SExternalIdentityMapping>searchExternalIdentityMappingsForUser(java.lang.String kind, long userId, java.lang.String externalId, QueryOptions queryOptions, java.lang.String querySuffix)Search allSExternalIdentityMappingobjects associated with the specified externalId and kind for the specific user.
-
-
-
Constructor Detail
-
ExternalIdentityMappingServiceImpl
public ExternalIdentityMappingServiceImpl(ReadPersistenceService persistenceService, Recorder recorder, EventService eventService, QueriableLoggerService queriableLoggerService)
-
-
Method Detail
-
createExternalIdentityMapping
public SExternalIdentityMapping createExternalIdentityMapping(SExternalIdentityMapping externalIdentityMapping) throws SExternalIdentityMappingCreationException
Description copied from interface:ExternalIdentityMappingServiceCreate externalIdentityMapping in DB for given externalIdentityMapping- Specified by:
createExternalIdentityMappingin interfaceExternalIdentityMappingService- Parameters:
externalIdentityMapping- an SExternalIdentityMapping object will be stored in DB- Returns:
- the new created SExternalIdentityMapping object
- Throws:
SExternalIdentityMappingCreationException
-
getExternalIdentityMappingById
public SExternalIdentityMapping getExternalIdentityMappingById(long mappingId) throws SExternalIdentityMappingNotFoundException
Description copied from interface:ExternalIdentityMappingServiceGet externalIdentityMapping by its id- Specified by:
getExternalIdentityMappingByIdin interfaceExternalIdentityMappingService- Parameters:
mappingId- the identifier of externalIdentityMapping- Returns:
- the externalIdentityMapping have id corresponding to the parameter
- Throws:
SExternalIdentityMappingNotFoundException- error thrown if no externalIdentityMapping have an id corresponding to the parameter.
-
getExternalIdentityMappingForUser
public SExternalIdentityMapping getExternalIdentityMappingForUser(long mappingId) throws SExternalIdentityMappingNotFoundException
Description copied from interface:ExternalIdentityMappingServiceGet externalIdentityMapping by its id with displayNamePart having user related informations- Specified by:
getExternalIdentityMappingForUserin interfaceExternalIdentityMappingService- Parameters:
mappingId- the identifier of externalIdentityMapping- Returns:
- the externalIdentityMapping with displayNamePart having userName informations
- Throws:
SExternalIdentityMappingNotFoundException- error thrown if no externalIdentityMapping have an id corresponding to the parameter.
-
getExternalIdentityMappingById
public SExternalIdentityMapping getExternalIdentityMappingById(long mappingId, java.lang.String suffix, java.lang.String messageSuffix) throws SExternalIdentityMappingNotFoundException
- Specified by:
getExternalIdentityMappingByIdin interfaceExternalIdentityMappingServicesuffix- the query suffix to specify (ForUser, ForGroup, ...)- Returns:
- Throws:
SExternalIdentityMappingNotFoundException
-
getExternalIdentityMappingForGroup
public SExternalIdentityMapping getExternalIdentityMappingForGroup(long mappingId) throws SExternalIdentityMappingNotFoundException
Description copied from interface:ExternalIdentityMappingServiceGet externalIdentityMapping by its id with displayNamePart having group related informations- Specified by:
getExternalIdentityMappingForGroupin interfaceExternalIdentityMappingService- Parameters:
mappingId- the identifier of externalIdentityMapping- Returns:
- the externalIdentityMapping with displayNamePart having group related informations
- Throws:
SExternalIdentityMappingNotFoundException- error thrown if no externalIdentityMapping have an id corresponding to the parameter.
-
getExternalIdentityMappingForRole
public SExternalIdentityMapping getExternalIdentityMappingForRole(long mappingId) throws SExternalIdentityMappingNotFoundException
Description copied from interface:ExternalIdentityMappingServiceGet externalIdentityMapping by its id with displayNamePart having role related informations- Specified by:
getExternalIdentityMappingForRolein interfaceExternalIdentityMappingService- Parameters:
mappingId- the identifier of externalIdentityMapping- Returns:
- the externalIdentityMapping with displayNamePart having role related informations
- Throws:
SExternalIdentityMappingNotFoundException- error thrown if no externalIdentityMapping have an id corresponding to the parameter.
-
getExternalIdentityMappingForRoleAndGroup
public SExternalIdentityMapping getExternalIdentityMappingForRoleAndGroup(long mappingId) throws SExternalIdentityMappingNotFoundException
Description copied from interface:ExternalIdentityMappingServiceGet externalIdentityMapping by its id with displayNamePart having role and group related informations- Specified by:
getExternalIdentityMappingForRoleAndGroupin interfaceExternalIdentityMappingService- Parameters:
mappingId- the identifier of externalIdentityMapping- Returns:
- the externalIdentityMapping with displayNamePart having role and group related informations
- Throws:
SExternalIdentityMappingNotFoundException- error thrown if no externalIdentityMapping have an id corresponding to the parameter.
-
deleteExternalIdentityMapping
public void deleteExternalIdentityMapping(long mappingId) throws SExternalIdentityMappingNotFoundException, SExternalIdentityMappingDeletionExceptionDescription copied from interface:ExternalIdentityMappingServiceDelete the id specified externalIdentityMapping- Specified by:
deleteExternalIdentityMappingin interfaceExternalIdentityMappingService- Parameters:
mappingId- the identifier of externalIdentityMapping- Throws:
SExternalIdentityMappingNotFoundException- error thrown if no externalIdentityMapping have an id corresponding to the parameter.SExternalIdentityMappingDeletionException
-
deleteExternalIdentityMapping
public void deleteExternalIdentityMapping(SExternalIdentityMapping externalIdentityMapping) throws SExternalIdentityMappingDeletionException
Description copied from interface:ExternalIdentityMappingServiceDelete the specific externalIdentityMapping- Specified by:
deleteExternalIdentityMappingin interfaceExternalIdentityMappingService- Parameters:
externalIdentityMapping- the externalIdentityMapping will be deleted- Throws:
SExternalIdentityMappingDeletionException
-
deleteAllExternalIdentityMappings
public void deleteAllExternalIdentityMappings() throws SExternalIdentityMappingDeletionExceptionDescription copied from interface:ExternalIdentityMappingServiceDelete all external identity mapping for the connected tenant- Specified by:
deleteAllExternalIdentityMappingsin interfaceExternalIdentityMappingService- Throws:
SExternalIdentityMappingDeletionException
-
getNumberOfExternalIdentityMappingsForUser
public long getNumberOfExternalIdentityMappingsForUser(java.lang.String kind, long userId, java.lang.String externalId, QueryOptions searchOptions, java.lang.String querySuffix) throws SBonitaReadExceptionDescription copied from interface:ExternalIdentityMappingServiceGet total number ofSExternalIdentityMappingobjects associated with the specified externalId and kind for the specific user. Use querySuffix to indicate what the displayNamePart is related to- Specified by:
getNumberOfExternalIdentityMappingsForUserin interfaceExternalIdentityMappingService- Parameters:
kind- the discriminator of theSExternalIdentityMappingto search for.userId- The identifier of userexternalId- the external Id identifying theSExternalIdentityMappings to search.searchOptions- a QueryOptions object containing some query conditionsquerySuffix- the query suffix, it can be "USER", "GROUP", "ROLE", "MEMBERSHIP";- Returns:
- the number of externalIdentityMappings matching the criteria.
- Throws:
SBonitaReadException
-
searchExternalIdentityMappingsForUser
public java.util.List<SExternalIdentityMapping> searchExternalIdentityMappingsForUser(java.lang.String kind, long userId, java.lang.String externalId, QueryOptions queryOptions, java.lang.String querySuffix) throws SBonitaReadException
Description copied from interface:ExternalIdentityMappingServiceSearch allSExternalIdentityMappingobjects associated with the specified externalId and kind for the specific user. Use querySuffix to indicate what the displayNamePart is related to- Specified by:
searchExternalIdentityMappingsForUserin interfaceExternalIdentityMappingService- Parameters:
kind- the discriminator of theSExternalIdentityMappingto search for.userId- The identifier of userexternalId- the external Id identifying theSExternalIdentityMappings to search.queryOptions- a QueryOptions object containing some query conditionsquerySuffix- the query suffix, it can be "USER", "GROUP", "ROLE", "MEMBERSHIP";- Returns:
- the list of results matching the criteria.
- Throws:
SBonitaReadException
-
getNumberOfExternalIdentityMappings
public long getNumberOfExternalIdentityMappings(java.lang.String kind, QueryOptions searchOptions, java.lang.String querySuffix) throws SBonitaReadExceptionDescription copied from interface:ExternalIdentityMappingServiceGet total number of externalIdentityMappings for specific kind according to the queryOptions.- Specified by:
getNumberOfExternalIdentityMappingsin interfaceExternalIdentityMappingService- Parameters:
kind- the discriminator of theSExternalIdentityMappingto search for.searchOptions- a QueryOptions object containing some query conditionsquerySuffix- the query suffix, it can be "USER", "GROUP", "ROLE", "MEMBERSHIP";- Returns:
- number of externalIdentityMappings matching the criteria.
- Throws:
SBonitaReadException
-
searchExternalIdentityMappings
public java.util.List<SExternalIdentityMapping> searchExternalIdentityMappings(java.lang.String kind, QueryOptions queryOptions, java.lang.String querySuffix) throws SBonitaReadException
Description copied from interface:ExternalIdentityMappingServiceGet all externalIdentityMappings for specific kind according to the queryOptions. use querySuffix to indicate what the displayNamePart is related to- Specified by:
searchExternalIdentityMappingsin interfaceExternalIdentityMappingService- Parameters:
kind- the discriminator of theSExternalIdentityMappingto search for.queryOptions- a QueryOptions object containing some query conditionsquerySuffix- The query suffix, it can be "USER", "GROUP", "ROLE", "MEMBERSHIP";- Returns:
- a list of SExternalIdentityMapping objects matching the criteria.
- Throws:
SBonitaReadException
-
searchExternalIdentityMappings
public java.util.List<SExternalIdentityMapping> searchExternalIdentityMappings(java.lang.String kind, java.lang.String externalId, QueryOptions queryOptions) throws SBonitaReadException
Description copied from interface:ExternalIdentityMappingServiceSearch allSExternalIdentityMappingobjects associated with the specified externalId and kind.- Specified by:
searchExternalIdentityMappingsin interfaceExternalIdentityMappingService- Parameters:
kind- the discriminator of theSExternalIdentityMappingto search for.externalId- the external Id identifying theSExternalIdentityMappings to search.queryOptions- a QueryOptions object containing some query conditions- Returns:
- the list of results matching the criteria.
- Throws:
SBonitaReadException- in case of search error.
-
-