public interface CustomUserInfoAPI
OrganizationAPI
and gives access to all the Administration operations
available on
CustomUserInfoDefinition
and
CustomUserInfoValue
: creation,
deletion and retrieve methodsOrganizationAPI
,
CustomUserInfoDefinition
,
CustomUserInfoValue
Modifier and Type | Method and Description |
---|---|
CustomUserInfoDefinition |
createCustomUserInfoDefinition(CustomUserInfoDefinitionCreator creator)
Creates a new
CustomUserInfoDefinition that will be available for all
User
s in the organization. |
void |
deleteCustomUserInfoDefinition(long id)
Deletes the
CustomUserInfoDefinition identified by the given id. |
List<CustomUserInfo> |
getCustomUserInfo(long userId,
int startIndex,
int maxResult)
Retrieves the list of
CustomUserInfo for the given user, ordered by
CustomUserInfoDefinition name. |
List<CustomUserInfoDefinition> |
getCustomUserInfoDefinitions(int startIndex,
int maxResult)
Retrieves the list of
CustomUserInfoDefinition according to the given pagination criteria, ordered by
name. |
long |
getNumberOfCustomInfoDefinitions()
Retrieves the number of existing
CustomUserInfoDefinition s. |
SearchResult<CustomUserInfoValue> |
searchCustomUserInfoValues(SearchOptions options)
Searches
CustomUserInfoValue s according to the criteria contained in the
given
SearchOptions . |
CustomUserInfoValue |
setCustomUserInfoValue(long definitionId,
long userId,
String value)
Defines the value of a
CustomUserInfoDefinition for a given
User . |
CustomUserInfoDefinition createCustomUserInfoDefinition(CustomUserInfoDefinitionCreator creator) throws AlreadyExistsException, CreationException
CustomUserInfoDefinition
that will be available for all
User
s in the organization. In order to set a value for the new created CustomUserInfoDefinition
for a specif
User
use the method setCustomUserInfoValue(long, long, String)
.
Example:
CustomUserInfoDefinitionCreator creator = new CustomUserInfoDefinitionCreator("Skills", "The user skills"); CustomUserInfoDefinition userInfoDef = identityAPI.createCustomUserInfoDefinition(creator);
creator
- A CustomUserInfoDefinitionCreator
describing all information about
the CustomUserInfoDefinition
to
be createdCustomUserInfoDefinition
AlreadyExistsException
- If a CustomUserInfoDefinition
already exists with the same name.CreationException
- If an error occurs during the creationCustomUserInfoDefinition
,
User
,
CustomUserInfoDefinitionCreator
List<CustomUserInfoDefinition> getCustomUserInfoDefinitions(int startIndex, int maxResult)
CustomUserInfoDefinition
according to the given pagination criteria, ordered by
name.startIndex
- The index for the first element to be retrieved (starts from zero)maxResult
- The maximum number of elements to be retrieved.CustomUserInfoDefinition
according to the given pagination criteria, ordered by name.CustomUserInfoDefinition
long getNumberOfCustomInfoDefinitions()
CustomUserInfoDefinition
s.CustomUserInfoDefinition
s.CustomUserInfoDefinition
void deleteCustomUserInfoDefinition(long id) throws DeletionException
CustomUserInfoDefinition
identified by the given id. All CustomUserInfoValue
related
to this CustomUserInfoDefinition
will be deleted as well.id
- The identifier of the CustomUserInfoDefinition
DeletionException
- If an error occurs during deletionCustomUserInfoDefinition
,
CustomUserInfoValue
List<CustomUserInfo> getCustomUserInfo(long userId, int startIndex, int maxResult)
CustomUserInfo
for the given user, ordered by
CustomUserInfoDefinition
name. For
CustomUserInfo
s which have CustomUserInfoDefinition
without a related
CustomUserInfoValue
, the field value will be null.userId
- The identifier of the User
startIndex
- The index of the first element to be retrieved (it starts from zero)maxResult
- The maximum elements to be retrieved.CustomUserInfo
for the given User
, ordered by
CustomUserInfoDefinition
name.CustomUserInfoDefinition
,
CustomUserInfoValue
,
CustomUserInfo
,
User
SearchResult<CustomUserInfoValue> searchCustomUserInfoValues(SearchOptions options)
CustomUserInfoValue
s according to the criteria contained in the
given
SearchOptions
. In order to know which fields can be used in filters and
sorting, please refer to
CustomUserInfoValueSearchDescriptor
.
Example: searches the first 10 CustomUserInfoValue
s having the given CustomUserInfoDefinition
(referenced by its identifier) with the
given value. The result is ordered by the related User
identifier:
SearchOptionsBuilder optionsBuilder = new SearchOptionsBuilder(0, 10); optionsBuilder.filter(CustomUserInfoValueSearchDescriptor.DEFINITION_ID, userInfoDefinition.getId()); optionsBuilder.filter(CustomUserInfoValueSearchDescriptor.VALUE, value); optionsBuilder.sort(CustomUserInfoValueSearchDescriptor.USER_ID, Order.ASC); SearchResult<CustomUserInfoValue> searchResult = identityAPI.searchCustomUserInfoValues(optionsBuilder.done());
options
- The SearchOptions
containing the search criteriaSearchResult
containing the number and the list of
CustomUserInfoValue
s matching the criteriaSearchOptions
,
CustomUserInfoValue
,
CustomUserInfoValueSearchDescriptor
,
SearchResult
CustomUserInfoValue setCustomUserInfoValue(long definitionId, long userId, String value) throws UpdateException
CustomUserInfoDefinition
for a given
User
.definitionId
- The identifier of the CustomUserInfoDefinition
userId
- The identifier of the User
value
- The Custom User Information
valueCustomUserInfoValue
representing the value of the given
CustomUserInfoDefinition
for the given
User
UpdateException
- When an error occurs during the update.CustomUserInfoDefinition.getId()
,
User.getId()
,
CustomUserInfoValue
Copyright © 2020 Bonitasoft S.A. All rights reserved.