Liferay 6.1.2-ce-ga3

com.liferay.portal.service.impl
Class UserLocalServiceImpl

java.lang.Object
  extended by com.liferay.portal.service.BaseLocalServiceImpl
      extended by com.liferay.portal.service.base.UserLocalServiceBaseImpl
          extended by com.liferay.portal.service.impl.UserLocalServiceImpl
All Implemented Interfaces:
IdentifiableBean, BaseLocalService, PersistedModelLocalService, UserLocalService

public class UserLocalServiceImpl
extends UserLocalServiceBaseImpl

The implementation of the user local service.


Field Summary
 
Fields inherited from class com.liferay.portal.service.base.UserLocalServiceBaseImpl
accountLocalService, accountPersistence, accountService, addressLocalService, addressPersistence, addressService, announcementsDeliveryLocalService, announcementsDeliveryPersistence, announcementsDeliveryService, assetEntryFinder, assetEntryLocalService, assetEntryPersistence, assetEntryService, blogsStatsUserFinder, blogsStatsUserLocalService, blogsStatsUserPersistence, browserTrackerLocalService, browserTrackerPersistence, classNameLocalService, classNamePersistence, classNameService, clusterGroupLocalService, clusterGroupPersistence, cmisRepositoryLocalService, companyLocalService, companyPersistence, companyService, contactLocalService, contactPersistence, contactService, counterLocalService, countryPersistence, countryService, dlFileRankFinder, dlFileRankLocalService, dlFileRankPersistence, emailAddressLocalService, emailAddressPersistence, emailAddressService, expandoValueLocalService, expandoValuePersistence, expandoValueService, groupFinder, groupLocalService, groupPersistence, groupService, imageLocalService, imagePersistence, imageService, layoutBranchLocalService, layoutBranchPersistence, layoutBranchService, layoutFinder, layoutLocalService, layoutPersistence, layoutPrototypeLocalService, layoutPrototypePersistence, layoutPrototypeService, layoutRevisionLocalService, layoutRevisionPersistence, layoutRevisionService, layoutService, layoutSetBranchLocalService, layoutSetBranchPersistence, layoutSetBranchService, layoutSetLocalService, layoutSetPersistence, layoutSetPrototypeLocalService, layoutSetPrototypePersistence, layoutSetPrototypeService, layoutSetService, layoutTemplateLocalService, listTypePersistence, listTypeService, lockFinder, lockLocalService, lockPersistence, mailService, mbBanLocalService, mbBanPersistence, mbBanService, mbMessageFinder, mbMessageLocalService, mbMessagePersistence, mbMessageService, mbStatsUserLocalService, mbStatsUserPersistence, mbThreadFlagLocalService, mbThreadFlagPersistence, membershipRequestLocalService, membershipRequestPersistence, membershipRequestService, organizationFinder, organizationLocalService, organizationPersistence, organizationService, orgGroupPermissionFinder, orgGroupPermissionPersistence, orgGroupRolePersistence, orgLaborLocalService, orgLaborPersistence, orgLaborService, passwordPolicyFinder, passwordPolicyLocalService, passwordPolicyPersistence, passwordPolicyRelLocalService, passwordPolicyRelPersistence, passwordPolicyService, passwordTrackerLocalService, passwordTrackerPersistence, permissionFinder, permissionLocalService, permissionPersistence, permissionService, persistedModelLocalServiceRegistry, phoneLocalService, phonePersistence, phoneService, pluginSettingLocalService, pluginSettingPersistence, pluginSettingService, portalLocalService, portalPreferencesLocalService, portalPreferencesPersistence, portalService, portletItemLocalService, portletItemPersistence, portletLocalService, portletPersistence, portletPreferencesFinder, portletPreferencesLocalService, portletPreferencesPersistence, portletPreferencesService, portletService, quartzLocalService, regionPersistence, regionService, releaseLocalService, releasePersistence, repositoryEntryLocalService, repositoryEntryPersistence, repositoryLocalService, repositoryPersistence, repositoryService, resourceActionLocalService, resourceActionPersistence, resourceBlockFinder, resourceBlockLocalService, resourceBlockPermissionLocalService, resourceBlockPermissionPersistence, resourceBlockPersistence, resourceBlockService, resourceCodeLocalService, resourceCodePersistence, resourceFinder, resourceLocalService, resourcePermissionFinder, resourcePermissionLocalService, resourcePermissionPersistence, resourcePermissionService, resourcePersistence, resourceService, resourceTypePermissionFinder, resourceTypePermissionLocalService, resourceTypePermissionPersistence, roleFinder, roleLocalService, rolePersistence, roleService, serviceComponentLocalService, serviceComponentPersistence, shardLocalService, shardPersistence, shoppingCartLocalService, shoppingCartPersistence, socialActivityFinder, socialActivityLocalService, socialActivityPersistence, socialRequestLocalService, socialRequestPersistence, subscriptionLocalService, subscriptionPersistence, teamFinder, teamLocalService, teamPersistence, teamService, themeLocalService, themeService, ticketLocalService, ticketPersistence, userFinder, userGroupFinder, userGroupGroupRoleLocalService, userGroupGroupRolePersistence, userGroupGroupRoleService, userGroupLocalService, userGroupPersistence, userGroupRoleFinder, userGroupRoleLocalService, userGroupRolePersistence, userGroupRoleService, userGroupService, userIdMapperLocalService, userIdMapperPersistence, userLocalService, userNotificationEventLocalService, userNotificationEventPersistence, userPersistence, userService, userTrackerLocalService, userTrackerPathLocalService, userTrackerPathPersistence, userTrackerPersistence, virtualHostLocalService, virtualHostPersistence, webDAVPropsLocalService, webDAVPropsPersistence, websiteLocalService, websitePersistence, websiteService, workflowDefinitionLinkLocalService, workflowDefinitionLinkPersistence, workflowInstanceLinkLocalService, workflowInstanceLinkPersistence
 
Constructor Summary
UserLocalServiceImpl()
           
 
Method Summary
 User addDefaultAdminUser(long companyId, String screenName, String emailAddress, Locale locale, String firstName, String middleName, String lastName)
           
 void addDefaultGroups(long userId)
          Adds the user to the default groups, unless the user is already in these groups.
 void addDefaultRoles(long userId)
          Adds the user to the default roles, unless the user already has these roles.
 void addDefaultUserGroups(long userId)
          Adds the user to the default user groups, unless the user is already in these user groups.
 void addGroupUsers(long groupId, long[] userIds)
          Adds the users to the group.
 void addOrganizationUsers(long organizationId, long[] userIds)
          Adds the users to the organization.
 void addPasswordPolicyUsers(long passwordPolicyId, long[] userIds)
          Assigns the password policy to the users, removing any other currently assigned password policies.
 void addRoleUsers(long roleId, long[] userIds)
          Adds the users to the role.
 void addTeamUsers(long teamId, long[] userIds)
          Adds the users to the team.
 User addUser(long creatorUserId, long companyId, boolean autoPassword, String password1, String password2, boolean autoScreenName, String screenName, String emailAddress, long facebookId, String openId, Locale locale, String firstName, String middleName, String lastName, int prefixId, int suffixId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, boolean sendEmail, ServiceContext serviceContext)
          Adds a user.
 void addUserGroupUsers(long userGroupId, long[] userIds)
          Adds the users to the user group.
 User addUserWithWorkflow(long creatorUserId, long companyId, boolean autoPassword, String password1, String password2, boolean autoScreenName, String screenName, String emailAddress, long facebookId, String openId, Locale locale, String firstName, String middleName, String lastName, int prefixId, int suffixId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, long[] userGroupIds, boolean sendEmail, ServiceContext serviceContext)
          Adds a user with workflow.
protected  int authenticate(long companyId, String login, String password, String authType, Map<String,String[]> headerMap, Map<String,String[]> parameterMap, Map<String,Object> resultsMap)
          Attempts to authenticate the user by their login and password, while using the AuthPipeline.
 int authenticateByEmailAddress(long companyId, String emailAddress, String password, Map<String,String[]> headerMap, Map<String,String[]> parameterMap, Map<String,Object> resultsMap)
          Attempts to authenticate the user by their email address and password, while using the AuthPipeline.
 int authenticateByScreenName(long companyId, String screenName, String password, Map<String,String[]> headerMap, Map<String,String[]> parameterMap, Map<String,Object> resultsMap)
          Attempts to authenticate the user by their screen name and password, while using the AuthPipeline.
 int authenticateByUserId(long companyId, long userId, String password, Map<String,String[]> headerMap, Map<String,String[]> parameterMap, Map<String,Object> resultsMap)
          Attempts to authenticate the user by their primary key and password, while using the AuthPipeline.
 long authenticateForBasic(long companyId, String authType, String login, String password)
          Attempts to authenticate the user using HTTP basic access authentication, without using the AuthPipeline.
 long authenticateForDigest(long companyId, String username, String realm, String nonce, String method, String uri, String response)
          Attempts to authenticate the user using HTTP digest access authentication, without using the AuthPipeline.
 boolean authenticateForJAAS(long userId, String encPassword)
          Attempts to authenticate the user using JAAS credentials, without using the AuthPipeline.
 void checkLockout(User user)
          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.
 void checkLoginFailure(User user)
          Adds a failed login attempt to the user and updates the user's last failed login date.
 void checkLoginFailureByEmailAddress(long companyId, String emailAddress)
          Adds a failed login attempt to the user with the email address and updates the user's last failed login date.
 void checkLoginFailureById(long userId)
          Adds a failed login attempt to the user and updates the user's last failed login date.
 void checkLoginFailureByScreenName(long companyId, String screenName)
          Adds a failed login attempt to the user with the screen name and updates the user's last failed login date.
 void checkPasswordExpired(User user)
          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.
 void clearOrganizationUsers(long organizationId)
          Removes all the users from the organization.
 void clearUserGroupUsers(long userGroupId)
          Removes all the users from the user group.
 void completeUserRegistration(User user, ServiceContext serviceContext)
          Completes the user's registration by generating a password and sending the confirmation email.
 KeyValuePair decryptUserId(long companyId, String name, String password)
          Decrypts the user's primary key and password from their encrypted forms.
 void deletePortrait(long userId)
          Deletes the user's portrait image.
 void deleteRoleUser(long roleId, long userId)
          Removes the user from the role.
 User deleteUser(long userId)
          Deletes the user.
 User deleteUser(User user)
          Deletes the user.
 void deleteUserGroupUser(long userGroupId, long userId)
          Removes the user from the user group.
 String encryptUserId(String name)
          Encrypts the primary key of the user.
 User fetchUserByEmailAddress(long companyId, String emailAddress)
          Returns the user with the email address.
 User fetchUserById(long userId)
          Returns the user with the primary key.
 User fetchUserByScreenName(long companyId, String screenName)
          Returns the user with the screen name.
protected  Date getBirthday(int birthdayMonth, int birthdayDay, int birthdayYear)
           
 List<User> getCompanyUsers(long companyId, int start, int end)
          Returns a range of all the users belonging to the company.
 int getCompanyUsersCount(long companyId)
          Returns the number of users belonging to the company.
 User getDefaultUser(long companyId)
          Returns the default user for the company.
 long getDefaultUserId(long companyId)
          Returns the primary key of the default user for the company.
 long[] getGroupUserIds(long groupId)
          Returns the primary keys of all the users belonging to the group.
 List<User> getGroupUsers(long groupId)
          Returns all the users belonging to the group.
 int getGroupUsersCount(long groupId)
          Returns the number of users belonging to the group.
 int getGroupUsersCount(long groupId, int status)
          Returns the number of users with the status belonging to the group.
 List<User> getNoAnnouncementsDeliveries(String type)
          Returns all the users who have not had any announcements of the type delivered, excluding the default user.
 List<User> getNoContacts()
          Returns all the users who do not have any contacts.
 List<User> getNoGroups()
          Returns all the users who do not belong to any groups, excluding the default user.
 long[] getOrganizationUserIds(long organizationId)
          Returns the primary keys of all the users belonging to the organization.
 List<User> getOrganizationUsers(long organizationId)
          Returns all the users belonging to the organization.
 int getOrganizationUsersCount(long organizationId)
          Returns the number of users belonging to the organization.
 int getOrganizationUsersCount(long organizationId, int status)
          Returns the number of users with the status belonging to the organization.
 long[] getRoleUserIds(long roleId)
          Returns the primary keys of all the users belonging to the role.
 List<User> getRoleUsers(long roleId)
          Returns all the users belonging to the role.
 List<User> getRoleUsers(long roleId, int start, int end)
          Returns a range of all the users belonging to the role.
 int getRoleUsersCount(long roleId)
          Returns the number of users belonging to the role.
 int getRoleUsersCount(long roleId, int status)
          Returns the number of users with the status belonging to the role.
protected  String getScreenName(String screenName)
           
 List<User> getSocialUsers(long userId, int type, int start, int end, OrderByComparator obc)
          Returns an ordered range of all the users with a social relation of the type with the user.
 List<User> getSocialUsers(long userId, int start, int end, OrderByComparator obc)
          Returns an ordered range of all the users with a social relation with the user.
 List<User> getSocialUsers(long userId1, long userId2, int type, int start, int end, OrderByComparator obc)
          Returns an ordered range of all the users with a mutual social relation of the type with both of the given users.
 List<User> getSocialUsers(long userId1, long userId2, int start, int end, OrderByComparator obc)
          Returns an ordered range of all the users with a mutual social relation with both of the given users.
 int getSocialUsersCount(long userId)
          Returns the number of users with a social relation with the user.
 int getSocialUsersCount(long userId, int type)
          Returns the number of users with a social relation of the type with the user.
 int getSocialUsersCount(long userId1, long userId2)
          Returns the number of users with a mutual social relation with both of the given users.
 int getSocialUsersCount(long userId1, long userId2, int type)
          Returns the number of users with a mutual social relation of the type with both of the given users.
 User getUserByContactId(long contactId)
          Returns the user with the contact ID.
 User getUserByEmailAddress(long companyId, String emailAddress)
          Returns the user with the email address.
 User getUserByFacebookId(long companyId, long facebookId)
          Returns the user with the Facebook ID.
 User getUserById(long userId)
          Returns the user with the primary key.
 User getUserById(long companyId, long userId)
          Returns the user with the primary key from the company.
 User getUserByOpenId(long companyId, String openId)
          Returns the user with the OpenID.
 User getUserByPortraitId(long portraitId)
          Returns the user with the portrait ID.
 User getUserByScreenName(long companyId, String screenName)
          Returns the user with the screen name.
 User getUserByUuid(String uuid)
          Returns the user with the universally unique identifier.
 List<User> getUserGroupUsers(long userGroupId)
          Returns all the users belonging to the user group.
 int getUserGroupUsersCount(long userGroupId)
          Returns the number of users belonging to the user group.
 int getUserGroupUsersCount(long userGroupId, int status)
          Returns the number of users with the status belonging to the user group.
 long getUserIdByEmailAddress(long companyId, String emailAddress)
          Returns the primary key of the user with the email address.
 long getUserIdByScreenName(long companyId, String screenName)
          Returns the primary key of the user with the screen name.
protected  long[] getUserIds(List<User> users)
           
 boolean hasGroupUser(long groupId, long userId)
          Returns true if the user is a member of the group.
 boolean hasOrganizationUser(long organizationId, long userId)
          Returns true if the user is a member of the organization.
 boolean hasPasswordPolicyUser(long passwordPolicyId, long userId)
          Returns true if the password policy has been assigned to the user.
 boolean hasRoleUser(long roleId, long userId)
          Returns true if the user is a member of the role.
 boolean hasRoleUser(long companyId, String name, long userId, boolean inherited)
          Returns true if the user has the role with the name, optionally through inheritance.
 boolean hasTeamUser(long teamId, long userId)
          Returns true if the user is a member of the team.
 boolean hasUserGroupUser(long userGroupId, long userId)
          Returns true if the user is a member of the user group.
 boolean isPasswordExpired(User user)
          Returns true if the user's password is expired.
 boolean isPasswordExpiringSoon(User user)
          Returns true if the user's password is expiring soon.
 User loadGetDefaultUser(long companyId)
           
protected  void reindex(User user)
           
 List<User> search(long companyId, String keywords, int status, LinkedHashMap<String,Object> params, int start, int end, OrderByComparator obc)
          Returns an ordered range of all the users who match the keywords and status, without using the indexer.
 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.
 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 obc)
          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.
 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.
protected  Hits search(long companyId, String firstName, String middleName, String lastName, String fullName, String screenName, String emailAddress, String street, String city, String zip, String region, String country, int status, LinkedHashMap<String,Object> params, boolean andSearch, int start, int end, Sort sort)
           
 int searchCount(long companyId, String keywords, int status, LinkedHashMap<String,Object> params)
          Returns the number of users who match the keywords and status.
 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.
protected  void sendEmail(User user, String password, ServiceContext serviceContext)
           
 void sendEmailAddressVerification(User user, String emailAddress, ServiceContext serviceContext)
          Sends an email address verification to the user.
 void sendPassword(long companyId, String emailAddress, String fromName, String fromAddress, String subject, String body, ServiceContext serviceContext)
          Sends the password email to the user with the email address.
protected  void setEmailAddress(User user, String password, String firstName, String middleName, String lastName, String emailAddress)
           
 void setRoleUsers(long roleId, long[] userIds)
          Sets the users in the role, removing and adding users to the role as necessary.
 void setUserGroupUsers(long userGroupId, long[] userIds)
          Sets the users in the user group, removing and adding users to the user group as necessary.
protected  void startWorkflowInstance(long companyId, long workflowUserId, long userId, User user, ServiceContext workflowServiceContext)
           
 void unsetGroupTeamsUsers(long groupId, long[] userIds)
          Removes the users from the teams of a group.
 void unsetGroupUsers(long groupId, long[] userIds, ServiceContext serviceContext)
          Removes the users from the group.
 void unsetOrganizationUsers(long organizationId, long[] userIds)
          Removes the users from the organization.
 void unsetPasswordPolicyUsers(long passwordPolicyId, long[] userIds)
          Removes the users from the password policy.
 void unsetRoleUsers(long roleId, List<User> users)
          Removes the users from the role.
 void unsetRoleUsers(long roleId, long[] userIds)
          Removes the users from the role.
 void unsetTeamUsers(long teamId, long[] userIds)
          Removes the users from the team.
 void unsetUserGroupUsers(long userGroupId, long[] userIds)
          Removes the users from the user group.
 User updateAgreedToTermsOfUse(long userId, boolean agreedToTermsOfUse)
          Updates whether the user has agreed to the terms of use.
 void updateAsset(long userId, User user, long[] assetCategoryIds, String[] assetTagNames)
          Updates the user's asset with the new asset categories and tag names, removing and adding asset categories and tag names as necessary.
 User updateCreateDate(long userId, Date createDate)
          Updates the user's creation date.
 User updateEmailAddress(long userId, String password, String emailAddress1, String emailAddress2)
          Updates the user's email address.
 User updateEmailAddress(long userId, String password, String emailAddress1, String emailAddress2, ServiceContext serviceContext)
          Updates the user's email address or sends verification email.
 User updateEmailAddressVerified(long userId, boolean emailAddressVerified)
          Updates whether the user has verified email address.
 User updateFacebookId(long userId, long facebookId)
          Updates the user's Facebook ID.
 void updateGroups(long userId, long[] newGroupIds, ServiceContext serviceContext)
          Sets the groups the user is in, removing and adding groups as necessary.
protected  void updateGroups(long userId, long[] newGroupIds, ServiceContext serviceContext, boolean indexingEnabled)
           
 User updateIncompleteUser(long creatorUserId, long companyId, boolean autoPassword, String password1, String password2, boolean autoScreenName, String screenName, String emailAddress, long facebookId, String openId, Locale locale, String firstName, String middleName, String lastName, int prefixId, int suffixId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String jobTitle, boolean updateUserInformation, boolean sendEmail, ServiceContext serviceContext)
          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.
 User updateJobTitle(long userId, String jobTitle)
          Updates the user's job title.
 User updateLastLogin(long userId, String loginIP)
          Updates the user's last login with the current time and the IP address.
 User updateLockout(User user, boolean lockout)
          Updates whether the user is locked out from logging in.
 User updateLockoutByEmailAddress(long companyId, String emailAddress, boolean lockout)
          Updates whether the user is locked out from logging in.
 User updateLockoutById(long userId, boolean lockout)
          Updates whether the user is locked out from logging in.
 User updateLockoutByScreenName(long companyId, String screenName, boolean lockout)
          Updates whether the user is locked out from logging in.
 User updateModifiedDate(long userId, Date modifiedDate)
          Updates the user's modified date.
 User updateOpenId(long userId, String openId)
          Updates the user's OpenID.
protected  void updateOrganizations(long userId, long[] newOrganizationIds, boolean indexingEnabled)
           
 void updateOrganizations(long userId, long[] newOrganizationIds, ServiceContext serviceContext)
          Sets the organizations that the user is in, removing and adding organizations as necessary.
 User updatePassword(long userId, String password1, String password2, boolean passwordReset)
          Updates the user's password without tracking or validation of the change.
 User updatePassword(long userId, String password1, String password2, boolean passwordReset, boolean silentUpdate)
          Updates the user's password, optionally with tracking and validation of the change.
 User updatePasswordManually(long userId, String password, boolean passwordEncrypted, boolean passwordReset, Date passwordModifiedDate)
          Updates the user's password with manually input information.
 User updatePasswordReset(long userId, boolean passwordReset)
          Updates whether the user should be asked to reset their password the next time they login.
 User updatePortrait(long userId, byte[] bytes)
          Updates the user's portrait image.
 User updateReminderQuery(long userId, String question, String answer)
          Updates the user's password reset question and answer.
 User updateScreenName(long userId, String screenName)
          Updates the user's screen name.
 User updateStatus(long userId, int status)
          Updates the user's workflow status.
 User updateUser(long userId, String oldPassword, String newPassword1, String newPassword2, boolean passwordReset, String reminderQueryQuestion, String reminderQueryAnswer, String screenName, String emailAddress, long facebookId, String openId, String languageId, String timeZoneId, String greeting, String comments, String firstName, String middleName, String lastName, int prefixId, int suffixId, boolean male, int birthdayMonth, int birthdayDay, int birthdayYear, String smsSn, String aimSn, String facebookSn, String icqSn, String jabberSn, String msnSn, String mySpaceSn, String skypeSn, String twitterSn, String ymSn, String jobTitle, long[] groupIds, long[] organizationIds, long[] roleIds, List<UserGroupRole> userGroupRoles, long[] userGroupIds, ServiceContext serviceContext)
          Updates the user.
protected  void updateUserGroupRoles(User user, long[] groupIds, long[] organizationIds, List<UserGroupRole> userGroupRoles)
           
protected  void validate(long companyId, long userId, boolean autoPassword, String password1, String password2, boolean autoScreenName, String screenName, String emailAddress, String openId, String firstName, String middleName, String lastName, long[] organizationIds)
           
protected  void validate(long userId, String screenName, String emailAddress, String openId, String firstName, String middleName, String lastName, String smsSn)
           
protected  void validateCompanyMaxUsers(long companyId)
           
protected  void validateEmailAddress(long companyId, String emailAddress)
           
protected  void validateEmailAddress(User user, String emailAddress1, String emailAddress2)
           
protected  void validateFullName(long companyId, String firstName, String middleName, String lastName)
           
protected  void validateOpenId(long companyId, long userId, String openId)
           
protected  void validatePassword(long companyId, long userId, String password1, String password2)
           
protected  void validateReminderQuery(String question, String answer)
           
protected  void validateScreenName(long companyId, long userId, String screenName)
           
 void verifyEmailAddress(String ticketKey)
          Verifies the email address of the ticket.
 
Methods inherited from class com.liferay.portal.service.base.UserLocalServiceBaseImpl
addGroupUser, addGroupUser, addGroupUsers, addOrganizationUser, addOrganizationUser, addOrganizationUsers, addPermissionUser, addPermissionUser, addPermissionUsers, addPermissionUsers, addRoleUser, addRoleUser, addRoleUsers, addTeamUser, addTeamUser, addTeamUsers, addUser, addUserGroupUser, addUserGroupUser, addUserGroupUsers, afterPropertiesSet, clearGroupUsers, clearPermissionUsers, clearRoleUsers, clearTeamUsers, createUser, deleteGroupUser, deleteGroupUser, deleteGroupUsers, deleteGroupUsers, deleteOrganizationUser, deleteOrganizationUser, deleteOrganizationUsers, deleteOrganizationUsers, deletePermissionUser, deletePermissionUser, deletePermissionUsers, deletePermissionUsers, deleteRoleUser, deleteRoleUsers, deleteRoleUsers, deleteTeamUser, deleteTeamUser, deleteTeamUsers, deleteTeamUsers, deleteUserGroupUser, deleteUserGroupUsers, deleteUserGroupUsers, destroy, dynamicQuery, dynamicQuery, dynamicQuery, dynamicQuery, dynamicQueryCount, fetchUser, getAccountLocalService, getAccountPersistence, getAccountService, getAddressLocalService, getAddressPersistence, getAddressService, getAnnouncementsDeliveryLocalService, getAnnouncementsDeliveryPersistence, getAnnouncementsDeliveryService, getAssetEntryFinder, getAssetEntryLocalService, getAssetEntryPersistence, getAssetEntryService, getBeanIdentifier, getBlogsStatsUserFinder, getBlogsStatsUserLocalService, getBlogsStatsUserPersistence, getBrowserTrackerLocalService, getBrowserTrackerPersistence, getClassNameLocalService, getClassNamePersistence, getClassNameService, getClusterGroupLocalService, getClusterGroupPersistence, getCMISRepositoryLocalService, getCompanyLocalService, getCompanyPersistence, getCompanyService, getContactLocalService, getContactPersistence, getContactService, getCounterLocalService, getCountryPersistence, getCountryService, getDLFileRankFinder, getDLFileRankLocalService, getDLFileRankPersistence, getEmailAddressLocalService, getEmailAddressPersistence, getEmailAddressService, getExpandoValueLocalService, getExpandoValuePersistence, getExpandoValueService, getGroupFinder, getGroupLocalService, getGroupPersistence, getGroupService, getGroupUsers, getGroupUsers, getImageLocalService, getImagePersistence, getImageService, getLayoutBranchLocalService, getLayoutBranchPersistence, getLayoutBranchService, getLayoutFinder, getLayoutLocalService, getLayoutPersistence, getLayoutPrototypeLocalService, getLayoutPrototypePersistence, getLayoutPrototypeService, getLayoutRevisionLocalService, getLayoutRevisionPersistence, getLayoutRevisionService, getLayoutService, getLayoutSetBranchLocalService, getLayoutSetBranchPersistence, getLayoutSetBranchService, getLayoutSetLocalService, getLayoutSetPersistence, getLayoutSetPrototypeLocalService, getLayoutSetPrototypePersistence, getLayoutSetPrototypeService, getLayoutSetService, getLayoutTemplateLocalService, getListTypePersistence, getListTypeService, getLockFinder, getLockLocalService, getLockPersistence, getMailService, getMBBanLocalService, getMBBanPersistence, getMBBanService, getMBMessageFinder, getMBMessageLocalService, getMBMessagePersistence, getMBMessageService, getMBStatsUserLocalService, getMBStatsUserPersistence, getMBThreadFlagLocalService, getMBThreadFlagPersistence, getMembershipRequestLocalService, getMembershipRequestPersistence, getMembershipRequestService, getModelClass, getModelClassName, getOrganizationFinder, getOrganizationLocalService, getOrganizationPersistence, getOrganizationService, getOrganizationUsers, getOrganizationUsers, getOrgGroupPermissionFinder, getOrgGroupPermissionPersistence, getOrgGroupRolePersistence, getOrgLaborLocalService, getOrgLaborPersistence, getOrgLaborService, getPasswordPolicyFinder, getPasswordPolicyLocalService, getPasswordPolicyPersistence, getPasswordPolicyRelLocalService, getPasswordPolicyRelPersistence, getPasswordPolicyService, getPasswordTrackerLocalService, getPasswordTrackerPersistence, getPermissionFinder, getPermissionLocalService, getPermissionPersistence, getPermissionService, getPermissionUsers, getPermissionUsers, getPermissionUsers, getPermissionUsersCount, getPersistedModel, getPhoneLocalService, getPhonePersistence, getPhoneService, getPluginSettingLocalService, getPluginSettingPersistence, getPluginSettingService, getPortalLocalService, getPortalPreferencesLocalService, getPortalPreferencesPersistence, getPortalService, getPortletItemLocalService, getPortletItemPersistence, getPortletLocalService, getPortletPersistence, getPortletPreferencesFinder, getPortletPreferencesLocalService, getPortletPreferencesPersistence, getPortletPreferencesService, getPortletService, getQuartzLocalService, getRegionPersistence, getRegionService, getReleaseLocalService, getReleasePersistence, getRepositoryEntryLocalService, getRepositoryEntryPersistence, getRepositoryLocalService, getRepositoryPersistence, getRepositoryService, getResourceActionLocalService, getResourceActionPersistence, getResourceBlockFinder, getResourceBlockLocalService, getResourceBlockPermissionLocalService, getResourceBlockPermissionPersistence, getResourceBlockPersistence, getResourceBlockService, getResourceCodeLocalService, getResourceCodePersistence, getResourceFinder, getResourceLocalService, getResourcePermissionFinder, getResourcePermissionLocalService, getResourcePermissionPersistence, getResourcePermissionService, getResourcePersistence, getResourceService, getResourceTypePermissionFinder, getResourceTypePermissionLocalService, getResourceTypePermissionPersistence, getRoleFinder, getRoleLocalService, getRolePersistence, getRoleService, getRoleUsers, getServiceComponentLocalService, getServiceComponentPersistence, getShardLocalService, getShardPersistence, getShoppingCartLocalService, getShoppingCartPersistence, getSocialActivityFinder, getSocialActivityLocalService, getSocialActivityPersistence, getSocialRequestLocalService, getSocialRequestPersistence, getSubscriptionLocalService, getSubscriptionPersistence, getTeamFinder, getTeamLocalService, getTeamPersistence, getTeamService, getTeamUsers, getTeamUsers, getTeamUsers, getTeamUsersCount, getThemeLocalService, getThemeService, getTicketLocalService, getTicketPersistence, getUser, getUserFinder, getUserGroupFinder, getUserGroupGroupRoleLocalService, getUserGroupGroupRolePersistence, getUserGroupGroupRoleService, getUserGroupLocalService, getUserGroupPersistence, getUserGroupRoleFinder, getUserGroupRoleLocalService, getUserGroupRolePersistence, getUserGroupRoleService, getUserGroupService, getUserGroupUsers, getUserGroupUsers, getUserIdMapperLocalService, getUserIdMapperPersistence, getUserLocalService, getUserNotificationEventLocalService, getUserNotificationEventPersistence, getUserPersistence, getUsers, getUsersCount, getUserService, getUserTrackerLocalService, getUserTrackerPathLocalService, getUserTrackerPathPersistence, getUserTrackerPersistence, getVirtualHostLocalService, getVirtualHostPersistence, getWebDAVPropsLocalService, getWebDAVPropsPersistence, getWebsiteLocalService, getWebsitePersistence, getWebsiteService, getWorkflowDefinitionLinkLocalService, getWorkflowDefinitionLinkPersistence, getWorkflowInstanceLinkLocalService, getWorkflowInstanceLinkPersistence, hasGroupUsers, hasOrganizationUsers, hasPermissionUser, hasPermissionUsers, hasRoleUsers, hasTeamUsers, hasUserGroupUsers, runSQL, setAccountLocalService, setAccountPersistence, setAccountService, setAddressLocalService, setAddressPersistence, setAddressService, setAnnouncementsDeliveryLocalService, setAnnouncementsDeliveryPersistence, setAnnouncementsDeliveryService, setAssetEntryFinder, setAssetEntryLocalService, setAssetEntryPersistence, setAssetEntryService, setBeanIdentifier, setBlogsStatsUserFinder, setBlogsStatsUserLocalService, setBlogsStatsUserPersistence, setBrowserTrackerLocalService, setBrowserTrackerPersistence, setClassNameLocalService, setClassNamePersistence, setClassNameService, setClusterGroupLocalService, setClusterGroupPersistence, setCMISRepositoryLocalService, setCompanyLocalService, setCompanyPersistence, setCompanyService, setContactLocalService, setContactPersistence, setContactService, setCounterLocalService, setCountryPersistence, setCountryService, setDLFileRankFinder, setDLFileRankLocalService, setDLFileRankPersistence, setEmailAddressLocalService, setEmailAddressPersistence, setEmailAddressService, setExpandoValueLocalService, setExpandoValuePersistence, setExpandoValueService, setGroupFinder, setGroupLocalService, setGroupPersistence, setGroupService, setGroupUsers, setImageLocalService, setImagePersistence, setImageService, setLayoutBranchLocalService, setLayoutBranchPersistence, setLayoutBranchService, setLayoutFinder, setLayoutLocalService, setLayoutPersistence, setLayoutPrototypeLocalService, setLayoutPrototypePersistence, setLayoutPrototypeService, setLayoutRevisionLocalService, setLayoutRevisionPersistence, setLayoutRevisionService, setLayoutService, setLayoutSetBranchLocalService, setLayoutSetBranchPersistence, setLayoutSetBranchService, setLayoutSetLocalService, setLayoutSetPersistence, setLayoutSetPrototypeLocalService, setLayoutSetPrototypePersistence, setLayoutSetPrototypeService, setLayoutSetService, setLayoutTemplateLocalService, setListTypePersistence, setListTypeService, setLockFinder, setLockLocalService, setLockPersistence, setMailService, setMBBanLocalService, setMBBanPersistence, setMBBanService, setMBMessageFinder, setMBMessageLocalService, setMBMessagePersistence, setMBMessageService, setMBStatsUserLocalService, setMBStatsUserPersistence, setMBThreadFlagLocalService, setMBThreadFlagPersistence, setMembershipRequestLocalService, setMembershipRequestPersistence, setMembershipRequestService, setOrganizationFinder, setOrganizationLocalService, setOrganizationPersistence, setOrganizationService, setOrganizationUsers, setOrgGroupPermissionFinder, setOrgGroupPermissionPersistence, setOrgGroupRolePersistence, setOrgLaborLocalService, setOrgLaborPersistence, setOrgLaborService, setPasswordPolicyFinder, setPasswordPolicyLocalService, setPasswordPolicyPersistence, setPasswordPolicyRelLocalService, setPasswordPolicyRelPersistence, setPasswordPolicyService, setPasswordTrackerLocalService, setPasswordTrackerPersistence, setPermissionFinder, setPermissionLocalService, setPermissionPersistence, setPermissionService, setPermissionUsers, setPhoneLocalService, setPhonePersistence, setPhoneService, setPluginSettingLocalService, setPluginSettingPersistence, setPluginSettingService, setPortalLocalService, setPortalPreferencesLocalService, setPortalPreferencesPersistence, setPortalService, setPortletItemLocalService, setPortletItemPersistence, setPortletLocalService, setPortletPersistence, setPortletPreferencesFinder, setPortletPreferencesLocalService, setPortletPreferencesPersistence, setPortletPreferencesService, setPortletService, setQuartzLocalService, setRegionPersistence, setRegionService, setReleaseLocalService, setReleasePersistence, setRepositoryEntryLocalService, setRepositoryEntryPersistence, setRepositoryLocalService, setRepositoryPersistence, setRepositoryService, setResourceActionLocalService, setResourceActionPersistence, setResourceBlockFinder, setResourceBlockLocalService, setResourceBlockPermissionLocalService, setResourceBlockPermissionPersistence, setResourceBlockPersistence, setResourceBlockService, setResourceCodeLocalService, setResourceCodePersistence, setResourceFinder, setResourceLocalService, setResourcePermissionFinder, setResourcePermissionLocalService, setResourcePermissionPersistence, setResourcePermissionService, setResourcePersistence, setResourceService, setResourceTypePermissionFinder, setResourceTypePermissionLocalService, setResourceTypePermissionPersistence, setRoleFinder, setRoleLocalService, setRolePersistence, setRoleService, setServiceComponentLocalService, setServiceComponentPersistence, setShardLocalService, setShardPersistence, setShoppingCartLocalService, setShoppingCartPersistence, setSocialActivityFinder, setSocialActivityLocalService, setSocialActivityPersistence, setSocialRequestLocalService, setSocialRequestPersistence, setSubscriptionLocalService, setSubscriptionPersistence, setTeamFinder, setTeamLocalService, setTeamPersistence, setTeamService, setTeamUsers, setThemeLocalService, setThemeService, setTicketLocalService, setTicketPersistence, setUserFinder, setUserGroupFinder, setUserGroupGroupRoleLocalService, setUserGroupGroupRolePersistence, setUserGroupGroupRoleService, setUserGroupLocalService, setUserGroupPersistence, setUserGroupRoleFinder, setUserGroupRoleLocalService, setUserGroupRolePersistence, setUserGroupRoleService, setUserGroupService, setUserIdMapperLocalService, setUserIdMapperPersistence, setUserLocalService, setUserNotificationEventLocalService, setUserNotificationEventPersistence, setUserPersistence, setUserService, setUserTrackerLocalService, setUserTrackerPathLocalService, setUserTrackerPathPersistence, setUserTrackerPersistence, setVirtualHostLocalService, setVirtualHostPersistence, setWebDAVPropsLocalService, setWebDAVPropsPersistence, setWebsiteLocalService, setWebsitePersistence, setWebsiteService, setWorkflowDefinitionLinkLocalService, setWorkflowDefinitionLinkPersistence, setWorkflowInstanceLinkLocalService, setWorkflowInstanceLinkPersistence, updateUser, updateUser
 
Methods inherited from class com.liferay.portal.service.BaseLocalServiceImpl
getClassLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserLocalServiceImpl

public UserLocalServiceImpl()
Method Detail

addDefaultAdminUser

public User addDefaultAdminUser(long companyId,
                                String screenName,
                                String emailAddress,
                                Locale locale,
                                String firstName,
                                String middleName,
                                String lastName)
                         throws PortalException,
                                SystemException
Throws:
PortalException
SystemException

addDefaultGroups

public void addDefaultGroups(long userId)
                      throws PortalException,
                             SystemException
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.

Parameters:
userId - the primary key of the user
Throws:
PortalException - if a user with the primary key could not be found
SystemException - if a system exception occurred

addDefaultRoles

public void addDefaultRoles(long userId)
                     throws PortalException,
                            SystemException
Adds the user to the default roles, unless the user already has these roles. The default roles can be specified in portal.properties with the key admin.default.role.names.

Parameters:
userId - the primary key of the user
Throws:
PortalException - if a user with the primary key could not be found
SystemException - if a system exception occurred

addDefaultUserGroups

public void addDefaultUserGroups(long userId)
                          throws PortalException,
                                 SystemException
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.

Parameters:
userId - the primary key of the user
Throws:
PortalException - if a user with the primary key could not be found
SystemException - if a system exception occurred

addGroupUsers

public void addGroupUsers(long groupId,
                          long[] userIds)
                   throws PortalException,
                          SystemException
Adds the users to the group.

Specified by:
addGroupUsers in interface UserLocalService
Overrides:
addGroupUsers in class UserLocalServiceBaseImpl
Parameters:
groupId - the primary key of the group
userIds - the primary keys of the users
Throws:
PortalException - if a group or user with the primary key could not be found
SystemException - if a system exception occurred

addOrganizationUsers

public void addOrganizationUsers(long organizationId,
                                 long[] userIds)
                          throws PortalException,
                                 SystemException
Adds the users to the organization.

Specified by:
addOrganizationUsers in interface UserLocalService
Overrides:
addOrganizationUsers in class UserLocalServiceBaseImpl
Parameters:
organizationId - the primary key of the organization
userIds - the primary keys of the users
Throws:
PortalException - if an organization or user with the primary key could not be found
SystemException - if a system exception occurred

addPasswordPolicyUsers

public void addPasswordPolicyUsers(long passwordPolicyId,
                                   long[] userIds)
                            throws SystemException
Assigns the password policy to the users, removing any other currently assigned password policies.

Parameters:
passwordPolicyId - the primary key of the password policy
userIds - the primary keys of the users
Throws:
SystemException - if a system exception occurred

addRoleUsers

public void addRoleUsers(long roleId,
                         long[] userIds)
                  throws PortalException,
                         SystemException
Adds the users to the role.

Specified by:
addRoleUsers in interface UserLocalService
Overrides:
addRoleUsers in class UserLocalServiceBaseImpl
Parameters:
roleId - the primary key of the role
userIds - the primary keys of the users
Throws:
PortalException - if a role or user with the primary key could not be found
SystemException - if a system exception occurred

addTeamUsers

public void addTeamUsers(long teamId,
                         long[] userIds)
                  throws PortalException,
                         SystemException
Adds the users to the team.

Specified by:
addTeamUsers in interface UserLocalService
Overrides:
addTeamUsers in class UserLocalServiceBaseImpl
Parameters:
teamId - the primary key of the team
userIds - the primary keys of the users
Throws:
PortalException - if a team or user with the primary key could not be found
SystemException - if a system exception occurred

addUser

public User addUser(long creatorUserId,
                    long companyId,
                    boolean autoPassword,
                    String password1,
                    String password2,
                    boolean autoScreenName,
                    String screenName,
                    String emailAddress,
                    long facebookId,
                    String openId,
                    Locale locale,
                    String firstName,
                    String middleName,
                    String lastName,
                    int prefixId,
                    int suffixId,
                    boolean male,
                    int birthdayMonth,
                    int birthdayDay,
                    int birthdayYear,
                    String jobTitle,
                    long[] groupIds,
                    long[] organizationIds,
                    long[] roleIds,
                    long[] userGroupIds,
                    boolean sendEmail,
                    ServiceContext serviceContext)
             throws PortalException,
                    SystemException
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.

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
facebookId - the user's facebook ID
openId - the user's OpenID
locale - the user's locale
firstName - the user's first name
middleName - the user's middle name
lastName - the user's last name
prefixId - the user's name prefix ID
suffixId - 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
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 user's service context (optionally null). Can set the universally unique identifier (with the uuid attribute), asset category IDs, asset tag names, and expando bridge attributes for the user.
Returns:
the new user
Throws:
PortalException - if the user's information was invalid
SystemException - if a system exception occurred

addUserGroupUsers

public void addUserGroupUsers(long userGroupId,
                              long[] userIds)
                       throws PortalException,
                              SystemException
Adds the users to the user group.

Specified by:
addUserGroupUsers in interface UserLocalService
Overrides:
addUserGroupUsers in class UserLocalServiceBaseImpl
Parameters:
userGroupId - the primary key of the user group
userIds - the primary keys of the users
Throws:
PortalException - if a user group or user with the primary could could not be found
SystemException - if a system exception occurred

addUserWithWorkflow

public User addUserWithWorkflow(long creatorUserId,
                                long companyId,
                                boolean autoPassword,
                                String password1,
                                String password2,
                                boolean autoScreenName,
                                String screenName,
                                String emailAddress,
                                long facebookId,
                                String openId,
                                Locale locale,
                                String firstName,
                                String middleName,
                                String lastName,
                                int prefixId,
                                int suffixId,
                                boolean male,
                                int birthdayMonth,
                                int birthdayDay,
                                int birthdayYear,
                                String jobTitle,
                                long[] groupIds,
                                long[] organizationIds,
                                long[] roleIds,
                                long[] userGroupIds,
                                boolean sendEmail,
                                ServiceContext serviceContext)
                         throws PortalException,
                                SystemException
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.

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
facebookId - the user's facebook ID
openId - the user's OpenID
locale - the user's locale
firstName - the user's first name
middleName - the user's middle name
lastName - the user's last name
prefixId - the user's name prefix ID
suffixId - 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
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 user's service context (optionally null). Can set the universally unique identifier (with the uuid attribute), asset category IDs, asset tag names, and expando bridge attributes for the user.
Returns:
the new user
Throws:
PortalException - if the user's information was invalid
SystemException - if a system exception occurred

authenticateByEmailAddress

public int authenticateByEmailAddress(long companyId,
                                      String emailAddress,
                                      String password,
                                      Map<String,String[]> headerMap,
                                      Map<String,String[]> parameterMap,
                                      Map<String,Object> resultsMap)
                               throws PortalException,
                                      SystemException
Attempts to authenticate the user by their email address and password, while using the AuthPipeline.

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 succesful 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 - if emailAddress or password was null
SystemException - if a system exception occurred
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,
                                    SystemException
Attempts to authenticate the user by their screen name and password, while using the AuthPipeline.

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 succesful 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 - if screenName or password was null
SystemException - if a system exception occurred
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,
                                SystemException
Attempts to authenticate the user by their primary key and password, while using the AuthPipeline.

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 succesful 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 - if userId or password was null
SystemException - if a system exception occurred
See Also:
AuthPipeline

authenticateForBasic

@Transactional(propagation=SUPPORTS,
               readOnly=true)
public long authenticateForBasic(long companyId,
                                                                          String authType,
                                                                          String login,
                                                                          String password)
                          throws PortalException,
                                 SystemException
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:

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 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 - if a portal exception occurred
SystemException - if a system exception occurred

authenticateForDigest

@Transactional(propagation=SUPPORTS,
               readOnly=true)
public long authenticateForDigest(long companyId,
                                                                           String username,
                                                                           String realm,
                                                                           String nonce,
                                                                           String method,
                                                                           String uri,
                                                                           String response)
                           throws PortalException,
                                  SystemException
Attempts to authenticate the user using HTTP digest access authentication, without using the AuthPipeline. Primarily used for authenticating users of tunnel-web.

Parameters:
companyId - the primary key of the user's company
username - either the user's email address, screen name, or primary key
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 succesful; 0 otherwise
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

authenticateForJAAS

@Transactional(propagation=SUPPORTS,
               readOnly=true)
public boolean authenticateForJAAS(long userId,
                                                                            String encPassword)
Attempts to authenticate the user using JAAS credentials, without using the AuthPipeline.

Parameters:
userId - the primary key of the user
encPassword - the encrypted password
Returns:
true if authentication is successful; false otherwise

checkLockout

public void checkLockout(User user)
                  throws PortalException,
                         SystemException
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.

Parameters:
user - the user
Throws:
PortalException - if the user was determined to still be locked out
SystemException - if a system exception occurred

checkLoginFailure

public void checkLoginFailure(User user)
                       throws SystemException
Adds a failed login attempt to the user and updates the user's last failed login date.

Parameters:
user - the user
Throws:
SystemException - if a system exception occurred

checkLoginFailureByEmailAddress

public void checkLoginFailureByEmailAddress(long companyId,
                                            String emailAddress)
                                     throws PortalException,
                                            SystemException
Adds a failed login attempt to the user with the email address and updates the user's last failed login date.

Parameters:
companyId - the primary key of the user's company
emailAddress - the user's email address
Throws:
PortalException - if a user with the email address could not be found
SystemException - if a system exception occurred

checkLoginFailureById

public void checkLoginFailureById(long userId)
                           throws PortalException,
                                  SystemException
Adds a failed login attempt to the user and updates the user's last failed login date.

Parameters:
userId - the primary key of the user
Throws:
PortalException - if a user with the primary key could not be found
SystemException - if a system exception occurred

checkLoginFailureByScreenName

public void checkLoginFailureByScreenName(long companyId,
                                          String screenName)
                                   throws PortalException,
                                          SystemException
Adds a failed login attempt to the user with the screen name and updates the user's last failed login date.

Parameters:
companyId - the primary key of the user's company
screenName - the user's screen name
Throws:
PortalException - if a user with the screen name could not be found
SystemException - if a system exception occurred

checkPasswordExpired

public void checkPasswordExpired(User user)
                          throws PortalException,
                                 SystemException
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.

Parameters:
user - the user
Throws:
PortalException - if the user's password has expired and the grace login limit has been exceeded
SystemException - if a system exception occurred

clearOrganizationUsers

public void clearOrganizationUsers(long organizationId)
                            throws SystemException
Removes all the users from the organization.

Specified by:
clearOrganizationUsers in interface UserLocalService
Overrides:
clearOrganizationUsers in class UserLocalServiceBaseImpl
Parameters:
organizationId - the primary key of the organization
Throws:
SystemException - if a system exception occurred

clearUserGroupUsers

public void clearUserGroupUsers(long userGroupId)
                         throws SystemException
Removes all the users from the user group.

Specified by:
clearUserGroupUsers in interface UserLocalService
Overrides:
clearUserGroupUsers in class UserLocalServiceBaseImpl
Parameters:
userGroupId - the primary key of the user group
Throws:
SystemException - if a system exception occurred

completeUserRegistration

public void completeUserRegistration(User user,
                                     ServiceContext serviceContext)
                              throws PortalException,
                                     SystemException
Completes the user's registration by generating a password and sending the confirmation email.

Parameters:
user - the user
serviceContext - the user's service context. Can set whether a password should be generated (with the autoPassword attribute) and whether the confirmation email should be sent (with the sendEmail attribute) for the user.
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

decryptUserId

public KeyValuePair decryptUserId(long companyId,
                                  String name,
                                  String password)
                           throws PortalException,
                                  SystemException
Decrypts the user's primary key and password from their encrypted forms. Used for decrypting a user's credentials from the values stored in an automatic login cookie.

Parameters:
companyId - the primary key of the user's company
name - the encrypted primary key of the user
password - the encrypted password of the user
Returns:
the user's primary key and password
Throws:
PortalException - if a user with the primary key could not be found or if the user's password was incorrect
SystemException - if a system exception occurred

deletePortrait

public void deletePortrait(long userId)
                    throws PortalException,
                           SystemException
Deletes the user's portrait image.

Parameters:
userId - the primary key of the user
Throws:
PortalException - if a user with the primary key could not be found or if the user's portrait could not be found
SystemException - if a system exception occurred

deleteRoleUser

public void deleteRoleUser(long roleId,
                           long userId)
                    throws PortalException,
                           SystemException
Removes the user from the role.

Specified by:
deleteRoleUser in interface UserLocalService
Overrides:
deleteRoleUser in class UserLocalServiceBaseImpl
Parameters:
roleId - the primary key of the role
userId - the primary key of the user
Throws:
PortalException - if a role or user with the primary key could not be found
SystemException - if a system exception occurred

deleteUser

public User deleteUser(long userId)
                throws PortalException,
                       SystemException
Deletes the user.

Specified by:
deleteUser in interface UserLocalService
Overrides:
deleteUser in class UserLocalServiceBaseImpl
Parameters:
userId - the primary key of the user
Returns:
the deleted user
Throws:
PortalException - if a user with the primary key could not be found
SystemException - if a system exception occurred

deleteUser

public User deleteUser(User user)
                throws PortalException,
                       SystemException
Deletes the user.

Specified by:
deleteUser in interface UserLocalService
Overrides:
deleteUser in class UserLocalServiceBaseImpl
Parameters:
user - the user
Returns:
the deleted user
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

deleteUserGroupUser

public void deleteUserGroupUser(long userGroupId,
                                long userId)
                         throws PortalException,
                                SystemException
Removes the user from the user group.

Specified by:
deleteUserGroupUser in interface UserLocalService
Overrides:
deleteUserGroupUser in class UserLocalServiceBaseImpl
Parameters:
userGroupId - the primary key of the user group
userId - the primary key of the user
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

encryptUserId

@Transactional(propagation=SUPPORTS,
               readOnly=true)
public String encryptUserId(String name)
                     throws PortalException,
                            SystemException
Encrypts the primary key of the user. Used when encrypting the user's credentials for storage in an automatic login cookie.

Parameters:
name - the primary key of the user
Returns:
the user's encrypted primary key
Throws:
PortalException - if a user with the primary key could not be found
SystemException - if a system exception occurred

fetchUserByEmailAddress

public User fetchUserByEmailAddress(long companyId,
                                    String emailAddress)
                             throws SystemException
Returns the user with the email address.

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
Throws:
SystemException - if a system exception occurred

fetchUserById

public User fetchUserById(long userId)
                   throws SystemException
Returns the user with the primary key.

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
Throws:
SystemException - if a system exception occurred

fetchUserByScreenName

public User fetchUserByScreenName(long companyId,
                                  String screenName)
                           throws SystemException
Returns the user with the screen name.

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
Throws:
SystemException - if a system exception occurred

getCompanyUsers

public List<User> getCompanyUsers(long companyId,
                                  int start,
                                  int end)
                           throws SystemException
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.

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
Throws:
SystemException - if a system exception occurred

getCompanyUsersCount

public int getCompanyUsersCount(long companyId)
                         throws SystemException
Returns the number of users belonging to the company.

Parameters:
companyId - the primary key of the company
Returns:
the number of users belonging to the company
Throws:
SystemException - if a system exception occurred

getDefaultUser

@Skip
public User getDefaultUser(long companyId)
                    throws PortalException,
                           SystemException
Returns the default user for the company.

Parameters:
companyId - the primary key of the company
Returns:
the default user for the company
Throws:
PortalException - if a default user for the company could not be found
SystemException - if a system exception occurred

getDefaultUserId

@Skip
public long getDefaultUserId(long companyId)
                      throws PortalException,
                             SystemException
Returns the primary key of the default user for the company.

Parameters:
companyId - the primary key of the company
Returns:
the primary key of the default user for the company
Throws:
PortalException - if a default user for the company could not be found
SystemException - if a system exception occurred

getGroupUserIds

public long[] getGroupUserIds(long groupId)
                       throws SystemException
Returns the primary keys of all the users belonging to the group.

Parameters:
groupId - the primary key of the group
Returns:
the primary keys of the users belonging to the group
Throws:
SystemException - if a system exception occurred

getGroupUsers

public List<User> getGroupUsers(long groupId)
                         throws SystemException
Returns all the users belonging to the group.

Specified by:
getGroupUsers in interface UserLocalService
Overrides:
getGroupUsers in class UserLocalServiceBaseImpl
Parameters:
groupId - the primary key of the group
Returns:
the users belonging to the group
Throws:
SystemException - if a system exception occurred

getGroupUsersCount

public int getGroupUsersCount(long groupId)
                       throws SystemException
Returns the number of users belonging to the group.

Specified by:
getGroupUsersCount in interface UserLocalService
Overrides:
getGroupUsersCount in class UserLocalServiceBaseImpl
Parameters:
groupId - the primary key of the group
Returns:
the number of users belonging to the group
Throws:
SystemException - if a system exception occurred

getGroupUsersCount

public int getGroupUsersCount(long groupId,
                              int status)
                       throws PortalException,
                              SystemException
Returns the number of users with the status belonging to the group.

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 - if a group with the primary key could not be found
SystemException - if a system exception occurred

getNoAnnouncementsDeliveries

public List<User> getNoAnnouncementsDeliveries(String type)
                                        throws SystemException
Returns all the users who have not had any announcements of the type delivered, excluding the default user.

Parameters:
type - the type of announcement
Returns:
the users who have not had any annoucements of the type delivered
Throws:
SystemException - if a system exception occurred

getNoContacts

public List<User> getNoContacts()
                         throws SystemException
Returns all the users who do not have any contacts.

Returns:
the users who do not have any contacts
Throws:
SystemException - if a system exception occurred

getNoGroups

public List<User> getNoGroups()
                       throws SystemException
Returns all the users who do not belong to any groups, excluding the default user.

Returns:
the users who do not belong to any groups
Throws:
SystemException - if a system exception occurred

getOrganizationUserIds

public long[] getOrganizationUserIds(long organizationId)
                              throws SystemException
Returns the primary keys of all the users belonging to the organization.

Parameters:
organizationId - the primary key of the organization
Returns:
the primary keys of the users belonging to the organization
Throws:
SystemException - if a system exception occurred

getOrganizationUsers

public List<User> getOrganizationUsers(long organizationId)
                                throws SystemException
Returns all the users belonging to the organization.

Specified by:
getOrganizationUsers in interface UserLocalService
Overrides:
getOrganizationUsers in class UserLocalServiceBaseImpl
Parameters:
organizationId - the primary key of the organization
Returns:
the users belonging to the organization
Throws:
SystemException - if a system exception occurred

getOrganizationUsersCount

public int getOrganizationUsersCount(long organizationId)
                              throws SystemException
Returns the number of users belonging to the organization.

Specified by:
getOrganizationUsersCount in interface UserLocalService
Overrides:
getOrganizationUsersCount in class UserLocalServiceBaseImpl
Parameters:
organizationId - the primary key of the organization
Returns:
the number of users belonging to the organization
Throws:
SystemException - if a system exception occurred

getOrganizationUsersCount

public int getOrganizationUsersCount(long organizationId,
                                     int status)
                              throws PortalException,
                                     SystemException
Returns the number of users with the status belonging to the organization.

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 - if an organization with the primary key could not be found
SystemException - if a system exception occurred

getRoleUserIds

public long[] getRoleUserIds(long roleId)
                      throws SystemException
Returns the primary keys of all the users belonging to the role.

Parameters:
roleId - the primary key of the role
Returns:
the primary keys of the users belonging to the role
Throws:
SystemException - if a system exception occurred

getRoleUsers

public List<User> getRoleUsers(long roleId)
                        throws SystemException
Returns all the users belonging to the role.

Specified by:
getRoleUsers in interface UserLocalService
Overrides:
getRoleUsers in class UserLocalServiceBaseImpl
Parameters:
roleId - the primary key of the role
Returns:
the users belonging to the role
Throws:
SystemException - if a system exception occurred

getRoleUsers

public List<User> getRoleUsers(long roleId,
                               int start,
                               int end)
                        throws SystemException
Returns a range of all the users belonging to the role.

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:
getRoleUsers in interface UserLocalService
Overrides:
getRoleUsers in class UserLocalServiceBaseImpl
Parameters:
roleId - the primary key of the role
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 role
Throws:
SystemException - if a system exception occurred

getRoleUsersCount

public int getRoleUsersCount(long roleId)
                      throws SystemException
Returns the number of users belonging to the role.

Specified by:
getRoleUsersCount in interface UserLocalService
Overrides:
getRoleUsersCount in class UserLocalServiceBaseImpl
Parameters:
roleId - the primary key of the role
Returns:
the number of users belonging to the role
Throws:
SystemException - if a system exception occurred

getRoleUsersCount

public int getRoleUsersCount(long roleId,
                             int status)
                      throws PortalException,
                             SystemException
Returns the number of users with the status belonging to the role.

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 - if an role with the primary key could not be found
SystemException - if a system exception occurred

getSocialUsers

public List<User> getSocialUsers(long userId,
                                 int type,
                                 int start,
                                 int end,
                                 OrderByComparator obc)
                          throws PortalException,
                                 SystemException
Returns an ordered range of all the users with a social relation of the type with the user.

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.

Parameters:
userId - the primary key of the user
type - 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)
obc - the comparator to order the users by (optionally null)
Returns:
the ordered range of users with a social relation of the type with the user
Throws:
PortalException - if a user with the primary key could not be found
SystemException - if a system exception occurred

getSocialUsers

public List<User> getSocialUsers(long userId,
                                 int start,
                                 int end,
                                 OrderByComparator obc)
                          throws PortalException,
                                 SystemException
Returns an ordered range of all the users with a social relation with the user.

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.

Parameters:
userId - the primary key of the user
start - the lower bound of the range of users
end - the upper bound of the range of users (not inclusive)
obc - the comparator to order the users by (optionally null)
Returns:
the ordered range of users with a social relation with the user
Throws:
PortalException - if a user with the primary key could not be found
SystemException - if a system exception occurred

getSocialUsers

public List<User> getSocialUsers(long userId1,
                                 long userId2,
                                 int type,
                                 int start,
                                 int end,
                                 OrderByComparator obc)
                          throws PortalException,
                                 SystemException
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.

Parameters:
userId1 - the primary key of the first user
userId2 - the primary key of the second user
type - 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)
obc - 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 - if a user with the primary key could not be found
SystemException - if a system exception occurred

getSocialUsers

public List<User> getSocialUsers(long userId1,
                                 long userId2,
                                 int start,
                                 int end,
                                 OrderByComparator obc)
                          throws PortalException,
                                 SystemException
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.

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)
obc - 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 - if a user with the primary key could not be found
SystemException - if a system exception occurred

getSocialUsersCount

public int getSocialUsersCount(long userId)
                        throws PortalException,
                               SystemException
Returns the number of users with a social relation with the user.

Parameters:
userId - the primary key of the user
Returns:
the number of users with a social relation with the user
Throws:
PortalException - if a user with the primary key could not be found
SystemException - if a system exception occurred

getSocialUsersCount

public int getSocialUsersCount(long userId,
                               int type)
                        throws PortalException,
                               SystemException
Returns the number of users with a social relation of the type with the user.

Parameters:
userId - the primary key of the user
type - the type of social relation. The possible types can be found in SocialRelationConstants.
Returns:
the number of users with a social relation of the type with the user
Throws:
PortalException - if a user with the primary key could not be found
SystemException - if a system exception occurred

getSocialUsersCount

public int getSocialUsersCount(long userId1,
                               long userId2)
                        throws PortalException,
                               SystemException
Returns the number of users with a mutual social relation with both of the given users.

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 - if a user with the primary key could not be found
SystemException - if a system exception occurred

getSocialUsersCount

public int getSocialUsersCount(long userId1,
                               long userId2,
                               int type)
                        throws PortalException,
                               SystemException
Returns the number of users with a mutual social relation of the type with both of the given users.

Parameters:
userId1 - the primary key of the first user
userId2 - the primary key of the second user
type - 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 - if a user with the primary key could not be found
SystemException - if a system exception occurred

getUserByContactId

public User getUserByContactId(long contactId)
                        throws PortalException,
                               SystemException
Returns the user with the contact ID.

Parameters:
contactId - the user's contact ID
Returns:
the user with the contact ID
Throws:
PortalException - if a user with the contact ID could not be found
SystemException - if a system exception occurred

getUserByEmailAddress

public User getUserByEmailAddress(long companyId,
                                  String emailAddress)
                           throws PortalException,
                                  SystemException
Returns the user with the email address.

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 - if a user with the email address could not be found
SystemException - if a system exception occurred

getUserByFacebookId

public User getUserByFacebookId(long companyId,
                                long facebookId)
                         throws PortalException,
                                SystemException
Returns the user with the Facebook ID.

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 - if a user with the Facebook ID could not be found
SystemException - if a system exception occurred

getUserById

public User getUserById(long userId)
                 throws PortalException,
                        SystemException
Returns the user with the primary key.

Parameters:
userId - the primary key of the user
Returns:
the user with the primary key
Throws:
PortalException - if a user with the primary key could not be found
SystemException - if a system exception occurred

getUserById

public User getUserById(long companyId,
                        long userId)
                 throws PortalException,
                        SystemException
Returns the user with the primary key from the company.

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 - if a user with the primary key from the company could not be found
SystemException - if a system exception occurred

getUserByOpenId

public User getUserByOpenId(long companyId,
                            String openId)
                     throws PortalException,
                            SystemException
Returns the user with the OpenID.

Parameters:
companyId - the primary key of the user's company
openId - the user's OpenID
Returns:
the user with the OpenID
Throws:
PortalException - if a user with the OpenID could not be found
SystemException - if a system exception occurred

getUserByPortraitId

public User getUserByPortraitId(long portraitId)
                         throws PortalException,
                                SystemException
Returns the user with the portrait ID.

Parameters:
portraitId - the user's portrait ID
Returns:
the user with the portrait ID
Throws:
PortalException - if a user with the portrait ID could not be found
SystemException - if a system exception occurred

getUserByScreenName

public User getUserByScreenName(long companyId,
                                String screenName)
                         throws PortalException,
                                SystemException
Returns the user with the screen name.

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 - if a user with the screen name could not be found
SystemException - if a system exception occurred

getUserByUuid

public User getUserByUuid(String uuid)
                   throws PortalException,
                          SystemException
Returns the user with the universally unique identifier.

Parameters:
uuid - the user's universally unique identifier
Returns:
the user with the universally unique identifier
Throws:
PortalException - if a user with the universally unique identifier could not be found
SystemException - if a system exception occurred

getUserGroupUsers

public List<User> getUserGroupUsers(long userGroupId)
                             throws SystemException
Returns all the users belonging to the user group.

Specified by:
getUserGroupUsers in interface UserLocalService
Overrides:
getUserGroupUsers in class UserLocalServiceBaseImpl
Parameters:
userGroupId - the primary key of the user group
Returns:
the users belonging to the user group
Throws:
SystemException - if a system exception occurred

getUserGroupUsersCount

public int getUserGroupUsersCount(long userGroupId)
                           throws SystemException
Returns the number of users belonging to the user group.

Specified by:
getUserGroupUsersCount in interface UserLocalService
Overrides:
getUserGroupUsersCount in class UserLocalServiceBaseImpl
Parameters:
userGroupId - the primary key of the user group
Returns:
the number of users belonging to the user group
Throws:
SystemException - if a system exception occurred

getUserGroupUsersCount

public int getUserGroupUsersCount(long userGroupId,
                                  int status)
                           throws PortalException,
                                  SystemException
Returns the number of users with the status belonging to the user group.

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 - if a user group with the primary key could not be found
SystemException - if a system exception occurred

getUserIdByEmailAddress

public long getUserIdByEmailAddress(long companyId,
                                    String emailAddress)
                             throws PortalException,
                                    SystemException
Returns the primary key of the user with the email address.

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 - if a user with the email address could not be found
SystemException - if a system exception occurred

getUserIdByScreenName

public long getUserIdByScreenName(long companyId,
                                  String screenName)
                           throws PortalException,
                                  SystemException
Returns the primary key of the user with the screen name.

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 - if a user with the screen name could not be found
SystemException - if a system exception occurred

hasGroupUser

public boolean hasGroupUser(long groupId,
                            long userId)
                     throws SystemException
Returns true if the user is a member of the group.

Specified by:
hasGroupUser in interface UserLocalService
Overrides:
hasGroupUser in class UserLocalServiceBaseImpl
Parameters:
groupId - the primary key of the group
userId - the primary key of the user
Returns:
true if the user is a member of the group; false otherwise
Throws:
SystemException - if a system exception occurred

hasOrganizationUser

public boolean hasOrganizationUser(long organizationId,
                                   long userId)
                            throws SystemException
Returns true if the user is a member of the organization.

Specified by:
hasOrganizationUser in interface UserLocalService
Overrides:
hasOrganizationUser in class UserLocalServiceBaseImpl
Parameters:
organizationId - the primary key of the organization
userId - the primary key of the user
Returns:
true if the user is a member of the organization; false otherwise
Throws:
SystemException - if a system exception occurred

hasPasswordPolicyUser

public boolean hasPasswordPolicyUser(long passwordPolicyId,
                                     long userId)
                              throws SystemException
Returns true if the password policy has been assigned to the user.

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
Throws:
SystemException - if a system exception occurred

hasRoleUser

public boolean hasRoleUser(long roleId,
                           long userId)
                    throws SystemException
Returns true if the user is a member of the role.

Specified by:
hasRoleUser in interface UserLocalService
Overrides:
hasRoleUser in class UserLocalServiceBaseImpl
Parameters:
roleId - the primary key of the role
userId - the primary key of the user
Returns:
true if the user is a member of the role; false otherwise
Throws:
SystemException - if a system exception occurred

hasRoleUser

public boolean hasRoleUser(long companyId,
                           String name,
                           long userId,
                           boolean inherited)
                    throws PortalException,
                           SystemException
Returns true if the user has the role with the name, optionally through inheritance.

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 - if a role with the name could not be found
SystemException - if a system exception occurred

hasTeamUser

public boolean hasTeamUser(long teamId,
                           long userId)
                    throws SystemException
Returns true if the user is a member of the team.

Specified by:
hasTeamUser in interface UserLocalService
Overrides:
hasTeamUser in class UserLocalServiceBaseImpl
Parameters:
teamId - the primary key of the team
userId - the primary key of the user
Returns:
true if the user is a member of the team; false otherwise
Throws:
SystemException - if a system exception occurred

hasUserGroupUser

public boolean hasUserGroupUser(long userGroupId,
                                long userId)
                         throws SystemException
Returns true if the user is a member of the user group.

Specified by:
hasUserGroupUser in interface UserLocalService
Overrides:
hasUserGroupUser in class UserLocalServiceBaseImpl
Parameters:
userGroupId - the primary key of the user group
userId - the primary key of the user
Returns:
true if the user is a member of the user group; false otherwise
Throws:
SystemException - if a system exception occurred

isPasswordExpired

public boolean isPasswordExpired(User user)
                          throws PortalException,
                                 SystemException
Returns true if the user's password is expired.

Parameters:
user - the user
Returns:
true if the user's password is expired; false otherwise
Throws:
PortalException - if the password policy for the user could not be found
SystemException - if a system exception occurred

isPasswordExpiringSoon

public boolean isPasswordExpiringSoon(User user)
                               throws PortalException,
                                      SystemException
Returns true if the user's password is expiring soon.

Parameters:
user - the user
Returns:
true if the user's password is expiring soon; false otherwise
Throws:
PortalException - if the password policy for the user could not be found
SystemException - if a system exception occurred

loadGetDefaultUser

public User loadGetDefaultUser(long companyId)
                        throws PortalException,
                               SystemException
Throws:
PortalException
SystemException

search

public List<User> search(long companyId,
                         String keywords,
                         int status,
                         LinkedHashMap<String,Object> params,
                         int start,
                         int end,
                         OrderByComparator obc)
                  throws SystemException
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.

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)
obc - the comparator to order the users by (optionally null)
Returns:
the matching users
Throws:
SystemException - if a system exception occurred
See Also:
UserFinder

search

public Hits search(long companyId,
                   String keywords,
                   int status,
                   LinkedHashMap<String,Object> params,
                   int start,
                   int end,
                   Sort sort)
            throws SystemException
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.

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). For more information see UserIndexer.
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
Throws:
SystemException - if a system exception occurred
See Also:
UserIndexer

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 obc)
                  throws SystemException
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.

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)
obc - the comparator to order the users by (optionally null)
Returns:
the matching users
Throws:
SystemException - if a system exception occurred
See Also:
UserFinder

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)
            throws SystemException
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.

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). For more information see UserIndexer.
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
Throws:
SystemException - if a system exception occurred
See Also:
UserIndexer

searchCount

public int searchCount(long companyId,
                       String keywords,
                       int status,
                       LinkedHashMap<String,Object> params)
                throws SystemException
Returns the number of users who match the keywords and status.

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
Throws:
SystemException - if a system exception occurred

searchCount

public int searchCount(long companyId,
                       String firstName,
                       String middleName,
                       String lastName,
                       String screenName,
                       String emailAddress,
                       int status,
                       LinkedHashMap<String,Object> params,
                       boolean andSearch)
                throws SystemException
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.

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
Throws:
SystemException - if a system exception occurred

sendEmailAddressVerification

public void sendEmailAddressVerification(User user,
                                         String emailAddress,
                                         ServiceContext serviceContext)
                                  throws PortalException,
                                         SystemException
Sends an email address verification to the user.

Parameters:
user - the verification email recipient
emailAddress - the recipient's email address
serviceContext - the service context. Must set the portal URL, main path, primary key of the layout, remote address, remote host, and agent for the user.
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

sendPassword

public void sendPassword(long companyId,
                         String emailAddress,
                         String fromName,
                         String fromAddress,
                         String subject,
                         String body,
                         ServiceContext serviceContext)
                  throws PortalException,
                         SystemException
Sends the password email to the user with the email address. The content of this email can be specified in portal.properties with the admin.email.password keys.

Parameters:
companyId - the primary key of the user's company
emailAddress - the user's email address
fromName - the name of the individual that the email should be from
fromAddress - the address of the individual that the email should be from
subject - the email subject. If null, the subject specified in portal.properties will be used.
body - the email body. If null, the body specified in portal.properties will be used.
serviceContext - the user's service context
Throws:
PortalException - if a user with the email address could not be found
SystemException - if a system exception occurred

setRoleUsers

public void setRoleUsers(long roleId,
                         long[] userIds)
                  throws PortalException,
                         SystemException
Sets the users in the role, removing and adding users to the role as necessary.

Specified by:
setRoleUsers in interface UserLocalService
Overrides:
setRoleUsers in class UserLocalServiceBaseImpl
Parameters:
roleId - the primary key of the role
userIds - the primary keys of the users
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

setUserGroupUsers

public void setUserGroupUsers(long userGroupId,
                              long[] userIds)
                       throws PortalException,
                              SystemException
Sets the users in the user group, removing and adding users to the user group as necessary.

Specified by:
setUserGroupUsers in interface UserLocalService
Overrides:
setUserGroupUsers in class UserLocalServiceBaseImpl
Parameters:
userGroupId - the primary key of the user group
userIds - the primary keys of the users
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

unsetGroupTeamsUsers

public void unsetGroupTeamsUsers(long groupId,
                                 long[] userIds)
                          throws PortalException,
                                 SystemException
Removes the users from the teams of a group.

Parameters:
groupId - the primary key of the group
userIds - the primary keys of the users
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

unsetGroupUsers

public void unsetGroupUsers(long groupId,
                            long[] userIds,
                            ServiceContext serviceContext)
                     throws PortalException,
                            SystemException
Removes the users from the group.

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 - if a portal exception occurred
SystemException - if a system exception occurred

unsetOrganizationUsers

public void unsetOrganizationUsers(long organizationId,
                                   long[] userIds)
                            throws PortalException,
                                   SystemException
Removes the users from the organization.

Parameters:
organizationId - the primary key of the organization
userIds - the primary keys of the users
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

unsetPasswordPolicyUsers

public void unsetPasswordPolicyUsers(long passwordPolicyId,
                                     long[] userIds)
                              throws SystemException
Removes the users from the password policy.

Parameters:
passwordPolicyId - the primary key of the password policy
userIds - the primary keys of the users
Throws:
SystemException - if a system exception occurred

unsetRoleUsers

public void unsetRoleUsers(long roleId,
                           List<User> users)
                    throws PortalException,
                           SystemException
Removes the users from the role.

Parameters:
roleId - the primary key of the role
users - the users
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

unsetRoleUsers

public void unsetRoleUsers(long roleId,
                           long[] userIds)
                    throws PortalException,
                           SystemException
Removes the users from the role.

Parameters:
roleId - the primary key of the role
userIds - the primary keys of the users
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

unsetTeamUsers

public void unsetTeamUsers(long teamId,
                           long[] userIds)
                    throws PortalException,
                           SystemException
Removes the users from the team.

Parameters:
teamId - the primary key of the team
userIds - the primary keys of the users
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

unsetUserGroupUsers

public void unsetUserGroupUsers(long userGroupId,
                                long[] userIds)
                         throws PortalException,
                                SystemException
Removes the users from the user group.

Parameters:
userGroupId - the primary key of the user group
userIds - the primary keys of the users
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

updateAgreedToTermsOfUse

public User updateAgreedToTermsOfUse(long userId,
                                     boolean agreedToTermsOfUse)
                              throws PortalException,
                                     SystemException
Updates whether the user has agreed to the terms of use.

Parameters:
userId - the primary key of the user
agreedToTermsOfUse - whether the user has agreet to the terms of use
Returns:
the user
Throws:
PortalException - if a user with the primary key could not be found
SystemException - if a system exception occurred

updateAsset

public void updateAsset(long userId,
                        User user,
                        long[] assetCategoryIds,
                        String[] assetTagNames)
                 throws PortalException,
                        SystemException
Updates the user's asset with the new asset categories and tag names, removing and adding asset categories and tag names as necessary.

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 - if a user with the primary key could not be found
SystemException - if a system exception occurred

updateCreateDate

public User updateCreateDate(long userId,
                             Date createDate)
                      throws PortalException,
                             SystemException
Updates the user's creation date.

Parameters:
userId - the primary key of the user
createDate - the new creation date
Returns:
the user
Throws:
PortalException - if a user with the primary key could not be found
SystemException - if a system exception occurred

updateEmailAddress

public User updateEmailAddress(long userId,
                               String password,
                               String emailAddress1,
                               String emailAddress2)
                        throws PortalException,
                               SystemException
Updates the user's email address.

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 - if a user with the primary key could not be found
SystemException - if a system exception occurred

updateEmailAddress

public User updateEmailAddress(long userId,
                               String password,
                               String emailAddress1,
                               String emailAddress2,
                               ServiceContext serviceContext)
                        throws PortalException,
                               SystemException
Updates the user's email address or sends verification email.

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 - if a user with the primary key could not be found
SystemException - if a system exception occurred

updateEmailAddressVerified

public User updateEmailAddressVerified(long userId,
                                       boolean emailAddressVerified)
                                throws PortalException,
                                       SystemException
Updates whether the user has verified email address.

Parameters:
userId - the primary key of the user
emailAddressVerified - whether the user has verified email address
Returns:
the user
Throws:
PortalException - if a user with the primary key could not be found
SystemException - if a system exception occurred

updateFacebookId

public User updateFacebookId(long userId,
                             long facebookId)
                      throws PortalException,
                             SystemException
Updates the user's Facebook ID.

Parameters:
userId - the primary key of the user
facebookId - the user's new Facebook ID
Returns:
the user
Throws:
PortalException - if a user with the primary key could not be found
SystemException - if a system exception occurred

updateGroups

public void updateGroups(long userId,
                         long[] newGroupIds,
                         ServiceContext serviceContext)
                  throws PortalException,
                         SystemException
Sets the groups the user is in, removing and adding groups as necessary.

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 - if a portal exception occurred
SystemException - if a system exception occurred

updateIncompleteUser

public User updateIncompleteUser(long creatorUserId,
                                 long companyId,
                                 boolean autoPassword,
                                 String password1,
                                 String password2,
                                 boolean autoScreenName,
                                 String screenName,
                                 String emailAddress,
                                 long facebookId,
                                 String openId,
                                 Locale locale,
                                 String firstName,
                                 String middleName,
                                 String lastName,
                                 int prefixId,
                                 int suffixId,
                                 boolean male,
                                 int birthdayMonth,
                                 int birthdayDay,
                                 int birthdayYear,
                                 String jobTitle,
                                 boolean updateUserInformation,
                                 boolean sendEmail,
                                 ServiceContext serviceContext)
                          throws PortalException,
                                 SystemException
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.

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
facebookId - the user's facebook ID
openId - the user's OpenID
locale - the user's locale
firstName - the user's first name
middleName - the user's middle name
lastName - the user's last name
prefixId - the user's name prefix ID
suffixId - 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 user's service context (optionally null). Can set expando bridge attributes for the user.
Returns:
the user
Throws:
PortalException - if the user's information was invalid
SystemException - if a system exception occurred

updateJobTitle

public User updateJobTitle(long userId,
                           String jobTitle)
                    throws PortalException,
                           SystemException
Updates the user's job title.

Parameters:
userId - the primary key of the user
jobTitle - the user's job title
Returns:
the user
Throws:
PortalException - if a user with the primary key could not be found or if a contact could not be found matching the user's contact ID
SystemException - if a system exception occurred

updateLastLogin

public User updateLastLogin(long userId,
                            String loginIP)
                     throws PortalException,
                            SystemException
Updates the user's last login with the current time and the IP address.

Parameters:
userId - the primary key of the user
loginIP - the IP address the user logged in from
Returns:
the user
Throws:
PortalException - if a user with the primary key could not be found
SystemException - if a system exception occurred

updateLockout

public User updateLockout(User user,
                          boolean lockout)
                   throws PortalException,
                          SystemException
Updates whether the user is locked out from logging in.

Parameters:
user - the user
lockout - whether the user is locked out
Returns:
the user
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

updateLockoutByEmailAddress

public User updateLockoutByEmailAddress(long companyId,
                                        String emailAddress,
                                        boolean lockout)
                                 throws PortalException,
                                        SystemException
Updates whether the user is locked out from logging in.

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 - if a user with the email address could not be found
SystemException - if a system exception occurred

updateLockoutById

public User updateLockoutById(long userId,
                              boolean lockout)
                       throws PortalException,
                              SystemException
Updates whether the user is locked out from logging in.

Parameters:
userId - the primary key of the user
lockout - whether the user is locked out
Returns:
the user
Throws:
PortalException - if a user with the primary key could not be found
SystemException - if a system exception occurred

updateLockoutByScreenName

public User updateLockoutByScreenName(long companyId,
                                      String screenName,
                                      boolean lockout)
                               throws PortalException,
                                      SystemException
Updates whether the user is locked out from logging in.

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 - if a user with the screen name could not be found
SystemException - if a system exception occurred

updateModifiedDate

public User updateModifiedDate(long userId,
                               Date modifiedDate)
                        throws PortalException,
                               SystemException
Updates the user's modified date.

Parameters:
userId - the primary key of the user
modifiedDate - the new modified date
Returns:
the user
Throws:
PortalException - if a user with the primary key could not be found
SystemException - if a system exception occurred

updateOpenId

public User updateOpenId(long userId,
                         String openId)
                  throws PortalException,
                         SystemException
Updates the user's OpenID.

Parameters:
userId - the primary key of the user
openId - the new OpenID
Returns:
the user
Throws:
PortalException - if a user with the primary key could not be found
SystemException - if a system exception occurred

updateOrganizations

public void updateOrganizations(long userId,
                                long[] newOrganizationIds,
                                ServiceContext serviceContext)
                         throws PortalException,
                                SystemException
Sets the organizations that the user is in, removing and adding organizations as necessary.

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 - if a user with the primary key could not be found
SystemException - if a system exception occurred

updatePassword

public User updatePassword(long userId,
                           String password1,
                           String password2,
                           boolean passwordReset)
                    throws PortalException,
                           SystemException
Updates the user's password without tracking or validation of the change.

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 - if a user with the primary key could not be found
SystemException - if a system exception occurred

updatePassword

public User updatePassword(long userId,
                           String password1,
                           String password2,
                           boolean passwordReset,
                           boolean silentUpdate)
                    throws PortalException,
                           SystemException
Updates the user's password, optionally with tracking and validation of the change.

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 - if a user with the primary key could not be found
SystemException - if a system exception occurred

updatePasswordManually

public User updatePasswordManually(long userId,
                                   String password,
                                   boolean passwordEncrypted,
                                   boolean passwordReset,
                                   Date passwordModifiedDate)
                            throws PortalException,
                                   SystemException
Updates the user's password with manually input information. This method should only be used when performing maintenance.

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 - if a user with the primary key could not be found
SystemException - if a system exception occurred

updatePasswordReset

public User updatePasswordReset(long userId,
                                boolean passwordReset)
                         throws PortalException,
                                SystemException
Updates whether the user should be asked to reset their password the next time they login.

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 - if a user with the primary key could not be found
SystemException - if a system exception occurred

updatePortrait

public User updatePortrait(long userId,
                           byte[] bytes)
                    throws PortalException,
                           SystemException
Updates the user's portrait image.

Parameters:
userId - the primary key of the user
bytes - the new portrait image data
Returns:
the user
Throws:
PortalException - if a user with the primary key could not be found or if the new portrait was invalid
SystemException - if a system exception occurred

updateReminderQuery

public User updateReminderQuery(long userId,
                                String question,
                                String answer)
                         throws PortalException,
                                SystemException
Updates the user's password reset question and answer.

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 - if a user with the primary key could not be found or if the new question or answer were invalid
SystemException - if a system exception occurred

updateScreenName

public User updateScreenName(long userId,
                             String screenName)
                      throws PortalException,
                             SystemException
Updates the user's screen name.

Parameters:
userId - the primary key of the user
screenName - the user's new screen name
Returns:
the user
Throws:
PortalException - if a user with the primary key could not be found or if the new screen name was invalid
SystemException - if a system exception occurred

updateStatus

public User updateStatus(long userId,
                         int status)
                  throws PortalException,
                         SystemException
Updates the user's workflow status.

Parameters:
userId - the primary key of the user
status - the user's new workflow status
Returns:
the user
Throws:
PortalException - if a user with the primary key could not be found
SystemException - if a system exception occurred

updateUser

public User updateUser(long userId,
                       String oldPassword,
                       String newPassword1,
                       String newPassword2,
                       boolean passwordReset,
                       String reminderQueryQuestion,
                       String reminderQueryAnswer,
                       String screenName,
                       String emailAddress,
                       long facebookId,
                       String openId,
                       String languageId,
                       String timeZoneId,
                       String greeting,
                       String comments,
                       String firstName,
                       String middleName,
                       String lastName,
                       int prefixId,
                       int suffixId,
                       boolean male,
                       int birthdayMonth,
                       int birthdayDay,
                       int birthdayYear,
                       String smsSn,
                       String aimSn,
                       String facebookSn,
                       String icqSn,
                       String jabberSn,
                       String msnSn,
                       String mySpaceSn,
                       String skypeSn,
                       String twitterSn,
                       String ymSn,
                       String jobTitle,
                       long[] groupIds,
                       long[] organizationIds,
                       long[] roleIds,
                       List<UserGroupRole> userGroupRoles,
                       long[] userGroupIds,
                       ServiceContext serviceContext)
                throws PortalException,
                       SystemException
Updates the user.

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
facebookId - the user's new Facebook ID
openId - the user's new OpenID
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
prefixId - the user's new name prefix ID
suffixId - 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
aimSn - the user's new AIM screen name
facebookSn - the user's new Facebook screen name
icqSn - the user's new ICQ screen name
jabberSn - the user's new Jabber screen name
msnSn - the user's new MSN screen name
mySpaceSn - the user's new MySpace screen name
skypeSn - the user's new Skype screen name
twitterSn - the user's new Twitter screen name
ymSn - the user's new Yahoo! Messenger 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 user's service context (optionally null). Can set the universally unique identifier (with the uuid attribute), asset category IDs, asset tag names, and expando bridge attributes for the user.
Returns:
the user
Throws:
PortalException - if a user with the primary key could not be found or if the new information was invalid
SystemException - if a system exception occurred

verifyEmailAddress

public void verifyEmailAddress(String ticketKey)
                        throws PortalException,
                               SystemException
Verifies the email address of the ticket.

Parameters:
ticketKey - the ticket key
Throws:
PortalException - if a ticket matching the ticket key could not be found, if the ticket has expired, if the ticket is an email address ticket, or if the email address is invalid
SystemException - if a system exception occurred

authenticate

protected int authenticate(long companyId,
                           String login,
                           String password,
                           String authType,
                           Map<String,String[]> headerMap,
                           Map<String,String[]> parameterMap,
                           Map<String,Object> resultsMap)
                    throws PortalException,
                           SystemException
Attempts to authenticate the user by their login and password, while using the AuthPipeline.

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

Parameters:
companyId - the primary key of the user's company
login - either the user's email address, screen name, or primary key depending on the value of authType
password - the user's password
authType - the type of authentication to perform
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 succesful 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 - if login or password was null
SystemException - if a system exception occurred
See Also:
AuthPipeline

getBirthday

protected Date getBirthday(int birthdayMonth,
                           int birthdayDay,
                           int birthdayYear)
                    throws PortalException
Throws:
PortalException

getScreenName

protected String getScreenName(String screenName)

getUserIds

protected long[] getUserIds(List<User> users)

reindex

protected void reindex(User user)

search

protected Hits search(long companyId,
                      String firstName,
                      String middleName,
                      String lastName,
                      String fullName,
                      String screenName,
                      String emailAddress,
                      String street,
                      String city,
                      String zip,
                      String region,
                      String country,
                      int status,
                      LinkedHashMap<String,Object> params,
                      boolean andSearch,
                      int start,
                      int end,
                      Sort sort)
               throws SystemException
Throws:
SystemException

sendEmail

protected void sendEmail(User user,
                         String password,
                         ServiceContext serviceContext)
                  throws SystemException
Throws:
SystemException

setEmailAddress

protected void setEmailAddress(User user,
                               String password,
                               String firstName,
                               String middleName,
                               String lastName,
                               String emailAddress)
                        throws PortalException,
                               SystemException
Throws:
PortalException
SystemException

startWorkflowInstance

protected void startWorkflowInstance(long companyId,
                                     long workflowUserId,
                                     long userId,
                                     User user,
                                     ServiceContext workflowServiceContext)

updateGroups

protected void updateGroups(long userId,
                            long[] newGroupIds,
                            ServiceContext serviceContext,
                            boolean indexingEnabled)
                     throws PortalException,
                            SystemException
Throws:
PortalException
SystemException

updateOrganizations

protected void updateOrganizations(long userId,
                                   long[] newOrganizationIds,
                                   boolean indexingEnabled)
                            throws PortalException,
                                   SystemException
Throws:
PortalException
SystemException

updateUserGroupRoles

protected void updateUserGroupRoles(User user,
                                    long[] groupIds,
                                    long[] organizationIds,
                                    List<UserGroupRole> userGroupRoles)
                             throws PortalException,
                                    SystemException
Throws:
PortalException
SystemException

validate

protected void validate(long companyId,
                        long userId,
                        boolean autoPassword,
                        String password1,
                        String password2,
                        boolean autoScreenName,
                        String screenName,
                        String emailAddress,
                        String openId,
                        String firstName,
                        String middleName,
                        String lastName,
                        long[] organizationIds)
                 throws PortalException,
                        SystemException
Throws:
PortalException
SystemException

validate

protected void validate(long userId,
                        String screenName,
                        String emailAddress,
                        String openId,
                        String firstName,
                        String middleName,
                        String lastName,
                        String smsSn)
                 throws PortalException,
                        SystemException
Throws:
PortalException
SystemException

validateCompanyMaxUsers

protected void validateCompanyMaxUsers(long companyId)
                                throws PortalException,
                                       SystemException
Throws:
PortalException
SystemException

validateEmailAddress

protected void validateEmailAddress(long companyId,
                                    String emailAddress)
                             throws PortalException,
                                    SystemException
Throws:
PortalException
SystemException

validateEmailAddress

protected void validateEmailAddress(User user,
                                    String emailAddress1,
                                    String emailAddress2)
                             throws PortalException,
                                    SystemException
Throws:
PortalException
SystemException

validateFullName

protected void validateFullName(long companyId,
                                String firstName,
                                String middleName,
                                String lastName)
                         throws PortalException,
                                SystemException
Throws:
PortalException
SystemException

validateOpenId

protected void validateOpenId(long companyId,
                              long userId,
                              String openId)
                       throws PortalException,
                              SystemException
Throws:
PortalException
SystemException

validatePassword

protected void validatePassword(long companyId,
                                long userId,
                                String password1,
                                String password2)
                         throws PortalException,
                                SystemException
Throws:
PortalException
SystemException

validateReminderQuery

protected void validateReminderQuery(String question,
                                     String answer)
                              throws PortalException
Throws:
PortalException

validateScreenName

protected void validateScreenName(long companyId,
                                  long userId,
                                  String screenName)
                           throws PortalException,
                                  SystemException
Throws:
PortalException
SystemException

Liferay 6.1.2-ce-ga3