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