001: /*
002: * Copyright (c) 2001 - 2005 ivata limited.
003: * All rights reserved.
004: * -----------------------------------------------------------------------------
005: * ivata groupware may be redistributed under the GNU General Public
006: * License as published by the Free Software Foundation;
007: * version 2 of the License.
008: *
009: * These programs are free software; you can redistribute them and/or
010: * modify them under the terms of the GNU General Public License
011: * as published by the Free Software Foundation; version 2 of the License.
012: *
013: * These programs are distributed in the hope that they will be useful,
014: * but WITHOUT ANY WARRANTY; without even the implied warranty of
015: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
016: *
017: * See the GNU General Public License in the file LICENSE.txt for more
018: * details.
019: *
020: * If you would like a copy of the GNU General Public License write to
021: *
022: * Free Software Foundation, Inc.
023: * 59 Temple Place - Suite 330
024: * Boston, MA 02111-1307, USA.
025: *
026: *
027: * To arrange commercial support and licensing, contact ivata at
028: * http://www.ivata.com/contact.jsp
029: * -----------------------------------------------------------------------------
030: * $Log: PersonDO.java,v $
031: * Revision 1.8 2005/10/11 18:53:06 colinmacleod
032: * Fixed some checkstyle and javadoc issues.
033: *
034: * Revision 1.7 2005/10/02 14:08:55 colinmacleod
035: * Added/improved log4j logging.
036: *
037: * Revision 1.6 2005/09/29 13:22:44 colinmacleod
038: * Added read-only functionality to data object classes (with a check on each
039: * setter).
040: *
041: * Revision 1.5 2005/09/15 10:23:23 colinmacleod
042: * Upgraded Maven to 1.1 (beta-2).
043: * Upgraded Hibernate to 3.0.5.
044: *
045: * Revision 1.4 2005/09/14 14:52:01 colinmacleod
046: * Added serialVersionUID.
047: *
048: * Revision 1.3 2005/04/10 18:47:34 colinmacleod
049: * Changed i tag to em and b tag to strong.
050: *
051: * Revision 1.2 2005/04/09 17:19:07 colinmacleod
052: * Changed copyright text to GPL v2 explicitly.
053: *
054: * Revision 1.1.1.1 2005/03/10 17:50:31 colinmacleod
055: * Restructured ivata op around Hibernate/PicoContainer.
056: * Renamed ivata groupware.
057: *
058: * Revision 1.7 2004/11/12 15:57:05 colinmacleod
059: * Removed dependencies on SSLEXT.
060: * Moved Persistence classes to ivata masks.
061: *
062: * Revision 1.6 2004/11/03 15:34:06 colinmacleod
063: * Changed relationship between person and address:
064: * each person for now has exactly one address.
065: *
066: * Revision 1.5 2004/07/18 21:59:10 colinmacleod
067: * Removed Person from User - now you need to use addressbook/persistence
068: * manager to find the person (makes the app run faster.)
069: *
070: * Revision 1.4 2004/07/13 19:41:13 colinmacleod
071: * Moved project to POJOs from EJBs.
072: * Applied PicoContainer to services layer (replacing session EJBs).
073: * Applied Hibernate to persistence layer (replacing entity EJBs).
074: *
075: * Revision 1.3 2004/03/21 21:16:06 colinmacleod
076: * Shortened name to ivata op.
077: *
078: * Revision 1.2 2004/02/01 22:00:32 colinmacleod
079: * Added full names to author tags
080: *
081: * Revision 1.1.1.1 2004/01/27 20:57:50 colinmacleod
082: * Moved ivata openportal to SourceForge..
083: *
084: * Revision 1.3 2003/10/17 12:36:12 jano
085: * fixing problems with building
086: * converting intranet -> portal
087: * Eclipse building
088: *
089: * Revision 1.2 2003/10/15 13:18:02 colin
090: * fixing for XDoclet
091: *
092: * Revision 1.7 2003/08/21 09:50:03 jano
093: * we have new field in personDO : memberOfUserGroups
094: *
095: * Revision 1.6 2003/08/20 16:24:27 jano
096: * fixing addressBook extension
097: *
098: * Revision 1.5 2003/08/05 14:57:35 jano
099: * addressBook extension
100: *
101: * Revision 1.4 2003/07/25 11:41:22 jano
102: * adding functionality for addressBook extension
103: *
104: * Revision 1.3 2003/06/02 22:04:29 colin
105: * added comparison method
106: *
107: * Revision 1.2 2003/04/09 08:52:53 jano
108: * handling data of removing user
109: *
110: * Revision 1.1 2003/02/24 19:09:21 colin
111: * moved to business
112: *
113: * Revision 1.12 2003/02/21 16:18:36 peter
114: * dateFormatter and birthDate Strings access taken off
115: *
116: * Revision 1.11 2003/02/18 11:08:54 colin
117: * fixes in setTelecomAddress...(int...
118: *
119: * Revision 1.10 2003/02/04 17:43:44 colin
120: * copyright notice
121: *
122: * Revision 1.9 2003/01/09 13:32:19 jano
123: * we have fiield in Person called : createdBy - its name of user who created
124: * that contact
125: *
126: * Revision 1.8 2002/12/19 12:56:02 jano
127: * when contact is read only then showonly name of main group
128: *
129: * Revision 1.7 2002/09/17 08:40:11 colin
130: * added checkDO which can be used to check before a new person is added
131: * improved methods for adding telecom addresses to the DO
132: *
133: * Revision 1.6 2002/09/09 08:37:38 colin
134: * improved documentation
135: * finished employee implementation via PersonBean.setDO
136: *
137: * Revision 1.5 2002/08/30 09:49:12 colin
138: * added employee EJB
139: * made country a separate EJB for address
140: *
141: * Revision 1.4 2002/08/29 08:49:21 jano
142: * renamed field department to mainGroup
143: *
144: * Revision 1.3 2002/06/28 13:15:23 colin
145: * first addressbook release
146: *
147: * Revision 1.2 2002/06/17 07:28:49 colin
148: * improved and extended javadoc documentation
149: *
150: * Revision 1.1 2002/06/13 11:21:24 colin
151: * first version with rose model integration.
152: * -----------------------------------------------------------------------------
153: */
154: package com.ivata.groupware.business.addressbook.person;
155:
156: import org.apache.log4j.Logger;
157:
158: import java.util.Date;
159: import java.util.HashSet;
160: import java.util.Iterator;
161: import java.util.Set;
162:
163: import com.ivata.groupware.admin.security.user.UserDO;
164: import com.ivata.groupware.business.addressbook.address.AddressDO;
165: import com.ivata.groupware.business.addressbook.person.employee.EmployeeDO;
166: import com.ivata.groupware.business.addressbook.person.group.GroupDO;
167: import com.ivata.groupware.business.addressbook.telecomaddress.TelecomAddressConstants;
168: import com.ivata.groupware.business.addressbook.telecomaddress.TelecomAddressDO;
169: import com.ivata.groupware.container.persistence.AuthorTimestampNamedDO;
170: import com.ivata.mask.util.StringHandling;
171:
172: /**
173: * <p>Represents a single person within the intranet system. This person can
174: * be simply within the address book, or can be a user by having a
175: * {@link UserBean user} associated with it.</p>
176: *
177: * @since ivata groupware 0.9 (2002-05-12)
178: * @author Colin MacLeod
179: * <a href='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
180: * @version $Revision: 1.8 $
181: *
182: * @hibernate.class
183: * table="person"
184: * @hibernate.cache
185: * usage="read-write"
186: */
187: public class PersonDO extends AuthorTimestampNamedDO implements
188: Comparable {
189: /**
190: * Logger for this class.
191: */
192: private static final Logger logger = Logger
193: .getLogger(PersonDO.class);
194:
195: /**
196: * Serialization version (for <code>Serializable</code> interface).
197: */
198: private static final long serialVersionUID = 1L;
199:
200: /**
201: * <p>Store this person's address.</p>
202: */
203: private AddressDO address;
204:
205: /**
206: * <p>Store the company the person works for.</p>
207: */
208: private String company;
209:
210: /**
211: * <p>Store the person's date of birth.</p>
212: */
213: private Date dateOfBirth;
214:
215: /**
216: * <p>
217: * Stores whether or not this person is logically deleted. If a person
218: * is a user and is deleted, then (s)he will only be logically deleted.
219: * </p>
220: */
221: private boolean deleted;
222:
223: /**
224: * <p>Stores the employee record for this person as a data object.</p>
225: */
226: private EmployeeDO employee = null;
227:
228: /**
229: * <p>Store the string to file the person under in the address book.</p>
230: */
231: private String fileAs;
232:
233: /**
234: * <p>Store the person's first names.</p>
235: */
236: private String firstNames;
237:
238: /**
239: * <p>Stores the group of this person.</p>
240: */
241: private GroupDO group;
242:
243: /**
244: * <p>Store the job title for this person.</p>
245: */
246: private String jobTitle;
247:
248: /**
249: * <p>Store the person's last name.</p>
250: */
251: private String lastName;
252:
253: /**
254: * <p>Store the salutation with which this person likes to be greeted by
255: * post or email.</p>
256: */
257: private String salutation;
258:
259: /**
260: * <p>Store the communication addresses themeselves.</p>
261: */
262: private Set telecomAddresses = new HashSet();
263:
264: /**
265: * <p>Stores the user for this person.</p>
266: */
267: private UserDO user;
268:
269: /**
270: * Get all the addresses associated with this person.
271: *
272: * @return all addresses associated with this person.
273: *
274: * @hibernate.one-to-one
275: * cascade="all"
276: */
277: public AddressDO getAddress() {
278: if (logger.isDebugEnabled()) {
279: logger.debug("getAddress() - start");
280: }
281:
282: if (logger.isDebugEnabled()) {
283: logger.debug("getAddress() - end - return value = "
284: + address);
285: }
286: return address;
287: }
288:
289: /**
290: * <p>Get the company the person works for.</p>
291: *
292: * @return the company the person works for.
293: * @hibernate.property
294: * column="company"
295: */
296: public final String getCompany() {
297: if (logger.isDebugEnabled()) {
298: logger.debug("getCompany() - start");
299: }
300:
301: if (logger.isDebugEnabled()) {
302: logger.debug("getCompany() - end - return value = "
303: + company);
304: }
305: return company;
306: }
307:
308: /**
309: * <p>Get the person's date of birth.</p>
310: *
311: * @return the person's date of birth.
312: * @hibernate.property
313: * column="date_of_birth"
314: */
315: public final Date getDateOfBirth() {
316: if (logger.isDebugEnabled()) {
317: logger.debug("getDateOfBirth() - start");
318: }
319:
320: if (logger.isDebugEnabled()) {
321: logger.debug("getDateOfBirth() - end - return value = "
322: + dateOfBirth);
323: }
324: return dateOfBirth;
325: }
326:
327: /**
328: * <p>
329: * Return the first name(s), followed by a space, followed by the last name.
330: * </p>
331: *
332: * @see com.ivata.mask.valueobject.ValueObject#getDisplayValue()
333: */
334: public final String getDisplayValue() {
335: if (logger.isDebugEnabled()) {
336: logger.debug("getDisplayValue() - start");
337: }
338:
339: StringBuffer displayValue = new StringBuffer();
340: if (!StringHandling.isNullOrEmpty(firstNames)) {
341: displayValue.append(firstNames);
342: }
343: if (!StringHandling.isNullOrEmpty(firstNames)) {
344: if (displayValue.length() > 0) {
345: displayValue.append(" ");
346: }
347: displayValue.append(lastName);
348: }
349: String returnString = displayValue.toString();
350: if (logger.isDebugEnabled()) {
351: logger.debug("getDisplayValue() - end - return value = "
352: + returnString);
353: }
354: return returnString;
355: }
356:
357: /**
358: * <p>Get the person's email address, formatted according to <a
359: * href='http://www.faqs.org/rfcs/rfc822.HTML'>RFC822</a>.</p>
360: *
361: *
362: * <p>This gives you the form:<br>
363: * <blockquote>"<em>{firstName} {lastName}</em>
364: * " <<em>{email}</em>>
365: * </blockquote></p>
366: *
367: * <p>If the person has multiple email addresses, the returned one is the
368: * first one found, as ordered by the address number.</p>
369: *
370: * @return formatted email address, or <code>null</code> if this person does
371: * not have an email address in the system.
372: */
373: public final String getEmailAddress() {
374: if (logger.isDebugEnabled()) {
375: logger.debug("getEmailAddress() - start");
376: }
377:
378: String firstEmailAddress = null;
379: for (Iterator telecomAddressIterator = telecomAddresses
380: .iterator(); telecomAddressIterator.hasNext();) {
381: TelecomAddressDO this Address = (TelecomAddressDO) telecomAddressIterator
382: .next();
383: if (this Address.getType() == TelecomAddressConstants.TYPE_EMAIL) {
384: firstEmailAddress = this Address.getAddress();
385: break;
386: }
387: }
388: // if no addresses found, return null
389: if (firstEmailAddress == null) {
390: if (logger.isDebugEnabled()) {
391: logger
392: .debug("getEmailAddress() - end - return value = "
393: + null);
394: }
395: return null;
396: }
397:
398: // first prepend the name if there is one for this person
399: StringBuffer formattedEmailAddress = new StringBuffer();
400: if (!StringHandling.isNullOrEmpty(firstNames)) {
401: formattedEmailAddress.append(firstNames);
402: }
403: if (!StringHandling.isNullOrEmpty(lastName)) {
404: if (formattedEmailAddress.length() > 0) {
405: formattedEmailAddress.append(" ");
406: }
407: formattedEmailAddress.append(lastName);
408: }
409: if (formattedEmailAddress.length() > 0) {
410: formattedEmailAddress.append(" ");
411: }
412: formattedEmailAddress.append("<");
413: formattedEmailAddress.append(firstEmailAddress);
414: formattedEmailAddress.append(">");
415:
416: String returnString = formattedEmailAddress.toString();
417: if (logger.isDebugEnabled()) {
418: logger.debug("getEmailAddress() - end - return value = "
419: + returnString);
420: }
421: return returnString;
422: }
423:
424: /**
425: * <p>Get the employee record for this person as a data object.</p>
426: *
427: * @return employee record, or <code>null</code> if this person is not an
428: * employee.
429: * @hibernate.one-to-one
430: * cascade="all"
431: */
432: public final EmployeeDO getEmployee() {
433: if (logger.isDebugEnabled()) {
434: logger.debug("getEmployee() - start");
435: }
436:
437: if (logger.isDebugEnabled()) {
438: logger.debug("getEmployee() - end - return value = "
439: + employee);
440: }
441: return employee;
442: }
443:
444: /**
445: * <p>Get the string to file the person under in the address book.</p>
446: *
447: * @return the string to file the person under in the address book.
448: * @hibernate.property
449: * column="file_as"
450: */
451: public final String getFileAs() {
452: if (logger.isDebugEnabled()) {
453: logger.debug("getFileAs() - start");
454: }
455:
456: if (logger.isDebugEnabled()) {
457: logger
458: .debug("getFileAs() - end - return value = "
459: + fileAs);
460: }
461: return fileAs;
462: }
463:
464: /**
465: * <p>Get the person's first names.</p>
466: *
467: * @return the person's first names, separated by a comma.
468: * @hibernate.property
469: * column="first_names"
470: */
471: public final String getFirstNames() {
472: if (logger.isDebugEnabled()) {
473: logger.debug("getFirstNames() - start");
474: }
475:
476: if (logger.isDebugEnabled()) {
477: logger.debug("getFirstNames() - end - return value = "
478: + firstNames);
479: }
480: return firstNames;
481: }
482:
483: /**
484: * <p>Get the group of this person.</p>
485: *
486: * @return the group this person is in.
487: *
488: * @hibernate.many-to-one
489: * column="person_group"
490: */
491: public final GroupDO getGroup() {
492: if (logger.isDebugEnabled()) {
493: logger.debug("getGroup() - start");
494: }
495:
496: if (logger.isDebugEnabled()) {
497: logger.debug("getGroup() - end - return value = " + group);
498: }
499: return group;
500: }
501:
502: /**
503: * <p>Get the job title for this person.</p>
504: *
505: * @return the job title for this person.
506: * @hibernate.property
507: * column="job_title"
508: */
509: public final String getJobTitle() {
510: if (logger.isDebugEnabled()) {
511: logger.debug("getJobTitle() - start");
512: }
513:
514: if (logger.isDebugEnabled()) {
515: logger.debug("getJobTitle() - end - return value = "
516: + jobTitle);
517: }
518: return jobTitle;
519: }
520:
521: /**
522: * <p>Get the person's last name.</p>
523: *
524: * @return the person's last name.
525: * @hibernate.property
526: * column="last_name"
527: */
528: public final String getLastName() {
529: if (logger.isDebugEnabled()) {
530: logger.debug("getLastName() - start");
531: }
532:
533: if (logger.isDebugEnabled()) {
534: logger.debug("getLastName() - end - return value = "
535: + lastName);
536: }
537: return lastName;
538: }
539:
540: /**
541: * <p>
542: * Get the full name of this person. This is the same as the
543: * <code>fileAs</code> value.
544: * </p>
545: *
546: * @return fileAs value for this person
547: */
548: public final String getName() {
549: if (logger.isDebugEnabled()) {
550: logger.debug("getName() - start");
551: }
552:
553: if (logger.isDebugEnabled()) {
554: logger.debug("getName() - end - return value = " + fileAs);
555: }
556: return fileAs;
557: }
558:
559: /**
560: * <p>Get the saluation with which this person likes to be greeted by mail
561: * or email.</p>
562: *
563: * @return the saluation with which this person likes to be greeted by mail
564: * or email.
565: * @hibernate.property
566: * column="salutation"
567: */
568: public final String getSalutation() {
569: if (logger.isDebugEnabled()) {
570: logger.debug("getSalutation() - start");
571: }
572:
573: if (logger.isDebugEnabled()) {
574: logger.debug("getSalutation() - end - return value = "
575: + salutation);
576: }
577: return salutation;
578: }
579:
580: /**
581: * <p>Get the communication addresses themeselves.</p>
582: *
583: * @return a set containing the communication addresses themeselves.
584: *
585: * @hibernate.set
586: * cascade="all"
587: * role="telecom-addresses"
588: * @hibernate.collection-key
589: * column="person"
590: * @hibernate.collection-one-to-many
591: * class="com.ivata.groupware.business.addressbook.telecomaddress
592: * .TelecomAddressDO"
593: */
594: public final Set getTelecomAddresses() {
595: if (logger.isDebugEnabled()) {
596: logger.debug("getTelecomAddresses() - start");
597: }
598:
599: if (logger.isDebugEnabled()) {
600: logger
601: .debug("getTelecomAddresses() - end - return value = "
602: + telecomAddresses);
603: }
604: return telecomAddresses;
605: }
606:
607: /**
608: * <p>Get the user for this person.</p>
609: *
610: * @return user name for this person, or <code>null</code> if this person is
611: * not a user.
612: * @hibernate.one-to-one
613: * cascade="all"
614: */
615: public UserDO getUser() {
616: if (logger.isDebugEnabled()) {
617: logger.debug("getUser() - start");
618: }
619:
620: if (logger.isDebugEnabled()) {
621: logger.debug("getUser() - end - return value = " + user);
622: }
623: return user;
624: }
625:
626: /**
627: * When a person is deleted from the system, under some circumstances (i.e.
628: * when the person is a user), the data object is retained. In this case,
629: * the object is marked logically deleted and this flag is set
630: * <code>true</code>.
631: *
632: * @return <code>true</code> if the person is logically deleted, otherwise
633: * <code>false</code>.
634: * @hibernate.property
635: */
636: public boolean isDeleted() {
637: if (logger.isDebugEnabled()) {
638: logger.debug("isDeleted() - start");
639: }
640:
641: if (logger.isDebugEnabled()) {
642: logger.debug("isDeleted() - end - return value = "
643: + deleted);
644: }
645: return deleted;
646: }
647:
648: /**
649: * <copyDoc>Refer to {@link #getAddress()}.</copyDoc>
650: * @param addressParam The address to set.
651: */
652: public final void setAddress(final AddressDO addressParam) {
653: if (logger.isDebugEnabled()) {
654: logger.debug("setAddress(AddressDO address = "
655: + addressParam + ") - start");
656: }
657:
658: checkSetter();
659: this .address = addressParam;
660:
661: if (logger.isDebugEnabled()) {
662: logger.debug("setAddress(AddressDO) - end");
663: }
664: }
665:
666: /**
667: * <p>Set the company the person works for.</p>
668: *
669: * @param companyParam the company the person works for.
670: */
671: public final void setCompany(final String companyParam) {
672: if (logger.isDebugEnabled()) {
673: logger.debug("setCompany(String company = " + companyParam
674: + ") - start");
675: }
676:
677: checkSetter();
678: this .company = companyParam;
679:
680: if (logger.isDebugEnabled()) {
681: logger.debug("setCompany(String) - end");
682: }
683: }
684:
685: /**
686: * <p>Set the person's date of birth.</p>
687: *
688: * @param dateOfBirthParam the new value supplied to person's date of birth.
689: */
690: public final void setDateOfBirth(
691: final java.util.Date dateOfBirthParam) {
692: if (logger.isDebugEnabled()) {
693: logger.debug("setDateOfBirth(java.util.Date dateOfBirth = "
694: + dateOfBirthParam + ") - start");
695: }
696:
697: checkSetter();
698: this .dateOfBirth = dateOfBirthParam;
699:
700: if (logger.isDebugEnabled()) {
701: logger.debug("setDateOfBirth(java.util.Date) - end");
702: }
703: }
704:
705: /**
706: * <copyDoc>Refer to {@link #isDeleted()}.</copyDoc>
707: * @param deletedParam <code>true</code> when the person should be marked
708: * as deleted.
709: */
710: public void setDeleted(final boolean deletedParam) {
711: if (logger.isDebugEnabled()) {
712: logger.debug("setDeleted(boolean deletedParam = "
713: + deletedParam + ") - start");
714: }
715:
716: checkSetter();
717: deleted = deletedParam;
718:
719: if (logger.isDebugEnabled()) {
720: logger.debug("setDeleted(boolean) - end");
721: }
722: }
723:
724: /**
725: * <p>Get the employee record for this person as a data object.</p>
726: *
727: * @param employeeParam employee record, or <code>null</code> if this
728: * person is not an employee.
729: */
730: public final void setEmployee(final EmployeeDO employeeParam) {
731: if (logger.isDebugEnabled()) {
732: logger.debug("setEmployee(EmployeeDO employee = "
733: + employeeParam + ") - start");
734: }
735:
736: checkSetter();
737: this .employee = employeeParam;
738:
739: if (logger.isDebugEnabled()) {
740: logger.debug("setEmployee - end");
741: }
742: }
743:
744: /**
745: * <p>Set the string to file the person under in the address book.</p>
746: *
747: * @param fileAsParam the string to file the person under in the address
748: * book.
749: */
750: public final void setFileAs(final String fileAsParam) {
751: if (logger.isDebugEnabled()) {
752: logger.debug("setFileAs(String fileAs = " + fileAsParam
753: + ") - start");
754: }
755:
756: checkSetter();
757: this .fileAs = fileAsParam;
758:
759: if (logger.isDebugEnabled()) {
760: logger.debug("setFileAs(String) - end");
761: }
762: }
763:
764: /**
765: * <p>Set the person's first names.</p>
766: *
767: * @param firstNamesParam the person's first names, separated by a comma.
768: */
769: public final void setFirstNames(final String firstNamesParam) {
770: if (logger.isDebugEnabled()) {
771: logger.debug("setFirstNames(String firstNames = "
772: + firstNamesParam + ") - start");
773: }
774:
775: checkSetter();
776: this .firstNames = firstNamesParam;
777:
778: if (logger.isDebugEnabled()) {
779: logger.debug("setFirstNames(String) - end");
780: }
781: }
782:
783: /**
784: * <p>Set the group of this person.</p>
785: *
786: * @param groupParam new value of the group.
787: */
788: public final void setGroup(final GroupDO groupParam) {
789: if (logger.isDebugEnabled()) {
790: logger.debug("setGroup(GroupDO group = " + groupParam
791: + ") - start");
792: }
793:
794: checkSetter();
795: this .group = groupParam;
796:
797: if (logger.isDebugEnabled()) {
798: logger.debug("setGroup(GroupDO) - end");
799: }
800: }
801:
802: /**
803: * <p>Set the job title for this person.</p>
804: *
805: * @param jobTitleParam the job title for this person.
806: */
807: public final void setJobTitle(final String jobTitleParam) {
808: if (logger.isDebugEnabled()) {
809: logger.debug("setJobTitle(String jobTitle = "
810: + jobTitleParam + ") - start");
811: }
812:
813: checkSetter();
814: this .jobTitle = jobTitleParam;
815:
816: if (logger.isDebugEnabled()) {
817: logger.debug("setJobTitle(String) - end");
818: }
819: }
820:
821: /**
822: * <p>Set the person's last name.</p>
823: *
824: * @param lastNameParam the person's last name.
825: */
826: public final void setLastName(final String lastNameParam) {
827: if (logger.isDebugEnabled()) {
828: logger.debug("setLastName(String lastName = "
829: + lastNameParam + ") - start");
830: }
831:
832: checkSetter();
833: this .lastName = lastNameParam;
834:
835: if (logger.isDebugEnabled()) {
836: logger.debug("setLastName(String) - end");
837: }
838: }
839:
840: /**
841: * <copyDoc>Refer to {@link #getSalutation()}.</copyDoc>
842: *
843: * @param salutationParam the saluation with which this person likes to be
844: * greeted by mail or email.
845: */
846: public final void setSalutation(final String salutationParam) {
847: if (logger.isDebugEnabled()) {
848: logger.debug("setSalutation(String salutation = "
849: + salutationParam + ") - start");
850: }
851:
852: checkSetter();
853: this .salutation = salutationParam;
854:
855: if (logger.isDebugEnabled()) {
856: logger.debug("setSalutation(String) - end");
857: }
858: }
859:
860: /**
861: * <copyDoc>Refer to {@link #getTelecomAddresses()}.</copyDoc>
862: * @param set
863: * <copyDoc>Refer to {@link #getTelecomAddresses()}.</copyDoc>
864: */
865: public final void setTelecomAddresses(final Set set) {
866: if (logger.isDebugEnabled()) {
867: logger.debug("setTelecomAddresses(Set set = " + set
868: + ") - start");
869: }
870:
871: checkSetter();
872: telecomAddresses = set;
873:
874: if (logger.isDebugEnabled()) {
875: logger.debug("setTelecomAddresses(Set) - end");
876: }
877: }
878:
879: /**
880: * <p>Set the user for this person.</p>
881: *
882: * @param userParam new user for this person, or <code>null</code> if
883: * this person is not a user.
884: */
885: public final void setUser(final UserDO userParam) {
886: if (logger.isDebugEnabled()) {
887: logger.debug("setUser(UserDO user = " + userParam
888: + ") - start");
889: }
890:
891: checkSetter();
892: this .user = userParam;
893:
894: if (logger.isDebugEnabled()) {
895: logger.debug("setUser(UserDO) - end");
896: }
897: }
898: }
|