Class UserMgmtService

java.lang.Object
io.jans.configapi.plugin.mgt.service.UserMgmtService

@ApplicationScoped @Named("userMgmtSrv") public class UserMgmtService extends Object
  • Constructor Details

    • UserMgmtService

      public UserMgmtService()
  • Method Details

    • getPeopleBaseDn

      public String getPeopleBaseDn()
      Obtain the base Distinguished Name (DN) under which people (user) entries are stored.
      Returns:
      the base DN for people entries
    • searchUsers

      public io.jans.orm.model.PagedResult<io.jans.as.common.model.common.User> searchUsers(io.jans.model.SearchRequest searchRequest)
      Builds and executes a paged user search based on the provided SearchRequest. Constructs substring OR-filters from assertion values across displayName, description, mail, uid, givenName, middleName, nickname, sn, inum and mobile (mobile is treated as a multi-valued attribute), and combines them with per-field filters from the request's fieldValueMap (fields typed as `jsonb` and the mobile field are treated as multi-valued). The search is executed under the people base DN using the requested sorting and pagination. Inactive custom attributes are removed from resulting users before returning.
      Parameters:
      searchRequest - the search parameters including assertion values, field-value map, sorting and pagination
      Returns:
      a paged result of User objects whose custom attributes have been filtered to exclude inactive attributes
    • getUserByName

      public List<io.jans.as.common.model.common.User> getUserByName(String name)
      Retrieve users matching the specified uid that are marked active.
      Parameters:
      name - the uid (login name) to search for
      Returns:
      the list of matching active User objects, or `null` if an error occurs
    • getUserByEmail

      public List<io.jans.as.common.model.common.User> getUserByEmail(String email)
    • removeUser

      public void removeUser(io.jans.as.common.model.common.User user)
    • patchUser

      public io.jans.as.common.model.common.User patchUser(String inum, UserPatchRequest userPatchRequest) throws com.github.fge.jsonpatch.JsonPatchException, IOException
      Throws:
      com.github.fge.jsonpatch.JsonPatchException
      IOException
    • getUserBasedOnInum

      public io.jans.as.common.model.common.User getUserBasedOnInum(String inum)
    • excludeAttributes

      public List<io.jans.as.common.model.common.User> excludeAttributes(List<io.jans.as.common.model.common.User> users, String commaSeparatedString) throws IllegalAccessException, InvocationTargetException
      Throws:
      IllegalAccessException
      InvocationTargetException
    • excludeAttributes

      public io.jans.as.common.model.common.User excludeAttributes(io.jans.as.common.model.common.User user, String commaSeparatedString) throws IllegalAccessException, InvocationTargetException
      Throws:
      IllegalAccessException
      InvocationTargetException
    • getUserExclusionAttributesAsString

      public String getUserExclusionAttributesAsString()
    • checkMandatoryFields

      public String checkMandatoryFields(io.jans.as.common.model.common.User user, List<String> excludeAttributes) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException
      Throws:
      NoSuchMethodException
      IllegalAccessException
      InvocationTargetException
    • parseBirthDateAttribute

      public io.jans.as.common.model.common.User parseBirthDateAttribute(io.jans.as.common.model.common.User user)
    • ignoreCustomObjectClassesForNonLDAP

      public io.jans.as.common.model.common.User ignoreCustomObjectClassesForNonLDAP(io.jans.as.common.model.common.User user)
    • isLDAP

      public boolean isLDAP()
    • getPersistenceType

      public String getPersistenceType()
    • addUser

      public io.jans.as.common.model.common.User addUser(io.jans.as.common.model.common.User user, boolean active)
    • updateUser

      public io.jans.as.common.model.common.User updateUser(io.jans.as.common.model.common.User user)
    • verifyCustomAttributes

      public List<io.jans.as.common.model.common.User> verifyCustomAttributes(List<io.jans.as.common.model.common.User> users)
    • removeInActiveCustomAttribute

      public List<io.jans.orm.model.base.CustomObjectAttribute> removeInActiveCustomAttribute(List<io.jans.orm.model.base.CustomObjectAttribute> customAttributes)
    • findAttributeByName

      public List<io.jans.model.JansAttribute> findAttributeByName(String name)
    • getRequiredAttributes

      public List<io.jans.model.JansAttribute> getRequiredAttributes()
    • getJansAttributeName

      public List<String> getJansAttributeName(List<io.jans.model.JansAttribute> jansAttributeList)
    • validateAttributes

      public void validateAttributes(List<io.jans.orm.model.base.CustomObjectAttribute> customAttributes)
    • getAttributeType

      public String getAttributeType(String attributeName)