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