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