Class UserEntityUtil

java.lang.Object
com.atlassian.crowd.plugin.rest.util.UserEntityUtil

public class UserEntityUtil extends Object
Utility class for UserEntity.
  • Method Details

    • expandUser

      public static UserEntity expandUser(ApplicationService applicationService, Application application, UserEntity minimalUserEntity, boolean expandAttributes) throws UserNotFoundException
      Expands a UserEntity from its minimal form to the expanded version. Attributes are expanded if expandAttributes</tt> is <tt>true, otherwise, UserEntity is returned with no attributes expanded.

      N.B. This is not the same as expanding a user entity, which expands a UserEntity from its minimal form, to having all the first name, last name, email, etc filled in. Expanding a UserEntity is automatically performed in UserEntityExpander.

      Parameters:
      applicationService - ApplicationService to find a user
      application - name of the application requesting the user
      minimalUserEntity - Minimal representation of a UserEntity. Must include at least a username and a link.
      expandAttributes - set to true if the expanded UserEntity should expand attributes.
      Returns:
      UserEntity expanded UserEntity
      Throws:
      IllegalArgumentException - if the minimal UserEntity does not include at least a username and a link.
      UserNotFoundException - if a user with the specified username could not be found.
    • translate

      public static UserEntity translate(User user, com.atlassian.plugins.rest.api.model.Link oldLink)
    • translateWithAttributes

      public static UserEntity translateWithAttributes(User user, Attributes attributes, com.atlassian.plugins.rest.api.model.Link oldLink)
    • expandUser

      public static UserEntity expandUser(DirectoryManager directoryManager, long directoryId, UserEntity minimalUserEntity, boolean expandAttributes) throws UserNotFoundException, DirectoryNotFoundException, OperationFailedException
      Throws:
      UserNotFoundException
      DirectoryNotFoundException
      OperationFailedException