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