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, TechnicalLoggerService logger, QueriableLoggerService queriableLoggerService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SExternalIdentityMapping
createExternalIdentityMapping(SExternalIdentityMapping externalIdentityMapping)
Create externalIdentityMapping in DB for given externalIdentityMappingvoid
deleteAllExternalIdentityMappings()
Delete all external identity mapping for the connected tenantvoid
deleteExternalIdentityMapping(long mappingId)
Delete the id specified externalIdentityMappingvoid
deleteExternalIdentityMapping(SExternalIdentityMapping externalIdentityMapping)
Delete the specific externalIdentityMappingSExternalIdentityMapping
getExternalIdentityMappingById(long mappingId)
Get externalIdentityMapping by its idSExternalIdentityMapping
getExternalIdentityMappingById(long mappingId, java.lang.String suffix, java.lang.String messageSuffix)
SExternalIdentityMapping
getExternalIdentityMappingForGroup(long mappingId)
Get externalIdentityMapping by its id with displayNamePart having group related informationsSExternalIdentityMapping
getExternalIdentityMappingForRole(long mappingId)
Get externalIdentityMapping by its id with displayNamePart having role related informationsSExternalIdentityMapping
getExternalIdentityMappingForRoleAndGroup(long mappingId)
Get externalIdentityMapping by its id with displayNamePart having role and group related informationsSExternalIdentityMapping
getExternalIdentityMappingForUser(long mappingId)
Get externalIdentityMapping by its id with displayNamePart having user related informationslong
getNumberOfExternalIdentityMappings(java.lang.String kind, QueryOptions searchOptions, java.lang.String querySuffix)
Get total number of externalIdentityMappings for specific kind according to the queryOptions.long
getNumberOfExternalIdentityMappingsForUser(java.lang.String kind, long userId, java.lang.String externalId, QueryOptions searchOptions, java.lang.String querySuffix)
Get total number ofSExternalIdentityMapping
objects 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 allSExternalIdentityMapping
objects 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 allSExternalIdentityMapping
objects associated with the specified externalId and kind for the specific user.
-
-
-
Constructor Detail
-
ExternalIdentityMappingServiceImpl
public ExternalIdentityMappingServiceImpl(ReadPersistenceService persistenceService, Recorder recorder, EventService eventService, TechnicalLoggerService logger, QueriableLoggerService queriableLoggerService)
-
-
Method Detail
-
createExternalIdentityMapping
public SExternalIdentityMapping createExternalIdentityMapping(SExternalIdentityMapping externalIdentityMapping) throws SExternalIdentityMappingCreationException
Description copied from interface:ExternalIdentityMappingService
Create externalIdentityMapping in DB for given externalIdentityMapping- Specified by:
createExternalIdentityMapping
in 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:ExternalIdentityMappingService
Get externalIdentityMapping by its id- Specified by:
getExternalIdentityMappingById
in 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:ExternalIdentityMappingService
Get externalIdentityMapping by its id with displayNamePart having user related informations- Specified by:
getExternalIdentityMappingForUser
in 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:
getExternalIdentityMappingById
in interfaceExternalIdentityMappingService
suffix
- the query suffix to specify (ForUser, ForGroup, ...)- Returns:
- Throws:
SExternalIdentityMappingNotFoundException
-
getExternalIdentityMappingForGroup
public SExternalIdentityMapping getExternalIdentityMappingForGroup(long mappingId) throws SExternalIdentityMappingNotFoundException
Description copied from interface:ExternalIdentityMappingService
Get externalIdentityMapping by its id with displayNamePart having group related informations- Specified by:
getExternalIdentityMappingForGroup
in 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:ExternalIdentityMappingService
Get externalIdentityMapping by its id with displayNamePart having role related informations- Specified by:
getExternalIdentityMappingForRole
in 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:ExternalIdentityMappingService
Get externalIdentityMapping by its id with displayNamePart having role and group related informations- Specified by:
getExternalIdentityMappingForRoleAndGroup
in 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, SExternalIdentityMappingDeletionException
Description copied from interface:ExternalIdentityMappingService
Delete the id specified externalIdentityMapping- Specified by:
deleteExternalIdentityMapping
in 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:ExternalIdentityMappingService
Delete the specific externalIdentityMapping- Specified by:
deleteExternalIdentityMapping
in interfaceExternalIdentityMappingService
- Parameters:
externalIdentityMapping
- the externalIdentityMapping will be deleted- Throws:
SExternalIdentityMappingDeletionException
-
deleteAllExternalIdentityMappings
public void deleteAllExternalIdentityMappings() throws SExternalIdentityMappingDeletionException
Description copied from interface:ExternalIdentityMappingService
Delete all external identity mapping for the connected tenant- Specified by:
deleteAllExternalIdentityMappings
in interfaceExternalIdentityMappingService
- Throws:
SExternalIdentityMappingDeletionException
-
getNumberOfExternalIdentityMappingsForUser
public long getNumberOfExternalIdentityMappingsForUser(java.lang.String kind, long userId, java.lang.String externalId, QueryOptions searchOptions, java.lang.String querySuffix) throws SBonitaReadException
Description copied from interface:ExternalIdentityMappingService
Get total number ofSExternalIdentityMapping
objects associated with the specified externalId and kind for the specific user. Use querySuffix to indicate what the displayNamePart is related to- Specified by:
getNumberOfExternalIdentityMappingsForUser
in interfaceExternalIdentityMappingService
- Parameters:
kind
- the discriminator of theSExternalIdentityMapping
to search for.userId
- The identifier of userexternalId
- the external Id identifying theSExternalIdentityMapping
s 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:ExternalIdentityMappingService
Search allSExternalIdentityMapping
objects associated with the specified externalId and kind for the specific user. Use querySuffix to indicate what the displayNamePart is related to- Specified by:
searchExternalIdentityMappingsForUser
in interfaceExternalIdentityMappingService
- Parameters:
kind
- the discriminator of theSExternalIdentityMapping
to search for.userId
- The identifier of userexternalId
- the external Id identifying theSExternalIdentityMapping
s 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 SBonitaReadException
Description copied from interface:ExternalIdentityMappingService
Get total number of externalIdentityMappings for specific kind according to the queryOptions.- Specified by:
getNumberOfExternalIdentityMappings
in interfaceExternalIdentityMappingService
- Parameters:
kind
- the discriminator of theSExternalIdentityMapping
to 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:ExternalIdentityMappingService
Get all externalIdentityMappings for specific kind according to the queryOptions. use querySuffix to indicate what the displayNamePart is related to- Specified by:
searchExternalIdentityMappings
in interfaceExternalIdentityMappingService
- Parameters:
kind
- the discriminator of theSExternalIdentityMapping
to 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:ExternalIdentityMappingService
Search allSExternalIdentityMapping
objects associated with the specified externalId and kind.- Specified by:
searchExternalIdentityMappings
in interfaceExternalIdentityMappingService
- Parameters:
kind
- the discriminator of theSExternalIdentityMapping
to search for.externalId
- the external Id identifying theSExternalIdentityMapping
s 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.
-
-