Class IdentityAPIImpl

java.lang.Object
org.bonitasoft.engine.api.impl.IdentityAPIImpl
All Implemented Interfaces:
org.bonitasoft.engine.api.CustomUserInfoAPI, org.bonitasoft.engine.api.GroupAPI, org.bonitasoft.engine.api.IdentityAPI, org.bonitasoft.engine.api.MembershipAPI, org.bonitasoft.engine.api.OrganizationAPI, org.bonitasoft.engine.api.RoleAPI, org.bonitasoft.engine.api.UserAPI

public class IdentityAPIImpl extends Object implements org.bonitasoft.engine.api.IdentityAPI
Author:
Matthieu Chaffotte, Elias Ricken de Medeiros, Feng Hui, Zhang Bole, Yanyan Liu, Lu Kai, Hongwen Zang, Celine Souchet
  • Constructor Details

    • IdentityAPIImpl

      public IdentityAPIImpl()
  • Method Details

    • getServiceAccessor

      protected ServiceAccessor getServiceAccessor()
    • getOrganizationAPIDelegate

      protected OrganizationAPIDelegate getOrganizationAPIDelegate()
    • createUser

      public org.bonitasoft.engine.identity.User createUser(String userName, String password) throws org.bonitasoft.engine.exception.CreationException
      Specified by:
      createUser in interface org.bonitasoft.engine.api.UserAPI
      Throws:
      org.bonitasoft.engine.exception.CreationException
    • createUser

      public org.bonitasoft.engine.identity.User createUser(String userName, String password, String firstName, String lastName) throws org.bonitasoft.engine.exception.CreationException
      Specified by:
      createUser in interface org.bonitasoft.engine.api.UserAPI
      Throws:
      org.bonitasoft.engine.exception.CreationException
    • createUser

      public org.bonitasoft.engine.identity.User createUser(org.bonitasoft.engine.identity.UserCreator creator) throws org.bonitasoft.engine.exception.CreationException
      Specified by:
      createUser in interface org.bonitasoft.engine.api.UserAPI
      Throws:
      org.bonitasoft.engine.exception.CreationException
    • updateUser

      public org.bonitasoft.engine.identity.User updateUser(long userId, org.bonitasoft.engine.identity.UserUpdater updater) throws org.bonitasoft.engine.identity.UserNotFoundException, org.bonitasoft.engine.exception.UpdateException
      Specified by:
      updateUser in interface org.bonitasoft.engine.api.UserAPI
      Throws:
      org.bonitasoft.engine.identity.UserNotFoundException
      org.bonitasoft.engine.exception.UpdateException
    • deleteUser

      public void deleteUser(long userId) throws org.bonitasoft.engine.exception.DeletionException
      Specified by:
      deleteUser in interface org.bonitasoft.engine.api.UserAPI
      Throws:
      org.bonitasoft.engine.exception.DeletionException
    • deleteUser

      public void deleteUser(String userName) throws org.bonitasoft.engine.exception.DeletionException
      Specified by:
      deleteUser in interface org.bonitasoft.engine.api.UserAPI
      Throws:
      org.bonitasoft.engine.exception.DeletionException
    • deleteUsers

      public void deleteUsers(List<Long> userIds) throws org.bonitasoft.engine.exception.DeletionException
      Specified by:
      deleteUsers in interface org.bonitasoft.engine.api.UserAPI
      Throws:
      org.bonitasoft.engine.exception.DeletionException
    • getUser

      public org.bonitasoft.engine.identity.User getUser(long userId) throws org.bonitasoft.engine.identity.UserNotFoundException
      Specified by:
      getUser in interface org.bonitasoft.engine.api.UserAPI
      Throws:
      org.bonitasoft.engine.identity.UserNotFoundException
    • getUserByUserName

      public org.bonitasoft.engine.identity.User getUserByUserName(String userName) throws org.bonitasoft.engine.identity.UserNotFoundException
      Specified by:
      getUserByUserName in interface org.bonitasoft.engine.api.UserAPI
      Throws:
      org.bonitasoft.engine.identity.UserNotFoundException
    • getUserWithProfessionalDetails

      public org.bonitasoft.engine.identity.UserWithContactData getUserWithProfessionalDetails(long userId) throws org.bonitasoft.engine.identity.UserNotFoundException
      Specified by:
      getUserWithProfessionalDetails in interface org.bonitasoft.engine.api.UserAPI
      Throws:
      org.bonitasoft.engine.identity.UserNotFoundException
    • getUserContactData

      public org.bonitasoft.engine.identity.ContactData getUserContactData(long userId, boolean personal) throws org.bonitasoft.engine.identity.UserNotFoundException
      Specified by:
      getUserContactData in interface org.bonitasoft.engine.api.UserAPI
      Throws:
      org.bonitasoft.engine.identity.UserNotFoundException
    • getNumberOfUsers

      public long getNumberOfUsers()
      Specified by:
      getNumberOfUsers in interface org.bonitasoft.engine.api.UserAPI
    • getUsers

      public List<org.bonitasoft.engine.identity.User> getUsers(int startIndex, int maxResults, org.bonitasoft.engine.identity.UserCriterion criterion)
      Specified by:
      getUsers in interface org.bonitasoft.engine.api.UserAPI
    • getUsers

      public Map<Long,org.bonitasoft.engine.identity.User> getUsers(List<Long> userIds)
      Specified by:
      getUsers in interface org.bonitasoft.engine.api.UserAPI
    • getUsersByUsernames

      public Map<String,org.bonitasoft.engine.identity.User> getUsersByUsernames(List<String> userNames)
      Specified by:
      getUsersByUsernames in interface org.bonitasoft.engine.api.UserAPI
    • searchUsers

      public org.bonitasoft.engine.search.SearchResult<org.bonitasoft.engine.identity.User> searchUsers(org.bonitasoft.engine.search.SearchOptions options) throws org.bonitasoft.engine.exception.SearchException
      Specified by:
      searchUsers in interface org.bonitasoft.engine.api.UserAPI
      Throws:
      org.bonitasoft.engine.exception.SearchException
    • getNumberOfUsersInRole

      public long getNumberOfUsersInRole(long roleId)
      Specified by:
      getNumberOfUsersInRole in interface org.bonitasoft.engine.api.UserAPI
    • getUsersInRole

      public List<org.bonitasoft.engine.identity.User> getUsersInRole(long roleId, int startIndex, int maxResults, org.bonitasoft.engine.identity.UserCriterion criterion)
      Specified by:
      getUsersInRole in interface org.bonitasoft.engine.api.UserAPI
    • getActiveUsersInRole

      public List<org.bonitasoft.engine.identity.User> getActiveUsersInRole(long roleId, int startIndex, int maxResults, org.bonitasoft.engine.identity.UserCriterion criterion)
      Specified by:
      getActiveUsersInRole in interface org.bonitasoft.engine.api.UserAPI
    • getInactiveUsersInRole

      public List<org.bonitasoft.engine.identity.User> getInactiveUsersInRole(long roleId, int startIndex, int maxResults, org.bonitasoft.engine.identity.UserCriterion criterion)
      Specified by:
      getInactiveUsersInRole in interface org.bonitasoft.engine.api.UserAPI
    • getUsersWithManager

      public List<org.bonitasoft.engine.identity.User> getUsersWithManager(long managerId, int startIndex, int maxResults, org.bonitasoft.engine.identity.UserCriterion criterion)
      Specified by:
      getUsersWithManager in interface org.bonitasoft.engine.api.UserAPI
    • getActiveUsersWithManager

      public List<org.bonitasoft.engine.identity.User> getActiveUsersWithManager(long managerId, int startIndex, int maxResults, org.bonitasoft.engine.identity.UserCriterion criterion)
      Specified by:
      getActiveUsersWithManager in interface org.bonitasoft.engine.api.UserAPI
    • getInactiveUsersWithManager

      public List<org.bonitasoft.engine.identity.User> getInactiveUsersWithManager(long managerId, int startIndex, int maxResults, org.bonitasoft.engine.identity.UserCriterion criterion)
      Specified by:
      getInactiveUsersWithManager in interface org.bonitasoft.engine.api.UserAPI
    • getNumberOfUsersInGroup

      public long getNumberOfUsersInGroup(long groupId)
      Specified by:
      getNumberOfUsersInGroup in interface org.bonitasoft.engine.api.UserAPI
    • getUsersInGroup

      public List<org.bonitasoft.engine.identity.User> getUsersInGroup(long groupId, int startIndex, int maxResults, org.bonitasoft.engine.identity.UserCriterion criterion)
      Specified by:
      getUsersInGroup in interface org.bonitasoft.engine.api.UserAPI
    • getActiveUsersInGroup

      public List<org.bonitasoft.engine.identity.User> getActiveUsersInGroup(long groupId, int startIndex, int maxResults, org.bonitasoft.engine.identity.UserCriterion criterion)
      Specified by:
      getActiveUsersInGroup in interface org.bonitasoft.engine.api.UserAPI
    • getInactiveUsersInGroup

      public List<org.bonitasoft.engine.identity.User> getInactiveUsersInGroup(long groupId, int startIndex, int maxResults, org.bonitasoft.engine.identity.UserCriterion criterion)
      Specified by:
      getInactiveUsersInGroup in interface org.bonitasoft.engine.api.UserAPI
    • getUserIdsWithCustomUserInfo

      public List<Long> getUserIdsWithCustomUserInfo(String infoName, String infoValue, boolean usePartialMatch, int startIndex, int maxResults)
      Specified by:
      getUserIdsWithCustomUserInfo in interface org.bonitasoft.engine.api.UserAPI
    • createRole

      public org.bonitasoft.engine.identity.Role createRole(String roleName) throws org.bonitasoft.engine.exception.CreationException
      Specified by:
      createRole in interface org.bonitasoft.engine.api.RoleAPI
      Throws:
      org.bonitasoft.engine.exception.CreationException
    • createRole

      public org.bonitasoft.engine.identity.Role createRole(org.bonitasoft.engine.identity.RoleCreator creator) throws org.bonitasoft.engine.exception.CreationException
      Specified by:
      createRole in interface org.bonitasoft.engine.api.RoleAPI
      Throws:
      org.bonitasoft.engine.exception.CreationException
    • updateRole

      public org.bonitasoft.engine.identity.Role updateRole(long roleId, org.bonitasoft.engine.identity.RoleUpdater updateDescriptor) throws org.bonitasoft.engine.identity.RoleNotFoundException, org.bonitasoft.engine.exception.UpdateException
      Specified by:
      updateRole in interface org.bonitasoft.engine.api.RoleAPI
      Throws:
      org.bonitasoft.engine.identity.RoleNotFoundException
      org.bonitasoft.engine.exception.UpdateException
    • deleteRole

      public void deleteRole(long roleId) throws org.bonitasoft.engine.exception.DeletionException
      Specified by:
      deleteRole in interface org.bonitasoft.engine.api.RoleAPI
      Throws:
      org.bonitasoft.engine.exception.DeletionException
    • deleteRoles

      public void deleteRoles(List<Long> roleIds) throws org.bonitasoft.engine.exception.DeletionException
      Specified by:
      deleteRoles in interface org.bonitasoft.engine.api.RoleAPI
      Throws:
      org.bonitasoft.engine.exception.DeletionException
    • getRole

      public org.bonitasoft.engine.identity.Role getRole(long roleId) throws org.bonitasoft.engine.identity.RoleNotFoundException
      Specified by:
      getRole in interface org.bonitasoft.engine.api.RoleAPI
      Throws:
      org.bonitasoft.engine.identity.RoleNotFoundException
    • getRoleByName

      public org.bonitasoft.engine.identity.Role getRoleByName(String roleName) throws org.bonitasoft.engine.identity.RoleNotFoundException
      Specified by:
      getRoleByName in interface org.bonitasoft.engine.api.RoleAPI
      Throws:
      org.bonitasoft.engine.identity.RoleNotFoundException
    • getNumberOfRoles

      public long getNumberOfRoles()
      Specified by:
      getNumberOfRoles in interface org.bonitasoft.engine.api.RoleAPI
    • getRoles

      public List<org.bonitasoft.engine.identity.Role> getRoles(int startIndex, int maxResults, org.bonitasoft.engine.identity.RoleCriterion criterion)
      Specified by:
      getRoles in interface org.bonitasoft.engine.api.RoleAPI
    • getRoles

      public Map<Long,org.bonitasoft.engine.identity.Role> getRoles(List<Long> roleIds)
      Specified by:
      getRoles in interface org.bonitasoft.engine.api.RoleAPI
    • searchRoles

      public org.bonitasoft.engine.search.SearchResult<org.bonitasoft.engine.identity.Role> searchRoles(org.bonitasoft.engine.search.SearchOptions options)
      Specified by:
      searchRoles in interface org.bonitasoft.engine.api.RoleAPI
    • createGroup

      public org.bonitasoft.engine.identity.Group createGroup(String name, String parentPath) throws org.bonitasoft.engine.exception.CreationException
      Specified by:
      createGroup in interface org.bonitasoft.engine.api.GroupAPI
      Throws:
      org.bonitasoft.engine.exception.CreationException
    • createGroup

      public org.bonitasoft.engine.identity.Group createGroup(org.bonitasoft.engine.identity.GroupCreator creator) throws org.bonitasoft.engine.exception.CreationException
      Specified by:
      createGroup in interface org.bonitasoft.engine.api.GroupAPI
      Throws:
      org.bonitasoft.engine.exception.CreationException
    • updateGroup

      public org.bonitasoft.engine.identity.Group updateGroup(long groupId, org.bonitasoft.engine.identity.GroupUpdater updater) throws org.bonitasoft.engine.identity.GroupNotFoundException, org.bonitasoft.engine.exception.UpdateException, org.bonitasoft.engine.exception.AlreadyExistsException
      Specified by:
      updateGroup in interface org.bonitasoft.engine.api.GroupAPI
      Throws:
      org.bonitasoft.engine.identity.GroupNotFoundException
      org.bonitasoft.engine.exception.UpdateException
      org.bonitasoft.engine.exception.AlreadyExistsException
    • deleteGroup

      public void deleteGroup(long groupId) throws org.bonitasoft.engine.exception.DeletionException
      Specified by:
      deleteGroup in interface org.bonitasoft.engine.api.GroupAPI
      Throws:
      org.bonitasoft.engine.exception.DeletionException
    • deleteGroups

      public void deleteGroups(List<Long> groupIds) throws org.bonitasoft.engine.exception.DeletionException
      Specified by:
      deleteGroups in interface org.bonitasoft.engine.api.GroupAPI
      Throws:
      org.bonitasoft.engine.exception.DeletionException
    • getGroup

      public org.bonitasoft.engine.identity.Group getGroup(long groupId) throws org.bonitasoft.engine.identity.GroupNotFoundException
      Specified by:
      getGroup in interface org.bonitasoft.engine.api.GroupAPI
      Throws:
      org.bonitasoft.engine.identity.GroupNotFoundException
    • getGroupByPath

      public org.bonitasoft.engine.identity.Group getGroupByPath(String groupPath) throws org.bonitasoft.engine.identity.GroupNotFoundException
      Specified by:
      getGroupByPath in interface org.bonitasoft.engine.api.GroupAPI
      Throws:
      org.bonitasoft.engine.identity.GroupNotFoundException
    • getNumberOfGroups

      public long getNumberOfGroups()
      Specified by:
      getNumberOfGroups in interface org.bonitasoft.engine.api.GroupAPI
    • getGroups

      public Map<Long,org.bonitasoft.engine.identity.Group> getGroups(List<Long> groupIds)
      Specified by:
      getGroups in interface org.bonitasoft.engine.api.GroupAPI
    • getGroups

      public List<org.bonitasoft.engine.identity.Group> getGroups(int startIndex, int maxResults, org.bonitasoft.engine.identity.GroupCriterion pagingCriterion)
      Specified by:
      getGroups in interface org.bonitasoft.engine.api.GroupAPI
    • searchGroups

      public org.bonitasoft.engine.search.SearchResult<org.bonitasoft.engine.identity.Group> searchGroups(org.bonitasoft.engine.search.SearchOptions options) throws org.bonitasoft.engine.exception.SearchException
      Specified by:
      searchGroups in interface org.bonitasoft.engine.api.GroupAPI
      Throws:
      org.bonitasoft.engine.exception.SearchException
    • addUserMembership

      public org.bonitasoft.engine.identity.UserMembership addUserMembership(long userId, long groupId, long roleId) throws org.bonitasoft.engine.exception.CreationException
      Specified by:
      addUserMembership in interface org.bonitasoft.engine.api.MembershipAPI
      Throws:
      org.bonitasoft.engine.exception.CreationException
    • addUserMemberships

      public void addUserMemberships(List<Long> userIds, long groupId, long roleId) throws org.bonitasoft.engine.exception.CreationException
      Specified by:
      addUserMemberships in interface org.bonitasoft.engine.api.MembershipAPI
      Throws:
      org.bonitasoft.engine.exception.CreationException
    • updateUserMembership

      public org.bonitasoft.engine.identity.UserMembership updateUserMembership(long userMembershipId, long newGroupId, long newRoleId) throws org.bonitasoft.engine.exception.UpdateException
      Specified by:
      updateUserMembership in interface org.bonitasoft.engine.api.MembershipAPI
      Throws:
      org.bonitasoft.engine.exception.UpdateException
    • deleteUserMembership

      public void deleteUserMembership(long userMembershipId) throws org.bonitasoft.engine.exception.DeletionException
      Specified by:
      deleteUserMembership in interface org.bonitasoft.engine.api.MembershipAPI
      Throws:
      org.bonitasoft.engine.exception.DeletionException
    • deleteUserMembership

      public void deleteUserMembership(long userId, long groupId, long roleId) throws org.bonitasoft.engine.exception.DeletionException
      Specified by:
      deleteUserMembership in interface org.bonitasoft.engine.api.MembershipAPI
      Throws:
      org.bonitasoft.engine.exception.DeletionException
    • deleteUserMemberships

      public void deleteUserMemberships(List<Long> userIds, long groupId, long roleId) throws org.bonitasoft.engine.exception.DeletionException
      Specified by:
      deleteUserMemberships in interface org.bonitasoft.engine.api.MembershipAPI
      Throws:
      org.bonitasoft.engine.exception.DeletionException
    • getUserMembership

      public org.bonitasoft.engine.identity.UserMembership getUserMembership(long userMembershipId) throws org.bonitasoft.engine.identity.MembershipNotFoundException
      Specified by:
      getUserMembership in interface org.bonitasoft.engine.api.MembershipAPI
      Throws:
      org.bonitasoft.engine.identity.MembershipNotFoundException
    • getNumberOfUserMemberships

      public long getNumberOfUserMemberships(long userId)
      Specified by:
      getNumberOfUserMemberships in interface org.bonitasoft.engine.api.MembershipAPI
    • getUserMemberships

      public List<org.bonitasoft.engine.identity.UserMembership> getUserMemberships(long userId, int startIndex, int maxResults, org.bonitasoft.engine.identity.UserMembershipCriterion pagingCrterion)
      Specified by:
      getUserMemberships in interface org.bonitasoft.engine.api.MembershipAPI
    • getUserMembershipsByGroup

      public List<org.bonitasoft.engine.identity.UserMembership> getUserMembershipsByGroup(long groupId, int startIndex, int maxResults)
      Specified by:
      getUserMembershipsByGroup in interface org.bonitasoft.engine.api.MembershipAPI
    • getUserMembershipsByRole

      public List<org.bonitasoft.engine.identity.UserMembership> getUserMembershipsByRole(long roleId, int startIndex, int maxResults)
      Specified by:
      getUserMembershipsByRole in interface org.bonitasoft.engine.api.MembershipAPI
    • deleteOrganization

      public void deleteOrganization() throws org.bonitasoft.engine.exception.DeletionException
      Specified by:
      deleteOrganization in interface org.bonitasoft.engine.api.OrganizationAPI
      Throws:
      org.bonitasoft.engine.exception.DeletionException
    • importOrganization

      public void importOrganization(String organizationContent) throws org.bonitasoft.engine.identity.OrganizationImportException
      Specified by:
      importOrganization in interface org.bonitasoft.engine.api.OrganizationAPI
      Throws:
      org.bonitasoft.engine.identity.OrganizationImportException
    • importOrganizationWithWarnings

      public List<String> importOrganizationWithWarnings(String organizationContent, org.bonitasoft.engine.identity.ImportPolicy policy) throws org.bonitasoft.engine.identity.OrganizationImportException
      Specified by:
      importOrganizationWithWarnings in interface org.bonitasoft.engine.api.OrganizationAPI
      Throws:
      org.bonitasoft.engine.identity.OrganizationImportException
    • exportOrganization

      public String exportOrganization() throws org.bonitasoft.engine.identity.OrganizationExportException
      Specified by:
      exportOrganization in interface org.bonitasoft.engine.api.OrganizationAPI
      Throws:
      org.bonitasoft.engine.identity.OrganizationExportException
    • createCustomUserInfoDefinition

      public org.bonitasoft.engine.identity.CustomUserInfoDefinition createCustomUserInfoDefinition(org.bonitasoft.engine.identity.CustomUserInfoDefinitionCreator creator) throws org.bonitasoft.engine.exception.CreationException
      Specified by:
      createCustomUserInfoDefinition in interface org.bonitasoft.engine.api.CustomUserInfoAPI
      Throws:
      org.bonitasoft.engine.exception.CreationException
    • getCustomUserInfoDefinitions

      public List<org.bonitasoft.engine.identity.CustomUserInfoDefinition> getCustomUserInfoDefinitions(int startIndex, int maxResult) throws org.bonitasoft.engine.exception.RetrieveException
      Specified by:
      getCustomUserInfoDefinitions in interface org.bonitasoft.engine.api.CustomUserInfoAPI
      Throws:
      org.bonitasoft.engine.exception.RetrieveException
    • getNumberOfCustomInfoDefinitions

      public long getNumberOfCustomInfoDefinitions()
      Specified by:
      getNumberOfCustomInfoDefinitions in interface org.bonitasoft.engine.api.CustomUserInfoAPI
    • deleteCustomUserInfoDefinition

      public void deleteCustomUserInfoDefinition(long id) throws org.bonitasoft.engine.exception.DeletionException
      Specified by:
      deleteCustomUserInfoDefinition in interface org.bonitasoft.engine.api.CustomUserInfoAPI
      Throws:
      org.bonitasoft.engine.exception.DeletionException
    • getCustomUserInfo

      public List<org.bonitasoft.engine.identity.CustomUserInfo> getCustomUserInfo(long userId, int startIndex, int maxResult)
      Specified by:
      getCustomUserInfo in interface org.bonitasoft.engine.api.CustomUserInfoAPI
    • searchCustomUserInfoValues

      public org.bonitasoft.engine.search.SearchResult<org.bonitasoft.engine.identity.CustomUserInfoValue> searchCustomUserInfoValues(org.bonitasoft.engine.search.SearchOptions options)
      Specified by:
      searchCustomUserInfoValues in interface org.bonitasoft.engine.api.CustomUserInfoAPI
    • setCustomUserInfoValue

      public org.bonitasoft.engine.identity.CustomUserInfoValue setCustomUserInfoValue(long definitionId, long userId, String value) throws org.bonitasoft.engine.exception.UpdateException
      Specified by:
      setCustomUserInfoValue in interface org.bonitasoft.engine.api.CustomUserInfoAPI
      Throws:
      org.bonitasoft.engine.exception.UpdateException
    • getIcon

      public org.bonitasoft.engine.identity.Icon getIcon(long id) throws org.bonitasoft.engine.exception.NotFoundException
      Specified by:
      getIcon in interface org.bonitasoft.engine.api.UserAPI
      Throws:
      org.bonitasoft.engine.exception.NotFoundException