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