1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service;
24  
25  import com.liferay.portal.PortalException;
26  import com.liferay.portal.SystemException;
27  import com.liferay.portal.kernel.annotation.Propagation;
28  import com.liferay.portal.kernel.annotation.Transactional;
29  
30  /**
31   * <a href="UserService.java.html"><b><i>View Source</i></b></a>
32   *
33   * <p>
34   * ServiceBuilder generated this class. Modifications in this class will be
35   * overwritten the next time is generated.
36   * </p>
37   *
38   * <p>
39   * This interface defines the service. The default implementation is
40   * <code>com.liferay.portal.service.impl.UserServiceImpl</code>.
41   * Modify methods in that class and rerun ServiceBuilder to populate this class
42   * and all other generated classes.
43   * </p>
44   *
45   * <p>
46   * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
47   * </p>
48   *
49   * @author Brian Wing Shun Chan
50   *
51   * @see com.liferay.portal.service.UserServiceUtil
52   *
53   */
54  @Transactional(rollbackFor =  {
55      PortalException.class, SystemException.class})
56  public interface UserService {
57      public void addGroupUsers(long groupId, long[] userIds)
58          throws com.liferay.portal.PortalException,
59              com.liferay.portal.SystemException;
60  
61      public void addOrganizationUsers(long organizationId, long[] userIds)
62          throws com.liferay.portal.PortalException,
63              com.liferay.portal.SystemException;
64  
65      public void addPasswordPolicyUsers(long passwordPolicyId, long[] userIds)
66          throws com.liferay.portal.PortalException,
67              com.liferay.portal.SystemException;
68  
69      public void addRoleUsers(long roleId, long[] userIds)
70          throws com.liferay.portal.PortalException,
71              com.liferay.portal.SystemException;
72  
73      public void addUserGroupUsers(long userGroupId, long[] userIds)
74          throws com.liferay.portal.PortalException,
75              com.liferay.portal.SystemException;
76  
77      public com.liferay.portal.model.User addUser(long companyId,
78          boolean autoPassword, java.lang.String password1,
79          java.lang.String password2, boolean autoScreenName,
80          java.lang.String screenName, java.lang.String emailAddress,
81          java.lang.String openId, java.util.Locale locale,
82          java.lang.String firstName, java.lang.String middleName,
83          java.lang.String lastName, int prefixId, int suffixId, boolean male,
84          int birthdayMonth, int birthdayDay, int birthdayYear,
85          java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
86          long[] roleIds, long[] userGroupIds, boolean sendEmail,
87          com.liferay.portal.service.ServiceContext serviceContext)
88          throws com.liferay.portal.PortalException,
89              com.liferay.portal.SystemException;
90  
91      public com.liferay.portal.model.User addUser(long companyId,
92          boolean autoPassword, java.lang.String password1,
93          java.lang.String password2, boolean autoScreenName,
94          java.lang.String screenName, java.lang.String emailAddress,
95          java.lang.String openId, java.util.Locale locale,
96          java.lang.String firstName, java.lang.String middleName,
97          java.lang.String lastName, int prefixId, int suffixId, boolean male,
98          int birthdayMonth, int birthdayDay, int birthdayYear,
99          java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
100         long[] roleIds, long[] userGroupIds, boolean sendEmail,
101         java.util.List<com.liferay.portal.model.Address> addresses,
102         java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
103         java.util.List<com.liferay.portal.model.Phone> phones,
104         java.util.List<com.liferay.portal.model.Website> websites,
105         java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDelivers,
106         com.liferay.portal.service.ServiceContext serviceContext)
107         throws com.liferay.portal.PortalException,
108             com.liferay.portal.SystemException;
109 
110     public void deletePortrait(long userId)
111         throws com.liferay.portal.PortalException,
112             com.liferay.portal.SystemException;
113 
114     public void deleteRoleUser(long roleId, long userId)
115         throws com.liferay.portal.PortalException,
116             com.liferay.portal.SystemException;
117 
118     public void deleteUser(long userId)
119         throws com.liferay.portal.PortalException,
120             com.liferay.portal.SystemException;
121 
122     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
123     public long getDefaultUserId(long companyId)
124         throws com.liferay.portal.PortalException,
125             com.liferay.portal.SystemException;
126 
127     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
128     public long[] getGroupUserIds(long groupId)
129         throws com.liferay.portal.SystemException;
130 
131     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
132     public long[] getOrganizationUserIds(long organizationId)
133         throws com.liferay.portal.SystemException;
134 
135     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
136     public long[] getRoleUserIds(long roleId)
137         throws com.liferay.portal.SystemException;
138 
139     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
140     public com.liferay.portal.model.User getUserByEmailAddress(long companyId,
141         java.lang.String emailAddress)
142         throws com.liferay.portal.PortalException,
143             com.liferay.portal.SystemException;
144 
145     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
146     public com.liferay.portal.model.User getUserById(long userId)
147         throws com.liferay.portal.PortalException,
148             com.liferay.portal.SystemException;
149 
150     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
151     public com.liferay.portal.model.User getUserByScreenName(long companyId,
152         java.lang.String screenName)
153         throws com.liferay.portal.PortalException,
154             com.liferay.portal.SystemException;
155 
156     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
157     public long getUserIdByEmailAddress(long companyId,
158         java.lang.String emailAddress)
159         throws com.liferay.portal.PortalException,
160             com.liferay.portal.SystemException;
161 
162     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
163     public long getUserIdByScreenName(long companyId,
164         java.lang.String screenName)
165         throws com.liferay.portal.PortalException,
166             com.liferay.portal.SystemException;
167 
168     public boolean hasGroupUser(long groupId, long userId)
169         throws com.liferay.portal.SystemException;
170 
171     public boolean hasRoleUser(long roleId, long userId)
172         throws com.liferay.portal.SystemException;
173 
174     public void setRoleUsers(long roleId, long[] userIds)
175         throws com.liferay.portal.PortalException,
176             com.liferay.portal.SystemException;
177 
178     public void setUserGroupUsers(long userGroupId, long[] userIds)
179         throws com.liferay.portal.PortalException,
180             com.liferay.portal.SystemException;
181 
182     public void unsetGroupUsers(long groupId, long[] userIds)
183         throws com.liferay.portal.PortalException,
184             com.liferay.portal.SystemException;
185 
186     public void unsetOrganizationUsers(long organizationId, long[] userIds)
187         throws com.liferay.portal.PortalException,
188             com.liferay.portal.SystemException;
189 
190     public void unsetPasswordPolicyUsers(long passwordPolicyId, long[] userIds)
191         throws com.liferay.portal.PortalException,
192             com.liferay.portal.SystemException;
193 
194     public void unsetRoleUsers(long roleId, long[] userIds)
195         throws com.liferay.portal.PortalException,
196             com.liferay.portal.SystemException;
197 
198     public void unsetUserGroupUsers(long userGroupId, long[] userIds)
199         throws com.liferay.portal.PortalException,
200             com.liferay.portal.SystemException;
201 
202     public com.liferay.portal.model.User updateActive(long userId,
203         boolean active)
204         throws com.liferay.portal.PortalException,
205             com.liferay.portal.SystemException;
206 
207     public com.liferay.portal.model.User updateAgreedToTermsOfUse(long userId,
208         boolean agreedToTermsOfUse)
209         throws com.liferay.portal.PortalException,
210             com.liferay.portal.SystemException;
211 
212     public void updateEmailAddress(long userId, java.lang.String password,
213         java.lang.String emailAddress1, java.lang.String emailAddress2)
214         throws com.liferay.portal.PortalException,
215             com.liferay.portal.SystemException;
216 
217     public com.liferay.portal.model.User updateLockout(long userId,
218         boolean lockout)
219         throws com.liferay.portal.PortalException,
220             com.liferay.portal.SystemException;
221 
222     public void updateOpenId(long userId, java.lang.String openId)
223         throws com.liferay.portal.PortalException,
224             com.liferay.portal.SystemException;
225 
226     public void updateOrganizations(long userId, long[] organizationIds)
227         throws com.liferay.portal.PortalException,
228             com.liferay.portal.SystemException;
229 
230     public com.liferay.portal.model.User updatePassword(long userId,
231         java.lang.String password1, java.lang.String password2,
232         boolean passwordReset)
233         throws com.liferay.portal.PortalException,
234             com.liferay.portal.SystemException;
235 
236     public void updatePortrait(long userId, byte[] bytes)
237         throws com.liferay.portal.PortalException,
238             com.liferay.portal.SystemException;
239 
240     public void updateReminderQuery(long userId, java.lang.String question,
241         java.lang.String answer)
242         throws com.liferay.portal.PortalException,
243             com.liferay.portal.SystemException;
244 
245     public void updateScreenName(long userId, java.lang.String screenName)
246         throws com.liferay.portal.PortalException,
247             com.liferay.portal.SystemException;
248 
249     public com.liferay.portal.model.User updateUser(long userId,
250         java.lang.String oldPassword, java.lang.String newPassword1,
251         java.lang.String newPassword2, boolean passwordReset,
252         java.lang.String reminderQueryQuestion,
253         java.lang.String reminderQueryAnswer, java.lang.String screenName,
254         java.lang.String emailAddress, java.lang.String openId,
255         java.lang.String languageId, java.lang.String timeZoneId,
256         java.lang.String greeting, java.lang.String comments,
257         java.lang.String firstName, java.lang.String middleName,
258         java.lang.String lastName, int prefixId, int suffixId, boolean male,
259         int birthdayMonth, int birthdayDay, int birthdayYear,
260         java.lang.String smsSn, java.lang.String aimSn,
261         java.lang.String facebookSn, java.lang.String icqSn,
262         java.lang.String jabberSn, java.lang.String msnSn,
263         java.lang.String mySpaceSn, java.lang.String skypeSn,
264         java.lang.String twitterSn, java.lang.String ymSn,
265         java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
266         long[] roleIds,
267         java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles,
268         long[] userGroupIds,
269         com.liferay.portal.service.ServiceContext serviceContext)
270         throws com.liferay.portal.PortalException,
271             com.liferay.portal.SystemException;
272 
273     public com.liferay.portal.model.User updateUser(long userId,
274         java.lang.String oldPassword, java.lang.String newPassword1,
275         java.lang.String newPassword2, boolean passwordReset,
276         java.lang.String reminderQueryQuestion,
277         java.lang.String reminderQueryAnswer, java.lang.String screenName,
278         java.lang.String emailAddress, java.lang.String openId,
279         java.lang.String languageId, java.lang.String timeZoneId,
280         java.lang.String greeting, java.lang.String comments,
281         java.lang.String firstName, java.lang.String middleName,
282         java.lang.String lastName, int prefixId, int suffixId, boolean male,
283         int birthdayMonth, int birthdayDay, int birthdayYear,
284         java.lang.String smsSn, java.lang.String aimSn,
285         java.lang.String facebookSn, java.lang.String icqSn,
286         java.lang.String jabberSn, java.lang.String msnSn,
287         java.lang.String mySpaceSn, java.lang.String skypeSn,
288         java.lang.String twitterSn, java.lang.String ymSn,
289         java.lang.String jobTitle, long[] groupIds, long[] organizationIds,
290         long[] roleIds,
291         java.util.List<com.liferay.portal.model.UserGroupRole> userGroupRoles,
292         long[] userGroupIds,
293         java.util.List<com.liferay.portal.model.Address> addresses,
294         java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses,
295         java.util.List<com.liferay.portal.model.Phone> phones,
296         java.util.List<com.liferay.portal.model.Website> websites,
297         java.util.List<com.liferay.portlet.announcements.model.AnnouncementsDelivery> announcementsDelivers,
298         com.liferay.portal.service.ServiceContext serviceContext)
299         throws com.liferay.portal.PortalException,
300             com.liferay.portal.SystemException;
301 }