001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.MethodCache;
019    import com.liferay.portal.kernel.util.ReferenceRegistry;
020    
021    /**
022     * The utility for the user local service. This utility wraps {@link com.liferay.portal.service.impl.UserLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
023     *
024     * <p>
025     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see UserLocalService
030     * @see com.liferay.portal.service.base.UserLocalServiceBaseImpl
031     * @see com.liferay.portal.service.impl.UserLocalServiceImpl
032     * @generated
033     */
034    public class UserLocalServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.UserLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040    
041            /**
042            * Adds the user to the database. Also notifies the appropriate model listeners.
043            *
044            * @param user the user
045            * @return the user that was added
046            * @throws SystemException if a system exception occurred
047            */
048            public static com.liferay.portal.model.User addUser(
049                    com.liferay.portal.model.User user)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    return getService().addUser(user);
052            }
053    
054            /**
055            * Creates a new user with the primary key. Does not add the user to the database.
056            *
057            * @param userId the primary key for the new user
058            * @return the new user
059            */
060            public static com.liferay.portal.model.User createUser(long userId) {
061                    return getService().createUser(userId);
062            }
063    
064            /**
065            * Deletes the user with the primary key from the database. Also notifies the appropriate model listeners.
066            *
067            * @param userId the primary key of the user
068            * @throws PortalException if a user with the primary key could not be found
069            * @throws SystemException if a system exception occurred
070            */
071            public static void deleteUser(long userId)
072                    throws com.liferay.portal.kernel.exception.PortalException,
073                            com.liferay.portal.kernel.exception.SystemException {
074                    getService().deleteUser(userId);
075            }
076    
077            /**
078            * Deletes the user from the database. Also notifies the appropriate model listeners.
079            *
080            * @param user the user
081            * @throws PortalException
082            * @throws SystemException if a system exception occurred
083            */
084            public static void deleteUser(com.liferay.portal.model.User user)
085                    throws com.liferay.portal.kernel.exception.PortalException,
086                            com.liferay.portal.kernel.exception.SystemException {
087                    getService().deleteUser(user);
088            }
089    
090            /**
091            * Performs a dynamic query on the database and returns the matching rows.
092            *
093            * @param dynamicQuery the dynamic query
094            * @return the matching rows
095            * @throws SystemException if a system exception occurred
096            */
097            @SuppressWarnings("rawtypes")
098            public static java.util.List dynamicQuery(
099                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
100                    throws com.liferay.portal.kernel.exception.SystemException {
101                    return getService().dynamicQuery(dynamicQuery);
102            }
103    
104            /**
105            * Performs a dynamic query on the database and returns a range of the matching rows.
106            *
107            * <p>
108            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
109            * </p>
110            *
111            * @param dynamicQuery the dynamic query
112            * @param start the lower bound of the range of model instances
113            * @param end the upper bound of the range of model instances (not inclusive)
114            * @return the range of matching rows
115            * @throws SystemException if a system exception occurred
116            */
117            @SuppressWarnings("rawtypes")
118            public static java.util.List dynamicQuery(
119                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
120                    int end) throws com.liferay.portal.kernel.exception.SystemException {
121                    return getService().dynamicQuery(dynamicQuery, start, end);
122            }
123    
124            /**
125            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
126            *
127            * <p>
128            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
129            * </p>
130            *
131            * @param dynamicQuery the dynamic query
132            * @param start the lower bound of the range of model instances
133            * @param end the upper bound of the range of model instances (not inclusive)
134            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
135            * @return the ordered range of matching rows
136            * @throws SystemException if a system exception occurred
137            */
138            @SuppressWarnings("rawtypes")
139            public static java.util.List dynamicQuery(
140                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
141                    int end,
142                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
143                    throws com.liferay.portal.kernel.exception.SystemException {
144                    return getService()
145                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
146            }
147    
148            /**
149            * Returns the number of rows that match the dynamic query.
150            *
151            * @param dynamicQuery the dynamic query
152            * @return the number of rows that match the dynamic query
153            * @throws SystemException if a system exception occurred
154            */
155            public static long dynamicQueryCount(
156                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
157                    throws com.liferay.portal.kernel.exception.SystemException {
158                    return getService().dynamicQueryCount(dynamicQuery);
159            }
160    
161            public static com.liferay.portal.model.User fetchUser(long userId)
162                    throws com.liferay.portal.kernel.exception.SystemException {
163                    return getService().fetchUser(userId);
164            }
165    
166            /**
167            * Returns the user with the primary key.
168            *
169            * @param userId the primary key of the user
170            * @return the user
171            * @throws PortalException if a user with the primary key could not be found
172            * @throws SystemException if a system exception occurred
173            */
174            public static com.liferay.portal.model.User getUser(long userId)
175                    throws com.liferay.portal.kernel.exception.PortalException,
176                            com.liferay.portal.kernel.exception.SystemException {
177                    return getService().getUser(userId);
178            }
179    
180            public static com.liferay.portal.model.PersistedModel getPersistedModel(
181                    java.io.Serializable primaryKeyObj)
182                    throws com.liferay.portal.kernel.exception.PortalException,
183                            com.liferay.portal.kernel.exception.SystemException {
184                    return getService().getPersistedModel(primaryKeyObj);
185            }
186    
187            /**
188            * Returns a range of all the users.
189            *
190            * <p>
191            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
192            * </p>
193            *
194            * @param start the lower bound of the range of users
195            * @param end the upper bound of the range of users (not inclusive)
196            * @return the range of users
197            * @throws SystemException if a system exception occurred
198            */
199            public static java.util.List<com.liferay.portal.model.User> getUsers(
200                    int start, int end)
201                    throws com.liferay.portal.kernel.exception.SystemException {
202                    return getService().getUsers(start, end);
203            }
204    
205            /**
206            * Returns the number of users.
207            *
208            * @return the number of users
209            * @throws SystemException if a system exception occurred
210            */
211            public static int getUsersCount()
212                    throws com.liferay.portal.kernel.exception.SystemException {
213                    return getService().getUsersCount();
214            }
215    
216            /**
217            * Updates the user in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
218            *
219            * @param user the user
220            * @return the user that was updated
221            * @throws SystemException if a system exception occurred
222            */
223            public static com.liferay.portal.model.User updateUser(
224                    com.liferay.portal.model.User user)
225                    throws com.liferay.portal.kernel.exception.SystemException {
226                    return getService().updateUser(user);
227            }
228    
229            /**
230            * Updates the user in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
231            *
232            * @param user the user
233            * @param merge whether to merge the user with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
234            * @return the user that was updated
235            * @throws SystemException if a system exception occurred
236            */
237            public static com.liferay.portal.model.User updateUser(
238                    com.liferay.portal.model.User user, boolean merge)
239                    throws com.liferay.portal.kernel.exception.SystemException {
240                    return getService().updateUser(user, merge);
241            }
242    
243            /**
244            * Returns the Spring bean ID for this bean.
245            *
246            * @return the Spring bean ID for this bean
247            */
248            public static java.lang.String getBeanIdentifier() {
249                    return getService().getBeanIdentifier();
250            }
251    
252            /**
253            * Sets the Spring bean ID for this bean.
254            *
255            * @param beanIdentifier the Spring bean ID for this bean
256            */
257            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
258                    getService().setBeanIdentifier(beanIdentifier);
259            }
260    
261            /**
262            * Adds the user to the default groups, unless the user is already in these
263            * groups. The default groups can be specified in
264            * <code>portal.properties</code> with the key
265            * <code>admin.default.group.names</code>.
266            *
267            * @param userId the primary key of the user
268            * @throws PortalException if a user with the primary key could not be
269            found
270            * @throws SystemException if a system exception occurred
271            */
272            public static void addDefaultGroups(long userId)
273                    throws com.liferay.portal.kernel.exception.PortalException,
274                            com.liferay.portal.kernel.exception.SystemException {
275                    getService().addDefaultGroups(userId);
276            }
277    
278            /**
279            * Adds the user to the default roles, unless the user already has these
280            * roles. The default roles can be specified in
281            * <code>portal.properties</code> with the key
282            * <code>admin.default.role.names</code>.
283            *
284            * @param userId the primary key of the user
285            * @throws PortalException if a user with the primary key could not be
286            found
287            * @throws SystemException if a system exception occurred
288            */
289            public static void addDefaultRoles(long userId)
290                    throws com.liferay.portal.kernel.exception.PortalException,
291                            com.liferay.portal.kernel.exception.SystemException {
292                    getService().addDefaultRoles(userId);
293            }
294    
295            /**
296            * Adds the user to the default user groups, unless the user is already in
297            * these user groups. The default user groups can be specified in
298            * <code>portal.properties</code> with the property
299            * <code>admin.default.user.group.names</code>.
300            *
301            * @param userId the primary key of the user
302            * @throws PortalException if a user with the primary key could not be
303            found
304            * @throws SystemException if a system exception occurred
305            */
306            public static void addDefaultUserGroups(long userId)
307                    throws com.liferay.portal.kernel.exception.PortalException,
308                            com.liferay.portal.kernel.exception.SystemException {
309                    getService().addDefaultUserGroups(userId);
310            }
311    
312            /**
313            * Adds the users to the group.
314            *
315            * @param groupId the primary key of the group
316            * @param userIds the primary keys of the users
317            * @throws PortalException if a group or user with the primary key could
318            not be found
319            * @throws SystemException if a system exception occurred
320            */
321            public static void addGroupUsers(long groupId, long[] userIds)
322                    throws com.liferay.portal.kernel.exception.PortalException,
323                            com.liferay.portal.kernel.exception.SystemException {
324                    getService().addGroupUsers(groupId, userIds);
325            }
326    
327            /**
328            * Adds the users to the organization.
329            *
330            * @param organizationId the primary key of the organization
331            * @param userIds the primary keys of the users
332            * @throws PortalException if an organization or user with the primary key
333            could not be found
334            * @throws SystemException if a system exception occurred
335            */
336            public static void addOrganizationUsers(long organizationId, long[] userIds)
337                    throws com.liferay.portal.kernel.exception.PortalException,
338                            com.liferay.portal.kernel.exception.SystemException {
339                    getService().addOrganizationUsers(organizationId, userIds);
340            }
341    
342            /**
343            * Assigns the password policy to the users, removing any other currently
344            * assigned password policies.
345            *
346            * @param passwordPolicyId the primary key of the password policy
347            * @param userIds the primary keys of the users
348            * @throws SystemException if a system exception occurred
349            */
350            public static void addPasswordPolicyUsers(long passwordPolicyId,
351                    long[] userIds)
352                    throws com.liferay.portal.kernel.exception.SystemException {
353                    getService().addPasswordPolicyUsers(passwordPolicyId, userIds);
354            }
355    
356            /**
357            * Adds the users to the role.
358            *
359            * @param roleId the primary key of the role
360            * @param userIds the primary keys of the users
361            * @throws PortalException if a role or user with the primary key could not
362            be found
363            * @throws SystemException if a system exception occurred
364            */
365            public static void addRoleUsers(long roleId, long[] userIds)
366                    throws com.liferay.portal.kernel.exception.PortalException,
367                            com.liferay.portal.kernel.exception.SystemException {
368                    getService().addRoleUsers(roleId, userIds);
369            }
370    
371            /**
372            * Adds the users to the team.
373            *
374            * @param teamId the primary key of the team
375            * @param userIds the primary keys of the users
376            * @throws PortalException if a team or user with the primary key could not
377            be found
378            * @throws SystemException if a system exception occurred
379            */
380            public static void addTeamUsers(long teamId, long[] userIds)
381                    throws com.liferay.portal.kernel.exception.PortalException,
382                            com.liferay.portal.kernel.exception.SystemException {
383                    getService().addTeamUsers(teamId, userIds);
384            }
385    
386            /**
387            * Adds a user.
388            *
389            * <p>
390            * This method handles the creation and bookkeeping of the user including
391            * its resources, metadata, and internal data structures. It is not
392            * necessary to make subsequent calls to any methods to setup default
393            * groups, resources, etc.
394            * </p>
395            *
396            * @param creatorUserId the primary key of the creator
397            * @param companyId the primary key of the user's company
398            * @param autoPassword whether a password should be automatically
399            generated for the user
400            * @param password1 the user's password
401            * @param password2 the user's password confirmation
402            * @param autoScreenName whether a screen name should be automatically
403            generated for the user
404            * @param screenName the user's screen name
405            * @param emailAddress the user's email address
406            * @param facebookId the user's facebook ID
407            * @param openId the user's OpenID
408            * @param locale the user's locale
409            * @param firstName the user's first name
410            * @param middleName the user's middle name
411            * @param lastName the user's last name
412            * @param prefixId the user's name prefix ID
413            * @param suffixId the user's name suffix ID
414            * @param male whether the user is male
415            * @param birthdayMonth the user's birthday month (0-based, meaning 0 for
416            January)
417            * @param birthdayDay the user's birthday day
418            * @param birthdayYear the user's birthday year
419            * @param jobTitle the user's job title
420            * @param groupIds the primary keys of the user's groups
421            * @param organizationIds the primary keys of the user's organizations
422            * @param roleIds the primary keys of the roles this user possesses
423            * @param userGroupIds the primary keys of the user's user groups
424            * @param sendEmail whether to send the user an email notification about
425            their new account
426            * @param serviceContext the user's service context (optionally
427            <code>null</code>). Can specify the user's universally unique
428            identifier (with the <code>uuid</code> attribute), asset
429            category IDs, asset tag names, and expando bridge attributes.
430            * @return the new user
431            * @throws PortalException if the user's information was invalid
432            * @throws SystemException if a system exception occurred
433            */
434            public static com.liferay.portal.model.User addUser(long creatorUserId,
435                    long companyId, boolean autoPassword, java.lang.String password1,
436                    java.lang.String password2, boolean autoScreenName,
437                    java.lang.String screenName, java.lang.String emailAddress,
438                    long facebookId, java.lang.String openId, java.util.Locale locale,
439                    java.lang.String firstName, java.lang.String middleName,
440                    java.lang.String lastName, int prefixId, int suffixId, boolean male,
441                    int birthdayMonth, int birthdayDay, int birthdayYear,
442                    java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
443                    long[] roleIds, long[] userGroupIds, boolean sendEmail,
444                    com.liferay.portal.service.ServiceContext serviceContext)
445                    throws com.liferay.portal.kernel.exception.PortalException,
446                            com.liferay.portal.kernel.exception.SystemException {
447                    return getService()
448                                       .addUser(creatorUserId, companyId, autoPassword, password1,
449                            password2, autoScreenName, screenName, emailAddress, facebookId,
450                            openId, locale, firstName, middleName, lastName, prefixId,
451                            suffixId, male, birthdayMonth, birthdayDay, birthdayYear, jobTitle,
452                            groupIds, organizationIds, roleIds, userGroupIds, sendEmail,
453                            serviceContext);
454            }
455    
456            /**
457            * Adds the users to the user group.
458            *
459            * @param userGroupId the primary key of the user group
460            * @param userIds the primary keys of the users
461            * @throws PortalException if a user group or user with the primary could
462            could not be found
463            * @throws SystemException if a system exception occurred
464            */
465            public static void addUserGroupUsers(long userGroupId, long[] userIds)
466                    throws com.liferay.portal.kernel.exception.PortalException,
467                            com.liferay.portal.kernel.exception.SystemException {
468                    getService().addUserGroupUsers(userGroupId, userIds);
469            }
470    
471            /**
472            * Adds a user with workflow.
473            *
474            * <p>
475            * This method handles the creation and bookkeeping of the user including
476            * its resources, metadata, and internal data structures. It is not
477            * necessary to make subsequent calls to any methods to setup default
478            * groups, resources, etc.
479            * </p>
480            *
481            * @param creatorUserId the primary key of the creator
482            * @param companyId the primary key of the user's company
483            * @param autoPassword whether a password should be automatically
484            generated for the user
485            * @param password1 the user's password
486            * @param password2 the user's password confirmation
487            * @param autoScreenName whether a screen name should be automatically
488            generated for the user
489            * @param screenName the user's screen name
490            * @param emailAddress the user's email address
491            * @param facebookId the user's facebook ID
492            * @param openId the user's OpenID
493            * @param locale the user's locale
494            * @param firstName the user's first name
495            * @param middleName the user's middle name
496            * @param lastName the user's last name
497            * @param prefixId the user's name prefix ID
498            * @param suffixId the user's name suffix ID
499            * @param male whether the user is male
500            * @param birthdayMonth the user's birthday month (0-based, meaning 0 for
501            January)
502            * @param birthdayDay the user's birthday day
503            * @param birthdayYear the user's birthday year
504            * @param jobTitle the user's job title
505            * @param groupIds the primary keys of the user's groups
506            * @param organizationIds the primary keys of the user's organizations
507            * @param roleIds the primary keys of the roles this user possesses
508            * @param userGroupIds the primary keys of the user's user groups
509            * @param sendEmail whether to send the user an email notification about
510            their new account
511            * @param serviceContext the user's service context (optionally
512            <code>null</code>). Can specify the user's universally unique
513            identifier (with the <code>uuid</code> attribute), asset
514            category IDs, asset tag names, and expando bridge attributes.
515            * @return the new user
516            * @throws PortalException if the user's information was invalid
517            * @throws SystemException if a system exception occurred
518            */
519            public static com.liferay.portal.model.User addUserWithWorkflow(
520                    long creatorUserId, long companyId, boolean autoPassword,
521                    java.lang.String password1, java.lang.String password2,
522                    boolean autoScreenName, java.lang.String screenName,
523                    java.lang.String emailAddress, long facebookId,
524                    java.lang.String openId, java.util.Locale locale,
525                    java.lang.String firstName, java.lang.String middleName,
526                    java.lang.String lastName, int prefixId, int suffixId, boolean male,
527                    int birthdayMonth, int birthdayDay, int birthdayYear,
528                    java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
529                    long[] roleIds, long[] userGroupIds, boolean sendEmail,
530                    com.liferay.portal.service.ServiceContext serviceContext)
531                    throws com.liferay.portal.kernel.exception.PortalException,
532                            com.liferay.portal.kernel.exception.SystemException {
533                    return getService()
534                                       .addUserWithWorkflow(creatorUserId, companyId, autoPassword,
535                            password1, password2, autoScreenName, screenName, emailAddress,
536                            facebookId, openId, locale, firstName, middleName, lastName,
537                            prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear,
538                            jobTitle, groupIds, organizationIds, roleIds, userGroupIds,
539                            sendEmail, serviceContext);
540            }
541    
542            /**
543            * Attempts to authenticate the user by their email address and password,
544            * while using the AuthPipeline.
545            *
546            * @param companyId the primary key of the user's company
547            * @param emailAddress the user's email address
548            * @param password the user's password
549            * @param headerMap the header map from the authentication request
550            * @param parameterMap the parameter map from the authentication request
551            * @param resultsMap the map of authentication results (may be nil). After
552            a succesful authentication the user's primary key will be placed
553            under the key <code>userId</code>.
554            * @return the authentication status. This can be {@link
555            com.liferay.portal.security.auth.Authenticator#FAILURE}
556            indicating that the user's credentials are invalid, {@link
557            com.liferay.portal.security.auth.Authenticator#SUCCESS}
558            indicating a successful login, or {@link
559            com.liferay.portal.security.auth.Authenticator#DNE} indicating
560            that a user with that login does not exist.
561            * @throws PortalException if <code>emailAddress</code> or
562            <code>password</code> was <code>null</code>
563            * @throws SystemException if a system exception occurred
564            * @see com.liferay.portal.security.auth.AuthPipeline
565            */
566            public static int authenticateByEmailAddress(long companyId,
567                    java.lang.String emailAddress, java.lang.String password,
568                    java.util.Map<java.lang.String, java.lang.String[]> headerMap,
569                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
570                    java.util.Map<java.lang.String, java.lang.Object> resultsMap)
571                    throws com.liferay.portal.kernel.exception.PortalException,
572                            com.liferay.portal.kernel.exception.SystemException {
573                    return getService()
574                                       .authenticateByEmailAddress(companyId, emailAddress,
575                            password, headerMap, parameterMap, resultsMap);
576            }
577    
578            /**
579            * Attempts to authenticate the user by their screen name and password,
580            * while using the AuthPipeline.
581            *
582            * @param companyId the primary key of the user's company
583            * @param screenName the user's screen name
584            * @param password the user's password
585            * @param headerMap the header map from the authentication request
586            * @param parameterMap the parameter map from the authentication request
587            * @param resultsMap the map of authentication results (may be nil). After
588            a succesful authentication the user's primary key will be placed
589            under the key <code>userId</code>.
590            * @return the authentication status. This can be {@link
591            com.liferay.portal.security.auth.Authenticator#FAILURE}
592            indicating that the user's credentials are invalid, {@link
593            com.liferay.portal.security.auth.Authenticator#SUCCESS}
594            indicating a successful login, or {@link
595            com.liferay.portal.security.auth.Authenticator#DNE} indicating
596            that a user with that login does not exist.
597            * @throws PortalException if <code>screenName</code> or
598            <code>password</code> was <code>null</code>
599            * @throws SystemException if a system exception occurred
600            * @see com.liferay.portal.security.auth.AuthPipeline
601            */
602            public static int authenticateByScreenName(long companyId,
603                    java.lang.String screenName, java.lang.String password,
604                    java.util.Map<java.lang.String, java.lang.String[]> headerMap,
605                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
606                    java.util.Map<java.lang.String, java.lang.Object> resultsMap)
607                    throws com.liferay.portal.kernel.exception.PortalException,
608                            com.liferay.portal.kernel.exception.SystemException {
609                    return getService()
610                                       .authenticateByScreenName(companyId, screenName, password,
611                            headerMap, parameterMap, resultsMap);
612            }
613    
614            /**
615            * Attempts to authenticate the user by their primary key and password,
616            * while using the AuthPipeline.
617            *
618            * @param companyId the primary key of the user's company
619            * @param userId the user's primary key
620            * @param password the user's password
621            * @param headerMap the header map from the authentication request
622            * @param parameterMap the parameter map from the authentication request
623            * @param resultsMap the map of authentication results (may be nil). After
624            a succesful authentication the user's primary key will be placed
625            under the key <code>userId</code>.
626            * @return the authentication status. This can be {@link
627            com.liferay.portal.security.auth.Authenticator#FAILURE}
628            indicating that the user's credentials are invalid, {@link
629            com.liferay.portal.security.auth.Authenticator#SUCCESS}
630            indicating a successful login, or {@link
631            com.liferay.portal.security.auth.Authenticator#DNE} indicating
632            that a user with that login does not exist.
633            * @throws PortalException if <code>userId</code> or <code>password</code>
634            was <code>null</code>
635            * @throws SystemException if a system exception occurred
636            * @see com.liferay.portal.security.auth.AuthPipeline
637            */
638            public static int authenticateByUserId(long companyId, long userId,
639                    java.lang.String password,
640                    java.util.Map<java.lang.String, java.lang.String[]> headerMap,
641                    java.util.Map<java.lang.String, java.lang.String[]> parameterMap,
642                    java.util.Map<java.lang.String, java.lang.Object> resultsMap)
643                    throws com.liferay.portal.kernel.exception.PortalException,
644                            com.liferay.portal.kernel.exception.SystemException {
645                    return getService()
646                                       .authenticateByUserId(companyId, userId, password,
647                            headerMap, parameterMap, resultsMap);
648            }
649    
650            /**
651            * Attempts to authenticate the user using HTTP basic access
652            * authentication, without using the AuthPipeline. Primarily used for
653            * authenticating users of <code>tunnel-web</code>.
654            *
655            * <p>
656            * Authentication type specifies what <code>login</code> contains.The valid
657            * values are:
658            * </p>
659            *
660            * <ul>
661            * <li>
662            * <code>CompanyConstants.AUTH_TYPE_EA</code> - <code>login</code> is the
663            * user's email address
664            * </li>
665            * <li>
666            * <code>CompanyConstants.AUTH_TYPE_SN</code> - <code>login</code> is the
667            * user's screen name
668            * </li>
669            * <li>
670            * <code>CompanyConstants.AUTH_TYPE_ID</code> - <code>login</code> is the
671            * user's primary key
672            * </li>
673            * </ul>
674            *
675            * @param companyId the primary key of the user's company
676            * @param authType the type of authentication to perform
677            * @param login either the user's email address, screen name, or primary
678            key depending on the value of <code>authType</code>
679            * @param password the user's password
680            * @return the authentication status. This can be {@link
681            com.liferay.portal.security.auth.Authenticator#FAILURE}
682            indicating that the user's credentials are invalid, {@link
683            com.liferay.portal.security.auth.Authenticator#SUCCESS}
684            indicating a successful login, or {@link
685            com.liferay.portal.security.auth.Authenticator#DNE} indicating
686            that a user with that login does not exist.
687            * @throws PortalException if a portal exception occurred
688            * @throws SystemException if a system exception occurred
689            */
690            public static long authenticateForBasic(long companyId,
691                    java.lang.String authType, java.lang.String login,
692                    java.lang.String password)
693                    throws com.liferay.portal.kernel.exception.PortalException,
694                            com.liferay.portal.kernel.exception.SystemException {
695                    return getService()
696                                       .authenticateForBasic(companyId, authType, login, password);
697            }
698    
699            /**
700            * Attempts to authenticate the user using HTTP digest access
701            * authentication, without using the AuthPipeline. Primarily used for
702            * authenticating users of <code>tunnel-web</code>.
703            *
704            * @param companyId the primary key of the user's company
705            * @param username either the user's email address, screen name, or
706            primary key
707            * @param realm unused
708            * @param nonce the number used once
709            * @param method the request method
710            * @param uri the request URI
711            * @param response the authentication response hash
712            * @return the user's primary key if authentication is succesful;
713            <code>0</code> otherwise
714            * @throws PortalException if a portal exception occurred
715            * @throws SystemException if a system exception occurred
716            */
717            public static long authenticateForDigest(long companyId,
718                    java.lang.String username, java.lang.String realm,
719                    java.lang.String nonce, java.lang.String method, java.lang.String uri,
720                    java.lang.String response)
721                    throws com.liferay.portal.kernel.exception.PortalException,
722                            com.liferay.portal.kernel.exception.SystemException {
723                    return getService()
724                                       .authenticateForDigest(companyId, username, realm, nonce,
725                            method, uri, response);
726            }
727    
728            /**
729            * Attempts to authenticate the user using JAAS credentials, without using
730            * the AuthPipeline.
731            *
732            * @param userId the primary key of the user
733            * @param encPassword the encrypted password
734            * @return <code>true</code> if authentication is successful;
735            <code>false</code> otherwise
736            */
737            public static boolean authenticateForJAAS(long userId,
738                    java.lang.String encPassword) {
739                    return getService().authenticateForJAAS(userId, encPassword);
740            }
741    
742            /**
743            * Checks if the user is currently locked out based on the password policy,
744            * and performs maintenance on the user's lockout and failed login data.
745            *
746            * @param user the user
747            * @throws PortalException if the user was determined to still be locked
748            out
749            * @throws SystemException if a system exception occurred
750            */
751            public static void checkLockout(com.liferay.portal.model.User user)
752                    throws com.liferay.portal.kernel.exception.PortalException,
753                            com.liferay.portal.kernel.exception.SystemException {
754                    getService().checkLockout(user);
755            }
756    
757            /**
758            * Adds a failed login attempt to the user and updates the user's last
759            * failed login date.
760            *
761            * @param user the user
762            * @throws SystemException if a system exception occurred
763            */
764            public static void checkLoginFailure(com.liferay.portal.model.User user)
765                    throws com.liferay.portal.kernel.exception.SystemException {
766                    getService().checkLoginFailure(user);
767            }
768    
769            /**
770            * Adds a failed login attempt to the user with the email address and
771            * updates the user's last failed login date.
772            *
773            * @param companyId the primary key of the user's company
774            * @param emailAddress the user's email address
775            * @throws PortalException if a user with the email address could not be
776            found
777            * @throws SystemException if a system exception occurred
778            */
779            public static void checkLoginFailureByEmailAddress(long companyId,
780                    java.lang.String emailAddress)
781                    throws com.liferay.portal.kernel.exception.PortalException,
782                            com.liferay.portal.kernel.exception.SystemException {
783                    getService().checkLoginFailureByEmailAddress(companyId, emailAddress);
784            }
785    
786            /**
787            * Adds a failed login attempt to the user and updates the user's last
788            * failed login date.
789            *
790            * @param userId the primary key of the user
791            * @throws PortalException if a user with the primary key could not be
792            found
793            * @throws SystemException if a system exception occurred
794            */
795            public static void checkLoginFailureById(long userId)
796                    throws com.liferay.portal.kernel.exception.PortalException,
797                            com.liferay.portal.kernel.exception.SystemException {
798                    getService().checkLoginFailureById(userId);
799            }
800    
801            /**
802            * Adds a failed login attempt to the user with the screen name and updates
803            * the user's last failed login date.
804            *
805            * @param companyId the primary key of the user's company
806            * @param screenName the user's screen name
807            * @throws PortalException if a user with the screen name could not be
808            found
809            * @throws SystemException if a system exception occurred
810            */
811            public static void checkLoginFailureByScreenName(long companyId,
812                    java.lang.String screenName)
813                    throws com.liferay.portal.kernel.exception.PortalException,
814                            com.liferay.portal.kernel.exception.SystemException {
815                    getService().checkLoginFailureByScreenName(companyId, screenName);
816            }
817    
818            /**
819            * Checks if the user's password is expired based on the password policy,
820            * and performs maintenance on the user's grace login and password reset
821            * data.
822            *
823            * @param user the user
824            * @throws PortalException if the user's password has expired and the grace
825            login limit has been exceeded
826            * @throws SystemException if a system exception occurred
827            */
828            public static void checkPasswordExpired(com.liferay.portal.model.User user)
829                    throws com.liferay.portal.kernel.exception.PortalException,
830                            com.liferay.portal.kernel.exception.SystemException {
831                    getService().checkPasswordExpired(user);
832            }
833    
834            /**
835            * Removes all the users from the organization.
836            *
837            * @param organizationId the primary key of the organization
838            * @throws SystemException if a system exception occurred
839            */
840            public static void clearOrganizationUsers(long organizationId)
841                    throws com.liferay.portal.kernel.exception.SystemException {
842                    getService().clearOrganizationUsers(organizationId);
843            }
844    
845            /**
846            * Removes all the users from the user group.
847            *
848            * @param userGroupId the primary key of the user group
849            * @throws SystemException if a system exception occurred
850            */
851            public static void clearUserGroupUsers(long userGroupId)
852                    throws com.liferay.portal.kernel.exception.SystemException {
853                    getService().clearUserGroupUsers(userGroupId);
854            }
855    
856            /**
857            * Completes the user's registration by generating a password and sending
858            * the confirmation email.
859            *
860            * @param user the user
861            * @param serviceContext the user's service context. Can specify whether a
862            password should be generated (with the <code>autoPassword</code>
863            attribute) and whether the confirmation email should be sent
864            (with the <code>sendEmail</code> attribute).
865            * @throws PortalException if a portal exception occurred
866            * @throws SystemException if a system exception occurred
867            */
868            public static void completeUserRegistration(
869                    com.liferay.portal.model.User user,
870                    com.liferay.portal.service.ServiceContext serviceContext)
871                    throws com.liferay.portal.kernel.exception.PortalException,
872                            com.liferay.portal.kernel.exception.SystemException {
873                    getService().completeUserRegistration(user, serviceContext);
874            }
875    
876            /**
877            * Decrypts the user's primary key and password from their encrypted forms.
878            * Used for decrypting a user's credentials from the values stored in an
879            * automatic login cookie.
880            *
881            * @param companyId the primary key of the user's company
882            * @param name the encrypted primary key of the user
883            * @param password the encrypted password of the user
884            * @return the user's primary key and password
885            * @throws PortalException if a user with the primary key could not be
886            found or if the user's password was incorrect
887            * @throws SystemException if a system exception occurred
888            */
889            public static com.liferay.portal.kernel.util.KeyValuePair decryptUserId(
890                    long companyId, java.lang.String name, java.lang.String password)
891                    throws com.liferay.portal.kernel.exception.PortalException,
892                            com.liferay.portal.kernel.exception.SystemException {
893                    return getService().decryptUserId(companyId, name, password);
894            }
895    
896            /**
897            * Deletes the user's portrait image.
898            *
899            * @param userId the primary key of the user
900            * @throws PortalException if a user with the primary key could not be
901            found or if the user's portrait could not be found
902            * @throws SystemException if a system exception occurred
903            */
904            public static void deletePortrait(long userId)
905                    throws com.liferay.portal.kernel.exception.PortalException,
906                            com.liferay.portal.kernel.exception.SystemException {
907                    getService().deletePortrait(userId);
908            }
909    
910            /**
911            * Removes the user from the role.
912            *
913            * @param roleId the primary key of the role
914            * @param userId the primary key of the user
915            * @throws PortalException if a role or user with the primary key could not
916            be found
917            * @throws SystemException if a system exception occurred
918            */
919            public static void deleteRoleUser(long roleId, long userId)
920                    throws com.liferay.portal.kernel.exception.PortalException,
921                            com.liferay.portal.kernel.exception.SystemException {
922                    getService().deleteRoleUser(roleId, userId);
923            }
924    
925            /**
926            * Removes the user from the user group.
927            *
928            * @param userGroupId the primary key of the user group
929            * @param userId the primary key of the user
930            * @throws PortalException if a portal exception occurred
931            * @throws SystemException if a system exception occurred
932            */
933            public static void deleteUserGroupUser(long userGroupId, long userId)
934                    throws com.liferay.portal.kernel.exception.PortalException,
935                            com.liferay.portal.kernel.exception.SystemException {
936                    getService().deleteUserGroupUser(userGroupId, userId);
937            }
938    
939            /**
940            * Encrypts the primary key of the user. Used when encrypting the user's
941            * credentials for storage in an automatic login cookie.
942            *
943            * @param name the primary key of the user
944            * @return the user's encrypted primary key
945            * @throws PortalException if a user with the primary key could not be
946            found
947            * @throws SystemException if a system exception occurred
948            */
949            public static java.lang.String encryptUserId(java.lang.String name)
950                    throws com.liferay.portal.kernel.exception.PortalException,
951                            com.liferay.portal.kernel.exception.SystemException {
952                    return getService().encryptUserId(name);
953            }
954    
955            /**
956            * Returns the user with the screen name.
957            *
958            * @param companyId the primary key of the user's company
959            * @param screenName the user's screen name
960            * @return the user with the screen name, or <code>null</code> if a user
961            with the screen name could not be found
962            * @throws SystemException if a system exception occurred
963            */
964            public static com.liferay.portal.model.User fetchUserByScreenName(
965                    long companyId, java.lang.String screenName)
966                    throws com.liferay.portal.kernel.exception.SystemException {
967                    return getService().fetchUserByScreenName(companyId, screenName);
968            }
969    
970            /**
971            * Returns the user with the primary key.
972            *
973            * @param userId the primary key of the user
974            * @return the user with the primary key, or <code>null</code> if a user
975            with the primary key could not be found
976            * @throws SystemException if a system exception occurred
977            */
978            public static com.liferay.portal.model.User fetchUserById(long userId)
979                    throws com.liferay.portal.kernel.exception.SystemException {
980                    return getService().fetchUserById(userId);
981            }
982    
983            /**
984            * Returns a range of all the users belonging to the company.
985            *
986            * <p>
987            * Useful when paginating results. Returns a maximum of <code>end -
988            * start</code> instances. <code>start</code> and <code>end</code> are not
989            * primary keys, they are indexes in the result set. Thus, <code>0</code>
990            * refers to the first result in the set. Setting both <code>start</code>
991            * and <code>end</code> to {@link
992            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the
993            * full result set.
994            * </p>
995            *
996            * @param companyId the primary key of the company
997            * @param start the lower bound of the range of users
998            * @param end the upper bound of the range of users (not inclusive)
999            * @return the range of users belonging to the company
1000            * @throws SystemException if a system exception occurred
1001            */
1002            public static java.util.List<com.liferay.portal.model.User> getCompanyUsers(
1003                    long companyId, int start, int end)
1004                    throws com.liferay.portal.kernel.exception.SystemException {
1005                    return getService().getCompanyUsers(companyId, start, end);
1006            }
1007    
1008            /**
1009            * Returns the number of users belonging to the company.
1010            *
1011            * @param companyId the primary key of the company
1012            * @return the number of users belonging to the company
1013            * @throws SystemException if a system exception occurred
1014            */
1015            public static int getCompanyUsersCount(long companyId)
1016                    throws com.liferay.portal.kernel.exception.SystemException {
1017                    return getService().getCompanyUsersCount(companyId);
1018            }
1019    
1020            /**
1021            * Returns the default user for the company.
1022            *
1023            * @param companyId the primary key of the company
1024            * @return the default user for the company
1025            * @throws PortalException if a default user for the company could not be
1026            found
1027            * @throws SystemException if a system exception occurred
1028            */
1029            public static com.liferay.portal.model.User getDefaultUser(long companyId)
1030                    throws com.liferay.portal.kernel.exception.PortalException,
1031                            com.liferay.portal.kernel.exception.SystemException {
1032                    return getService().getDefaultUser(companyId);
1033            }
1034    
1035            /**
1036            * Returns the primary key of the default user for the company.
1037            *
1038            * @param companyId the primary key of the company
1039            * @return the primary key of the default user for the company
1040            * @throws PortalException if a default user for the company could not be
1041            found
1042            * @throws SystemException if a system exception occurred
1043            */
1044            public static long getDefaultUserId(long companyId)
1045                    throws com.liferay.portal.kernel.exception.PortalException,
1046                            com.liferay.portal.kernel.exception.SystemException {
1047                    return getService().getDefaultUserId(companyId);
1048            }
1049    
1050            /**
1051            * Returns the primary keys of all the users belonging to the group.
1052            *
1053            * @param groupId the primary key of the group
1054            * @return the primary keys of the users belonging to the group
1055            * @throws SystemException if a system exception occurred
1056            */
1057            public static long[] getGroupUserIds(long groupId)
1058                    throws com.liferay.portal.kernel.exception.SystemException {
1059                    return getService().getGroupUserIds(groupId);
1060            }
1061    
1062            /**
1063            * Returns all the users belonging to the group.
1064            *
1065            * @param groupId the primary key of the group
1066            * @return the users belonging to the group
1067            * @throws SystemException if a system exception occurred
1068            */
1069            public static java.util.List<com.liferay.portal.model.User> getGroupUsers(
1070                    long groupId)
1071                    throws com.liferay.portal.kernel.exception.SystemException {
1072                    return getService().getGroupUsers(groupId);
1073            }
1074    
1075            /**
1076            * Returns the number of users belonging to the group.
1077            *
1078            * @param groupId the primary key of the group
1079            * @return the number of users belonging to the group
1080            * @throws SystemException if a system exception occurred
1081            */
1082            public static int getGroupUsersCount(long groupId)
1083                    throws com.liferay.portal.kernel.exception.SystemException {
1084                    return getService().getGroupUsersCount(groupId);
1085            }
1086    
1087            /**
1088            * Returns the number of users with the status belonging to the group.
1089            *
1090            * @param groupId the primary key of the group
1091            * @param status the workflow status
1092            * @return the number of users with the status belonging to the group
1093            * @throws PortalException if a group with the primary key could not be
1094            found
1095            * @throws SystemException if a system exception occurred
1096            */
1097            public static int getGroupUsersCount(long groupId, int status)
1098                    throws com.liferay.portal.kernel.exception.PortalException,
1099                            com.liferay.portal.kernel.exception.SystemException {
1100                    return getService().getGroupUsersCount(groupId, status);
1101            }
1102    
1103            /**
1104            * Returns all the users who have not had any announcements of the type
1105            * delivered, excluding the default user.
1106            *
1107            * @param type the type of announcement
1108            * @return the users who have not had any annoucements of the type
1109            delivered
1110            * @throws SystemException if a system exception occurred
1111            */
1112            public static java.util.List<com.liferay.portal.model.User> getNoAnnouncementsDeliveries(
1113                    java.lang.String type)
1114                    throws com.liferay.portal.kernel.exception.SystemException {
1115                    return getService().getNoAnnouncementsDeliveries(type);
1116            }
1117    
1118            /**
1119            * Returns all the users who do not have any contacts.
1120            *
1121            * @return the users who do not have any contacts
1122            * @throws SystemException if a system exception occurred
1123            */
1124            public static java.util.List<com.liferay.portal.model.User> getNoContacts()
1125                    throws com.liferay.portal.kernel.exception.SystemException {
1126                    return getService().getNoContacts();
1127            }
1128    
1129            /**
1130            * Returns all the users who do not belong to any groups, excluding the
1131            * default user.
1132            *
1133            * @return the users who do not belong to any groups
1134            * @throws SystemException if a system exception occurred
1135            */
1136            public static java.util.List<com.liferay.portal.model.User> getNoGroups()
1137                    throws com.liferay.portal.kernel.exception.SystemException {
1138                    return getService().getNoGroups();
1139            }
1140    
1141            /**
1142            * Returns the primary keys of all the users belonging to the organization.
1143            *
1144            * @param organizationId the primary key of the organization
1145            * @return the primary keys of the users belonging to the organization
1146            * @throws SystemException if a system exception occurred
1147            */
1148            public static long[] getOrganizationUserIds(long organizationId)
1149                    throws com.liferay.portal.kernel.exception.SystemException {
1150                    return getService().getOrganizationUserIds(organizationId);
1151            }
1152    
1153            /**
1154            * Returns all the users belonging to the organization.
1155            *
1156            * @param organizationId the primary key of the organization
1157            * @return the users belonging to the organization
1158            * @throws SystemException if a system exception occurred
1159            */
1160            public static java.util.List<com.liferay.portal.model.User> getOrganizationUsers(
1161                    long organizationId)
1162                    throws com.liferay.portal.kernel.exception.SystemException {
1163                    return getService().getOrganizationUsers(organizationId);
1164            }
1165    
1166            /**
1167            * Returns the number of users belonging to the organization.
1168            *
1169            * @param organizationId the primary key of the organization
1170            * @return the number of users belonging to the organization
1171            * @throws SystemException if a system exception occurred
1172            */
1173            public static int getOrganizationUsersCount(long organizationId)
1174                    throws com.liferay.portal.kernel.exception.SystemException {
1175                    return getService().getOrganizationUsersCount(organizationId);
1176            }
1177    
1178            /**
1179            * Returns the number of users with the status belonging to the
1180            * organization.
1181            *
1182            * @param organizationId the primary key of the organization
1183            * @param status the workflow status
1184            * @return the number of users with the status belonging to the
1185            organization
1186            * @throws PortalException if an organization with the primary key could
1187            not be found
1188            * @throws SystemException if a system exception occurred
1189            */
1190            public static int getOrganizationUsersCount(long organizationId, int status)
1191                    throws com.liferay.portal.kernel.exception.PortalException,
1192                            com.liferay.portal.kernel.exception.SystemException {
1193                    return getService().getOrganizationUsersCount(organizationId, status);
1194            }
1195    
1196            /**
1197            * Returns the primary keys of all the users belonging to the role.
1198            *
1199            * @param roleId the primary key of the role
1200            * @return the primary keys of the users belonging to the role
1201            * @throws SystemException if a system exception occurred
1202            */
1203            public static long[] getRoleUserIds(long roleId)
1204                    throws com.liferay.portal.kernel.exception.SystemException {
1205                    return getService().getRoleUserIds(roleId);
1206            }
1207    
1208            /**
1209            * Returns all the users belonging to the role.
1210            *
1211            * @param roleId the primary key of the role
1212            * @return the users belonging to the role
1213            * @throws SystemException if a system exception occurred
1214            */
1215            public static java.util.List<com.liferay.portal.model.User> getRoleUsers(
1216                    long roleId) throws com.liferay.portal.kernel.exception.SystemException {
1217                    return getService().getRoleUsers(roleId);
1218            }
1219    
1220            /**
1221            * Returns a range of all the users belonging to the role.
1222            *
1223            * <p>
1224            * Useful when paginating results. Returns a maximum of <code>end -
1225            * start</code> instances. <code>start</code> and <code>end</code> are not
1226            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1227            * refers to the first result in the set. Setting both <code>start</code>
1228            * and <code>end</code> to {@link
1229            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the
1230            * full result set.
1231            * </p>
1232            *
1233            * @param roleId the primary key of the role
1234            * @param start the lower bound of the range of users
1235            * @param end the upper bound of the range of users (not inclusive)
1236            * @return the range of users belonging to the role
1237            * @throws SystemException if a system exception occurred
1238            */
1239            public static java.util.List<com.liferay.portal.model.User> getRoleUsers(
1240                    long roleId, int start, int end)
1241                    throws com.liferay.portal.kernel.exception.SystemException {
1242                    return getService().getRoleUsers(roleId, start, end);
1243            }
1244    
1245            /**
1246            * Returns the number of users belonging to the role.
1247            *
1248            * @param roleId the primary key of the role
1249            * @return the number of users belonging to the role
1250            * @throws SystemException if a system exception occurred
1251            */
1252            public static int getRoleUsersCount(long roleId)
1253                    throws com.liferay.portal.kernel.exception.SystemException {
1254                    return getService().getRoleUsersCount(roleId);
1255            }
1256    
1257            /**
1258            * Returns the number of users with the status belonging to the role.
1259            *
1260            * @param roleId the primary key of the role
1261            * @param status the workflow status
1262            * @return the number of users with the status belonging to the role
1263            * @throws PortalException if an role with the primary key could not be
1264            found
1265            * @throws SystemException if a system exception occurred
1266            */
1267            public static int getRoleUsersCount(long roleId, int status)
1268                    throws com.liferay.portal.kernel.exception.PortalException,
1269                            com.liferay.portal.kernel.exception.SystemException {
1270                    return getService().getRoleUsersCount(roleId, status);
1271            }
1272    
1273            /**
1274            * Returns an ordered range of all the users with a social relation of the
1275            * type with the user.
1276            *
1277            * <p>
1278            * Useful when paginating results. Returns a maximum of <code>end -
1279            * start</code> instances. <code>start</code> and <code>end</code> are not
1280            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1281            * refers to the first result in the set. Setting both <code>start</code>
1282            * and <code>end</code> to {@link
1283            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the
1284            * full result set.
1285            * </p>
1286            *
1287            * @param userId the primary key of the user
1288            * @param type the type of social relation. The possible types can be
1289            found in {@link
1290            com.liferay.portlet.social.model.SocialRelationConstants}.
1291            * @param start the lower bound of the range of users
1292            * @param end the upper bound of the range of users (not inclusive)
1293            * @param obc the comparator to order the users by (optionally
1294            <code>null</code>)
1295            * @return the ordered range of users with a social relation of the type
1296            with the user
1297            * @throws PortalException if a user with the primary key could not be
1298            found
1299            * @throws SystemException if a system exception occurred
1300            */
1301            public static java.util.List<com.liferay.portal.model.User> getSocialUsers(
1302                    long userId, int type, int start, int end,
1303                    com.liferay.portal.kernel.util.OrderByComparator obc)
1304                    throws com.liferay.portal.kernel.exception.PortalException,
1305                            com.liferay.portal.kernel.exception.SystemException {
1306                    return getService().getSocialUsers(userId, type, start, end, obc);
1307            }
1308    
1309            /**
1310            * Returns an ordered range of all the users with a social relation with
1311            * the user.
1312            *
1313            * <p>
1314            * Useful when paginating results. Returns a maximum of <code>end -
1315            * start</code> instances. <code>start</code> and <code>end</code> are not
1316            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1317            * refers to the first result in the set. Setting both <code>start</code>
1318            * and <code>end</code> to {@link
1319            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the
1320            * full result set.
1321            * </p>
1322            *
1323            * @param userId the primary key of the user
1324            * @param start the lower bound of the range of users
1325            * @param end the upper bound of the range of users (not inclusive)
1326            * @param obc the comparator to order the users by (optionally
1327            <code>null</code>)
1328            * @return the ordered range of users with a social relation with the user
1329            * @throws PortalException if a user with the primary key could not be
1330            found
1331            * @throws SystemException if a system exception occurred
1332            */
1333            public static java.util.List<com.liferay.portal.model.User> getSocialUsers(
1334                    long userId, int start, int end,
1335                    com.liferay.portal.kernel.util.OrderByComparator obc)
1336                    throws com.liferay.portal.kernel.exception.PortalException,
1337                            com.liferay.portal.kernel.exception.SystemException {
1338                    return getService().getSocialUsers(userId, start, end, obc);
1339            }
1340    
1341            /**
1342            * Returns an ordered range of all the users with a mutual social relation
1343            * of the type with both of the given users.
1344            *
1345            * <p>
1346            * Useful when paginating results. Returns a maximum of <code>end -
1347            * start</code> instances. <code>start</code> and <code>end</code> are not
1348            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1349            * refers to the first result in the set. Setting both <code>start</code>
1350            * and <code>end</code> to {@link
1351            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the
1352            * full result set.
1353            * </p>
1354            *
1355            * @param userId1 the primary key of the first user
1356            * @param userId2 the primary key of the second user
1357            * @param type the type of social relation. The possible types can be
1358            found in {@link
1359            com.liferay.portlet.social.model.SocialRelationConstants}.
1360            * @param start the lower bound of the range of users
1361            * @param end the upper bound of the range of users (not inclusive)
1362            * @param obc the comparator to order the users by (optionally
1363            <code>null</code>)
1364            * @return the ordered range of users with a mutual social relation of the
1365            type with the user
1366            * @throws PortalException if a user with the primary key could not be
1367            found
1368            * @throws SystemException if a system exception occurred
1369            */
1370            public static java.util.List<com.liferay.portal.model.User> getSocialUsers(
1371                    long userId1, long userId2, int type, int start, int end,
1372                    com.liferay.portal.kernel.util.OrderByComparator obc)
1373                    throws com.liferay.portal.kernel.exception.PortalException,
1374                            com.liferay.portal.kernel.exception.SystemException {
1375                    return getService()
1376                                       .getSocialUsers(userId1, userId2, type, start, end, obc);
1377            }
1378    
1379            /**
1380            * Returns an ordered range of all the users with a mutual social relation
1381            * with both of the given users.
1382            *
1383            * <p>
1384            * Useful when paginating results. Returns a maximum of <code>end -
1385            * start</code> instances. <code>start</code> and <code>end</code> are not
1386            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1387            * refers to the first result in the set. Setting both <code>start</code>
1388            * and <code>end</code> to {@link
1389            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the
1390            * full result set.
1391            * </p>
1392            *
1393            * @param userId1 the primary key of the first user
1394            * @param userId2 the primary key of the second user
1395            * @param start the lower bound of the range of users
1396            * @param end the upper bound of the range of users (not inclusive)
1397            * @param obc the comparator to order the users by (optionally
1398            <code>null</code>)
1399            * @return the ordered range of users with a mutual social relation with
1400            the user
1401            * @throws PortalException if a user with the primary key could not be
1402            found
1403            * @throws SystemException if a system exception occurred
1404            */
1405            public static java.util.List<com.liferay.portal.model.User> getSocialUsers(
1406                    long userId1, long userId2, int start, int end,
1407                    com.liferay.portal.kernel.util.OrderByComparator obc)
1408                    throws com.liferay.portal.kernel.exception.PortalException,
1409                            com.liferay.portal.kernel.exception.SystemException {
1410                    return getService().getSocialUsers(userId1, userId2, start, end, obc);
1411            }
1412    
1413            /**
1414            * Returns the number of users with a social relation with the user.
1415            *
1416            * @param userId the primary key of the user
1417            * @return the number of users with a social relation with the user
1418            * @throws PortalException if a user with the primary key could not be
1419            found
1420            * @throws SystemException if a system exception occurred
1421            */
1422            public static int getSocialUsersCount(long userId)
1423                    throws com.liferay.portal.kernel.exception.PortalException,
1424                            com.liferay.portal.kernel.exception.SystemException {
1425                    return getService().getSocialUsersCount(userId);
1426            }
1427    
1428            /**
1429            * Returns the number of users with a social relation of the type with the
1430            * user.
1431            *
1432            * @param userId the primary key of the user
1433            * @param type the type of social relation. The possible types can be
1434            found in {@link
1435            com.liferay.portlet.social.model.SocialRelationConstants}.
1436            * @return the number of users with a social relation of the type with the
1437            user
1438            * @throws PortalException if a user with the primary key could not be
1439            found
1440            * @throws SystemException if a system exception occurred
1441            */
1442            public static int getSocialUsersCount(long userId, int type)
1443                    throws com.liferay.portal.kernel.exception.PortalException,
1444                            com.liferay.portal.kernel.exception.SystemException {
1445                    return getService().getSocialUsersCount(userId, type);
1446            }
1447    
1448            /**
1449            * Returns the number of users with a mutual social relation with both of
1450            * the given users.
1451            *
1452            * @param userId1 the primary key of the first user
1453            * @param userId2 the primary key of the second user
1454            * @return the number of users with a mutual social relation with the user
1455            * @throws PortalException if a user with the primary key could not be
1456            found
1457            * @throws SystemException if a system exception occurred
1458            */
1459            public static int getSocialUsersCount(long userId1, long userId2)
1460                    throws com.liferay.portal.kernel.exception.PortalException,
1461                            com.liferay.portal.kernel.exception.SystemException {
1462                    return getService().getSocialUsersCount(userId1, userId2);
1463            }
1464    
1465            /**
1466            * Returns the number of users with a mutual social relation of the type
1467            * with both of the given users.
1468            *
1469            * @param userId1 the primary key of the first user
1470            * @param userId2 the primary key of the second user
1471            * @param type the type of social relation. The possible types can be
1472            found in {@link
1473            com.liferay.portlet.social.model.SocialRelationConstants}.
1474            * @return the number of users with a mutual social relation of the type
1475            with the user
1476            * @throws PortalException if a user with the primary key could not be
1477            found
1478            * @throws SystemException if a system exception occurred
1479            */
1480            public static int getSocialUsersCount(long userId1, long userId2, int type)
1481                    throws com.liferay.portal.kernel.exception.PortalException,
1482                            com.liferay.portal.kernel.exception.SystemException {
1483                    return getService().getSocialUsersCount(userId1, userId2, type);
1484            }
1485    
1486            /**
1487            * Returns the user with the contact ID.
1488            *
1489            * @param contactId the user's contact ID
1490            * @return the user with the contact ID
1491            * @throws PortalException if a user with the contact ID could not be found
1492            * @throws SystemException if a system exception occurred
1493            */
1494            public static com.liferay.portal.model.User getUserByContactId(
1495                    long contactId)
1496                    throws com.liferay.portal.kernel.exception.PortalException,
1497                            com.liferay.portal.kernel.exception.SystemException {
1498                    return getService().getUserByContactId(contactId);
1499            }
1500    
1501            /**
1502            * Returns the user with the email address.
1503            *
1504            * @param companyId the primary key of the user's company
1505            * @param emailAddress the user's email address
1506            * @return the user with the email address
1507            * @throws PortalException if a user with the email address could not be
1508            found
1509            * @throws SystemException if a system exception occurred
1510            */
1511            public static com.liferay.portal.model.User getUserByEmailAddress(
1512                    long companyId, java.lang.String emailAddress)
1513                    throws com.liferay.portal.kernel.exception.PortalException,
1514                            com.liferay.portal.kernel.exception.SystemException {
1515                    return getService().getUserByEmailAddress(companyId, emailAddress);
1516            }
1517    
1518            /**
1519            * Returns the user with the Facebook ID.
1520            *
1521            * @param companyId the primary key of the user's company
1522            * @param facebookId the user's Facebook ID
1523            * @return the user with the Facebook ID
1524            * @throws PortalException if a user with the Facebook ID could not be
1525            found
1526            * @throws SystemException if a system exception occurred
1527            */
1528            public static com.liferay.portal.model.User getUserByFacebookId(
1529                    long companyId, long facebookId)
1530                    throws com.liferay.portal.kernel.exception.PortalException,
1531                            com.liferay.portal.kernel.exception.SystemException {
1532                    return getService().getUserByFacebookId(companyId, facebookId);
1533            }
1534    
1535            /**
1536            * Returns the user with the primary key.
1537            *
1538            * @param userId the primary key of the user
1539            * @return the user with the primary key
1540            * @throws PortalException if a user with the primary key could not be
1541            found
1542            * @throws SystemException if a system exception occurred
1543            */
1544            public static com.liferay.portal.model.User getUserById(long userId)
1545                    throws com.liferay.portal.kernel.exception.PortalException,
1546                            com.liferay.portal.kernel.exception.SystemException {
1547                    return getService().getUserById(userId);
1548            }
1549    
1550            /**
1551            * Returns the user with the primary key from the company.
1552            *
1553            * @param companyId the primary key of the user's company
1554            * @param userId the primary key of the user
1555            * @return the user with the primary key
1556            * @throws PortalException if a user with the primary key from the company
1557            could not be found
1558            * @throws SystemException if a system exception occurred
1559            */
1560            public static com.liferay.portal.model.User getUserById(long companyId,
1561                    long userId)
1562                    throws com.liferay.portal.kernel.exception.PortalException,
1563                            com.liferay.portal.kernel.exception.SystemException {
1564                    return getService().getUserById(companyId, userId);
1565            }
1566    
1567            /**
1568            * Returns the user with the OpenID.
1569            *
1570            * @param companyId the primary key of the user's company
1571            * @param openId the user's OpenID
1572            * @return the user with the OpenID
1573            * @throws PortalException if a user with the OpenID could not be found
1574            * @throws SystemException if a system exception occurred
1575            */
1576            public static com.liferay.portal.model.User getUserByOpenId(
1577                    long companyId, java.lang.String openId)
1578                    throws com.liferay.portal.kernel.exception.PortalException,
1579                            com.liferay.portal.kernel.exception.SystemException {
1580                    return getService().getUserByOpenId(companyId, openId);
1581            }
1582    
1583            /**
1584            * Returns the user with the portrait ID.
1585            *
1586            * @param portraitId the user's portrait ID
1587            * @return the user with the portrait ID
1588            * @throws PortalException if a user with the portrait ID could not be
1589            found
1590            * @throws SystemException if a system exception occurred
1591            */
1592            public static com.liferay.portal.model.User getUserByPortraitId(
1593                    long portraitId)
1594                    throws com.liferay.portal.kernel.exception.PortalException,
1595                            com.liferay.portal.kernel.exception.SystemException {
1596                    return getService().getUserByPortraitId(portraitId);
1597            }
1598    
1599            /**
1600            * Returns the user with the screen name.
1601            *
1602            * @param companyId the primary key of the user's company
1603            * @param screenName the user's screen name
1604            * @return the user with the screen name
1605            * @throws PortalException if a user with the screen name could not be
1606            found
1607            * @throws SystemException if a system exception occurred
1608            */
1609            public static com.liferay.portal.model.User getUserByScreenName(
1610                    long companyId, java.lang.String screenName)
1611                    throws com.liferay.portal.kernel.exception.PortalException,
1612                            com.liferay.portal.kernel.exception.SystemException {
1613                    return getService().getUserByScreenName(companyId, screenName);
1614            }
1615    
1616            /**
1617            * Returns the user with the universally unique identifier.
1618            *
1619            * @param uuid the user's universally unique identifier
1620            * @return the user with the universally unique identifier
1621            * @throws PortalException if a user with the universally unique identifier
1622            could not be found
1623            * @throws SystemException if a system exception occurred
1624            */
1625            public static com.liferay.portal.model.User getUserByUuid(
1626                    java.lang.String uuid)
1627                    throws com.liferay.portal.kernel.exception.PortalException,
1628                            com.liferay.portal.kernel.exception.SystemException {
1629                    return getService().getUserByUuid(uuid);
1630            }
1631    
1632            /**
1633            * Returns all the users belonging to the user group.
1634            *
1635            * @param userGroupId the primary key of the user group
1636            * @return the users belonging to the user group
1637            * @throws SystemException if a system exception occurred
1638            */
1639            public static java.util.List<com.liferay.portal.model.User> getUserGroupUsers(
1640                    long userGroupId)
1641                    throws com.liferay.portal.kernel.exception.SystemException {
1642                    return getService().getUserGroupUsers(userGroupId);
1643            }
1644    
1645            /**
1646            * Returns the number of users belonging to the user group.
1647            *
1648            * @param userGroupId the primary key of the user group
1649            * @return the number of users belonging to the user group
1650            * @throws SystemException if a system exception occurred
1651            */
1652            public static int getUserGroupUsersCount(long userGroupId)
1653                    throws com.liferay.portal.kernel.exception.SystemException {
1654                    return getService().getUserGroupUsersCount(userGroupId);
1655            }
1656    
1657            /**
1658            * Returns the number of users with the status belonging to the user group.
1659            *
1660            * @param userGroupId the primary key of the user group
1661            * @param status the workflow status
1662            * @return the number of users with the status belonging to the user group
1663            * @throws PortalException if a user group with the primary key could not
1664            be found
1665            * @throws SystemException if a system exception occurred
1666            */
1667            public static int getUserGroupUsersCount(long userGroupId, int status)
1668                    throws com.liferay.portal.kernel.exception.PortalException,
1669                            com.liferay.portal.kernel.exception.SystemException {
1670                    return getService().getUserGroupUsersCount(userGroupId, status);
1671            }
1672    
1673            /**
1674            * Returns the primary key of the user with the email address.
1675            *
1676            * @param companyId the primary key of the user's company
1677            * @param emailAddress the user's email address
1678            * @return the primary key of the user with the email address
1679            * @throws PortalException if a user with the email address could not be
1680            found
1681            * @throws SystemException if a system exception occurred
1682            */
1683            public static long getUserIdByEmailAddress(long companyId,
1684                    java.lang.String emailAddress)
1685                    throws com.liferay.portal.kernel.exception.PortalException,
1686                            com.liferay.portal.kernel.exception.SystemException {
1687                    return getService().getUserIdByEmailAddress(companyId, emailAddress);
1688            }
1689    
1690            /**
1691            * Returns the primary key of the user with the screen name.
1692            *
1693            * @param companyId the primary key of the user's company
1694            * @param screenName the user's screen name
1695            * @return the primary key of the user with the screen name
1696            * @throws PortalException if a user with the screen name could not be
1697            found
1698            * @throws SystemException if a system exception occurred
1699            */
1700            public static long getUserIdByScreenName(long companyId,
1701                    java.lang.String screenName)
1702                    throws com.liferay.portal.kernel.exception.PortalException,
1703                            com.liferay.portal.kernel.exception.SystemException {
1704                    return getService().getUserIdByScreenName(companyId, screenName);
1705            }
1706    
1707            /**
1708            * Returns <code>true</code> if the user is a member of the group.
1709            *
1710            * @param groupId the primary key of the group
1711            * @param userId the primary key of the user
1712            * @return <code>true</code> if the user is a member of the group;
1713            <code>false</code> otherwise
1714            * @throws SystemException if a system exception occurred
1715            */
1716            public static boolean hasGroupUser(long groupId, long userId)
1717                    throws com.liferay.portal.kernel.exception.SystemException {
1718                    return getService().hasGroupUser(groupId, userId);
1719            }
1720    
1721            /**
1722            * Returns <code>true</code> if the user is a member of the organization.
1723            *
1724            * @param organizationId the primary key of the organization
1725            * @param userId the primary key of the user
1726            * @return <code>true</code> if the user is a member of the organization;
1727            <code>false</code> otherwise
1728            * @throws SystemException if a system exception occurred
1729            */
1730            public static boolean hasOrganizationUser(long organizationId, long userId)
1731                    throws com.liferay.portal.kernel.exception.SystemException {
1732                    return getService().hasOrganizationUser(organizationId, userId);
1733            }
1734    
1735            /**
1736            * Returns <code>true</code> if the password policy has been assigned to
1737            * the user.
1738            *
1739            * @param passwordPolicyId the primary key of the password policy
1740            * @param userId the primary key of the user
1741            * @return <code>true</code> if the password policy is assigned to the
1742            user; <code>false</code> otherwise
1743            * @throws SystemException if a system exception occurred
1744            */
1745            public static boolean hasPasswordPolicyUser(long passwordPolicyId,
1746                    long userId) throws com.liferay.portal.kernel.exception.SystemException {
1747                    return getService().hasPasswordPolicyUser(passwordPolicyId, userId);
1748            }
1749    
1750            /**
1751            * Returns <code>true</code> if the user is a member of the role.
1752            *
1753            * @param roleId the primary key of the role
1754            * @param userId the primary key of the user
1755            * @return <code>true</code> if the user is a member of the role;
1756            <code>false</code> otherwise
1757            * @throws SystemException if a system exception occurred
1758            */
1759            public static boolean hasRoleUser(long roleId, long userId)
1760                    throws com.liferay.portal.kernel.exception.SystemException {
1761                    return getService().hasRoleUser(roleId, userId);
1762            }
1763    
1764            /**
1765            * Returns <code>true</code> if the user has the role with the name,
1766            * optionally through inheritance.
1767            *
1768            * @param companyId the primary key of the role's company
1769            * @param name the name of the role (must be a regular role, not an
1770            organization, site or provider role)
1771            * @param userId the primary key of the user
1772            * @param inherited whether to include roles inherited from organizations,
1773            sites, etc.
1774            * @return <code>true</code> if the user has the role; <code>false</code>
1775            otherwise
1776            * @throws PortalException if a role with the name could not be found
1777            * @throws SystemException if a system exception occurred
1778            */
1779            public static boolean hasRoleUser(long companyId, java.lang.String name,
1780                    long userId, boolean inherited)
1781                    throws com.liferay.portal.kernel.exception.PortalException,
1782                            com.liferay.portal.kernel.exception.SystemException {
1783                    return getService().hasRoleUser(companyId, name, userId, inherited);
1784            }
1785    
1786            /**
1787            * Returns <code>true</code> if the user is a member of the team.
1788            *
1789            * @param teamId the primary key of the team
1790            * @param userId the primary key of the user
1791            * @return <code>true</code> if the user is a member of the team;
1792            <code>false</code> otherwise
1793            * @throws SystemException if a system exception occurred
1794            */
1795            public static boolean hasTeamUser(long teamId, long userId)
1796                    throws com.liferay.portal.kernel.exception.SystemException {
1797                    return getService().hasTeamUser(teamId, userId);
1798            }
1799    
1800            /**
1801            * Returns <code>true</code> if the user is a member of the user group.
1802            *
1803            * @param userGroupId the primary key of the user group
1804            * @param userId the primary key of the user
1805            * @return <code>true</code> if the user is a member of the user group;
1806            <code>false</code> otherwise
1807            * @throws SystemException if a system exception occurred
1808            */
1809            public static boolean hasUserGroupUser(long userGroupId, long userId)
1810                    throws com.liferay.portal.kernel.exception.SystemException {
1811                    return getService().hasUserGroupUser(userGroupId, userId);
1812            }
1813    
1814            /**
1815            * Returns <code>true</code> if the user's password is expired.
1816            *
1817            * @param user the user
1818            * @return <code>true</code> if the user's password is expired;
1819            <code>false</code> otherwise
1820            * @throws PortalException if the password policy for the user could not be
1821            found
1822            * @throws SystemException if a system exception occurred
1823            */
1824            public static boolean isPasswordExpired(com.liferay.portal.model.User user)
1825                    throws com.liferay.portal.kernel.exception.PortalException,
1826                            com.liferay.portal.kernel.exception.SystemException {
1827                    return getService().isPasswordExpired(user);
1828            }
1829    
1830            /**
1831            * Returns <code>true</code> if the user's password is expiring soon.
1832            *
1833            * @param user the user
1834            * @return <code>true</code> if the user's password is expiring soon;
1835            <code>false</code> otherwise
1836            * @throws PortalException if the password policy for the user could not be
1837            found
1838            * @throws SystemException if a system exception occurred
1839            */
1840            public static boolean isPasswordExpiringSoon(
1841                    com.liferay.portal.model.User user)
1842                    throws com.liferay.portal.kernel.exception.PortalException,
1843                            com.liferay.portal.kernel.exception.SystemException {
1844                    return getService().isPasswordExpiringSoon(user);
1845            }
1846    
1847            public static com.liferay.portal.model.User loadGetDefaultUser(
1848                    long companyId)
1849                    throws com.liferay.portal.kernel.exception.PortalException,
1850                            com.liferay.portal.kernel.exception.SystemException {
1851                    return getService().loadGetDefaultUser(companyId);
1852            }
1853    
1854            /**
1855            * Updates a user account that was automatically created when a guest user
1856            * participated in an action (e.g. posting a comment) and only provided his
1857            * name and email address.
1858            *
1859            * @param creatorUserId the primary key of the creator
1860            * @param companyId the primary key of the user's company
1861            * @param autoPassword whether a password should be automatically
1862            generated for the user
1863            * @param password1 the user's password
1864            * @param password2 the user's password confirmation
1865            * @param autoScreenName whether a screen name should be automatically
1866            generated for the user
1867            * @param screenName the user's screen name
1868            * @param emailAddress the user's email address
1869            * @param facebookId the user's facebook ID
1870            * @param openId the user's OpenID
1871            * @param locale the user's locale
1872            * @param firstName the user's first name
1873            * @param middleName the user's middle name
1874            * @param lastName the user's last name
1875            * @param prefixId the user's name prefix ID
1876            * @param suffixId the user's name suffix ID
1877            * @param male whether the user is male
1878            * @param birthdayMonth the user's birthday month (0-based, meaning 0 for
1879            January)
1880            * @param birthdayDay the user's birthday day
1881            * @param birthdayYear the user's birthday year
1882            * @param jobTitle the user's job title
1883            * @param updateUserInformation whether to update the user's information
1884            * @param sendEmail whether to send the user an email notification about
1885            their new account
1886            * @param serviceContext the user's service context (optionally
1887            <code>null</code>). Can specify the user's expando bridge
1888            attributes.
1889            * @return the user
1890            * @throws PortalException if the user's information was invalid
1891            * @throws SystemException if a system exception occurred
1892            */
1893            public static com.liferay.portal.model.User updateIncompleteUser(
1894                    long creatorUserId, long companyId, boolean autoPassword,
1895                    java.lang.String password1, java.lang.String password2,
1896                    boolean autoScreenName, java.lang.String screenName,
1897                    java.lang.String emailAddress, long facebookId,
1898                    java.lang.String openId, java.util.Locale locale,
1899                    java.lang.String firstName, java.lang.String middleName,
1900                    java.lang.String lastName, int prefixId, int suffixId, boolean male,
1901                    int birthdayMonth, int birthdayDay, int birthdayYear,
1902                    java.lang.String jobTitle, boolean updateUserInformation,
1903                    boolean sendEmail,
1904                    com.liferay.portal.service.ServiceContext serviceContext)
1905                    throws com.liferay.portal.kernel.exception.PortalException,
1906                            com.liferay.portal.kernel.exception.SystemException {
1907                    return getService()
1908                                       .updateIncompleteUser(creatorUserId, companyId,
1909                            autoPassword, password1, password2, autoScreenName, screenName,
1910                            emailAddress, facebookId, openId, locale, firstName, middleName,
1911                            lastName, prefixId, suffixId, male, birthdayMonth, birthdayDay,
1912                            birthdayYear, jobTitle, updateUserInformation, sendEmail,
1913                            serviceContext);
1914            }
1915    
1916            /**
1917            * Returns an ordered range of all the users who match the keywords and
1918            * status, without using the indexer. It is preferable to use the indexed
1919            * version {@link #search(long, String, int, LinkedHashMap, int, int,
1920            * Sort)} instead of this method wherever possible for performance reasons.
1921            *
1922            * <p>
1923            * Useful when paginating results. Returns a maximum of <code>end -
1924            * start</code> instances. <code>start</code> and <code>end</code> are not
1925            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1926            * refers to the first result in the set. Setting both <code>start</code>
1927            * and <code>end</code> to {@link
1928            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the
1929            * full result set.
1930            * </p>
1931            *
1932            * @param companyId the primary key of the user's company
1933            * @param keywords the keywords (space separated), which may occur in the
1934            user's first name, middle name, last name, screen name, or email
1935            address
1936            * @param status the workflow status
1937            * @param params the finder parameters (optionally <code>null</code>). For
1938            more information see {@link
1939            com.liferay.portal.service.persistence.UserFinder}.
1940            * @param start the lower bound of the range of users
1941            * @param end the upper bound of the range of users (not inclusive)
1942            * @param obc the comparator to order the users by (optionally
1943            <code>null</code>)
1944            * @return the matching users
1945            * @throws SystemException if a system exception occurred
1946            * @see com.liferay.portal.service.persistence.UserFinder
1947            */
1948            public static java.util.List<com.liferay.portal.model.User> search(
1949                    long companyId, java.lang.String keywords, int status,
1950                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
1951                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
1952                    throws com.liferay.portal.kernel.exception.SystemException {
1953                    return getService()
1954                                       .search(companyId, keywords, status, params, start, end, obc);
1955            }
1956    
1957            /**
1958            * Returns an ordered range of all the users who match the keywords and
1959            * status, using the indexer. It is preferable to use this method instead
1960            * of the non-indexed version whenever possible for performance reasons.
1961            *
1962            * <p>
1963            * Useful when paginating results. Returns a maximum of <code>end -
1964            * start</code> instances. <code>start</code> and <code>end</code> are not
1965            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1966            * refers to the first result in the set. Setting both <code>start</code>
1967            * and <code>end</code> to {@link
1968            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the
1969            * full result set.
1970            * </p>
1971            *
1972            * @param companyId the primary key of the user's company
1973            * @param keywords the keywords (space separated), which may occur in the
1974            user's first name, middle name, last name, screen name, or email
1975            address
1976            * @param status the workflow status
1977            * @param params the indexer parameters (optionally <code>null</code>).
1978            For more information see {@link
1979            com.liferay.portlet.usersadmin.util.UserIndexer}.
1980            * @param start the lower bound of the range of users
1981            * @param end the upper bound of the range of users (not inclusive)
1982            * @param sort the field and direction to sort by (optionally
1983            <code>null</code>)
1984            * @return the matching users
1985            * @throws SystemException if a system exception occurred
1986            * @see com.liferay.portlet.usersadmin.util.UserIndexer
1987            */
1988            public static com.liferay.portal.kernel.search.Hits search(long companyId,
1989                    java.lang.String keywords, int status,
1990                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
1991                    int start, int end, com.liferay.portal.kernel.search.Sort sort)
1992                    throws com.liferay.portal.kernel.exception.SystemException {
1993                    return getService()
1994                                       .search(companyId, keywords, status, params, start, end, sort);
1995            }
1996    
1997            /**
1998            * Returns an ordered range of all the users with the status, and whose
1999            * first name, middle name, last name, screen name, and email address match
2000            * the keywords specified for them, without using the indexer. It is
2001            * preferable to use the indexed version {@link #search(long, String,
2002            * String, String, String, String, int, LinkedHashMap, boolean, int, int,
2003            * Sort)} instead of this method wherever possible for performance reasons.
2004            *
2005            * <p>
2006            * Useful when paginating results. Returns a maximum of <code>end -
2007            * start</code> instances. <code>start</code> and <code>end</code> are not
2008            * primary keys, they are indexes in the result set. Thus, <code>0</code>
2009            * refers to the first result in the set. Setting both <code>start</code>
2010            * and <code>end</code> to {@link
2011            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the
2012            * full result set.
2013            * </p>
2014            *
2015            * @param companyId the primary key of the user's company
2016            * @param firstName the first name keywords (space separated)
2017            * @param middleName the middle name keywords
2018            * @param lastName the last name keywords
2019            * @param screenName the screen name keywords
2020            * @param emailAddress the email address keywords
2021            * @param status the workflow status
2022            * @param params the finder parameters (optionally <code>null</code>). For
2023            more information see {@link
2024            com.liferay.portal.service.persistence.UserFinder}.
2025            * @param andSearch whether every field must match its keywords, or just
2026            one field. For example, &quot;users with the first name 'bob'
2027            and last name 'smith'&quot; vs &quot;users with the first name
2028            'bob' or the last name 'smith'&quot;.
2029            * @param start the lower bound of the range of users
2030            * @param end the upper bound of the range of users (not inclusive)
2031            * @param obc the comparator to order the users by (optionally
2032            <code>null</code>)
2033            * @return the matching users
2034            * @throws SystemException if a system exception occurred
2035            * @see com.liferay.portal.service.persistence.UserFinder
2036            */
2037            public static java.util.List<com.liferay.portal.model.User> search(
2038                    long companyId, java.lang.String firstName,
2039                    java.lang.String middleName, java.lang.String lastName,
2040                    java.lang.String screenName, java.lang.String emailAddress, int status,
2041                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
2042                    boolean andSearch, int start, int end,
2043                    com.liferay.portal.kernel.util.OrderByComparator obc)
2044                    throws com.liferay.portal.kernel.exception.SystemException {
2045                    return getService()
2046                                       .search(companyId, firstName, middleName, lastName,
2047                            screenName, emailAddress, status, params, andSearch, start, end, obc);
2048            }
2049    
2050            /**
2051            * Returns an ordered range of all the users with the status, and whose
2052            * first name, middle name, last name, screen name, and email address match
2053            * the keywords specified for them, using the indexer. It is preferable to
2054            * use this method instead of the non-indexed version whenever possible for
2055            * performance reasons.
2056            *
2057            * <p>
2058            * Useful when paginating results. Returns a maximum of <code>end -
2059            * start</code> instances. <code>start</code> and <code>end</code> are not
2060            * primary keys, they are indexes in the result set. Thus, <code>0</code>
2061            * refers to the first result in the set. Setting both <code>start</code>
2062            * and <code>end</code> to {@link
2063            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the
2064            * full result set.
2065            * </p>
2066            *
2067            * @param companyId the primary key of the user's company
2068            * @param firstName the first name keywords (space separated)
2069            * @param middleName the middle name keywords
2070            * @param lastName the last name keywords
2071            * @param screenName the screen name keywords
2072            * @param emailAddress the email address keywords
2073            * @param status the workflow status
2074            * @param params the indexer parameters (optionally <code>null</code>).
2075            For more information see {@link
2076            com.liferay.portlet.usersadmin.util.UserIndexer}.
2077            * @param andSearch whether every field must match its keywords, or just
2078            one field. For example, &quot;users with the first name 'bob'
2079            and last name 'smith'&quot; vs &quot;users with the first name
2080            'bob' or the last name 'smith'&quot;.
2081            * @param start the lower bound of the range of users
2082            * @param end the upper bound of the range of users (not inclusive)
2083            * @param sort the field and direction to sort by (optionally
2084            <code>null</code>)
2085            * @return the matching users
2086            * @throws SystemException if a system exception occurred
2087            * @see com.liferay.portlet.usersadmin.util.UserIndexer
2088            */
2089            public static com.liferay.portal.kernel.search.Hits search(long companyId,
2090                    java.lang.String firstName, java.lang.String middleName,
2091                    java.lang.String lastName, java.lang.String screenName,
2092                    java.lang.String emailAddress, int status,
2093                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
2094                    boolean andSearch, int start, int end,
2095                    com.liferay.portal.kernel.search.Sort sort)
2096                    throws com.liferay.portal.kernel.exception.SystemException {
2097                    return getService()
2098                                       .search(companyId, firstName, middleName, lastName,
2099                            screenName, emailAddress, status, params, andSearch, start, end,
2100                            sort);
2101            }
2102    
2103            /**
2104            * Returns the number of users who match the keywords and status.
2105            *
2106            * @param companyId the primary key of the user's company
2107            * @param keywords the keywords (space separated), which may occur in the
2108            user's first name, middle name, last name, screen name, or email
2109            address
2110            * @param status the workflow status
2111            * @param params the finder parameters (optionally <code>null</code>). For
2112            more information see {@link
2113            com.liferay.portal.service.persistence.UserFinder}.
2114            * @return the number matching users
2115            * @throws SystemException if a system exception occurred
2116            */
2117            public static int searchCount(long companyId, java.lang.String keywords,
2118                    int status,
2119                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
2120                    throws com.liferay.portal.kernel.exception.SystemException {
2121                    return getService().searchCount(companyId, keywords, status, params);
2122            }
2123    
2124            /**
2125            * Returns the number of users with the status, and whose first name,
2126            * middle name, last name, screen name, and email address match the
2127            * keywords specified for them.
2128            *
2129            * @param companyId the primary key of the user's company
2130            * @param firstName the first name keywords (space separated)
2131            * @param middleName the middle name keywords
2132            * @param lastName the last name keywords
2133            * @param screenName the screen name keywords
2134            * @param emailAddress the email address keywords
2135            * @param status the workflow status
2136            * @param params the finder parameters (optionally <code>null</code>). For
2137            more information see {@link
2138            com.liferay.portal.service.persistence.UserFinder}.
2139            * @param andSearch whether every field must match its keywords, or just
2140            one field. For example, &quot;users with the first name 'bob'
2141            and last name 'smith'&quot; vs &quot;users with the first name
2142            'bob' or the last name 'smith'&quot;.
2143            * @return the number of matching users
2144            * @throws SystemException if a system exception occurred
2145            */
2146            public static int searchCount(long companyId, java.lang.String firstName,
2147                    java.lang.String middleName, java.lang.String lastName,
2148                    java.lang.String screenName, java.lang.String emailAddress, int status,
2149                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
2150                    boolean andSearch)
2151                    throws com.liferay.portal.kernel.exception.SystemException {
2152                    return getService()
2153                                       .searchCount(companyId, firstName, middleName, lastName,
2154                            screenName, emailAddress, status, params, andSearch);
2155            }
2156    
2157            /**
2158            * Sends an email address verification to the user.
2159            *
2160            * @param user the verification email recipient
2161            * @param emailAddress the recipient's email address
2162            * @param serviceContext the service context. Must specify the portal URL,
2163            main path, primary key of the layout, remote address, remote
2164            host, and user agent.
2165            * @throws PortalException if a portal exception occurred
2166            * @throws SystemException if a system exception occurred
2167            */
2168            public static void sendEmailAddressVerification(
2169                    com.liferay.portal.model.User user, java.lang.String emailAddress,
2170                    com.liferay.portal.service.ServiceContext serviceContext)
2171                    throws com.liferay.portal.kernel.exception.PortalException,
2172                            com.liferay.portal.kernel.exception.SystemException {
2173                    getService()
2174                            .sendEmailAddressVerification(user, emailAddress, serviceContext);
2175            }
2176    
2177            /**
2178            * Sends the password email to the user with the email address. The content
2179            * of this email can be specified in <code>portal.properties</code> with
2180            * the <code>admin.email.password</code> keys.
2181            *
2182            * @param companyId the primary key of the user's company
2183            * @param emailAddress the user's email address
2184            * @param fromName the name of the individual that the email should be
2185            from
2186            * @param fromAddress the address of the individual that the email should
2187            be from
2188            * @param subject the email subject. If <code>null</code>, the subject
2189            specified in <code>portal.properties</code> will be used.
2190            * @param body the email body. If <code>null</code>, the body specified in
2191            <code>portal.properties</code> will be used.
2192            * @param serviceContext the user's service context
2193            * @throws PortalException if a user with the email address could not be
2194            found
2195            * @throws SystemException if a system exception occurred
2196            */
2197            public static void sendPassword(long companyId,
2198                    java.lang.String emailAddress, java.lang.String fromName,
2199                    java.lang.String fromAddress, java.lang.String subject,
2200                    java.lang.String body,
2201                    com.liferay.portal.service.ServiceContext serviceContext)
2202                    throws com.liferay.portal.kernel.exception.PortalException,
2203                            com.liferay.portal.kernel.exception.SystemException {
2204                    getService()
2205                            .sendPassword(companyId, emailAddress, fromName, fromAddress,
2206                            subject, body, serviceContext);
2207            }
2208    
2209            /**
2210            * Sets the users in the role, removing and adding users to the role as
2211            * necessary.
2212            *
2213            * @param roleId the primary key of the role
2214            * @param userIds the primary keys of the users
2215            * @throws PortalException if a portal exception occurred
2216            * @throws SystemException if a system exception occurred
2217            */
2218            public static void setRoleUsers(long roleId, long[] userIds)
2219                    throws com.liferay.portal.kernel.exception.PortalException,
2220                            com.liferay.portal.kernel.exception.SystemException {
2221                    getService().setRoleUsers(roleId, userIds);
2222            }
2223    
2224            /**
2225            * Sets the users in the user group, removing and adding users to the user
2226            * group as necessary.
2227            *
2228            * @param userGroupId the primary key of the user group
2229            * @param userIds the primary keys of the users
2230            * @throws PortalException if a portal exception occurred
2231            * @throws SystemException if a system exception occurred
2232            */
2233            public static void setUserGroupUsers(long userGroupId, long[] userIds)
2234                    throws com.liferay.portal.kernel.exception.PortalException,
2235                            com.liferay.portal.kernel.exception.SystemException {
2236                    getService().setUserGroupUsers(userGroupId, userIds);
2237            }
2238    
2239            /**
2240            * Removes the users from the group.
2241            *
2242            * @param groupId the primary key of the group
2243            * @param userIds the primary keys of the users
2244            * @throws PortalException if a portal exception occurred
2245            * @throws SystemException if a system exception occurred
2246            */
2247            public static void unsetGroupUsers(long groupId, long[] userIds)
2248                    throws com.liferay.portal.kernel.exception.PortalException,
2249                            com.liferay.portal.kernel.exception.SystemException {
2250                    getService().unsetGroupUsers(groupId, userIds);
2251            }
2252    
2253            /**
2254            * Removes the users from the organization.
2255            *
2256            * @param organizationId the primary key of the organization
2257            * @param userIds the primary keys of the users
2258            * @throws PortalException if a portal exception occurred
2259            * @throws SystemException if a system exception occurred
2260            */
2261            public static void unsetOrganizationUsers(long organizationId,
2262                    long[] userIds)
2263                    throws com.liferay.portal.kernel.exception.PortalException,
2264                            com.liferay.portal.kernel.exception.SystemException {
2265                    getService().unsetOrganizationUsers(organizationId, userIds);
2266            }
2267    
2268            /**
2269            * Removes the users from the password policy.
2270            *
2271            * @param passwordPolicyId the primary key of the password policy
2272            * @param userIds the primary keys of the users
2273            * @throws SystemException if a system exception occurred
2274            */
2275            public static void unsetPasswordPolicyUsers(long passwordPolicyId,
2276                    long[] userIds)
2277                    throws com.liferay.portal.kernel.exception.SystemException {
2278                    getService().unsetPasswordPolicyUsers(passwordPolicyId, userIds);
2279            }
2280    
2281            /**
2282            * Removes the users from the role.
2283            *
2284            * @param roleId the primary key of the role
2285            * @param users the users
2286            * @throws PortalException if a portal exception occurred
2287            * @throws SystemException if a system exception occurred
2288            */
2289            public static void unsetRoleUsers(long roleId,
2290                    java.util.List<com.liferay.portal.model.User> users)
2291                    throws com.liferay.portal.kernel.exception.PortalException,
2292                            com.liferay.portal.kernel.exception.SystemException {
2293                    getService().unsetRoleUsers(roleId, users);
2294            }
2295    
2296            /**
2297            * Removes the users from the role.
2298            *
2299            * @param roleId the primary key of the role
2300            * @param userIds the primary keys of the users
2301            * @throws PortalException if a portal exception occurred
2302            * @throws SystemException if a system exception occurred
2303            */
2304            public static void unsetRoleUsers(long roleId, long[] userIds)
2305                    throws com.liferay.portal.kernel.exception.PortalException,
2306                            com.liferay.portal.kernel.exception.SystemException {
2307                    getService().unsetRoleUsers(roleId, userIds);
2308            }
2309    
2310            /**
2311            * Removes the users from the team.
2312            *
2313            * @param teamId the primary key of the team
2314            * @param userIds the primary keys of the users
2315            * @throws PortalException if a portal exception occurred
2316            * @throws SystemException if a system exception occurred
2317            */
2318            public static void unsetTeamUsers(long teamId, long[] userIds)
2319                    throws com.liferay.portal.kernel.exception.PortalException,
2320                            com.liferay.portal.kernel.exception.SystemException {
2321                    getService().unsetTeamUsers(teamId, userIds);
2322            }
2323    
2324            /**
2325            * Removes the users from the user group.
2326            *
2327            * @param userGroupId the primary key of the user group
2328            * @param userIds the primary keys of the users
2329            * @throws PortalException if a portal exception occurred
2330            * @throws SystemException if a system exception occurred
2331            */
2332            public static void unsetUserGroupUsers(long userGroupId, long[] userIds)
2333                    throws com.liferay.portal.kernel.exception.PortalException,
2334                            com.liferay.portal.kernel.exception.SystemException {
2335                    getService().unsetUserGroupUsers(userGroupId, userIds);
2336            }
2337    
2338            /**
2339            * Updates whether the user has agreed to the terms of use.
2340            *
2341            * @param userId the primary key of the user
2342            * @param agreedToTermsOfUse whether the user has agreet to the terms of
2343            use
2344            * @return the user
2345            * @throws PortalException if a user with the primary key could not be
2346            found
2347            * @throws SystemException if a system exception occurred
2348            */
2349            public static com.liferay.portal.model.User updateAgreedToTermsOfUse(
2350                    long userId, boolean agreedToTermsOfUse)
2351                    throws com.liferay.portal.kernel.exception.PortalException,
2352                            com.liferay.portal.kernel.exception.SystemException {
2353                    return getService().updateAgreedToTermsOfUse(userId, agreedToTermsOfUse);
2354            }
2355    
2356            /**
2357            * Updates the user's asset with the new asset categories and tag names,
2358            * removing and adding asset categories and tag names as necessary.
2359            *
2360            * @param userId the primary key of the user
2361            * @param user ID the primary key of the user
2362            * @param assetCategoryIds the primary key's of the new asset categories
2363            * @param assetTagNames the new asset tag names
2364            * @throws PortalException if a user with the primary key could not be
2365            found
2366            * @throws SystemException if a system exception occurred
2367            */
2368            public static void updateAsset(long userId,
2369                    com.liferay.portal.model.User user, long[] assetCategoryIds,
2370                    java.lang.String[] assetTagNames)
2371                    throws com.liferay.portal.kernel.exception.PortalException,
2372                            com.liferay.portal.kernel.exception.SystemException {
2373                    getService().updateAsset(userId, user, assetCategoryIds, assetTagNames);
2374            }
2375    
2376            /**
2377            * Updates the user's creation date.
2378            *
2379            * @param userId the primary key of the user
2380            * @param createDate the new creation date
2381            * @return the user
2382            * @throws PortalException if a user with the primary key could not be
2383            found
2384            * @throws SystemException if a system exception occurred
2385            */
2386            public static com.liferay.portal.model.User updateCreateDate(long userId,
2387                    java.util.Date createDate)
2388                    throws com.liferay.portal.kernel.exception.PortalException,
2389                            com.liferay.portal.kernel.exception.SystemException {
2390                    return getService().updateCreateDate(userId, createDate);
2391            }
2392    
2393            /**
2394            * Updates the user's email address.
2395            *
2396            * @param userId the primary key of the user
2397            * @param password the user's password
2398            * @param emailAddress1 the user's new email address
2399            * @param emailAddress2 the user's new email address confirmation
2400            * @return the user
2401            * @throws PortalException if a user with the primary key could not be
2402            found
2403            * @throws SystemException if a system exception occurred
2404            */
2405            public static com.liferay.portal.model.User updateEmailAddress(
2406                    long userId, java.lang.String password, java.lang.String emailAddress1,
2407                    java.lang.String emailAddress2)
2408                    throws com.liferay.portal.kernel.exception.PortalException,
2409                            com.liferay.portal.kernel.exception.SystemException {
2410                    return getService()
2411                                       .updateEmailAddress(userId, password, emailAddress1,
2412                            emailAddress2);
2413            }
2414    
2415            /**
2416            * Updates whether the user has verified email address.
2417            *
2418            * @param userId the primary key of the user
2419            * @param emailAddressVerified whether the user has verified email address
2420            * @return the user
2421            * @throws PortalException if a user with the primary key could not be
2422            found
2423            * @throws SystemException if a system exception occurred
2424            */
2425            public static com.liferay.portal.model.User updateEmailAddressVerified(
2426                    long userId, boolean emailAddressVerified)
2427                    throws com.liferay.portal.kernel.exception.PortalException,
2428                            com.liferay.portal.kernel.exception.SystemException {
2429                    return getService()
2430                                       .updateEmailAddressVerified(userId, emailAddressVerified);
2431            }
2432    
2433            /**
2434            * Updates the user's Facebook ID.
2435            *
2436            * @param userId the primary key of the user
2437            * @param facebookId the user's new Facebook ID
2438            * @return the user
2439            * @throws PortalException if a user with the primary key could not be
2440            found
2441            * @throws SystemException if a system exception occurred
2442            */
2443            public static com.liferay.portal.model.User updateFacebookId(long userId,
2444                    long facebookId)
2445                    throws com.liferay.portal.kernel.exception.PortalException,
2446                            com.liferay.portal.kernel.exception.SystemException {
2447                    return getService().updateFacebookId(userId, facebookId);
2448            }
2449    
2450            /**
2451            * Sets the groups the user is in, removing and adding groups as necessary.
2452            *
2453            * @param userId the primary key of the user
2454            * @param newGroupIds the primary keys of the groups
2455            * @throws PortalException if a portal exception occurred
2456            * @throws SystemException if a system exception occurred
2457            */
2458            public static void updateGroups(long userId, long[] newGroupIds,
2459                    com.liferay.portal.service.ServiceContext serviceContext)
2460                    throws com.liferay.portal.kernel.exception.PortalException,
2461                            com.liferay.portal.kernel.exception.SystemException {
2462                    getService().updateGroups(userId, newGroupIds, serviceContext);
2463            }
2464    
2465            /**
2466            * Updates the user's job title.
2467            *
2468            * @param userId the primary key of the user
2469            * @param jobTitle the user's job title
2470            * @return the user
2471            * @throws PortalException if a user with the primary key could not be
2472            found or if a contact could not be found matching the user's
2473            contact ID
2474            * @throws SystemException if a system exception occurred
2475            */
2476            public static com.liferay.portal.model.User updateJobTitle(long userId,
2477                    java.lang.String jobTitle)
2478                    throws com.liferay.portal.kernel.exception.PortalException,
2479                            com.liferay.portal.kernel.exception.SystemException {
2480                    return getService().updateJobTitle(userId, jobTitle);
2481            }
2482    
2483            /**
2484            * Updates the user's last login with the current time and the IP address.
2485            *
2486            * @param userId the primary key of the user
2487            * @param loginIP the IP address the user logged in from
2488            * @return the user
2489            * @throws PortalException if a user with the primary key could not be
2490            found
2491            * @throws SystemException if a system exception occurred
2492            */
2493            public static com.liferay.portal.model.User updateLastLogin(long userId,
2494                    java.lang.String loginIP)
2495                    throws com.liferay.portal.kernel.exception.PortalException,
2496                            com.liferay.portal.kernel.exception.SystemException {
2497                    return getService().updateLastLogin(userId, loginIP);
2498            }
2499    
2500            /**
2501            * Updates whether the user is locked out from logging in.
2502            *
2503            * @param user the user
2504            * @param lockout whether the user is locked out
2505            * @return the user
2506            * @throws PortalException if a portal exception occurred
2507            * @throws SystemException if a system exception occurred
2508            */
2509            public static com.liferay.portal.model.User updateLockout(
2510                    com.liferay.portal.model.User user, boolean lockout)
2511                    throws com.liferay.portal.kernel.exception.PortalException,
2512                            com.liferay.portal.kernel.exception.SystemException {
2513                    return getService().updateLockout(user, lockout);
2514            }
2515    
2516            /**
2517            * Updates whether the user is locked out from logging in.
2518            *
2519            * @param companyId the primary key of the user's company
2520            * @param emailAddress the user's email address
2521            * @param lockout whether the user is locked out
2522            * @return the user
2523            * @throws PortalException if a user with the email address could not be
2524            found
2525            * @throws SystemException if a system exception occurred
2526            */
2527            public static com.liferay.portal.model.User updateLockoutByEmailAddress(
2528                    long companyId, java.lang.String emailAddress, boolean lockout)
2529                    throws com.liferay.portal.kernel.exception.PortalException,
2530                            com.liferay.portal.kernel.exception.SystemException {
2531                    return getService()
2532                                       .updateLockoutByEmailAddress(companyId, emailAddress, lockout);
2533            }
2534    
2535            /**
2536            * Updates whether the user is locked out from logging in.
2537            *
2538            * @param userId the primary key of the user
2539            * @param lockout whether the user is locked out
2540            * @return the user
2541            * @throws PortalException if a user with the primary key could not be
2542            found
2543            * @throws SystemException if a system exception occurred
2544            */
2545            public static com.liferay.portal.model.User updateLockoutById(long userId,
2546                    boolean lockout)
2547                    throws com.liferay.portal.kernel.exception.PortalException,
2548                            com.liferay.portal.kernel.exception.SystemException {
2549                    return getService().updateLockoutById(userId, lockout);
2550            }
2551    
2552            /**
2553            * Updates whether the user is locked out from logging in.
2554            *
2555            * @param companyId the primary key of the user's company
2556            * @param screenName the user's screen name
2557            * @param lockout whether the user is locked out
2558            * @return the user
2559            * @throws PortalException if a user with the screen name could not be
2560            found
2561            * @throws SystemException if a system exception occurred
2562            */
2563            public static com.liferay.portal.model.User updateLockoutByScreenName(
2564                    long companyId, java.lang.String screenName, boolean lockout)
2565                    throws com.liferay.portal.kernel.exception.PortalException,
2566                            com.liferay.portal.kernel.exception.SystemException {
2567                    return getService()
2568                                       .updateLockoutByScreenName(companyId, screenName, lockout);
2569            }
2570    
2571            /**
2572            * Updates the user's modified date.
2573            *
2574            * @param userId the primary key of the user
2575            * @param modifiedDate the new modified date
2576            * @return the user
2577            * @throws PortalException if a user with the primary key could not be
2578            found
2579            * @throws SystemException if a system exception occurred
2580            */
2581            public static com.liferay.portal.model.User updateModifiedDate(
2582                    long userId, java.util.Date modifiedDate)
2583                    throws com.liferay.portal.kernel.exception.PortalException,
2584                            com.liferay.portal.kernel.exception.SystemException {
2585                    return getService().updateModifiedDate(userId, modifiedDate);
2586            }
2587    
2588            /**
2589            * Updates the user's OpenID.
2590            *
2591            * @param userId the primary key of the user
2592            * @param openId the new OpenID
2593            * @return the user
2594            * @throws PortalException if a user with the primary key could not be
2595            found
2596            * @throws SystemException if a system exception occurred
2597            */
2598            public static com.liferay.portal.model.User updateOpenId(long userId,
2599                    java.lang.String openId)
2600                    throws com.liferay.portal.kernel.exception.PortalException,
2601                            com.liferay.portal.kernel.exception.SystemException {
2602                    return getService().updateOpenId(userId, openId);
2603            }
2604    
2605            /**
2606            * Sets the organizations that the user is in, removing and adding
2607            * organizations as necessary.
2608            *
2609            * @param userId the primary key of the user
2610            * @param newOrganizationIds the primary keys of the organizations
2611            * @throws PortalException if a user with the primary key could not be
2612            found
2613            * @throws SystemException if a system exception occurred
2614            */
2615            public static void updateOrganizations(long userId,
2616                    long[] newOrganizationIds,
2617                    com.liferay.portal.service.ServiceContext serviceContext)
2618                    throws com.liferay.portal.kernel.exception.PortalException,
2619                            com.liferay.portal.kernel.exception.SystemException {
2620                    getService()
2621                            .updateOrganizations(userId, newOrganizationIds, serviceContext);
2622            }
2623    
2624            /**
2625            * Updates the user's password without tracking or validation of the
2626            * change.
2627            *
2628            * @param userId the primary key of the user
2629            * @param password1 the user's new password
2630            * @param password2 the user's new password confirmation
2631            * @param passwordReset whether the user should be asked to reset their
2632            password the next time they log in
2633            * @return the user
2634            * @throws PortalException if a user with the primary key could not be
2635            found
2636            * @throws SystemException if a system exception occurred
2637            */
2638            public static com.liferay.portal.model.User updatePassword(long userId,
2639                    java.lang.String password1, java.lang.String password2,
2640                    boolean passwordReset)
2641                    throws com.liferay.portal.kernel.exception.PortalException,
2642                            com.liferay.portal.kernel.exception.SystemException {
2643                    return getService()
2644                                       .updatePassword(userId, password1, password2, passwordReset);
2645            }
2646    
2647            /**
2648            * Updates the user's password, optionally with tracking and validation of
2649            * the change.
2650            *
2651            * @param userId the primary key of the user
2652            * @param password1 the user's new password
2653            * @param password2 the user's new password confirmation
2654            * @param passwordReset whether the user should be asked to reset their
2655            password the next time they login
2656            * @param silentUpdate whether the password should be updated without
2657            being tracked, or validated. Primarily used for password
2658            imports.
2659            * @return the user
2660            * @throws PortalException if a user with the primary key could not be
2661            found
2662            * @throws SystemException if a system exception occurred
2663            */
2664            public static com.liferay.portal.model.User updatePassword(long userId,
2665                    java.lang.String password1, java.lang.String password2,
2666                    boolean passwordReset, boolean silentUpdate)
2667                    throws com.liferay.portal.kernel.exception.PortalException,
2668                            com.liferay.portal.kernel.exception.SystemException {
2669                    return getService()
2670                                       .updatePassword(userId, password1, password2, passwordReset,
2671                            silentUpdate);
2672            }
2673    
2674            /**
2675            * Updates the user's password with manually input information. This method
2676            * should only be used when performing maintenance.
2677            *
2678            * @param userId the primary key of the user
2679            * @param password the user's new password
2680            * @param passwordEncrypted the user's new encrypted password
2681            * @param passwordReset whether the user should be asked to reset their
2682            password the next time they login
2683            * @param passwordModifiedDate the new password modified date
2684            * @return the user
2685            * @throws PortalException if a user with the primary key could not be
2686            found
2687            * @throws SystemException if a system exception occurred
2688            */
2689            public static com.liferay.portal.model.User updatePasswordManually(
2690                    long userId, java.lang.String password, boolean passwordEncrypted,
2691                    boolean passwordReset, java.util.Date passwordModifiedDate)
2692                    throws com.liferay.portal.kernel.exception.PortalException,
2693                            com.liferay.portal.kernel.exception.SystemException {
2694                    return getService()
2695                                       .updatePasswordManually(userId, password, passwordEncrypted,
2696                            passwordReset, passwordModifiedDate);
2697            }
2698    
2699            /**
2700            * Updates whether the user should be asked to reset their password the
2701            * next time they login.
2702            *
2703            * @param userId the primary key of the user
2704            * @param passwordReset whether the user should be asked to reset their
2705            password the next time they login
2706            * @return the user
2707            * @throws PortalException if a user with the primary key could not be
2708            found
2709            * @throws SystemException if a system exception occurred
2710            */
2711            public static com.liferay.portal.model.User updatePasswordReset(
2712                    long userId, boolean passwordReset)
2713                    throws com.liferay.portal.kernel.exception.PortalException,
2714                            com.liferay.portal.kernel.exception.SystemException {
2715                    return getService().updatePasswordReset(userId, passwordReset);
2716            }
2717    
2718            /**
2719            * Updates the user's portrait image.
2720            *
2721            * @param userId the primary key of the user
2722            * @param bytes the new portrait image data
2723            * @return the user
2724            * @throws PortalException if a user with the primary key could not be
2725            found or if the new portrait was invalid
2726            * @throws SystemException if a system exception occurred
2727            */
2728            public static com.liferay.portal.model.User updatePortrait(long userId,
2729                    byte[] bytes)
2730                    throws com.liferay.portal.kernel.exception.PortalException,
2731                            com.liferay.portal.kernel.exception.SystemException {
2732                    return getService().updatePortrait(userId, bytes);
2733            }
2734    
2735            /**
2736            * Updates the user's password reset question and answer.
2737            *
2738            * @param userId the primary key of the user
2739            * @param question the user's new password reset question
2740            * @param answer the user's new password reset answer
2741            * @return the user
2742            * @throws PortalException if a user with the primary key could not be
2743            found or if the new question or answer were invalid
2744            * @throws SystemException if a system exception occurred
2745            */
2746            public static com.liferay.portal.model.User updateReminderQuery(
2747                    long userId, java.lang.String question, java.lang.String answer)
2748                    throws com.liferay.portal.kernel.exception.PortalException,
2749                            com.liferay.portal.kernel.exception.SystemException {
2750                    return getService().updateReminderQuery(userId, question, answer);
2751            }
2752    
2753            /**
2754            * Updates the user's screen name.
2755            *
2756            * @param userId the primary key of the user
2757            * @param screenName the user's new screen name
2758            * @return the user
2759            * @throws PortalException if a user with the primary key could not be
2760            found or if the new screen name was invalid
2761            * @throws SystemException if a system exception occurred
2762            */
2763            public static com.liferay.portal.model.User updateScreenName(long userId,
2764                    java.lang.String screenName)
2765                    throws com.liferay.portal.kernel.exception.PortalException,
2766                            com.liferay.portal.kernel.exception.SystemException {
2767                    return getService().updateScreenName(userId, screenName);
2768            }
2769    
2770            /**
2771            * Updates the user's workflow status.
2772            *
2773            * @param userId the primary key of the user
2774            * @param status the user's new workflow status
2775            * @return the user
2776            * @throws PortalException if a user with the primary key could not be
2777            found
2778            * @throws SystemException if a system exception occurred
2779            */
2780            public static com.liferay.portal.model.User updateStatus(long userId,
2781                    int status)
2782                    throws com.liferay.portal.kernel.exception.PortalException,
2783                            com.liferay.portal.kernel.exception.SystemException {
2784                    return getService().updateStatus(userId, status);
2785            }
2786    
2787            /**
2788            * Updates the user.
2789            *
2790            * @param userId the primary key of the user
2791            * @param oldPassword the user's old password
2792            * @param newPassword1 the user's new password (optionally
2793            <code>null</code>)
2794            * @param newPassword2 the user's new password confirmation (optionally
2795            <code>null</code>)
2796            * @param passwordReset whether the user should be asked to reset their
2797            password the next time they login
2798            * @param reminderQueryQuestion the user's new password reset question
2799            * @param reminderQueryAnswer the user's new password reset answer
2800            * @param screenName the user's new screen name
2801            * @param emailAddress the user's new email address
2802            * @param facebookId the user's new Facebook ID
2803            * @param openId the user's new OpenID
2804            * @param languageId the user's new language ID
2805            * @param timeZoneId the user's new time zone ID
2806            * @param greeting the user's new greeting
2807            * @param comments the user's new comments
2808            * @param firstName the user's new first name
2809            * @param middleName the user's new middle name
2810            * @param lastName the user's new last name
2811            * @param prefixId the user's new name prefix ID
2812            * @param suffixId the user's new name suffix ID
2813            * @param male whether user is male
2814            * @param birthdayMonth the user's new birthday month (0-based, meaning 0
2815            for January)
2816            * @param birthdayDay the user's new birthday day
2817            * @param birthdayYear the user's birthday year
2818            * @param smsSn the user's new SMS screen name
2819            * @param aimSn the user's new AIM screen name
2820            * @param facebookSn the user's new Facebook screen name
2821            * @param icqSn the user's new ICQ screen name
2822            * @param jabberSn the user's new Jabber screen name
2823            * @param msnSn the user's new MSN screen name
2824            * @param mySpaceSn the user's new MySpace screen name
2825            * @param skypeSn the user's new Skype screen name
2826            * @param twitterSn the user's new Twitter screen name
2827            * @param ymSn the user's new Yahoo! Messenger screen name
2828            * @param jobTitle the user's new job title
2829            * @param groupIds the primary keys of the user's groups
2830            * @param organizationIds the primary keys of the user's organizations
2831            * @param roleIds the primary keys of the user's roles
2832            * @param userGroupRoles the user user's group roles
2833            * @param userGroupIds the primary keys of the user's user groups
2834            * @param serviceContext the user's service context (optionally
2835            <code>null</code>). Can specify the user's universally unique
2836            identifier (with the <code>uuid</code> attribute), replacement
2837            asset category IDs, replacement asset tag names, and new expando
2838            bridge attributes.
2839            * @return the user
2840            * @throws PortalException if a user with the primary key could not be
2841            found or if the new information was invalid
2842            * @throws SystemException if a system exception occurred
2843            */
2844            public static com.liferay.portal.model.User updateUser(long userId,
2845                    java.lang.String oldPassword, java.lang.String newPassword1,
2846                    java.lang.String newPassword2, boolean passwordReset,
2847                    java.lang.String reminderQueryQuestion,
2848                    java.lang.String reminderQueryAnswer, java.lang.String screenName,
2849                    java.lang.String emailAddress, long facebookId,
2850                    java.lang.String openId, java.lang.String languageId,
2851                    java.lang.String timeZoneId, java.lang.String greeting,
2852                    java.lang.String comments, java.lang.String firstName,
2853                    java.lang.String middleName, java.lang.String lastName, int prefixId,
2854                    int suffixId, boolean male, int birthdayMonth, int birthdayDay,
2855                    int birthdayYear, java.lang.String smsSn, java.lang.String aimSn,
2856                    java.lang.String facebookSn, java.lang.String icqSn,
2857                    java.lang.String jabberSn, java.lang.String msnSn,
2858                    java.lang.String mySpaceSn, java.lang.String skypeSn,
2859                    java.lang.String twitterSn, java.lang.String ymSn,
2860                    java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
2861                    long[] roleIds,
2862                    java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles,
2863                    long[] userGroupIds,
2864                    com.liferay.portal.service.ServiceContext serviceContext)
2865                    throws com.liferay.portal.kernel.exception.PortalException,
2866                            com.liferay.portal.kernel.exception.SystemException {
2867                    return getService()
2868                                       .updateUser(userId, oldPassword, newPassword1, newPassword2,
2869                            passwordReset, reminderQueryQuestion, reminderQueryAnswer,
2870                            screenName, emailAddress, facebookId, openId, languageId,
2871                            timeZoneId, greeting, comments, firstName, middleName, lastName,
2872                            prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear,
2873                            smsSn, aimSn, facebookSn, icqSn, jabberSn, msnSn, mySpaceSn,
2874                            skypeSn, twitterSn, ymSn, jobTitle, groupIds, organizationIds,
2875                            roleIds, userGroupRoles, userGroupIds, serviceContext);
2876            }
2877    
2878            /**
2879            * Verifies the email address of the ticket.
2880            *
2881            * @param ticketKey the ticket key
2882            * @throws PortalException if a ticket matching the ticket key could not be
2883            found, if the ticket has expired, if the ticket is an email
2884            address ticket, or if the email address is invalid
2885            * @throws SystemException if a system exception occurred
2886            */
2887            public static void verifyEmailAddress(java.lang.String ticketKey)
2888                    throws com.liferay.portal.kernel.exception.PortalException,
2889                            com.liferay.portal.kernel.exception.SystemException {
2890                    getService().verifyEmailAddress(ticketKey);
2891            }
2892    
2893            public static UserLocalService getService() {
2894                    if (_service == null) {
2895                            _service = (UserLocalService)PortalBeanLocatorUtil.locate(UserLocalService.class.getName());
2896    
2897                            ReferenceRegistry.registerReference(UserLocalServiceUtil.class,
2898                                    "_service");
2899                            MethodCache.remove(UserLocalService.class);
2900                    }
2901    
2902                    return _service;
2903            }
2904    
2905            public void setService(UserLocalService service) {
2906                    MethodCache.remove(UserLocalService.class);
2907    
2908                    _service = service;
2909    
2910                    ReferenceRegistry.registerReference(UserLocalServiceUtil.class,
2911                            "_service");
2912                    MethodCache.remove(UserLocalService.class);
2913            }
2914    
2915            private static UserLocalService _service;
2916    }