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