PageRenderTime 69ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/projects/ivatagroupware-0.11.3/addressbook/src/java/com/ivata/groupware/business/addressbook/AddressBookBean.java

https://gitlab.com/essere.lab.public/qualitas.class-corpus
Java | 713 lines | 133 code | 36 blank | 544 comment | 0 complexity | 342d4d59562d9976108362e9f69dd9e7 MD5 | raw file
  1. /*
  2. * Copyright (c) 2001 - 2005 ivata limited.
  3. * All rights reserved.
  4. * -----------------------------------------------------------------------------
  5. * ivata groupware may be redistributed under the GNU General Public
  6. * License as published by the Free Software Foundation;
  7. * version 2 of the License.
  8. *
  9. * These programs are free software; you can redistribute them and/or
  10. * modify them under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; version 2 of the License.
  12. *
  13. * These programs are distributed in the hope that they will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  16. *
  17. * See the GNU General Public License in the file LICENSE.txt for more
  18. * details.
  19. *
  20. * If you would like a copy of the GNU General Public License write to
  21. *
  22. * Free Software Foundation, Inc.
  23. * 59 Temple Place - Suite 330
  24. * Boston, MA 02111-1307, USA.
  25. *
  26. *
  27. * To arrange commercial support and licensing, contact ivata at
  28. * http://www.ivata.com/contact.jsp
  29. * -----------------------------------------------------------------------------
  30. * $Log: AddressBookBean.java,v $
  31. * Revision 1.4 2005/04/29 02:48:14 colinmacleod
  32. * Data bugfixes.
  33. * Changed primary key back to Integer.
  34. *
  35. * Revision 1.3 2005/04/10 20:09:34 colinmacleod
  36. * Added new themes.
  37. * Changed id type to String.
  38. * Changed i tag to em and b tag to strong.
  39. * Improved PicoContainerFactory with NanoContainer scripts.
  40. *
  41. * Revision 1.2 2005/04/09 17:19:06 colinmacleod
  42. * Changed copyright text to GPL v2 explicitly.
  43. *
  44. * Revision 1.1.1.1 2005/03/10 17:50:19 colinmacleod
  45. * Restructured ivata op around Hibernate/PicoContainer.
  46. * Renamed ivata groupware.
  47. *
  48. * Revision 1.10 2004/11/12 18:17:10 colinmacleod
  49. * Ordered imports.
  50. *
  51. * Revision 1.9 2004/11/12 15:56:47 colinmacleod
  52. * Removed dependencies on SSLEXT.
  53. * Moved Persistence classes to ivata masks.
  54. *
  55. * Revision 1.8 2004/11/03 15:36:48 colinmacleod
  56. * Changed relationship between person and address:
  57. * each person for now has exactly one address.
  58. *
  59. * Revision 1.7 2004/07/18 21:59:12 colinmacleod
  60. * Removed Person from User - now you need to use addressbook/persistence manager to find the person (makes the app run faster.)
  61. *
  62. * Revision 1.6 2004/07/13 19:41:13 colinmacleod
  63. * Moved project to POJOs from EJBs.
  64. * Applied PicoContainer to services layer (replacing session EJBs).
  65. * Applied Hibernate to persistence layer (replacing entity EJBs).
  66. *
  67. * Revision 1.5 2004/03/27 10:29:41 colinmacleod
  68. * Added getAddressBook implementation.
  69. *
  70. * Revision 1.4 2004/03/26 21:34:35 colinmacleod
  71. * Split off functionality into POJO.
  72. *
  73. * Revision 1.3 2004/03/21 21:16:05 colinmacleod
  74. * Shortened name to ivata op.
  75. *
  76. * Revision 1.2 2004/02/01 22:00:32 colinmacleod
  77. * Added full names to author tags
  78. *
  79. * Revision 1.1.1.1 2004/01/27 20:57:49 colinmacleod
  80. * Moved ivata openportal to SourceForge..
  81. *
  82. * Revision 1.6 2003/12/12 11:08:58 jano
  83. * fixing aaddressbook functionaality
  84. *
  85. * Revision 1.5 2003/11/03 11:28:24 jano
  86. * commiting addressbook,
  87. * tryinjg to fix deploying problem
  88. *
  89. * Revision 1.4 2003/10/17 12:36:12 jano
  90. * fixing problems with building
  91. * converting intranet -> portal
  92. * Eclipse building
  93. *
  94. * Revision 1.3 2003/10/15 13:36:47 jano
  95. * converting to XDoclet
  96. *
  97. * Revision 1.2 2003/10/15 13:18:02 colin
  98. * fixing for XDoclet
  99. *
  100. * Revision 1.20 2003/08/21 09:49:22 jano
  101. * removed unusing methods
  102. *
  103. * Revision 1.19 2003/08/20 16:23:59 jano
  104. * fixing addressBook extension
  105. *
  106. * Revision 1.18 2003/08/19 14:53:30 jano
  107. * *** empty log message ***
  108. *
  109. * Revision 1.17 2003/08/14 15:54:19 jano
  110. * fixing bugs
  111. *
  112. * Revision 1.16 2003/08/14 08:19:59 jano
  113. * fixing bug
  114. *
  115. * Revision 1.15 2003/08/13 13:32:16 jano
  116. * addressBook exttension: next level
  117. *
  118. * Revision 1.14 2003/08/05 14:51:03 jano
  119. * addressBook extension
  120. *
  121. * Revision 1.13 2003/08/05 05:54:06 jano
  122. * new methods in addressbook
  123. *
  124. * Revision 1.12 2003/07/31 08:45:57 jano
  125. * new method findAllPeople
  126. * removing all similar methods
  127. *
  128. * Revision 1.10 2003/07/25 11:40:17 jano
  129. * adding functionality for addressBook extension
  130. *
  131. * Revision 1.9 2003/06/18 14:20:43 jano
  132. * fixing problem with removing user
  133. *
  134. * Revision 1.8 2003/05/23 13:04:46 peter
  135. * uncommented email address validation
  136. *
  137. * Revision 1.7 2003/05/12 13:45:52 colin
  138. * added new methods for finding rights
  139. *
  140. * Revision 1.6 2003/05/02 15:14:57 peter
  141. * added email address validation
  142. *
  143. * Revision 1.5 2003/04/09 08:51:48 jano
  144. * handling data of removing user
  145. *
  146. * Revision 1.4 2003/04/02 09:04:05 jano
  147. * again, fixing bug with wrong keys in validate method
  148. *
  149. * Revision 1.3 2003/03/31 15:44:04 jano
  150. * mistake in validate method, using wrong key of applicationResources
  151. *
  152. * Revision 1.2 2003/02/27 12:57:40 peter
  153. * fixed the resouceBundle paths in validation methods
  154. *
  155. * Revision 1.1 2003/02/24 19:09:20 colin
  156. * moved to business
  157. *
  158. * Revision 1.28 2003/02/21 09:23:17 colin
  159. * fixed bug when fileAs values are the same (only 1 was shown)
  160. *
  161. * Revision 1.27 2003/02/20 20:49:53 colin
  162. * changed checking of unique fileAs field to ValidaitonException
  163. *
  164. * Revision 1.26 2003/02/20 20:22:54 colin
  165. * improved validation error handling
  166. *
  167. * Revision 1.25 2003/02/20 14:34:02 colin
  168. * addGroupsToPerson no longer adds child groups to the person (just the parent)
  169. *
  170. * Revision 1.24 2003/02/18 11:11:27 colin
  171. * first release of address book with Struts
  172. *
  173. * Revision 1.23 2003/02/14 07:57:07 colin
  174. * changed finder in AddressBookBean so it finds all groups (rather than just parent groups)
  175. *
  176. * Revision 1.22 2003/02/04 17:43:44 colin
  177. * copyright notice
  178. *
  179. * Revision 1.21 2003/01/30 15:29:38 colin
  180. * added group validation
  181. *
  182. * Revision 1.20 2003/01/10 10:30:06 jano
  183. * we need information about user who created group
  184. *
  185. * Revision 1.19 2003/01/09 13:31:49 jano
  186. * we have fiield in Person called : createdBy - its name of user who created that contact
  187. *
  188. * Revision 1.18 2003/01/09 10:02:51 jano
  189. * we are not storing group's rights in geoupDO now
  190. * we are using methods in addressBookRightsBean
  191. *
  192. * Revision 1.17 2003/01/03 15:43:50 jano
  193. * we don't need tempFindTarge...... method, we are using getTargetIdsByAUD
  194. *
  195. * Revision 1.16 2002/12/16 13:41:34 jano
  196. * in there is not groupId we have to find only those contacts which we can see
  197. *
  198. * Revision 1.15 2002/12/12 15:03:28 jano
  199. * rights for groups
  200. *
  201. * Revision 1.14 2002/12/03 15:42:19 jano
  202. * if the person is user so put him to USER group if he is not there
  203. *
  204. * Revision 1.13 2002/10/11 12:51:10 colin
  205. * added check for duplicate values of fileAs
  206. *
  207. * Revision 1.12 2002/09/30 12:51:34 jano
  208. * trow exception if the group i main group for any people
  209. *
  210. * Revision 1.11 2002/09/27 14:18:19 jano
  211. * when you want delete group contain sub groups throw exception
  212. *
  213. * Revision 1.10 2002/09/17 08:36:59 colin
  214. * added checkDO to check the person before adding
  215. *
  216. * Revision 1.9 2002/09/09 08:38:10 colin
  217. * moved user handling to new security bean
  218. *
  219. * Revision 1.8 2002/09/02 08:47:48 colin
  220. * added country handling and sorting (comparator)
  221. *
  222. * Revision 1.7 2002/08/30 09:48:45 colin
  223. * added employee EJB
  224. *
  225. * Revision 1.6 2002/08/29 14:33:43 colin
  226. * changed AddressBook: added isUserEnabled method
  227. *
  228. * Revision 1.5 2002/07/26 13:07:21 colin
  229. * split user rights off into separate class
  230. * added mail server methods
  231. *
  232. * Revision 1.4 2002/06/28 13:15:22 colin
  233. * first addressbook release
  234. *
  235. * Revision 1.3 2002/06/17 10:45:47 colin
  236. * Tidied up the canUser... code
  237. *
  238. * Revision 1.2 2002/06/17 07:28:51 colin
  239. * improved and extended javadoc documentation
  240. * -----------------------------------------------------------------------------
  241. */
  242. package com.ivata.groupware.business.addressbook;
  243. import java.util.List;
  244. import javax.ejb.CreateException;
  245. import javax.ejb.RemoveException;
  246. import javax.ejb.SessionBean;
  247. import javax.ejb.SessionContext;
  248. import org.picocontainer.PicoContainer;
  249. import com.ivata.groupware.admin.security.server.SecuritySession;
  250. import com.ivata.groupware.business.addressbook.address.AddressDO;
  251. import com.ivata.groupware.business.addressbook.address.country.CountryDO;
  252. import com.ivata.groupware.business.addressbook.person.PersonDO;
  253. import com.ivata.groupware.business.addressbook.person.group.GroupDO;
  254. import com.ivata.groupware.container.PicoContainerFactory;
  255. import com.ivata.mask.util.SystemException;
  256. import com.ivata.mask.validation.ValidationErrors;
  257. /**
  258. * <p>This address book provides clients with access to the register of people
  259. * within the ivata groupware system.</p>
  260. *
  261. * <p>Actions are here to retrieve people, change their details and enter new
  262. * people into the system. This bean manages people's street and
  263. * telecommunications addresses, together with which people are users and what
  264. * group(s) each person is a member of.</p>
  265. *
  266. * <p>Furthermore, this bean is responsible for assigning and maintaining
  267. * employee information.</p>
  268. *
  269. * <p><strong>Note</strong>, however that whilst the addressbook may react on which
  270. * people are users (it checks those people always have an email address), this
  271. * <em>EJB</em> is not responsible for adding, removing or amending users or their
  272. * passwords. For that functionality, see the {@link com.ivata.groupware.admin.security.SecurityBean
  273. * SecurityBean}.</p>
  274. *
  275. * @since 2002-05-12
  276. * @author Colin MacLeod
  277. * <a href='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
  278. * @version $Revision: 1.4 $
  279. * TODO: the employee and user methods need to check the user rights
  280. *
  281. * @ejb.bean
  282. * name="AddressBook"
  283. * display-name="AddressBook"
  284. * type="Stateless"
  285. * view-type="remote"
  286. * jndi-name="AddressBookRemote"
  287. *
  288. * @ejb.transaction
  289. * type = "Required"
  290. *
  291. * @ejb.home
  292. * generate="false"
  293. * remote-class="com.ivata.groupware.business.addressbook.AddressBookRemoteHome"
  294. *
  295. * @ejb.interface
  296. * remote-class="com.ivata.groupware.business.addressbook.AddressBookRemote"
  297. */
  298. public class AddressBookBean implements SessionBean, AddressBook {
  299. /**
  300. * <p>Provides the session bean with container-specific information.</p>
  301. */
  302. SessionContext sessionContext;
  303. /**
  304. * <p>Add bew AddressBook.</p>
  305. * @param userName
  306. * @param groupDO
  307. * @return
  308. *
  309. * @ejb.interface-method
  310. * view-type = "remote"
  311. */
  312. public GroupDO addAddressBook(final SecuritySession securitySession,
  313. final GroupDO groupDO)
  314. throws SystemException {
  315. return getAddressBook().addAddressBook(securitySession, groupDO);
  316. }
  317. /**
  318. * <p>Add a new group to the address book.</p>
  319. *
  320. * @param userName the name of the user who wants to add the group. This is
  321. * used to check user rights.
  322. * @param groupDO a data object containing all the details
  323. * of the group to add.
  324. * @exception com.ivata.groupware.ejb.entity.UserRightException if the user
  325. * provided is not entitled to add this group
  326. * @exception com.ivata.groupware.ejb.entity.InvalidFieldValueException
  327. * if a field value in the new group contains an invalid value
  328. * @return the new group data object, with the details as they
  329. * now are in the adressbook.
  330. *
  331. * @ejb.interface-method
  332. * view-type = "remote"
  333. */
  334. public GroupDO addGroup(final SecuritySession securitySession,
  335. final GroupDO groupDO)
  336. throws SystemException {
  337. return getAddressBook().addGroup(securitySession, groupDO);
  338. }
  339. /**
  340. * <p>Add a new person to the address book.</p>
  341. *
  342. * @param personDO data object containing the details of the
  343. * person you want to add.
  344. * @return the new person data object, with the details as they
  345. * now are in the adressbook.
  346. *
  347. * @ejb.interface-method
  348. * view-type = "remote"
  349. */
  350. public PersonDO addPerson(final SecuritySession securitySession,
  351. final PersonDO personDO)
  352. throws SystemException {
  353. return getAddressBook().addPerson(securitySession, personDO);
  354. }
  355. /**
  356. * <p>add new userGroup.</p>
  357. * @param userName
  358. * @param groupDO
  359. * @return
  360. *
  361. * @ejb.interface-method
  362. * view-type = "remote"
  363. */
  364. public GroupDO addUserGroup(final SecuritySession securitySession,
  365. final GroupDO groupDO)
  366. throws SystemException {
  367. return getAddressBook().addUserGroup(securitySession, groupDO);
  368. }
  369. /**
  370. * <p>Amend the details of a group in the public address book.</p>
  371. *
  372. * @param userName the name of the user who wants to amend the group. This
  373. * is used to check user rights.
  374. * @param groupDO a data object containing all the details
  375. * of the group to amend.
  376. * @exception com.ivata.groupware.ejb.entity.UserRightException if the user
  377. * provided is not entitled to amend this group.
  378. * @exception com.ivata.groupware.ejb.entity.InvalidFieldValueException
  379. * if a field value in the new group contains an invalid value.
  380. * @return the new group data object, with the details as they
  381. * now are in the adressbook.
  382. *
  383. * @ejb.interface-method
  384. * view-type = "remote"
  385. */
  386. public GroupDO amendGroup(final SecuritySession securitySession,
  387. final GroupDO groupDO)
  388. throws SystemException {
  389. return getAddressBook().amendGroup(securitySession, groupDO);
  390. }
  391. /**
  392. * <p>Change/update a person's details in the addressbook.</p>
  393. *
  394. * @param personDO data object containing the details of the
  395. * person you want to amend.
  396. * @return the new person data object, with the details as they
  397. * now are in the adressbook.
  398. *
  399. * @ejb.interface-method
  400. * view-type = "remote"
  401. */
  402. public PersonDO amendPerson(final SecuritySession securitySession,
  403. final PersonDO personDO)
  404. throws SystemException {
  405. return getAddressBook().amendPerson(securitySession, personDO);
  406. }
  407. /**
  408. * <p>Called by the container to notify an entity object it has been
  409. * activated.</p>
  410. */
  411. public void ejbActivate() {}
  412. /**
  413. * <p>Called by the container just after the bean has been created.</p>
  414. *
  415. * @exception CreateException if any error occurs. Never thrown by this
  416. * class.
  417. *
  418. * @ejb.create-method
  419. */
  420. public void ejbCreate() throws CreateException {}
  421. /**
  422. * <p>Called by the container to notify the entity object it will be
  423. * deactivated. Called just before deactivation.</p>
  424. */
  425. public void ejbPassivate() {}
  426. /**
  427. * <p>This method is called by the container when the bean is about
  428. * to be removed.</p>
  429. *
  430. * <p>This method will be called after a client calls the <code>remove</code>
  431. * method of the remote/local home interface.</p>
  432. *
  433. * @throws RemoveException if any error occurs. Currently never thrown by
  434. * this class.
  435. */
  436. public final void ejbRemove() {}
  437. /**
  438. * <p>get Map of all address book names which are allowed with specific access.</p>
  439. * @param userName
  440. * @param access
  441. * @return
  442. *
  443. * @ejb.interface-method
  444. * view-type = "remote"
  445. */
  446. public List findAddressBooks(final SecuritySession securitySession,
  447. final boolean includePersonal)
  448. throws SystemException {
  449. return getAddressBook().findAddressBooks(securitySession, includePersonal);
  450. }
  451. /**
  452. * <p>Find all of the countries in the system.</p>
  453. *
  454. * @return all of the coutries in the system as a <code>List</code>
  455. * of {@link com.ivata.groupware.business.addressbook.address.country.CountryDO CountryDO}
  456. * instances.
  457. *
  458. * @ejb.interface-method
  459. * view-type = "remote"
  460. */
  461. public List findAllCountries(final SecuritySession securitySession)
  462. throws SystemException {
  463. return getAddressBook().findAllCountries(securitySession);
  464. }
  465. /**
  466. * <p>Find All People in a specific address book.</p
  467. *
  468. * @see com.ivata.groupware.business.addressbook.AddressBook#findAllPeople(com.ivata.groupware.admin.security.server.SecuritySession, Integer, Integer, String)
  469. * @ejb.interface-method
  470. * view-type = "remote"
  471. */
  472. public List findAllPeopleInGroup(final SecuritySession securitySession,
  473. final GroupDO group,
  474. final String initialLetter) throws SystemException {
  475. return getAddressBook().findAllPeopleInGroup(securitySession, group,
  476. initialLetter);
  477. }
  478. /**
  479. * <p>Find a single county identified by its two-letter country code.</p>
  480. *
  481. * @param countryCode two-letter internet country code.
  482. * @return details of the country as an instance of
  483. * {@link com.ivata.groupware.business.addressbook.address.country.CountryDO CountryDO),
  484. * or <code>null</code> if no such country exists.
  485. *
  486. * @ejb.interface-method
  487. * view-type = "remote"
  488. */
  489. public CountryDO findCountryByCode(final SecuritySession securitySession,
  490. final String countryCode)
  491. throws SystemException {
  492. return getAddressBook().findCountryByCode(securitySession, countryCode);
  493. }
  494. /**
  495. * <p>Find a group in the address book by its unique identifier.</p>
  496. *
  497. * @param id the unique identifier of the group to find.
  498. * @return the data object of the group which matches this unique
  499. * identifier.
  500. *
  501. * @ejb.interface-method
  502. * view-type = "remote"
  503. */
  504. public GroupDO findGroupByPrimaryKey(final SecuritySession securitySession,
  505. final Integer id)
  506. throws SystemException {
  507. return getAddressBook().findGroupByPrimaryKey(securitySession, id);
  508. }
  509. /**
  510. * <p>
  511. * Find all groups which are siblings, identified by the parent group.
  512. * </p>
  513. * @see com.ivata.groupware.business.addressbook.AddressBook#findGroupsByParent(com.ivata.groupware.admin.security.server.SecuritySession, Integer)
  514. */
  515. public List findGroupsByParent(final SecuritySession securitySession,
  516. final Integer parentId) throws SystemException {
  517. return getAddressBook().findGroupsByParent(securitySession, parentId);
  518. }
  519. /**
  520. * <p>Find Id of personal AddressBook.</p>
  521. * @param userName
  522. * @return
  523. *
  524. * @ejb.interface-method
  525. * view-type = "remote"
  526. */
  527. public GroupDO findPersonalAddressBook(final SecuritySession securitySession)
  528. throws SystemException {
  529. return getAddressBook().findPersonalAddressBook(securitySession);
  530. }
  531. /**
  532. * <p>Find a person in the address book by their unique identifier.</p>
  533. *
  534. * @param id the unique identifier of the person to find.
  535. * @return the person data object which matches this id, with the
  536. * details as they now are in the adressbook.
  537. *
  538. * @ejb.interface-method
  539. * view-type = "remote"
  540. */
  541. public PersonDO findPersonByPrimaryKey(final SecuritySession securitySession,
  542. final String id)
  543. throws SystemException {
  544. return getAddressBook().findPersonByPrimaryKey(securitySession, id);
  545. }
  546. /**
  547. * <p>Find a person in the address book by their user name.</p>
  548. *
  549. * @param userName Name of the user to find.
  550. * @return the person data object which matches this user name.
  551. * @see com.ivata.groupware.business.addressbook.AddressBook#findPersonByUserName(com.ivata.groupware.admin.security.server.SecuritySession, String)
  552. */
  553. public PersonDO findPersonByUserName(final SecuritySession securitySession,
  554. final String userName) throws SystemException {
  555. return getAddressBook().findPersonByUserName(securitySession, userName);
  556. }
  557. /**
  558. * <p>get Map of all usergroup names which are allowed with specific access.</p>
  559. * @param userName
  560. * @param access
  561. * @return
  562. *
  563. * @ejb.interface-method
  564. * view-type = "remote"
  565. */
  566. public List findUserGroups(final SecuritySession securitySession,
  567. final boolean includeAdministrator)
  568. throws SystemException {
  569. return getAddressBook().findUserGroups(securitySession, includeAdministrator);
  570. }
  571. /**
  572. * Get the addressbook implementation from the <code>PicoContainer</code>.
  573. */
  574. private AddressBook getAddressBook()
  575. throws SystemException {
  576. PicoContainer container = PicoContainerFactory.getInstance()
  577. .getGlobalContainer();
  578. return (AddressBook) container.getComponentInstance(AddressBook.class);
  579. }
  580. /**
  581. * <p>Remove a group from the public address book.</p>
  582. *
  583. * @param userName the name of the user who wants to remove the group. This
  584. * is used to check user rights.
  585. * @param groupDO a data object containing all the details
  586. * of the group to remove. The id of the group is used to identify which
  587. * group to remove.
  588. * @exception com.ivata.groupware.ejb.entity.UserRightException if the user
  589. * provided is not entitled to remvoe this group.
  590. * @exception com.ivata.groupware.ejb.entity.InvalidFieldValueException
  591. * if the id of the group contains an invalid value.
  592. *
  593. * @ejb.interface-method
  594. * view-type = "remote"
  595. */
  596. public void removeGroup(final SecuritySession securitySession,
  597. final Integer id)
  598. throws SystemException {
  599. getAddressBook().removeGroup(securitySession, id);
  600. }
  601. /**
  602. * <p>Remove a person from the address book.</p>
  603. *
  604. * @param personDO data object containing the details of the
  605. * person you want to remove. The id is used to locate and remove the
  606. * person.
  607. *
  608. * @ejb.interface-method
  609. * view-type = "remote"
  610. */
  611. public void removePerson(final SecuritySession securitySession,
  612. final Integer id)
  613. throws SystemException {
  614. getAddressBook().removePerson(securitySession, id);
  615. }
  616. /**
  617. * <p>Set up the context for this entity object. The session bean stores the
  618. * context for later use.</p>
  619. *
  620. * @param sessionContext the new context which the session object should
  621. * store.
  622. */
  623. public final void setSessionContext(final SessionContext sessionContext) {
  624. this.sessionContext = sessionContext;
  625. }
  626. /**
  627. * <p>Confirm all of the elements of the person are address and valid,
  628. * before the message is sent.</p>
  629. *
  630. * @param addressDO data object to check for consistency and
  631. * completeness.
  632. * @return a collection of validation errors if any of the
  633. * mandatory fields are missing, or if fields contain invalid values.
  634. *
  635. * @ejb.interface-method
  636. * view-type = "remote"
  637. */
  638. public ValidationErrors validate(final SecuritySession securitySession,
  639. final AddressDO addressDO)
  640. throws SystemException {
  641. return getAddressBook().validate(securitySession, addressDO);
  642. }
  643. /**
  644. * <p>Confirm all of the elements of the group are present and valid,
  645. * before the message is sent.</p>
  646. *
  647. * @param groupDO data object to check for consistency and
  648. * completeness.
  649. * @return a collection of validation errors if any of the
  650. * mandatory fields are missing, or if fields contain invalid values.
  651. *
  652. * @ejb.interface-method
  653. * view-type = "remote"
  654. */
  655. public ValidationErrors validate(final SecuritySession securitySession,
  656. final GroupDO groupDO)
  657. throws SystemException {
  658. return getAddressBook().validate(securitySession, groupDO);
  659. }
  660. /**
  661. * <p>Confirm all of the elements of the person are present and valid,
  662. * before the message is sent.</p>
  663. *
  664. * @param personDO data object to check for consistency and
  665. * completeness.
  666. * @return a collection of validation errors if any of the
  667. * mandatory fields are missing, or if fields contain invalid values.
  668. *
  669. * @ejb.interface-method
  670. * view-type = "remote"
  671. */
  672. public ValidationErrors validate(final SecuritySession securitySession,
  673. final PersonDO personDO)
  674. throws SystemException {
  675. return getAddressBook().validate(securitySession, personDO);
  676. }
  677. }