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.security.ldap;
016    
017    import com.liferay.portal.kernel.util.LocaleUtil;
018    import com.liferay.portal.model.Contact;
019    import com.liferay.portal.model.User;
020    import com.liferay.portal.model.UserGroupRole;
021    import com.liferay.portal.service.ServiceContext;
022    
023    import java.util.Date;
024    import java.util.List;
025    import java.util.Locale;
026    import java.util.Map;
027    
028    /**
029     * @author Edward Han
030     * @author Brian Wing Shun Chan
031     */
032    public class LDAPUser {
033    
034            public Date getBirthday() {
035                    return _contact.getBirthday();
036            }
037    
038            public String getComments() {
039                    return _user.getComments();
040            }
041    
042            public Contact getContact() {
043                    return _contact;
044            }
045    
046            public Map<String, String[]> getContactExpandoAttributes() {
047                    return _contactExpandoAttributes;
048            }
049    
050            public long getCreatorUserId() {
051                    return _creatorUserId;
052            }
053    
054            public String getEmailAddress() {
055                    return _user.getEmailAddress();
056            }
057    
058            public long getFacebookId() {
059                    return _user.getFacebookId();
060            }
061    
062            public String getFacebookSn() {
063                    return _contact.getFacebookSn();
064            }
065    
066            public String getFirstName() {
067                    return _user.getFirstName();
068            }
069    
070            public String getGreeting() {
071                    return _user.getGreeting();
072            }
073    
074            public long[] getGroupIds() {
075                    return _groupIds;
076            }
077    
078            public String getJabberSn() {
079                    return _contact.getJabberSn();
080            }
081    
082            public String getJobTitle() {
083                    return _user.getJobTitle();
084            }
085    
086            public String getLanguageId() {
087                    return _user.getLanguageId();
088            }
089    
090            public String getLastName() {
091                    return _user.getLastName();
092            }
093    
094            public Locale getLocale() {
095                    return _user.getLocale();
096            }
097    
098            public String getMiddleName() {
099                    return _user.getMiddleName();
100            }
101    
102            public String getOpenId() {
103                    return _user.getOpenId();
104            }
105    
106            public long[] getOrganizationIds() {
107                    return _organizationIds;
108            }
109    
110            public byte[] getPortraitBytes() {
111                    return _portraitBytes;
112            }
113    
114            public long getPortraitId() {
115                    return _user.getPortraitId();
116            }
117    
118            public long getPrefixId() {
119                    return _contact.getPrefixId();
120            }
121    
122            public String getReminderQueryAnswer() {
123                    return _user.getReminderQueryAnswer();
124            }
125    
126            public String getReminderQueryQuestion() {
127                    return _user.getReminderQueryQuestion();
128            }
129    
130            public long[] getRoleIds() {
131                    return _roleIds;
132            }
133    
134            public String getScreenName() {
135                    return _user.getScreenName();
136            }
137    
138            public ServiceContext getServiceContext() {
139                    return _serviceContext;
140            }
141    
142            public String getSkypeSn() {
143                    return _contact.getSkypeSn();
144            }
145    
146            public String getSmsSn() {
147                    return _contact.getSmsSn();
148            }
149    
150            public int getStatus() {
151                    return _user.getStatus();
152            }
153    
154            public long getSuffixId() {
155                    return _contact.getSuffixId();
156            }
157    
158            public String getTimeZoneId() {
159                    return _user.getTimeZoneId();
160            }
161    
162            public String getTwitterSn() {
163                    return _contact.getTwitterSn();
164            }
165    
166            public User getUser() {
167                    return _user;
168            }
169    
170            public Map<String, String[]> getUserExpandoAttributes() {
171                    return _userExpandoAttributes;
172            }
173    
174            public long[] getUserGroupIds() {
175                    return _userGroupIds;
176            }
177    
178            public List<UserGroupRole> getUserGroupRoles() {
179                    return _userGroupRoles;
180            }
181    
182            public boolean isAutoPassword() {
183                    return _autoPassword;
184            }
185    
186            public boolean isAutoScreenName() {
187                    return _autoScreenName;
188            }
189    
190            public boolean isMale() {
191                    return _contact.isMale();
192            }
193    
194            /**
195             * @deprecated As of 6.2.0, replaced by {@link #setMale(boolean)}
196             */
197            @Deprecated
198            public void isMale(boolean male) {
199                    setMale(male);
200            }
201    
202            public boolean isPasswordReset() {
203                    return _passwordReset;
204            }
205    
206            public boolean isSendEmail() {
207                    return _sendEmail;
208            }
209    
210            public boolean isUpdatePassword() {
211                    return _updatePassword;
212            }
213    
214            public boolean isUpdatePortrait() {
215                    return _updatePortrait;
216            }
217    
218            public void setAutoPassword(boolean autoPassword) {
219                    _autoPassword = autoPassword;
220            }
221    
222            public void setAutoScreenName(boolean autoScreenName) {
223                    _autoScreenName = autoScreenName;
224            }
225    
226            public void setBirthday(Date birthday) {
227                    _contact.setBirthday(birthday);
228            }
229    
230            public void setComments(String comments) {
231                    _user.setComments(comments);
232            }
233    
234            public void setContact(Contact contact) {
235                    _contact = contact;
236            }
237    
238            public void setContactExpandoAttributes(
239                    Map<String, String[]> contactExpandoAttributes) {
240    
241                    _contactExpandoAttributes = contactExpandoAttributes;
242            }
243    
244            public void setCreatorUserId(long creatorUserId) {
245                    _creatorUserId = creatorUserId;
246            }
247    
248            public void setEmailAddress(String emailAddress) {
249                    _user.setEmailAddress(emailAddress);
250            }
251    
252            public void setFacebookId(long facebookId) {
253                    _user.setFacebookId(facebookId);
254            }
255    
256            public void setFacebookSn(String facebookSn) {
257                    _contact.setFacebookSn(facebookSn);
258            }
259    
260            public void setFirstName(String firstName) {
261                    _user.setFirstName(firstName);
262            }
263    
264            public void setGreeting(String greeting) {
265                    _user.setGreeting(greeting);
266            }
267    
268            public void setGroupIds(long[] groupIds) {
269                    _groupIds = groupIds;
270            }
271    
272            public void setJabberSn(String jabberSn) {
273                    _contact.setJabberSn(jabberSn);
274            }
275    
276            public void setJobTitle(String jobTitle) {
277                    _user.setJobTitle(jobTitle);
278            }
279    
280            public void setLanguageId(String languageId) {
281                    _user.setLanguageId(languageId);
282            }
283    
284            public void setLastName(String lastName) {
285                    _user.setLastName(lastName);
286            }
287    
288            public void setLocale(Locale locale) {
289                    _user.setLanguageId(LocaleUtil.toLanguageId(locale));
290            }
291    
292            public void setMale(boolean male) {
293                    _contact.setMale(male);
294            }
295    
296            public void setMiddleName(String middleName) {
297                    _user.setMiddleName(middleName);
298            }
299    
300            public void setOpenId(String openId) {
301                    _user.setOpenId(openId);
302            }
303    
304            public void setOrganizationIds(long[] organizationIds) {
305                    _organizationIds = organizationIds;
306            }
307    
308            public void setPasswordReset(boolean passwordReset) {
309                    _passwordReset = passwordReset;
310            }
311    
312            public void setPortraitBytes(byte[] portraitBytes) {
313                    _portraitBytes = portraitBytes;
314            }
315    
316            public void setPrefixId(long prefixId) {
317                    _contact.setPrefixId(prefixId);
318            }
319    
320            public void setReminderQueryAnswer(String reminderQueryAnswer) {
321                    _user.setReminderQueryAnswer(reminderQueryAnswer);
322            }
323    
324            public void setReminderQueryQuestion(String reminderQueryQuestion) {
325                    _user.setReminderQueryQuestion(reminderQueryQuestion);
326            }
327    
328            public void setRoleIds(long[] roleIds) {
329                    _roleIds = roleIds;
330            }
331    
332            public void setScreenName(String screenName) {
333                    _user.setScreenName(screenName);
334            }
335    
336            public void setSendEmail(boolean sendEmail) {
337                    _sendEmail = sendEmail;
338            }
339    
340            public void setServiceContext(ServiceContext serviceContext) {
341                    _serviceContext = serviceContext;
342            }
343    
344            public void setSkypeSn(String skypeSn) {
345                    _contact.setSkypeSn(skypeSn);
346            }
347    
348            public void setSmsSn(String smsSn) {
349                    _contact.setSmsSn(smsSn);
350            }
351    
352            public void setStatus(int status) {
353                    _user.setStatus(status);
354            }
355    
356            public void setSuffixId(long suffixId) {
357                    _contact.setSuffixId(suffixId);
358            }
359    
360            public void setTimeZoneId(String timeZoneId) {
361                    _user.setTimeZoneId(timeZoneId);
362            }
363    
364            public void setTwitterSn(String twitterSn) {
365                    _contact.setTwitterSn(twitterSn);
366            }
367    
368            public void setUpdatePassword(boolean updatePassword) {
369                    _updatePassword = updatePassword;
370            }
371    
372            public void setUpdatePortrait(boolean updatePortrait) {
373                    _updatePortrait = updatePortrait;
374            }
375    
376            public void setUser(User user) {
377                    _user = user;
378            }
379    
380            public void setUserExpandoAttributes(
381                    Map<String, String[]> userExpandoAttributes) {
382    
383                    _userExpandoAttributes = userExpandoAttributes;
384            }
385    
386            public void setUserGroupIds(long[] userGroupIds) {
387                    _userGroupIds = userGroupIds;
388            }
389    
390            public void setUserGroupRoles(List<UserGroupRole> userGroupRoles) {
391                    _userGroupRoles = userGroupRoles;
392            }
393    
394            private boolean _autoPassword;
395            private boolean _autoScreenName;
396            private Contact _contact;
397            private Map<String, String[]> _contactExpandoAttributes;
398            private long _creatorUserId;
399            private long[] _groupIds;
400            private long[] _organizationIds;
401            private boolean _passwordReset;
402            private byte[] _portraitBytes;
403            private long[] _roleIds;
404            private boolean _sendEmail;
405            private ServiceContext _serviceContext;
406            private boolean _updatePassword;
407            private boolean _updatePortrait;
408            private User _user;
409            private Map<String, String[]> _userExpandoAttributes;
410            private long[] _userGroupIds;
411            private List<UserGroupRole> _userGroupRoles;
412    
413    }