Class UserLocalServiceWrapper

Object
com.liferay.portal.kernel.service.UserLocalServiceWrapper
All Implemented Interfaces:
BaseLocalService, CTService<User>, PersistedModelLocalService, ServiceWrapper<UserLocalService>, UserLocalService

public class UserLocalServiceWrapper extends Object implements ServiceWrapper<UserLocalService>, UserLocalService
Provides a wrapper for UserLocalService.
Author:
Brian Wing Shun Chan
See Also:
{$generated.description}
  • Constructor Details

    • UserLocalServiceWrapper

      public UserLocalServiceWrapper()
    • UserLocalServiceWrapper

      public UserLocalServiceWrapper(UserLocalService userLocalService)
  • Method Details

    • addDefaultAdminUser

      public User addDefaultAdminUser(long companyId, String password, String screenName, String emailAddress, Locale locale, String firstName, String middleName, String lastName) throws PortalException
      Adds a default admin user for the company.
      Specified by:
      addDefaultAdminUser in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      password - the password of the user
      screenName - the user's screen name
      emailAddress - the user's email address
      locale - the user's locale
      firstName - the user's first name
      middleName - the user's middle name
      lastName - the user's last name
      Returns:
      the new default admin user
      Throws:
      PortalException
    • addDefaultGroups

      public boolean addDefaultGroups(long userId) throws PortalException
      Adds the user to the default groups, unless the user is already in these groups. The default groups can be specified in portal.properties with the key admin.default.group.names.
      Specified by:
      addDefaultGroups in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      Returns:
      true if user was added to default groups; false if user was already a member
      Throws:
      PortalException
    • addDefaultRoles

      public boolean addDefaultRoles(long userId) throws PortalException
      Adds the user to the default regular roles, unless the user already has these regular roles. The default regular roles can be specified in portal.properties with the key admin.default.role.names.
      Specified by:
      addDefaultRoles in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      Returns:
      true if user was given default roles; false if user already has default roles
      Throws:
      PortalException
    • addDefaultServiceAccountUser

      public User addDefaultServiceAccountUser(long companyId) throws PortalException
      Specified by:
      addDefaultServiceAccountUser in interface UserLocalService
      Throws:
      PortalException
    • addDefaultUserGroups

      public boolean addDefaultUserGroups(long userId) throws PortalException
      Adds the user to the default user groups, unless the user is already in these user groups. The default user groups can be specified in portal.properties with the property admin.default.user.group.names.
      Specified by:
      addDefaultUserGroups in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      Returns:
      true if user was added to default user groups; false if user is already a user group member
      Throws:
      PortalException
    • addGroupUser

      public boolean addGroupUser(long groupId, long userId)
      Specified by:
      addGroupUser in interface UserLocalService
    • addGroupUser

      public boolean addGroupUser(long groupId, User user)
      Specified by:
      addGroupUser in interface UserLocalService
    • addGroupUsers

      public boolean addGroupUsers(long groupId, List<User> users) throws PortalException
      Specified by:
      addGroupUsers in interface UserLocalService
      Throws:
      PortalException
      PortalException
    • addGroupUsers

      public boolean addGroupUsers(long groupId, long[] userIds) throws PortalException
      Specified by:
      addGroupUsers in interface UserLocalService
      Throws:
      PortalException
      PortalException
    • addOrganizationUser

      public boolean addOrganizationUser(long organizationId, long userId)
      Specified by:
      addOrganizationUser in interface UserLocalService
    • addOrganizationUser

      public boolean addOrganizationUser(long organizationId, User user)
      Specified by:
      addOrganizationUser in interface UserLocalService
    • addOrganizationUsers

      public boolean addOrganizationUsers(long organizationId, List<User> users) throws PortalException
      Specified by:
      addOrganizationUsers in interface UserLocalService
      Throws:
      PortalException
      PortalException
    • addOrganizationUsers

      public boolean addOrganizationUsers(long organizationId, long[] userIds) throws PortalException
      Specified by:
      addOrganizationUsers in interface UserLocalService
      Throws:
      PortalException
      PortalException
    • addOrUpdateUser

      public User addOrUpdateUser(String externalReferenceCode, long creatorUserId, long companyId, boolean autoPassword, String password1, String password2, boolean autoScreenName, String screenName, String emailAddress, Locale locale, String firstName, String middleName, String lastName, long prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, boolean sendEmail, ServiceContext serviceContext) throws PortalException
      Specified by:
      addOrUpdateUser in interface UserLocalService
      Throws:
      PortalException
    • addPasswordPolicyUsers

      public void addPasswordPolicyUsers(long passwordPolicyId, long[] userIds)
      Assigns the password policy to the users, removing any other currently assigned password policies.
      Specified by:
      addPasswordPolicyUsers in interface UserLocalService
      Parameters:
      passwordPolicyId - the primary key of the password policy
      userIds - the primary keys of the users
    • addRoleUser

      public boolean addRoleUser(long roleId, long userId)
      Specified by:
      addRoleUser in interface UserLocalService
    • addRoleUser

      public boolean addRoleUser(long roleId, User user)
      Specified by:
      addRoleUser in interface UserLocalService
    • addRoleUsers

      public boolean addRoleUsers(long roleId, List<User> users) throws PortalException
      Specified by:
      addRoleUsers in interface UserLocalService
      Throws:
      PortalException
      PortalException
    • addRoleUsers

      public boolean addRoleUsers(long roleId, long[] userIds) throws PortalException
      Specified by:
      addRoleUsers in interface UserLocalService
      Throws:
      PortalException
      PortalException
    • addTeamUser

      public boolean addTeamUser(long teamId, long userId)
      Specified by:
      addTeamUser in interface UserLocalService
    • addTeamUser

      public boolean addTeamUser(long teamId, User user)
      Specified by:
      addTeamUser in interface UserLocalService
    • addTeamUsers

      public boolean addTeamUsers(long teamId, List<User> users) throws PortalException
      Specified by:
      addTeamUsers in interface UserLocalService
      Throws:
      PortalException
      PortalException
    • addTeamUsers

      public boolean addTeamUsers(long teamId, long[] userIds) throws PortalException
      Specified by:
      addTeamUsers in interface UserLocalService
      Throws:
      PortalException
      PortalException
    • addUser

      public User addUser(long creatorUserId, long companyId, boolean autoPassword, String password1, String password2, boolean autoScreenName, String screenName, String emailAddress, Locale locale, String firstName, String middleName, String lastName, long prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, int type, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, boolean sendEmail, ServiceContext serviceContext) throws PortalException
      Adds a user.

      This method handles the creation and bookkeeping of the user including its resources, metadata, and internal data structures. It is not necessary to make subsequent calls to any methods to setup default groups, resources, etc.

      Specified by:
      addUser in interface UserLocalService
      Parameters:
      creatorUserId - the primary key of the creator
      companyId - the primary key of the user's company
      autoPassword - whether a password should be automatically generated for the user
      password1 - the user's password
      password2 - the user's password confirmation
      autoScreenName - whether a screen name should be automatically generated for the user
      screenName - the user's screen name
      emailAddress - the user's email address
      locale - the user's locale
      firstName - the user's first name
      middleName - the user's middle name
      lastName - the user's last name
      prefixListTypeId - the user's name prefix ID
      suffixListTypeId - the user's name suffix ID
      male - whether the user is male
      birthdayMonth - the user's birthday month (0-based, meaning 0 for January)
      birthdayDay - the user's birthday day
      birthdayYear - the user's birthday year
      jobTitle - the user's job title
      type - the user's type
      groupIds - the primary keys of the user's groups
      organizationIds - the primary keys of the user's organizations
      roleIds - the primary keys of the roles this user possesses
      userGroupIds - the primary keys of the user's user groups
      sendEmail - whether to send the user an email notification about their new account
      serviceContext - the service context to be applied (optionally null). Can set the UUID (with the uuid attribute), asset category IDs, asset tag names, and expando bridge attributes for the user.
      Returns:
      the new user
      Throws:
      PortalException
    • addUser

      public User addUser(User user)
      Adds the user to the database. Also notifies the appropriate model listeners.

      Important: Inspect UserLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.

      Specified by:
      addUser in interface UserLocalService
      Parameters:
      user - the user
      Returns:
      the user that was added
    • addUserGroupUser

      public boolean addUserGroupUser(long userGroupId, long userId)
      Specified by:
      addUserGroupUser in interface UserLocalService
    • addUserGroupUser

      public boolean addUserGroupUser(long userGroupId, User user)
      Specified by:
      addUserGroupUser in interface UserLocalService
    • addUserGroupUsers

      public boolean addUserGroupUsers(long userGroupId, List<User> users) throws PortalException
      Specified by:
      addUserGroupUsers in interface UserLocalService
      Throws:
      PortalException
      PortalException
    • addUserGroupUsers

      public boolean addUserGroupUsers(long userGroupId, long[] userIds) throws PortalException
      Specified by:
      addUserGroupUsers in interface UserLocalService
      Throws:
      PortalException
      PortalException
    • addUserWithWorkflow

      public User addUserWithWorkflow(long creatorUserId, long companyId, boolean autoPassword, String password1, String password2, boolean autoScreenName, String screenName, String emailAddress, Locale locale, String firstName, String middleName, String lastName, long prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, int type, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, boolean sendEmail, ServiceContext serviceContext) throws PortalException
      Adds a user with workflow.

      This method handles the creation and bookkeeping of the user including its resources, metadata, and internal data structures. It is not necessary to make subsequent calls to any methods to setup default groups, resources, etc.

      Specified by:
      addUserWithWorkflow in interface UserLocalService
      Parameters:
      creatorUserId - the primary key of the creator
      companyId - the primary key of the user's company
      autoPassword - whether a password should be automatically generated for the user
      password1 - the user's password
      password2 - the user's password confirmation
      autoScreenName - whether a screen name should be automatically generated for the user
      screenName - the user's screen name
      emailAddress - the user's email address
      locale - the user's locale
      firstName - the user's first name
      middleName - the user's middle name
      lastName - the user's last name
      prefixListTypeId - the user's name prefix ID
      suffixListTypeId - the user's name suffix ID
      male - whether the user is male
      birthdayMonth - the user's birthday month (0-based, meaning 0 for January)
      birthdayDay - the user's birthday day
      birthdayYear - the user's birthday year
      jobTitle - the user's job title
      type - the user's type
      groupIds - the primary keys of the user's groups
      organizationIds - the primary keys of the user's organizations
      roleIds - the primary keys of the roles this user possesses
      userGroupIds - the primary keys of the user's user groups
      sendEmail - whether to send the user an email notification about their new account
      serviceContext - the service context to be applied (optionally null). Can set the UUID (with the uuid attribute), asset category IDs, asset tag names, and expando bridge attributes for the user.
      Returns:
      the new user
      Throws:
      PortalException
    • authenticateByEmailAddress

      public int authenticateByEmailAddress(long companyId, String emailAddress, String password, Map<String,String[]> headerMap, Map<String,String[]> parameterMap, Map<String,Object> resultsMap) throws PortalException
      Attempts to authenticate the user by their email address and password, while using the AuthPipeline.
      Specified by:
      authenticateByEmailAddress in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      emailAddress - the user's email address
      password - the user's password
      headerMap - the header map from the authentication request
      parameterMap - the parameter map from the authentication request
      resultsMap - the map of authentication results (may be nil). After a successful authentication the user's primary key will be placed under the key userId.
      Returns:
      the authentication status. This can be Authenticator#FAILURE indicating that the user's credentials are invalid, Authenticator#SUCCESS indicating a successful login, or Authenticator#DNE indicating that a user with that login does not exist.
      Throws:
      PortalException
      See Also:
      • AuthPipeline
    • authenticateByScreenName

      public int authenticateByScreenName(long companyId, String screenName, String password, Map<String,String[]> headerMap, Map<String,String[]> parameterMap, Map<String,Object> resultsMap) throws PortalException
      Attempts to authenticate the user by their screen name and password, while using the AuthPipeline.
      Specified by:
      authenticateByScreenName in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      screenName - the user's screen name
      password - the user's password
      headerMap - the header map from the authentication request
      parameterMap - the parameter map from the authentication request
      resultsMap - the map of authentication results (may be nil). After a successful authentication the user's primary key will be placed under the key userId.
      Returns:
      the authentication status. This can be Authenticator#FAILURE indicating that the user's credentials are invalid, Authenticator#SUCCESS indicating a successful login, or Authenticator#DNE indicating that a user with that login does not exist.
      Throws:
      PortalException
      See Also:
      • AuthPipeline
    • authenticateByUserId

      public int authenticateByUserId(long companyId, long userId, String password, Map<String,String[]> headerMap, Map<String,String[]> parameterMap, Map<String,Object> resultsMap) throws PortalException
      Attempts to authenticate the user by their primary key and password, while using the AuthPipeline.
      Specified by:
      authenticateByUserId in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      userId - the user's primary key
      password - the user's password
      headerMap - the header map from the authentication request
      parameterMap - the parameter map from the authentication request
      resultsMap - the map of authentication results (may be nil). After a successful authentication the user's primary key will be placed under the key userId.
      Returns:
      the authentication status. This can be Authenticator#FAILURE indicating that the user's credentials are invalid, Authenticator#SUCCESS indicating a successful login, or Authenticator#DNE indicating that a user with that login does not exist.
      Throws:
      PortalException
      See Also:
      • AuthPipeline
    • authenticateForBasic

      public long authenticateForBasic(long companyId, String authType, String login, String password) throws PortalException
      Attempts to authenticate the user using HTTP basic access authentication, without using the AuthPipeline. Primarily used for authenticating users of tunnel-web.

      Authentication type specifies what login contains.The valid values are:

      • CompanyConstants.AUTH_TYPE_EA - login is the user's email address
      • CompanyConstants.AUTH_TYPE_SN - login is the user's screen name
      • CompanyConstants.AUTH_TYPE_ID - login is the user's primary key
      Specified by:
      authenticateForBasic in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      authType - the type of authentication to perform
      login - either the user's email address, screen name, or primary key depending on the value of authType
      password - the user's password
      Returns:
      the user's primary key if authentication is successful; 0 otherwise
      Throws:
      PortalException
    • authenticateForDigest

      @Deprecated public long authenticateForDigest(long companyId, String userName, String realm, String nonce, String method, String uri, String response) throws PortalException
      Deprecated.
      As of Cavanaugh (7.4.x), with no direct replacement
      Attempts to authenticate the user using HTTP digest access authentication, without using the AuthPipeline. Primarily used for authenticating users of tunnel-web.
      Specified by:
      authenticateForDigest in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      realm - unused
      nonce - the number used once
      method - the request method
      uri - the request URI
      response - the authentication response hash
      Returns:
      the user's primary key if authentication is successful; 0 otherwise
      Throws:
      PortalException
    • checkLockout

      public void checkLockout(User user) throws PortalException
      Checks if the user is currently locked out based on the password policy, and performs maintenance on the user's lockout and failed login data.
      Specified by:
      checkLockout in interface UserLocalService
      Parameters:
      user - the user
      Throws:
      PortalException
    • checkLoginFailure

      public void checkLoginFailure(User user)
      Adds a failed login attempt to the user and updates the user's last failed login date.
      Specified by:
      checkLoginFailure in interface UserLocalService
      Parameters:
      user - the user
    • checkLoginFailureByEmailAddress

      public void checkLoginFailureByEmailAddress(long companyId, String emailAddress) throws PortalException
      Adds a failed login attempt to the user with the email address and updates the user's last failed login date.
      Specified by:
      checkLoginFailureByEmailAddress in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      emailAddress - the user's email address
      Throws:
      PortalException
    • checkLoginFailureById

      public void checkLoginFailureById(long userId) throws PortalException
      Adds a failed login attempt to the user and updates the user's last failed login date.
      Specified by:
      checkLoginFailureById in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      Throws:
      PortalException
    • checkLoginFailureByScreenName

      public void checkLoginFailureByScreenName(long companyId, String screenName) throws PortalException
      Adds a failed login attempt to the user with the screen name and updates the user's last failed login date.
      Specified by:
      checkLoginFailureByScreenName in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      screenName - the user's screen name
      Throws:
      PortalException
    • checkPasswordExpired

      public void checkPasswordExpired(User user) throws PortalException
      Checks if the user's password is expired based on the password policy, and performs maintenance on the user's grace login and password reset data.
      Specified by:
      checkPasswordExpired in interface UserLocalService
      Parameters:
      user - the user
      Throws:
      PortalException
    • clearGroupUsers

      public void clearGroupUsers(long groupId)
      Specified by:
      clearGroupUsers in interface UserLocalService
    • clearOrganizationUsers

      public void clearOrganizationUsers(long organizationId)
      Specified by:
      clearOrganizationUsers in interface UserLocalService
    • clearRoleUsers

      public void clearRoleUsers(long roleId)
      Specified by:
      clearRoleUsers in interface UserLocalService
    • clearTeamUsers

      public void clearTeamUsers(long teamId)
      Specified by:
      clearTeamUsers in interface UserLocalService
    • clearUserGroupUsers

      public void clearUserGroupUsers(long userGroupId)
      Specified by:
      clearUserGroupUsers in interface UserLocalService
    • completeUserRegistration

      public void completeUserRegistration(User user, ServiceContext serviceContext) throws PortalException
      Completes the user's registration by generating a password and sending the confirmation email.
      Specified by:
      completeUserRegistration in interface UserLocalService
      Parameters:
      user - the user
      serviceContext - the service context to be applied. You automatically generate a password for the user by setting attribute autoPassword to true. You can send a confirmation email to the user by setting attribute sendEmail to true.
      Throws:
      PortalException
    • createPersistedModel

      public PersistedModel createPersistedModel(Serializable primaryKeyObj) throws PortalException
      Specified by:
      createPersistedModel in interface PersistedModelLocalService
      Specified by:
      createPersistedModel in interface UserLocalService
      Throws:
      PortalException
      PortalException
    • createUser

      public User createUser(long userId)
      Creates a new user with the primary key. Does not add the user to the database.
      Specified by:
      createUser in interface UserLocalService
      Parameters:
      userId - the primary key for the new user
      Returns:
      the new user
    • deleteGroupUser

      public void deleteGroupUser(long groupId, long userId)
      Specified by:
      deleteGroupUser in interface UserLocalService
    • deleteGroupUser

      public void deleteGroupUser(long groupId, User user)
      Specified by:
      deleteGroupUser in interface UserLocalService
    • deleteGroupUsers

      public void deleteGroupUsers(long groupId, List<User> users)
      Specified by:
      deleteGroupUsers in interface UserLocalService
    • deleteGroupUsers

      public void deleteGroupUsers(long groupId, long[] userIds)
      Specified by:
      deleteGroupUsers in interface UserLocalService
    • deleteOrganizationUser

      public void deleteOrganizationUser(long organizationId, long userId)
      Specified by:
      deleteOrganizationUser in interface UserLocalService
    • deleteOrganizationUser

      public void deleteOrganizationUser(long organizationId, User user)
      Specified by:
      deleteOrganizationUser in interface UserLocalService
    • deleteOrganizationUsers

      public void deleteOrganizationUsers(long organizationId, List<User> users)
      Specified by:
      deleteOrganizationUsers in interface UserLocalService
    • deleteOrganizationUsers

      public void deleteOrganizationUsers(long organizationId, long[] userIds)
      Specified by:
      deleteOrganizationUsers in interface UserLocalService
    • deletePersistedModel

      public PersistedModel deletePersistedModel(PersistedModel persistedModel) throws PortalException
      Specified by:
      deletePersistedModel in interface PersistedModelLocalService
      Specified by:
      deletePersistedModel in interface UserLocalService
      Throws:
      PortalException
      PortalException
    • deletePortrait

      public void deletePortrait(long userId) throws PortalException
      Deletes the user's portrait image.
      Specified by:
      deletePortrait in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      Throws:
      PortalException
    • deleteRoleUser

      public void deleteRoleUser(long roleId, long userId) throws PortalException
      Specified by:
      deleteRoleUser in interface UserLocalService
      Throws:
      PortalException
      PortalException
    • deleteRoleUser

      public void deleteRoleUser(long roleId, User user) throws PortalException
      Specified by:
      deleteRoleUser in interface UserLocalService
      Throws:
      PortalException
      PortalException
    • deleteRoleUsers

      public void deleteRoleUsers(long roleId, List<User> users)
      Specified by:
      deleteRoleUsers in interface UserLocalService
    • deleteRoleUsers

      public void deleteRoleUsers(long roleId, long[] userIds)
      Specified by:
      deleteRoleUsers in interface UserLocalService
    • deleteTeamUser

      public void deleteTeamUser(long teamId, long userId)
      Specified by:
      deleteTeamUser in interface UserLocalService
    • deleteTeamUser

      public void deleteTeamUser(long teamId, User user)
      Specified by:
      deleteTeamUser in interface UserLocalService
    • deleteTeamUsers

      public void deleteTeamUsers(long teamId, List<User> users)
      Specified by:
      deleteTeamUsers in interface UserLocalService
    • deleteTeamUsers

      public void deleteTeamUsers(long teamId, long[] userIds)
      Specified by:
      deleteTeamUsers in interface UserLocalService
    • deleteUser

      public User deleteUser(long userId) throws PortalException
      Deletes the user with the primary key from the database. Also notifies the appropriate model listeners.

      Important: Inspect UserLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.

      Specified by:
      deleteUser in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      Returns:
      the user that was removed
      Throws:
      PortalException - if a user with the primary key could not be found
      PortalException
    • deleteUser

      public User deleteUser(User user) throws PortalException
      Deletes the user from the database. Also notifies the appropriate model listeners.

      Important: Inspect UserLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.

      Specified by:
      deleteUser in interface UserLocalService
      Parameters:
      user - the user
      Returns:
      the user that was removed
      Throws:
      PortalException
      PortalException
    • deleteUserGroupUser

      public void deleteUserGroupUser(long userGroupId, long userId) throws PortalException
      Specified by:
      deleteUserGroupUser in interface UserLocalService
      Throws:
      PortalException
      PortalException
    • deleteUserGroupUser

      public void deleteUserGroupUser(long userGroupId, User user) throws PortalException
      Specified by:
      deleteUserGroupUser in interface UserLocalService
      Throws:
      PortalException
      PortalException
    • deleteUserGroupUsers

      public void deleteUserGroupUsers(long userGroupId, List<User> users)
      Specified by:
      deleteUserGroupUsers in interface UserLocalService
    • deleteUserGroupUsers

      public void deleteUserGroupUsers(long userGroupId, long[] userIds)
      Specified by:
      deleteUserGroupUsers in interface UserLocalService
    • dslQuery

      public <T> T dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery)
      Specified by:
      dslQuery in interface PersistedModelLocalService
      Specified by:
      dslQuery in interface UserLocalService
    • dslQueryCount

      public int dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery)
      Specified by:
      dslQueryCount in interface PersistedModelLocalService
      Specified by:
      dslQueryCount in interface UserLocalService
    • dynamicQuery

      public DynamicQuery dynamicQuery()
      Specified by:
      dynamicQuery in interface UserLocalService
    • dynamicQuery

      public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery)
      Performs a dynamic query on the database and returns the matching rows.
      Specified by:
      dynamicQuery in interface UserLocalService
      Parameters:
      dynamicQuery - the dynamic query
      Returns:
      the matching rows
    • dynamicQuery

      public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
      Performs a dynamic query on the database and returns a range of the matching rows.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.UserModelImpl.

      Specified by:
      dynamicQuery in interface UserLocalService
      Parameters:
      dynamicQuery - the dynamic query
      start - the lower bound of the range of model instances
      end - the upper bound of the range of model instances (not inclusive)
      Returns:
      the range of matching rows
    • dynamicQuery

      public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<T> orderByComparator)
      Performs a dynamic query on the database and returns an ordered range of the matching rows.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.UserModelImpl.

      Specified by:
      dynamicQuery in interface UserLocalService
      Parameters:
      dynamicQuery - the dynamic query
      start - the lower bound of the range of model instances
      end - the upper bound of the range of model instances (not inclusive)
      orderByComparator - the comparator to order the results by (optionally null)
      Returns:
      the ordered range of matching rows
    • dynamicQueryCount

      public long dynamicQueryCount(DynamicQuery dynamicQuery)
      Returns the number of rows matching the dynamic query.
      Specified by:
      dynamicQueryCount in interface UserLocalService
      Parameters:
      dynamicQuery - the dynamic query
      Returns:
      the number of rows matching the dynamic query
    • dynamicQueryCount

      public long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection)
      Returns the number of rows matching the dynamic query.
      Specified by:
      dynamicQueryCount in interface UserLocalService
      Parameters:
      dynamicQuery - the dynamic query
      projection - the projection to apply to the query
      Returns:
      the number of rows matching the dynamic query
    • encryptUserId

      public String encryptUserId(String name) throws PortalException
      Encrypts the primary key of the user. Used when encrypting the user's credentials for storage in an automatic login cookie.
      Specified by:
      encryptUserId in interface UserLocalService
      Parameters:
      name - the primary key of the user
      Returns:
      the user's encrypted primary key
      Throws:
      PortalException
    • fetchGuestUser

      public User fetchGuestUser(long companyId)
      Returns the guest user for the company.
      Specified by:
      fetchGuestUser in interface UserLocalService
      Parameters:
      companyId - the primary key of the company
      Returns:
      the guest user for the company, or null if a user with the company key could not be found
    • fetchUser

      public User fetchUser(long userId)
      Specified by:
      fetchUser in interface UserLocalService
    • fetchUserByContactId

      public User fetchUserByContactId(long contactId)
      Returns the user with the contact ID.
      Specified by:
      fetchUserByContactId in interface UserLocalService
      Parameters:
      contactId - the user's contact ID
      Returns:
      the user with the contact ID, or null if a user with the contact ID could not be found
    • fetchUserByEmailAddress

      public User fetchUserByEmailAddress(long companyId, String emailAddress)
      Returns the user with the email address.
      Specified by:
      fetchUserByEmailAddress in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      emailAddress - the user's email address
      Returns:
      the user with the email address, or null if a user with the email address could not be found
    • fetchUserByExternalReferenceCode

      public User fetchUserByExternalReferenceCode(String externalReferenceCode, long companyId)
      Specified by:
      fetchUserByExternalReferenceCode in interface UserLocalService
    • fetchUserByFacebookId

      @Deprecated public User fetchUserByFacebookId(long companyId, long facebookId)
      Deprecated.
      As of Athanasius (7.3.x), with no direct replacement
      Returns the user with the Facebook ID.
      Specified by:
      fetchUserByFacebookId in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      facebookId - the user's Facebook ID
      Returns:
      the user with the Facebook ID, or null if a user with the Facebook ID could not be found
    • fetchUserByGoogleUserId

      public User fetchUserByGoogleUserId(long companyId, String googleUserId)
      Returns the user with the Google user ID.
      Specified by:
      fetchUserByGoogleUserId in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      googleUserId - the user's Google user ID
      Returns:
      the user with the Google user ID, or null if a user with the Google user ID could not be found
    • fetchUserById

      public User fetchUserById(long userId)
      Returns the user with the primary key.
      Specified by:
      fetchUserById in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      Returns:
      the user with the primary key, or null if a user with the primary key could not be found
    • fetchUserByOpenId

      @Deprecated public User fetchUserByOpenId(long companyId, String openId)
      Deprecated.
      As of Athanasius (7.3.x), with no direct replacement
      Returns the user with the OpenID.
      Specified by:
      fetchUserByOpenId in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      openId - the user's OpenID
      Returns:
      the user with the OpenID, or null if a user with the OpenID could not be found
    • fetchUserByPortraitId

      public User fetchUserByPortraitId(long portraitId)
      Returns the user with the portrait ID.
      Specified by:
      fetchUserByPortraitId in interface UserLocalService
      Parameters:
      portraitId - the user's portrait ID
      Returns:
      the user with the portrait ID, or null if a user with the portrait ID could not be found
    • fetchUserByScreenName

      public User fetchUserByScreenName(long companyId, String screenName)
      Returns the user with the screen name.
      Specified by:
      fetchUserByScreenName in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      screenName - the user's screen name
      Returns:
      the user with the screen name, or null if a user with the screen name could not be found
    • fetchUserByUuidAndCompanyId

      public User fetchUserByUuidAndCompanyId(String uuid, long companyId)
      Returns the user with the matching UUID and company.
      Specified by:
      fetchUserByUuidAndCompanyId in interface UserLocalService
      Parameters:
      uuid - the user's UUID
      companyId - the primary key of the company
      Returns:
      the matching user, or null if a matching user could not be found
    • getActionableDynamicQuery

      public ActionableDynamicQuery getActionableDynamicQuery()
      Specified by:
      getActionableDynamicQuery in interface UserLocalService
    • getCompanyUsers

      public List<User> getCompanyUsers(long companyId, int start, int end)
      Returns a range of all the users belonging to the company.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set.

      Specified by:
      getCompanyUsers in interface UserLocalService
      Parameters:
      companyId - the primary key of the company
      start - the lower bound of the range of users
      end - the upper bound of the range of users (not inclusive)
      Returns:
      the range of users belonging to the company
    • getCompanyUsersCount

      public int getCompanyUsersCount(long companyId)
      Returns the number of users belonging to the company.
      Specified by:
      getCompanyUsersCount in interface UserLocalService
      Parameters:
      companyId - the primary key of the company
      Returns:
      the number of users belonging to the company
    • getDefaultUser

      @Deprecated public User getDefaultUser(long companyId) throws PortalException
      Deprecated.
      As of Cavanaugh (7.4.x), replaced by getGuestUser(long)
      Specified by:
      getDefaultUser in interface UserLocalService
      Throws:
      PortalException
    • getDefaultUserId

      @Deprecated public long getDefaultUserId(long companyId) throws PortalException
      Deprecated.
      As of Cavanaugh (7.4.x), replaced by getGuestUserId(long)
      Specified by:
      getDefaultUserId in interface UserLocalService
      Throws:
      PortalException
    • getExportActionableDynamicQuery

      public ExportActionableDynamicQuery getExportActionableDynamicQuery(PortletDataContext portletDataContext)
      Specified by:
      getExportActionableDynamicQuery in interface UserLocalService
    • getGroupPrimaryKeys

      public long[] getGroupPrimaryKeys(long userId)
      Returns the groupIds of the groups associated with the user.
      Specified by:
      getGroupPrimaryKeys in interface UserLocalService
      Parameters:
      userId - the userId of the user
      Returns:
      long[] the groupIds of groups associated with the user
    • getGroupUserIds

      public long[] getGroupUserIds(long groupId)
      Returns the primary keys of all the users belonging to the group.
      Specified by:
      getGroupUserIds in interface UserLocalService
      Parameters:
      groupId - the primary key of the group
      Returns:
      the primary keys of the users belonging to the group
    • getGroupUsers

      public List<User> getGroupUsers(long groupId)
      Specified by:
      getGroupUsers in interface UserLocalService
    • getGroupUsers

      public List<User> getGroupUsers(long groupId, int start, int end) throws PortalException
      Specified by:
      getGroupUsers in interface UserLocalService
      Throws:
      PortalException
      PortalException
    • getGroupUsers

      public List<User> getGroupUsers(long groupId, int status, int start, int end, OrderByComparator<User> orderByComparator) throws PortalException
      Returns the users belonging to a group.
      Specified by:
      getGroupUsers in interface UserLocalService
      Parameters:
      groupId - the primary key of the group
      status - the workflow status
      start - the lower bound of the range of users
      end - the upper bound of the range of users (not inclusive)
      orderByComparator - the comparator to order the users by (optionally null)
      Returns:
      the matching users
      Throws:
      PortalException
    • getGroupUsers

      public List<User> getGroupUsers(long groupId, int start, int end, OrderByComparator<User> orderByComparator)
      Specified by:
      getGroupUsers in interface UserLocalService
    • getGroupUsers

      public List<User> getGroupUsers(long groupId, int status, OrderByComparator<User> orderByComparator) throws PortalException
      Returns the users belonging to a group.
      Specified by:
      getGroupUsers in interface UserLocalService
      Parameters:
      groupId - the primary key of the group
      status - the workflow status
      orderByComparator - the comparator to order the users by (optionally null)
      Returns:
      the matching users
      Throws:
      PortalException
    • getGroupUsersCount

      public int getGroupUsersCount(long groupId)
      Specified by:
      getGroupUsersCount in interface UserLocalService
    • getGroupUsersCount

      public int getGroupUsersCount(long groupId, int status) throws PortalException
      Returns the number of users with the status belonging to the group.
      Specified by:
      getGroupUsersCount in interface UserLocalService
      Parameters:
      groupId - the primary key of the group
      status - the workflow status
      Returns:
      the number of users with the status belonging to the group
      Throws:
      PortalException
    • getGuestUser

      public User getGuestUser(long companyId) throws PortalException
      Returns the guest user for the company.
      Specified by:
      getGuestUser in interface UserLocalService
      Parameters:
      companyId - the primary key of the company
      Returns:
      the guest user for the company
      Throws:
      PortalException
    • getGuestUserId

      public long getGuestUserId(long companyId) throws PortalException
      Returns the primary key of the guest user for the company.
      Specified by:
      getGuestUserId in interface UserLocalService
      Parameters:
      companyId - the primary key of the company
      Returns:
      the primary key of the guest user for the company
      Throws:
      PortalException
    • getIndexableActionableDynamicQuery

      public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()
      Specified by:
      getIndexableActionableDynamicQuery in interface UserLocalService
    • getInheritedRoleUsers

      public List<User> getInheritedRoleUsers(long roleId, int start, int end, OrderByComparator<User> orderByComparator) throws PortalException
      Specified by:
      getInheritedRoleUsers in interface UserLocalService
      Throws:
      PortalException
    • getNoAnnouncementsDeliveries

      public List<User> getNoAnnouncementsDeliveries(String type)
      Returns all the users who have not had any announcements of the type delivered, excluding the default user.
      Specified by:
      getNoAnnouncementsDeliveries in interface UserLocalService
      Parameters:
      type - the type of announcement
      Returns:
      the users who have not had any annoucements of the type delivered
    • getNoGroups

      public List<User> getNoGroups()
      Returns all the users who do not belong to any groups, excluding the default user.
      Specified by:
      getNoGroups in interface UserLocalService
      Returns:
      the users who do not belong to any groups
    • getOrganizationPrimaryKeys

      public long[] getOrganizationPrimaryKeys(long userId)
      Returns the organizationIds of the organizations associated with the user.
      Specified by:
      getOrganizationPrimaryKeys in interface UserLocalService
      Parameters:
      userId - the userId of the user
      Returns:
      long[] the organizationIds of organizations associated with the user
    • getOrganizationsAndUserGroupsUsersCount

      public int getOrganizationsAndUserGroupsUsersCount(long[] organizationIds, long[] userGroupIds)
      Specified by:
      getOrganizationsAndUserGroupsUsersCount in interface UserLocalService
    • getOrganizationUserIds

      public long[] getOrganizationUserIds(long organizationId)
      Returns the primary keys of all the users belonging to the organization.
      Specified by:
      getOrganizationUserIds in interface UserLocalService
      Parameters:
      organizationId - the primary key of the organization
      Returns:
      the primary keys of the users belonging to the organization
    • getOrganizationUsers

      public List<User> getOrganizationUsers(long organizationId)
      Specified by:
      getOrganizationUsers in interface UserLocalService
    • getOrganizationUsers

      public List<User> getOrganizationUsers(long organizationId, int start, int end) throws PortalException
      Specified by:
      getOrganizationUsers in interface UserLocalService
      Throws:
      PortalException
      PortalException
    • getOrganizationUsers

      public List<User> getOrganizationUsers(long organizationId, int status, int start, int end, OrderByComparator<User> orderByComparator) throws PortalException
      Returns the users belonging to the organization with the status.
      Specified by:
      getOrganizationUsers in interface UserLocalService
      Parameters:
      organizationId - the primary key of the organization
      status - the workflow status
      start - the lower bound of the range of users
      end - the upper bound of the range of users (not inclusive)
      orderByComparator - the comparator to order the users by (optionally null)
      Returns:
      the matching users
      Throws:
      PortalException
    • getOrganizationUsers

      public List<User> getOrganizationUsers(long organizationId, int start, int end, OrderByComparator<User> orderByComparator)
      Specified by:
      getOrganizationUsers in interface UserLocalService
    • getOrganizationUsers

      public List<User> getOrganizationUsers(long organizationId, int status, OrderByComparator<User> orderByComparator) throws PortalException
      Returns the users belonging to the organization with the status.
      Specified by:
      getOrganizationUsers in interface UserLocalService
      Parameters:
      organizationId - the primary key of the organization
      status - the workflow status
      orderByComparator - the comparator to order the users by (optionally null)
      Returns:
      the matching users
      Throws:
      PortalException
    • getOrganizationUsersCount

      public int getOrganizationUsersCount(long organizationId)
      Specified by:
      getOrganizationUsersCount in interface UserLocalService
    • getOrganizationUsersCount

      public int getOrganizationUsersCount(long organizationId, int status) throws PortalException
      Returns the number of users with the status belonging to the organization.
      Specified by:
      getOrganizationUsersCount in interface UserLocalService
      Parameters:
      organizationId - the primary key of the organization
      status - the workflow status
      Returns:
      the number of users with the status belonging to the organization
      Throws:
      PortalException
    • getOSGiServiceIdentifier

      public String getOSGiServiceIdentifier()
      Returns the OSGi service identifier.
      Specified by:
      getOSGiServiceIdentifier in interface UserLocalService
      Returns:
      the OSGi service identifier
    • getPersistedModel

      public PersistedModel getPersistedModel(Serializable primaryKeyObj) throws PortalException
      Specified by:
      getPersistedModel in interface PersistedModelLocalService
      Specified by:
      getPersistedModel in interface UserLocalService
      Throws:
      PortalException
      PortalException
    • getRolePrimaryKeys

      public long[] getRolePrimaryKeys(long userId)
      Returns the roleIds of the roles associated with the user.
      Specified by:
      getRolePrimaryKeys in interface UserLocalService
      Parameters:
      userId - the userId of the user
      Returns:
      long[] the roleIds of roles associated with the user
    • getRoleUserIds

      public long[] getRoleUserIds(long roleId)
      Returns the primary keys of all the users belonging to the role.
      Specified by:
      getRoleUserIds in interface UserLocalService
      Parameters:
      roleId - the primary key of the role
      Returns:
      the primary keys of the users belonging to the role
    • getRoleUserIds

      public long[] getRoleUserIds(long roleId, long type)
      Specified by:
      getRoleUserIds in interface UserLocalService
    • getRoleUsers

      public List<User> getRoleUsers(long roleId)
      Specified by:
      getRoleUsers in interface UserLocalService
    • getRoleUsers

      public List<User> getRoleUsers(long roleId, int start, int end)
      Specified by:
      getRoleUsers in interface UserLocalService
    • getRoleUsers

      public List<User> getRoleUsers(long roleId, int start, int end, OrderByComparator<User> orderByComparator)
      Specified by:
      getRoleUsers in interface UserLocalService
    • getRoleUsersCount

      public int getRoleUsersCount(long roleId)
      Specified by:
      getRoleUsersCount in interface UserLocalService
    • getRoleUsersCount

      public int getRoleUsersCount(long roleId, int status) throws PortalException
      Returns the number of users with the status belonging to the role.
      Specified by:
      getRoleUsersCount in interface UserLocalService
      Parameters:
      roleId - the primary key of the role
      status - the workflow status
      Returns:
      the number of users with the status belonging to the role
      Throws:
      PortalException
    • getSocialUsers

      public List<User> getSocialUsers(long userId, int socialRelationType, String socialRelationTypeComparator, int start, int end, OrderByComparator<User> orderByComparator) throws PortalException
      Specified by:
      getSocialUsers in interface UserLocalService
      Throws:
      PortalException
    • getSocialUsers

      public List<User> getSocialUsers(long userId1, long userId2, int socialRelationType, int start, int end, OrderByComparator<User> orderByComparator) throws PortalException
      Returns an ordered range of all the users with a mutual social relation of the type with both of the given users.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set.

      Specified by:
      getSocialUsers in interface UserLocalService
      Parameters:
      userId1 - the primary key of the first user
      userId2 - the primary key of the second user
      socialRelationType - the type of social relation. The possible types can be found in SocialRelationConstants.
      start - the lower bound of the range of users
      end - the upper bound of the range of users (not inclusive)
      orderByComparator - the comparator to order the users by (optionally null)
      Returns:
      the ordered range of users with a mutual social relation of the type with the user
      Throws:
      PortalException
    • getSocialUsers

      public List<User> getSocialUsers(long userId1, long userId2, int start, int end, OrderByComparator<User> orderByComparator) throws PortalException
      Returns an ordered range of all the users with a mutual social relation with both of the given users.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set.

      Specified by:
      getSocialUsers in interface UserLocalService
      Parameters:
      userId1 - the primary key of the first user
      userId2 - the primary key of the second user
      start - the lower bound of the range of users
      end - the upper bound of the range of users (not inclusive)
      orderByComparator - the comparator to order the users by (optionally null)
      Returns:
      the ordered range of users with a mutual social relation with the user
      Throws:
      PortalException
    • getSocialUsersCount

      public int getSocialUsersCount(long userId, int socialRelationType, String socialRelationTypeComparator) throws PortalException
      Returns the number of users with a social relation with the user.
      Specified by:
      getSocialUsersCount in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      socialRelationType - the type of social relation. The possible types can be found in SocialRelationConstants.
      Returns:
      the number of users with a social relation with the user
      Throws:
      PortalException
    • getSocialUsersCount

      public int getSocialUsersCount(long userId1, long userId2) throws PortalException
      Returns the number of users with a mutual social relation with both of the given users.
      Specified by:
      getSocialUsersCount in interface UserLocalService
      Parameters:
      userId1 - the primary key of the first user
      userId2 - the primary key of the second user
      Returns:
      the number of users with a mutual social relation with the user
      Throws:
      PortalException
    • getSocialUsersCount

      public int getSocialUsersCount(long userId1, long userId2, int socialRelationType) throws PortalException
      Returns the number of users with a mutual social relation of the type with both of the given users.
      Specified by:
      getSocialUsersCount in interface UserLocalService
      Parameters:
      userId1 - the primary key of the first user
      userId2 - the primary key of the second user
      socialRelationType - the type of social relation. The possible types can be found in SocialRelationConstants.
      Returns:
      the number of users with a mutual social relation of the type with the user
      Throws:
      PortalException
    • getTeamPrimaryKeys

      public long[] getTeamPrimaryKeys(long userId)
      Returns the teamIds of the teams associated with the user.
      Specified by:
      getTeamPrimaryKeys in interface UserLocalService
      Parameters:
      userId - the userId of the user
      Returns:
      long[] the teamIds of teams associated with the user
    • getTeamUsers

      public List<User> getTeamUsers(long teamId)
      Specified by:
      getTeamUsers in interface UserLocalService
    • getTeamUsers

      public List<User> getTeamUsers(long teamId, int start, int end)
      Specified by:
      getTeamUsers in interface UserLocalService
    • getTeamUsers

      public List<User> getTeamUsers(long teamId, int start, int end, OrderByComparator<User> orderByComparator)
      Specified by:
      getTeamUsers in interface UserLocalService
    • getTeamUsersCount

      public int getTeamUsersCount(long teamId)
      Specified by:
      getTeamUsersCount in interface UserLocalService
    • getUser

      public User getUser(long userId) throws PortalException
      Returns the user with the primary key.
      Specified by:
      getUser in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      Returns:
      the user
      Throws:
      PortalException - if a user with the primary key could not be found
      PortalException
    • getUserByContactId

      public User getUserByContactId(long contactId) throws PortalException
      Returns the user with the contact ID.
      Specified by:
      getUserByContactId in interface UserLocalService
      Parameters:
      contactId - the user's contact ID
      Returns:
      the user with the contact ID
      Throws:
      PortalException
    • getUserByEmailAddress

      public User getUserByEmailAddress(long companyId, String emailAddress) throws PortalException
      Returns the user with the email address.
      Specified by:
      getUserByEmailAddress in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      emailAddress - the user's email address
      Returns:
      the user with the email address
      Throws:
      PortalException
    • getUserByExternalReferenceCode

      public User getUserByExternalReferenceCode(String externalReferenceCode, long companyId) throws PortalException
      Specified by:
      getUserByExternalReferenceCode in interface UserLocalService
      Throws:
      PortalException
    • getUserByFacebookId

      @Deprecated public User getUserByFacebookId(long companyId, long facebookId) throws PortalException
      Deprecated.
      As of Athanasius (7.3.x), with no direct replacement
      Returns the user with the Facebook ID.
      Specified by:
      getUserByFacebookId in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      facebookId - the user's Facebook ID
      Returns:
      the user with the Facebook ID
      Throws:
      PortalException
    • getUserByGoogleUserId

      public User getUserByGoogleUserId(long companyId, String googleUserId) throws PortalException
      Returns the user with the Google user ID.
      Specified by:
      getUserByGoogleUserId in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      googleUserId - the user's Google user ID
      Returns:
      the user with the Google user ID
      Throws:
      PortalException
    • getUserById

      public User getUserById(long userId) throws PortalException
      Returns the user with the primary key.
      Specified by:
      getUserById in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      Returns:
      the user with the primary key
      Throws:
      PortalException
    • getUserById

      public User getUserById(long companyId, long userId) throws PortalException
      Returns the user with the primary key from the company.
      Specified by:
      getUserById in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      userId - the primary key of the user
      Returns:
      the user with the primary key
      Throws:
      PortalException
    • getUserByOpenId

      @Deprecated public User getUserByOpenId(long companyId, String openId) throws PortalException
      Deprecated.
      As of Athanasius (7.3.x), with no direct replacement
      Returns the user with the OpenID.
      Specified by:
      getUserByOpenId in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      openId - the user's OpenID
      Returns:
      the user with the OpenID
      Throws:
      PortalException
    • getUserByPortraitId

      public User getUserByPortraitId(long portraitId) throws PortalException
      Returns the user with the portrait ID.
      Specified by:
      getUserByPortraitId in interface UserLocalService
      Parameters:
      portraitId - the user's portrait ID
      Returns:
      the user with the portrait ID
      Throws:
      PortalException
    • getUserByScreenName

      public User getUserByScreenName(long companyId, String screenName) throws PortalException
      Returns the user with the screen name.
      Specified by:
      getUserByScreenName in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      screenName - the user's screen name
      Returns:
      the user with the screen name
      Throws:
      PortalException
    • getUserByUuidAndCompanyId

      public User getUserByUuidAndCompanyId(String uuid, long companyId) throws PortalException
      Returns the user with the matching UUID and company.
      Specified by:
      getUserByUuidAndCompanyId in interface UserLocalService
      Parameters:
      uuid - the user's UUID
      companyId - the primary key of the company
      Returns:
      the matching user
      Throws:
      PortalException - if a matching user could not be found
      PortalException
    • getUserGroupPrimaryKeys

      public long[] getUserGroupPrimaryKeys(long userId)
      Returns the userGroupIds of the user groups associated with the user.
      Specified by:
      getUserGroupPrimaryKeys in interface UserLocalService
      Parameters:
      userId - the userId of the user
      Returns:
      long[] the userGroupIds of user groups associated with the user
    • getUserGroupUsers

      public List<User> getUserGroupUsers(long userGroupId)
      Specified by:
      getUserGroupUsers in interface UserLocalService
    • getUserGroupUsers

      public List<User> getUserGroupUsers(long userGroupId, int start, int end)
      Specified by:
      getUserGroupUsers in interface UserLocalService
    • getUserGroupUsers

      public List<User> getUserGroupUsers(long userGroupId, int start, int end, OrderByComparator<User> orderByComparator)
      Specified by:
      getUserGroupUsers in interface UserLocalService
    • getUserGroupUsersCount

      public int getUserGroupUsersCount(long userGroupId)
      Specified by:
      getUserGroupUsersCount in interface UserLocalService
    • getUserGroupUsersCount

      public int getUserGroupUsersCount(long userGroupId, int status) throws PortalException
      Returns the number of users with the status belonging to the user group.
      Specified by:
      getUserGroupUsersCount in interface UserLocalService
      Parameters:
      userGroupId - the primary key of the user group
      status - the workflow status
      Returns:
      the number of users with the status belonging to the user group
      Throws:
      PortalException
    • getUserIdByEmailAddress

      public long getUserIdByEmailAddress(long companyId, String emailAddress) throws PortalException
      Returns the primary key of the user with the email address.
      Specified by:
      getUserIdByEmailAddress in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      emailAddress - the user's email address
      Returns:
      the primary key of the user with the email address
      Throws:
      PortalException
    • getUserIdByScreenName

      public long getUserIdByScreenName(long companyId, String screenName) throws PortalException
      Returns the primary key of the user with the screen name.
      Specified by:
      getUserIdByScreenName in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      screenName - the user's screen name
      Returns:
      the primary key of the user with the screen name
      Throws:
      PortalException
    • getUsers

      public List<User> getUsers(int start, int end)
      Returns a range of all the users.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.UserModelImpl.

      Specified by:
      getUsers in interface UserLocalService
      Parameters:
      start - the lower bound of the range of users
      end - the upper bound of the range of users (not inclusive)
      Returns:
      the range of users
    • getUsers

      public List<User> getUsers(long companyId, int status, int start, int end, OrderByComparator<User> orderByComparator)
      Specified by:
      getUsers in interface UserLocalService
    • getUsersByRoleId

      public List<User> getUsersByRoleId(long roleId, int start, int end) throws PortalException
      Specified by:
      getUsersByRoleId in interface UserLocalService
      Throws:
      PortalException
    • getUsersByRoleName

      public List<User> getUsersByRoleName(long companyId, String roleName, int start, int end) throws PortalException
      Specified by:
      getUsersByRoleName in interface UserLocalService
      Throws:
      PortalException
    • getUsersCount

      public int getUsersCount()
      Returns the number of users.
      Specified by:
      getUsersCount in interface UserLocalService
      Returns:
      the number of users
    • getUsersCount

      public int getUsersCount(long companyId, int status)
      Specified by:
      getUsersCount in interface UserLocalService
    • hasGroupUser

      public boolean hasGroupUser(long groupId, long userId)
      Specified by:
      hasGroupUser in interface UserLocalService
    • hasGroupUsers

      public boolean hasGroupUsers(long groupId)
      Specified by:
      hasGroupUsers in interface UserLocalService
    • hasOrganizationUser

      public boolean hasOrganizationUser(long organizationId, long userId)
      Specified by:
      hasOrganizationUser in interface UserLocalService
    • hasOrganizationUsers

      public boolean hasOrganizationUsers(long organizationId)
      Specified by:
      hasOrganizationUsers in interface UserLocalService
    • hasPasswordPolicyUser

      public boolean hasPasswordPolicyUser(long passwordPolicyId, long userId)
      Returns true if the password policy has been assigned to the user.
      Specified by:
      hasPasswordPolicyUser in interface UserLocalService
      Parameters:
      passwordPolicyId - the primary key of the password policy
      userId - the primary key of the user
      Returns:
      true if the password policy is assigned to the user; false otherwise
    • hasRoleUser

      public boolean hasRoleUser(long roleId, long userId)
      Specified by:
      hasRoleUser in interface UserLocalService
    • hasRoleUser

      public boolean hasRoleUser(long companyId, String name, long userId, boolean inherited) throws PortalException
      Returns true if the user has the role with the name, optionally through inheritance.
      Specified by:
      hasRoleUser in interface UserLocalService
      Parameters:
      companyId - the primary key of the role's company
      name - the name of the role (must be a regular role, not an organization, site or provider role)
      userId - the primary key of the user
      inherited - whether to include roles inherited from organizations, sites, etc.
      Returns:
      true if the user has the role; false otherwise
      Throws:
      PortalException
    • hasRoleUsers

      public boolean hasRoleUsers(long roleId)
      Specified by:
      hasRoleUsers in interface UserLocalService
    • hasTeamUser

      public boolean hasTeamUser(long teamId, long userId)
      Specified by:
      hasTeamUser in interface UserLocalService
    • hasTeamUsers

      public boolean hasTeamUsers(long teamId)
      Specified by:
      hasTeamUsers in interface UserLocalService
    • hasUserGroupUser

      public boolean hasUserGroupUser(long userGroupId, long userId)
      Specified by:
      hasUserGroupUser in interface UserLocalService
    • hasUserGroupUsers

      public boolean hasUserGroupUsers(long userGroupId)
      Specified by:
      hasUserGroupUsers in interface UserLocalService
    • isPasswordExpired

      public boolean isPasswordExpired(User user) throws PortalException
      Returns true if the user's password is expired.
      Specified by:
      isPasswordExpired in interface UserLocalService
      Parameters:
      user - the user
      Returns:
      true if the user's password is expired; false otherwise
      Throws:
      PortalException
    • loadGetGuestUser

      public User loadGetGuestUser(long companyId) throws PortalException
      Returns the guest user for the company.
      Specified by:
      loadGetGuestUser in interface UserLocalService
      Parameters:
      companyId - the primary key of the company
      Returns:
      the guest user for the company
      Throws:
      PortalException
    • search

      public List<User> search(long companyId, String keywords, int status, LinkedHashMap<String,Object> params, int start, int end, OrderByComparator<User> orderByComparator)
      Returns an ordered range of all the users who match the keywords and status, without using the indexer. It is preferable to use the indexed version search(long, String, int, LinkedHashMap, int, int, Sort) instead of this method wherever possible for performance reasons.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set.

      Specified by:
      search in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      keywords - the keywords (space separated), which may occur in the user's first name, middle name, last name, screen name, or email address
      status - the workflow status
      params - the finder parameters (optionally null). For more information see UserFinder.
      start - the lower bound of the range of users
      end - the upper bound of the range of users (not inclusive)
      orderByComparator - the comparator to order the users by (optionally null)
      Returns:
      the matching users
      See Also:
    • search

      public Hits search(long companyId, String keywords, int status, LinkedHashMap<String,Object> params, int start, int end, Sort sort)
      Returns an ordered range of all the users who match the keywords and status, using the indexer. It is preferable to use this method instead of the non-indexed version whenever possible for performance reasons.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set.

      Specified by:
      search in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      keywords - the keywords (space separated), which may occur in the user's first name, middle name, last name, screen name, or email address
      status - the workflow status
      params - the indexer parameters (optionally null).
      start - the lower bound of the range of users
      end - the upper bound of the range of users (not inclusive)
      sort - the field and direction to sort by (optionally null)
      Returns:
      the matching users
    • search

      public Hits search(long companyId, String keywords, int status, LinkedHashMap<String,Object> params, int start, int end, Sort[] sorts)
      Specified by:
      search in interface UserLocalService
    • search

      public List<User> search(long companyId, String firstName, String middleName, String lastName, String screenName, String emailAddress, int status, LinkedHashMap<String,Object> params, boolean andSearch, int start, int end, OrderByComparator<User> orderByComparator)
      Returns an ordered range of all the users with the status, and whose first name, middle name, last name, screen name, and email address match the keywords specified for them, without using the indexer. It is preferable to use the indexed version search(long, String, String, String, String, String, int, LinkedHashMap, boolean, int, int, Sort) instead of this method wherever possible for performance reasons.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set.

      Specified by:
      search in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      firstName - the first name keywords (space separated)
      middleName - the middle name keywords
      lastName - the last name keywords
      screenName - the screen name keywords
      emailAddress - the email address keywords
      status - the workflow status
      params - the finder parameters (optionally null). For more information see UserFinder.
      andSearch - whether every field must match its keywords, or just one field. For example, "users with the first name 'bob' and last name 'smith'" vs "users with the first name 'bob' or the last name 'smith'".
      start - the lower bound of the range of users
      end - the upper bound of the range of users (not inclusive)
      orderByComparator - the comparator to order the users by (optionally null)
      Returns:
      the matching users
      See Also:
    • search

      public Hits search(long companyId, String firstName, String middleName, String lastName, String screenName, String emailAddress, int status, LinkedHashMap<String,Object> params, boolean andSearch, int start, int end, Sort sort)
      Returns an ordered range of all the users with the status, and whose first name, middle name, last name, screen name, and email address match the keywords specified for them, using the indexer. It is preferable to use this method instead of the non-indexed version whenever possible for performance reasons.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil#ALL_POS will return the full result set.

      Specified by:
      search in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      firstName - the first name keywords (space separated)
      middleName - the middle name keywords
      lastName - the last name keywords
      screenName - the screen name keywords
      emailAddress - the email address keywords
      status - the workflow status
      params - the indexer parameters (optionally null).
      andSearch - whether every field must match its keywords, or just one field. For example, "users with the first name 'bob' and last name 'smith'" vs "users with the first name 'bob' or the last name 'smith'".
      start - the lower bound of the range of users
      end - the upper bound of the range of users (not inclusive)
      sort - the field and direction to sort by (optionally null)
      Returns:
      the matching users
    • search

      public Hits search(long companyId, String firstName, String middleName, String lastName, String screenName, String emailAddress, int status, LinkedHashMap<String,Object> params, boolean andSearch, int start, int end, Sort[] sorts)
      Specified by:
      search in interface UserLocalService
    • searchBySocial

      public List<User> searchBySocial(long userId, int[] socialRelationTypes, String keywords, int start, int end) throws PortalException
      Specified by:
      searchBySocial in interface UserLocalService
      Throws:
      PortalException
    • searchBySocial

      public List<User> searchBySocial(long companyId, long[] groupIds, long[] userGroupIds, String keywords, int start, int end)
      Specified by:
      searchBySocial in interface UserLocalService
    • searchBySocial

      public List<User> searchBySocial(long companyId, long[] groupIds, long[] userGroupIds, String keywords, int start, int end, OrderByComparator<User> orderByComparator)
      Specified by:
      searchBySocial in interface UserLocalService
    • searchBySocial

      public List<User> searchBySocial(long[] groupIds, long userId, int[] socialRelationTypes, String keywords, int start, int end) throws PortalException
      Specified by:
      searchBySocial in interface UserLocalService
      Throws:
      PortalException
    • searchCount

      public int searchCount(long companyId, String keywords, int status, LinkedHashMap<String,Object> params)
      Returns the number of users who match the keywords and status.
      Specified by:
      searchCount in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      keywords - the keywords (space separated), which may occur in the user's first name, middle name, last name, screen name, or email address
      status - the workflow status
      params - the finder parameters (optionally null). For more information see UserFinder.
      Returns:
      the number matching users
    • searchCount

      public int searchCount(long companyId, String firstName, String middleName, String lastName, String screenName, String emailAddress, int status, LinkedHashMap<String,Object> params, boolean andSearch)
      Returns the number of users with the status, and whose first name, middle name, last name, screen name, and email address match the keywords specified for them.
      Specified by:
      searchCount in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      firstName - the first name keywords (space separated)
      middleName - the middle name keywords
      lastName - the last name keywords
      screenName - the screen name keywords
      emailAddress - the email address keywords
      status - the workflow status
      params - the finder parameters (optionally null). For more information see UserFinder.
      andSearch - whether every field must match its keywords, or just one field. For example, "users with the first name 'bob' and last name 'smith'" vs "users with the first name 'bob' or the last name 'smith'".
      Returns:
      the number of matching users
    • searchCounts

      public Map<Long,Integer> searchCounts(long companyId, int status, long[] groupIds)
      Specified by:
      searchCounts in interface UserLocalService
    • searchUsers

      public BaseModelSearchResult<User> searchUsers(long companyId, String keywords, int status, LinkedHashMap<String,Object> params, int start, int end, Sort sort) throws PortalException
      Specified by:
      searchUsers in interface UserLocalService
      Throws:
      PortalException
    • searchUsers

      public BaseModelSearchResult<User> searchUsers(long companyId, String keywords, int status, LinkedHashMap<String,Object> params, int start, int end, Sort[] sorts) throws PortalException
      Specified by:
      searchUsers in interface UserLocalService
      Throws:
      PortalException
    • searchUsers

      public BaseModelSearchResult<User> searchUsers(long companyId, String firstName, String middleName, String lastName, String screenName, String emailAddress, int status, LinkedHashMap<String,Object> params, boolean andSearch, int start, int end, Sort sort) throws PortalException
      Specified by:
      searchUsers in interface UserLocalService
      Throws:
      PortalException
    • searchUsers

      public BaseModelSearchResult<User> searchUsers(long companyId, String firstName, String middleName, String lastName, String screenName, String emailAddress, int status, LinkedHashMap<String,Object> params, boolean andSearch, int start, int end, Sort[] sorts) throws PortalException
      Specified by:
      searchUsers in interface UserLocalService
      Throws:
      PortalException
    • sendEmailAddressVerification

      public void sendEmailAddressVerification(User user, String emailAddress, ServiceContext serviceContext) throws PortalException
      Sends an email address verification to the user.
      Specified by:
      sendEmailAddressVerification in interface UserLocalService
      Parameters:
      user - the verification email recipient
      emailAddress - the recipient's email address
      serviceContext - the service context to be applied. Must set the portal URL, main path, primary key of the layout, remote address, remote host, and agent for the user.
      Throws:
      PortalException
    • sendEmailUserCreationAttempt

      public boolean sendEmailUserCreationAttempt(long companyId, String emailAddress, String fromName, String fromAddress, String subject, String body, ServiceContext serviceContext) throws PortalException
      Specified by:
      sendEmailUserCreationAttempt in interface UserLocalService
      Throws:
      PortalException
    • sendPassword

      public boolean sendPassword(long companyId, String emailAddress, String fromName, String fromAddress, String subject, String body, ServiceContext serviceContext) throws PortalException
      Specified by:
      sendPassword in interface UserLocalService
      Throws:
      PortalException
    • sendPasswordByEmailAddress

      public boolean sendPasswordByEmailAddress(long companyId, String emailAddress) throws PortalException
      Sends a password notification email to the user matching the email address. The portal's settings determine whether a password is sent explicitly or whether a link for resetting the user's password is sent. The method sends the email asynchronously and returns before the email is sent.

      The content of the notification email is specified with the admin.email.password portal property keys. They can be overridden via a portal-ext.properties file or modified through the Portal Settings UI.

      Specified by:
      sendPasswordByEmailAddress in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      emailAddress - the user's email address
      Returns:
      true if the notification email includes a new password; false if the notification email only contains a reset link
      Throws:
      PortalException
    • sendPasswordByScreenName

      public boolean sendPasswordByScreenName(long companyId, String screenName) throws PortalException
      Sends a password notification email to the user matching the screen name. The portal's settings determine whether a password is sent explicitly or whether a link for resetting the user's password is sent. The method sends the email asynchronously and returns before the email is sent.

      The content of the notification email is specified with the admin.email.password portal property keys. They can be overridden via a portal-ext.properties file or modified through the Portal Settings UI.

      Specified by:
      sendPasswordByScreenName in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      screenName - the user's screen name
      Returns:
      true if the notification email includes a new password; false if the notification email only contains a reset link
      Throws:
      PortalException
    • sendPasswordByUserId

      public boolean sendPasswordByUserId(long userId) throws PortalException
      Sends a password notification email to the user matching the ID. The portal's settings determine whether a password is sent explicitly or whether a link for resetting the user's password is sent. The method sends the email asynchronously and returns before the email is sent.

      The content of the notification email is specified with the admin.email.password portal property keys. They can be overridden via a portal-ext.properties file or modified through the Portal Settings UI.

      Specified by:
      sendPasswordByUserId in interface UserLocalService
      Parameters:
      userId - the user's primary key
      Returns:
      true if the notification email includes a new password; false if the notification email only contains a reset link
      Throws:
      PortalException
    • sendPasswordLockout

      public boolean sendPasswordLockout(long companyId, String emailAddress, String fromName, String fromAddress, String subject, String body, ServiceContext serviceContext) throws PortalException
      Specified by:
      sendPasswordLockout in interface UserLocalService
      Throws:
      PortalException
    • setGroupUsers

      public void setGroupUsers(long groupId, long[] userIds)
      Specified by:
      setGroupUsers in interface UserLocalService
    • setOrganizationUsers

      public void setOrganizationUsers(long organizationId, long[] userIds)
      Specified by:
      setOrganizationUsers in interface UserLocalService
    • setRoleUsers

      public void setRoleUsers(long roleId, long[] userIds) throws PortalException
      Specified by:
      setRoleUsers in interface UserLocalService
      Throws:
      PortalException
      PortalException
    • setTeamUsers

      public void setTeamUsers(long teamId, long[] userIds)
      Specified by:
      setTeamUsers in interface UserLocalService
    • setUserGroupUsers

      public void setUserGroupUsers(long userGroupId, long[] userIds) throws PortalException
      Specified by:
      setUserGroupUsers in interface UserLocalService
      Throws:
      PortalException
      PortalException
    • unsetGroupTeamsUsers

      public void unsetGroupTeamsUsers(long groupId, long[] userIds) throws PortalException
      Removes the users from the teams of a group.
      Specified by:
      unsetGroupTeamsUsers in interface UserLocalService
      Parameters:
      groupId - the primary key of the group
      userIds - the primary keys of the users
      Throws:
      PortalException
    • unsetGroupUsers

      public void unsetGroupUsers(long groupId, long[] userIds, ServiceContext serviceContext) throws PortalException
      Removes the users from the group.
      Specified by:
      unsetGroupUsers in interface UserLocalService
      Parameters:
      groupId - the primary key of the group
      userIds - the primary keys of the users
      serviceContext - the service context to be applied (optionally null)
      Throws:
      PortalException
    • unsetOrganizationUsers

      public void unsetOrganizationUsers(long organizationId, long[] userIds) throws PortalException
      Removes the users from the organization.
      Specified by:
      unsetOrganizationUsers in interface UserLocalService
      Parameters:
      organizationId - the primary key of the organization
      userIds - the primary keys of the users
      Throws:
      PortalException
    • unsetPasswordPolicyUsers

      public void unsetPasswordPolicyUsers(long passwordPolicyId, long[] userIds)
      Removes the users from the password policy.
      Specified by:
      unsetPasswordPolicyUsers in interface UserLocalService
      Parameters:
      passwordPolicyId - the primary key of the password policy
      userIds - the primary keys of the users
    • unsetRoleUsers

      public void unsetRoleUsers(long roleId, List<User> users) throws PortalException
      Removes the users from the role.
      Specified by:
      unsetRoleUsers in interface UserLocalService
      Parameters:
      roleId - the primary key of the role
      users - the users
      Throws:
      PortalException
    • unsetRoleUsers

      public void unsetRoleUsers(long roleId, long[] userIds) throws PortalException
      Removes the users from the role.
      Specified by:
      unsetRoleUsers in interface UserLocalService
      Parameters:
      roleId - the primary key of the role
      userIds - the primary keys of the users
      Throws:
      PortalException
    • unsetTeamUsers

      public void unsetTeamUsers(long teamId, long[] userIds) throws PortalException
      Removes the users from the team.
      Specified by:
      unsetTeamUsers in interface UserLocalService
      Parameters:
      teamId - the primary key of the team
      userIds - the primary keys of the users
      Throws:
      PortalException
    • unsetUserGroupUsers

      public void unsetUserGroupUsers(long userGroupId, long[] userIds) throws PortalException
      Removes the users from the user group.
      Specified by:
      unsetUserGroupUsers in interface UserLocalService
      Parameters:
      userGroupId - the primary key of the user group
      userIds - the primary keys of the users
      Throws:
      PortalException
    • updateAgreedToTermsOfUse

      public User updateAgreedToTermsOfUse(long userId, boolean agreedToTermsOfUse) throws PortalException
      Updates whether the user has agreed to the terms of use.
      Specified by:
      updateAgreedToTermsOfUse in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      agreedToTermsOfUse - whether the user has agreet to the terms of use
      Returns:
      the user
      Throws:
      PortalException
    • updateAsset

      public void updateAsset(long userId, User user, long[] assetCategoryIds, String[] assetTagNames) throws PortalException
      Updates the user's asset with the new asset categories and tag names, removing and adding asset categories and tag names as necessary.
      Specified by:
      updateAsset in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      user - ID the primary key of the user
      assetCategoryIds - the primary key's of the new asset categories
      assetTagNames - the new asset tag names
      Throws:
      PortalException
    • updateCreateDate

      public User updateCreateDate(long userId, Date createDate) throws PortalException
      Updates the user's creation date.
      Specified by:
      updateCreateDate in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      createDate - the new creation date
      Returns:
      the user
      Throws:
      PortalException
    • updateEmailAddress

      public User updateEmailAddress(long userId, String password, String emailAddress1, String emailAddress2) throws PortalException
      Updates the user's email address.
      Specified by:
      updateEmailAddress in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      password - the user's password
      emailAddress1 - the user's new email address
      emailAddress2 - the user's new email address confirmation
      Returns:
      the user
      Throws:
      PortalException
    • updateEmailAddress

      public User updateEmailAddress(long userId, String password, String emailAddress1, String emailAddress2, ServiceContext serviceContext) throws PortalException
      Updates the user's email address or sends verification email.
      Specified by:
      updateEmailAddress in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      password - the user's password
      emailAddress1 - the user's new email address
      emailAddress2 - the user's new email address confirmation
      serviceContext - the service context to be applied. Must set the portal URL, main path, primary key of the layout, remote address, remote host, and agent for the user.
      Returns:
      the user
      Throws:
      PortalException
    • updateEmailAddressVerified

      public User updateEmailAddressVerified(long userId, boolean emailAddressVerified) throws PortalException
      Updates whether the user has verified email address.
      Specified by:
      updateEmailAddressVerified in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      emailAddressVerified - whether the user has verified email address
      Returns:
      the user
      Throws:
      PortalException
    • updateExternalReferenceCode

      public User updateExternalReferenceCode(long userId, String externalReferenceCode) throws PortalException
      Specified by:
      updateExternalReferenceCode in interface UserLocalService
      Throws:
      PortalException
    • updateExternalReferenceCode

      public User updateExternalReferenceCode(User user, String externalReferenceCode) throws PortalException
      Specified by:
      updateExternalReferenceCode in interface UserLocalService
      Throws:
      PortalException
    • updateFacebookId

      @Deprecated public User updateFacebookId(long userId, long facebookId) throws PortalException
      Deprecated.
      As of Athanasius (7.3.x), with no direct replacement
      Updates the user's Facebook ID.
      Specified by:
      updateFacebookId in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      facebookId - the user's new Facebook ID
      Returns:
      the user
      Throws:
      PortalException
    • updateGoogleUserId

      public User updateGoogleUserId(long userId, String googleUserId) throws PortalException
      Updates the user's Google user ID.
      Specified by:
      updateGoogleUserId in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      googleUserId - the new Google user ID
      Returns:
      the user
      Throws:
      PortalException
    • updateGroups

      public void updateGroups(long userId, long[] newGroupIds, ServiceContext serviceContext) throws PortalException
      Sets the groups the user is in, removing and adding groups as necessary.
      Specified by:
      updateGroups in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      newGroupIds - the primary keys of the groups
      serviceContext - the service context to be applied (optionally null)
      Throws:
      PortalException
    • updateIncompleteUser

      public User updateIncompleteUser(long creatorUserId, long companyId, boolean autoPassword, String password1, String password2, boolean autoScreenName, String screenName, String emailAddress, Locale locale, String firstName, String middleName, String lastName, long prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, boolean updateUserInformation, boolean sendEmail, ServiceContext serviceContext) throws PortalException
      Updates a user account that was automatically created when a guest user participated in an action (e.g. posting a comment) and only provided his name and email address.
      Specified by:
      updateIncompleteUser in interface UserLocalService
      Parameters:
      creatorUserId - the primary key of the creator
      companyId - the primary key of the user's company
      autoPassword - whether a password should be automatically generated for the user
      password1 - the user's password
      password2 - the user's password confirmation
      autoScreenName - whether a screen name should be automatically generated for the user
      screenName - the user's screen name
      emailAddress - the user's email address
      locale - the user's locale
      firstName - the user's first name
      middleName - the user's middle name
      lastName - the user's last name
      prefixListTypeId - the user's name prefix ID
      suffixListTypeId - the user's name suffix ID
      male - whether the user is male
      birthdayMonth - the user's birthday month (0-based, meaning 0 for January)
      birthdayDay - the user's birthday day
      birthdayYear - the user's birthday year
      jobTitle - the user's job title
      updateUserInformation - whether to update the user's information
      sendEmail - whether to send the user an email notification about their new account
      serviceContext - the service context to be applied (optionally null). Can set expando bridge attributes for the user.
      Returns:
      the user
      Throws:
      PortalException
    • updateJobTitle

      public User updateJobTitle(long userId, String jobTitle) throws PortalException
      Updates the user's job title.
      Specified by:
      updateJobTitle in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      jobTitle - the user's job title
      Returns:
      the user
      Throws:
      PortalException
    • updateLanguageId

      public User updateLanguageId(long userId, String languageId) throws PortalException
      Specified by:
      updateLanguageId in interface UserLocalService
      Throws:
      PortalException
    • updateLastLogin

      public User updateLastLogin(long userId, String loginIP) throws PortalException
      Updates the user's last login with the current time and the IP address.
      Specified by:
      updateLastLogin in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      loginIP - the IP address the user logged in from
      Returns:
      the user
      Throws:
      PortalException
    • updateLastLogin

      public User updateLastLogin(User user, String loginIP) throws PortalException
      Specified by:
      updateLastLogin in interface UserLocalService
      Throws:
      PortalException
    • updateLockout

      public User updateLockout(User user, boolean lockout) throws PortalException
      Updates whether the user is locked out from logging in.
      Specified by:
      updateLockout in interface UserLocalService
      Parameters:
      user - the user
      lockout - whether the user is locked out
      Returns:
      the user
      Throws:
      PortalException
    • updateLockoutByEmailAddress

      public User updateLockoutByEmailAddress(long companyId, String emailAddress, boolean lockout) throws PortalException
      Updates whether the user is locked out from logging in.
      Specified by:
      updateLockoutByEmailAddress in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      emailAddress - the user's email address
      lockout - whether the user is locked out
      Returns:
      the user
      Throws:
      PortalException
    • updateLockoutById

      public User updateLockoutById(long userId, boolean lockout) throws PortalException
      Updates whether the user is locked out from logging in.
      Specified by:
      updateLockoutById in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      lockout - whether the user is locked out
      Returns:
      the user
      Throws:
      PortalException
    • updateLockoutByScreenName

      public User updateLockoutByScreenName(long companyId, String screenName, boolean lockout) throws PortalException
      Updates whether the user is locked out from logging in.
      Specified by:
      updateLockoutByScreenName in interface UserLocalService
      Parameters:
      companyId - the primary key of the user's company
      screenName - the user's screen name
      lockout - whether the user is locked out
      Returns:
      the user
      Throws:
      PortalException
    • updateModifiedDate

      public User updateModifiedDate(long userId, Date modifiedDate) throws PortalException
      Updates the user's modified date.
      Specified by:
      updateModifiedDate in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      modifiedDate - the new modified date
      Returns:
      the user
      Throws:
      PortalException
    • updateOpenId

      @Deprecated public User updateOpenId(long userId, String openId) throws PortalException
      Deprecated.
      As of Athanasius (7.3.x), with no direct replacement
      Updates the user's OpenID.
      Specified by:
      updateOpenId in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      openId - the new OpenID
      Returns:
      the user
      Throws:
      PortalException
    • updateOrganizations

      public void updateOrganizations(long userId, long[] newOrganizationIds, ServiceContext serviceContext) throws PortalException
      Sets the organizations that the user is in, removing and adding organizations as necessary.
      Specified by:
      updateOrganizations in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      newOrganizationIds - the primary keys of the organizations
      serviceContext - the service context to be applied. Must set whether user indexing is enabled.
      Throws:
      PortalException
    • updatePassword

      public User updatePassword(long userId, String password1, String password2, boolean passwordReset) throws PortalException
      Updates the user's password without tracking or validation of the change.
      Specified by:
      updatePassword in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      password1 - the user's new password
      password2 - the user's new password confirmation
      passwordReset - whether the user should be asked to reset their password the next time they log in
      Returns:
      the user
      Throws:
      PortalException
    • updatePassword

      public User updatePassword(long userId, String password1, String password2, boolean passwordReset, boolean silentUpdate) throws PortalException
      Updates the user's password, optionally with tracking and validation of the change.
      Specified by:
      updatePassword in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      password1 - the user's new password
      password2 - the user's new password confirmation
      passwordReset - whether the user should be asked to reset their password the next time they login
      silentUpdate - whether the password should be updated without being tracked, or validated. Primarily used for password imports.
      Returns:
      the user
      Throws:
      PortalException
    • updatePasswordManually

      public User updatePasswordManually(long userId, String password, boolean passwordEncrypted, boolean passwordReset, Date passwordModifiedDate) throws PortalException
      Updates the user's password with manually input information. This method should only be used when performing maintenance.
      Specified by:
      updatePasswordManually in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      password - the user's new password
      passwordEncrypted - the user's new encrypted password
      passwordReset - whether the user should be asked to reset their password the next time they login
      passwordModifiedDate - the new password modified date
      Returns:
      the user
      Throws:
      PortalException
    • updatePasswordReset

      public User updatePasswordReset(long userId, boolean passwordReset) throws PortalException
      Updates whether the user should be asked to reset their password the next time they login.
      Specified by:
      updatePasswordReset in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      passwordReset - whether the user should be asked to reset their password the next time they login
      Returns:
      the user
      Throws:
      PortalException
    • updatePortrait

      public User updatePortrait(long userId, byte[] bytes) throws PortalException
      Updates the user's portrait image.
      Specified by:
      updatePortrait in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      bytes - the new portrait image data
      Returns:
      the user
      Throws:
      PortalException
    • updateReminderQuery

      public User updateReminderQuery(long userId, String question, String answer) throws PortalException
      Updates the user's password reset question and answer.
      Specified by:
      updateReminderQuery in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      question - the user's new password reset question
      answer - the user's new password reset answer
      Returns:
      the user
      Throws:
      PortalException
    • updateScreenName

      public User updateScreenName(long userId, String screenName) throws PortalException
      Updates the user's screen name.
      Specified by:
      updateScreenName in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      screenName - the user's new screen name
      Returns:
      the user
      Throws:
      PortalException
    • updateStatus

      public User updateStatus(long userId, int status, ServiceContext serviceContext) throws PortalException
      Updates the user's workflow status.
      Specified by:
      updateStatus in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      status - the user's new workflow status
      serviceContext - the service context to be applied. You can specify an unencrypted custom password (used by an LDAP listener) for the user via attribute passwordUnencrypted.
      Returns:
      the user
      Throws:
      PortalException
    • updateStatus

      public User updateStatus(User user, int status, ServiceContext serviceContext) throws PortalException
      Specified by:
      updateStatus in interface UserLocalService
      Throws:
      PortalException
    • updateUser

      public User updateUser(long userId, String oldPassword, String newPassword1, String newPassword2, boolean passwordReset, String reminderQueryQuestion, String reminderQueryAnswer, String screenName, String emailAddress, boolean hasPortrait, byte[] portraitBytes, String languageId, String timeZoneId, String greeting, String comments, String firstName, String middleName, String lastName, long prefixListTypeId, long suffixListTypeId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String smsSn, String facebookSn, String jabberSn, String skypeSn, String twitterSn, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, List<UserGroupRole> userGroupRoles, long[] userGroupIds, ServiceContext serviceContext) throws PortalException
      Updates the user.
      Specified by:
      updateUser in interface UserLocalService
      Parameters:
      userId - the primary key of the user
      oldPassword - the user's old password
      newPassword1 - the user's new password (optionally null)
      newPassword2 - the user's new password confirmation (optionally null)
      passwordReset - whether the user should be asked to reset their password the next time they login
      reminderQueryQuestion - the user's new password reset question
      reminderQueryAnswer - the user's new password reset answer
      screenName - the user's new screen name
      emailAddress - the user's new email address
      hasPortrait - if the user has a custom portrait image
      portraitBytes - the new portrait image data
      languageId - the user's new language ID
      timeZoneId - the user's new time zone ID
      greeting - the user's new greeting
      comments - the user's new comments
      firstName - the user's new first name
      middleName - the user's new middle name
      lastName - the user's new last name
      prefixListTypeId - the user's new name prefix ID
      suffixListTypeId - the user's new name suffix ID
      male - whether user is male
      birthdayMonth - the user's new birthday month (0-based, meaning 0 for January)
      birthdayDay - the user's new birthday day
      birthdayYear - the user's birthday year
      smsSn - the user's new SMS screen name
      facebookSn - the user's new Facebook screen name
      jabberSn - the user's new Jabber screen name
      skypeSn - the user's new Skype screen name
      twitterSn - the user's new Twitter screen name
      jobTitle - the user's new job title
      groupIds - the primary keys of the user's groups
      organizationIds - the primary keys of the user's organizations
      roleIds - the primary keys of the user's roles
      userGroupRoles - the user user's group roles
      userGroupIds - the primary keys of the user's user groups
      serviceContext - the service context to be applied (optionally null). Can set the UUID (with the uuid attribute), asset category IDs, asset tag names, and expando bridge attributes for the user.
      Returns:
      the user
      Throws:
      PortalException
    • updateUser

      public User updateUser(User user)
      Updates the user in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.

      Important: Inspect UserLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.

      Specified by:
      updateUser in interface UserLocalService
      Parameters:
      user - the user
      Returns:
      the user that was updated
    • validateMaxUsers

      public void validateMaxUsers(long companyId) throws PortalException
      Specified by:
      validateMaxUsers in interface UserLocalService
      Throws:
      PortalException
    • verifyEmailAddress

      public void verifyEmailAddress(String ticketKey) throws PortalException
      Verifies the email address of the ticket.
      Specified by:
      verifyEmailAddress in interface UserLocalService
      Parameters:
      ticketKey - the ticket key
      Throws:
      PortalException
    • getBasePersistence

      public BasePersistence<?> getBasePersistence()
      Specified by:
      getBasePersistence in interface PersistedModelLocalService
    • getCTPersistence

      public CTPersistence<User> getCTPersistence()
      Specified by:
      getCTPersistence in interface CTService<User>
      Specified by:
      getCTPersistence in interface UserLocalService
    • getModelClass

      public Class<User> getModelClass()
      Specified by:
      getModelClass in interface CTService<User>
      Specified by:
      getModelClass in interface UserLocalService
    • updateWithUnsafeFunction

      public <R, E extends Throwable> R updateWithUnsafeFunction(com.liferay.petra.function.UnsafeFunction<CTPersistence<User>,R,E> updateUnsafeFunction) throws E
      Specified by:
      updateWithUnsafeFunction in interface CTService<User>
      Specified by:
      updateWithUnsafeFunction in interface UserLocalService
      Throws:
      E extends Throwable
    • getWrappedService

      public UserLocalService getWrappedService()
      Specified by:
      getWrappedService in interface ServiceWrapper<UserLocalService>
    • setWrappedService

      public void setWrappedService(UserLocalService userLocalService)
      Specified by:
      setWrappedService in interface ServiceWrapper<UserLocalService>