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
CustomUserInfoDefinitions. |
SearchResult<CustomUserInfoValue> |
searchCustomUserInfoValues(SearchOptions options)
Searches
CustomUserInfoValues 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 createdCustomUserInfoDefinitionAlreadyExistsException - If a CustomUserInfoDefinition already exists with the same name.CreationException - If an error occurs during the creationCustomUserInfoDefinition,
User,
CustomUserInfoDefinitionCreatorList<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.CustomUserInfoDefinitionlong getNumberOfCustomInfoDefinitions()
CustomUserInfoDefinitions.CustomUserInfoDefinitions.CustomUserInfoDefinitionvoid 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 CustomUserInfoDefinitionDeletionException - If an error occurs during deletionCustomUserInfoDefinition,
CustomUserInfoValueList<CustomUserInfo> getCustomUserInfo(long userId, int startIndex, int maxResult)
CustomUserInfo for the given user, ordered by CustomUserInfoDefinition name. For
CustomUserInfos which have CustomUserInfoDefinition without a related CustomUserInfoValue, the field value will be null.userId - The identifier of the UserstartIndex - 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,
UserSearchResult<CustomUserInfoValue> searchCustomUserInfoValues(SearchOptions options)
CustomUserInfoValues 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 CustomUserInfoValues 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 CustomUserInfoValues matching the criteriaSearchOptions,
CustomUserInfoValue,
CustomUserInfoValueSearchDescriptor,
SearchResultCustomUserInfoValue setCustomUserInfoValue(long definitionId, long userId, String value) throws UpdateException
CustomUserInfoDefinition for a given User.definitionId - The identifier of the CustomUserInfoDefinitionuserId - The identifier of the Uservalue - The Custom User Information valueCustomUserInfoValue representing the value of the given CustomUserInfoDefinition for the given
UserUpdateException - When an error occurs during the update.CustomUserInfoDefinition.getId(),
User.getId(),
CustomUserInfoValueCopyright © 2018 Bonitasoft S.A.. All rights reserved.