KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > pim > business > base > Person


1 package org.enhydra.pim.business.base;
2
3 import java.math.BigDecimal JavaDoc;
4 import java.util.Vector JavaDoc;
5 import org.enhydra.pim.business.ContactManager;
6 import org.enhydra.pim.business.api.ContactI;
7 import org.enhydra.pim.business.api.OwnerI;
8 import org.enhydra.pim.business.api.PersonI;
9 import org.enhydra.pim.exception.EnhydraPimException;
10
11 /**
12  * @author P.Djojic Apr 20, 2005 3:50:18 AM
13  *
14  * TODO Person
15  */

16 public class Person extends BasePimImpl implements PersonI ,java.io.Serializable JavaDoc {
17
18     private OwnerI owner = null;
19
20     private String JavaDoc firstname = null;
21
22     private String JavaDoc lastname = null;
23
24     private String JavaDoc nicname = null;
25
26     private String JavaDoc note = null;
27
28     /**
29      * @param user
30      * @param firstname
31      * @param lastname
32      * @param nicname
33      * @param note
34      */

35     public Person(OwnerI owner, String JavaDoc firstname, String JavaDoc lastname, String JavaDoc nicname, String JavaDoc note) {
36         super(null);
37         this.owner = owner;
38         this.firstname = firstname;
39         this.lastname = lastname;
40         this.nicname = nicname;
41         this.note = note;
42     }
43
44     /**
45      * @param handle
46      * @param user
47      * @param firstname
48      * @param lastname
49      * @param nicname
50      * @param note
51      */

52     public Person(BigDecimal JavaDoc handle, OwnerI owner, String JavaDoc firstname, String JavaDoc lastname, String JavaDoc nicname, String JavaDoc note) {
53         super(handle);
54         this.owner = owner;
55         this.firstname = firstname;
56         this.lastname = lastname;
57         this.nicname = nicname;
58         this.note = note;
59     }
60
61     public void clean() {
62         super.clean();
63         this.owner = null;
64         this.firstname = null;
65         this.lastname = null;
66         this.nicname = null;
67         this.note = null;
68     }
69
70     /**
71      * Sets Firstname column.
72      *
73      * @param _firstname
74      * new column value.
75      */

76     public void setFirstname(String JavaDoc _firstname) {
77         firstname = _firstname;
78     }
79
80     /**
81      * Return value of Firstname column.
82      *
83      * @return value of Firstname column.
84      */

85     public String JavaDoc getFirstname() {
86         return firstname;
87     }
88
89     /**
90      * Sets Lastname column.
91      *
92      * @param _lastname
93      * new column value.
94      */

95     public void setLastname(String JavaDoc _lastname) {
96         lastname = _lastname;
97     }
98
99     /**
100      * Return value of Lastname column.
101      *
102      * @return value of Lastname column.
103      */

104     public String JavaDoc getLastname() {
105         return lastname;
106     }
107
108     /**
109      * Sets Nicname column.
110      *
111      * @param _nicname
112      * new column value.
113      */

114     public void setNicname(String JavaDoc _nicname) {
115         nicname = _nicname;
116     }
117
118     /**
119      * Return value of Nicname column.
120      *
121      * @return value of Nicname column.
122      */

123     public String JavaDoc getNicname() {
124         return nicname;
125     }
126
127     /**
128      * Sets Note column.
129      *
130      * @param _note
131      * new column value.
132      */

133     public void setNote(String JavaDoc _note) {
134         note = _note;
135     }
136
137     /**
138      * Return value of Note column.
139      *
140      * @return value of Note column.
141      */

142     public String JavaDoc getNote() {
143         return note;
144     }
145
146     /**
147      * Sets Owner.
148      *
149      * @param _owner
150      * new value.
151      */

152     public void setOwner(OwnerI _owner) {
153         this.owner = _owner;
154     }
155
156     /**
157      * Return value of Owner.
158      *
159      * @return value of Owner.
160      */

161     public OwnerI getOwner() {
162         return this.owner;
163     }
164
165     /**
166      * Returns Person Contacts.
167      *
168      * @return Returns User Tasks.
169      * @throws EnhydraPimException
170      */

171     public Vector JavaDoc getContacts() throws EnhydraPimException {
172         ContactManager cMan = new ContactManager();
173         return cMan.getPersonContacts(this);
174     }
175
176     /**
177      * Add Person Contact.
178      *
179      * @param _contact
180      * Person Contact.
181      * @throws EnhydraPimException
182      */

183     public void addContact(ContactI _contact) throws EnhydraPimException {
184         ContactManager cMan = new ContactManager();
185         cMan.addContact(_contact,this,_contact.getContact_type());
186     }
187
188     /**
189      * Remove Person Contact.
190      *
191      * @param _contact
192      * Person Contact.
193      * @throws EnhydraPimException
194      */

195     public void removeContact(ContactI _contact) throws EnhydraPimException {
196         ContactManager cMan = new ContactManager();
197         cMan.removeContact(_contact);
198         
199     }
200
201 }
Popular Tags