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