Class UserMgmtService


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

      • UserMgmtService

        public UserMgmtService()
    • Method Detail

      • 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)
      • getUserExclusionAttributesAsString

        public String getUserExclusionAttributesAsString()
      • 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)