Source Code Cross Referenced for MessengerImpl.java in  » J2EE » Enhydra-Demos » com » lutris » airsent » business » messenger » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » Enhydra Demos » com.lutris.airsent.business.messenger 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 1999-2001 Lutris Technologies, Inc. All Rights
003:         * Reserved.
004:         * 
005:         * This source code file is distributed by Lutris Technologies, Inc. for
006:         * use only by licensed users of product(s) that include this source
007:         * file. Use of this source file or the software that uses it is covered
008:         * by the terms and conditions of the Lutris Enhydra Development License
009:         * Agreement included with this product.
010:         * 
011:         * This Software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
012:         * ANY KIND, either express or implied. See the License for the specific terms
013:         * governing rights and limitations under the License.
014:         * 
015:         * Contributor(s):
016:         * 
017:         * $Id: MessengerImpl.java,v 1.1 2006-09-11 12:27:25 sinisa Exp $
018:         */
019:
020:        package com.lutris.airsent.business.messenger;
021:
022:        import com.lutris.airsent.spec.AirSentException;
023:        import com.lutris.airsent.business.*;
024:
025:        import com.lutris.airsent.spec.messenger.Messenger;
026:        import com.lutris.airsent.spec.customer.Customer;
027:        import com.lutris.airsent.spec.address.Address;
028:        import com.lutris.airsent.business.address.AddressManager;
029:
030:        import com.lutris.airsent.business.address.*;
031:        import com.lutris.airsent.business.address.AddressImpl;
032:
033:        import com.lutris.airsent.data.person.*;
034:        import com.lutris.appserver.server.sql.*;
035:        import com.lutris.dods.builder.generator.query.DataObjectException;
036:
037:        /**
038:         * Messenger implementation.
039:         */
040:        public class MessengerImpl implements  Messenger, java.io.Serializable {
041:            MessengerDO messengerDO = null;
042:            PersonDO personDO = null;
043:
044:            /**
045:             * Constructs empty Messenger
046:             *
047:             * @exception if an error occurs
048:             */
049:            MessengerImpl() throws AirSentException {
050:                try {
051:                    messengerDO = MessengerDO.createVirgin();
052:                    personDO = PersonDO.createVirgin();
053:                    AddressManager af = HomeManagerImpl.getInstance()
054:                            .getAddressManager();
055:                    AddressImpl addr = af.create();
056:                    personDO.setAddressID(addr.getDataObject());
057:                    messengerDO.setPersonID(personDO);
058:                } catch (Exception ex) {
059:                    throw new AirSentException("Error creating Messenger", ex);
060:                }
061:            }
062:
063:            /**
064:             * Constructs messenger using data object.
065:             *
066:             * @exception if an error occurs
067:             */
068:            MessengerImpl(MessengerDO messenger) throws AirSentException {
069:                try {
070:                    this .messengerDO = messenger;
071:                    this .personDO = messengerDO.getPersonID();
072:                } catch (Exception ex) {
073:                    throw new AirSentException("Error creating Messenger", ex);
074:                }
075:            }
076:
077:            /**
078:             * Constructs messenger using database handle
079:             *
080:             * @exception if an error occurs
081:             */
082:            MessengerImpl(String id) throws AirSentException {
083:                try {
084:                    this .messengerDO = messengerDO.createExisting(id);
085:                    this .personDO = messengerDO.getPersonID();
086:                } catch (Exception ex) {
087:                    throw new AirSentException("Error creating Messenger", ex);
088:                }
089:            }
090:
091:            /**
092:             * Get messengers database handle
093:             *
094:             * @return database id
095:             * @exception if an error occurs
096:             */
097:            public String getHandle() throws AirSentException {
098:                try {
099:                    return messengerDO.getHandle();
100:                } catch (Exception ex) {
101:                    throw new AirSentException(
102:                            "Error getting messenger's handle", ex);
103:                }
104:            }
105:
106:            /**
107:             * Get first name.
108:             *
109:             * @return first name
110:             * @exception if an error occurs
111:             */
112:            public String getFirstName() throws AirSentException {
113:                try {
114:                    return personDO.getFirstName();
115:                } catch (Exception ex) {
116:                    throw new AirSentException(
117:                            "Error getting messenger's firstname", ex);
118:                }
119:            }
120:
121:            /**
122:             * Set first name.
123:             *
124:             * @param first first name
125:             * @exception if an error occurs
126:             * @exception if business rules are violated
127:             */
128:            public void setFirstName(String first) throws AirSentException,
129:                    AirSentBusinessException {
130:                if (first.length() > Customer.MAX_FIRST_NAME) {
131:                    throw new AirSentBusinessException("Exceeds maximum size");
132:                }
133:                try {
134:                    this .personDO.setFirstName(first);
135:                } catch (Exception ex) {
136:                    throw new AirSentException(
137:                            "Error setting messenger's name", ex);
138:                }
139:            }
140:
141:            /**
142:             * Get email.
143:             * @return email address
144:             * @exception if an error occurs
145:             */
146:            public String getEmail() throws AirSentException {
147:                try {
148:                    return personDO.getEmail();
149:                } catch (Exception ex) {
150:                    throw new AirSentException(
151:                            "Error getting messenger's firstname", ex);
152:                }
153:            }
154:
155:            /**
156:             * Set Email.
157:             * 
158:             * @param email
159:             * @exception if an error occurs
160:             * @exception if business rules are violated
161:
162:             */
163:            public void setEmail(String email) throws AirSentException,
164:                    AirSentBusinessException {
165:                if (email.length() > Customer.MAX_EMAIL) {
166:                    throw new AirSentBusinessException("Exceeds maximum size");
167:                }
168:                try {
169:                    this .personDO.setEmail(email);
170:                } catch (Exception ex) {
171:                    throw new AirSentException(
172:                            "Error setting messenger's name", ex);
173:                }
174:            }
175:
176:            /**
177:             * Get last name.
178:             *
179:             * @return last name
180:             * @exception if an error occurs
181:             */
182:            public String getLastName() throws AirSentException {
183:                try {
184:                    return personDO.getLastName();
185:                } catch (Exception ex) {
186:                    throw new AirSentException(
187:                            "Error getting messenger's lastname", ex);
188:                }
189:            }
190:
191:            /**
192:             * Set last name.
193:             * 
194:             * @param last
195:             * @exception if an error occurs
196:             * @exception if business rules are violated
197:             */
198:            public void setLastName(String last) throws AirSentException,
199:                    AirSentBusinessException {
200:                if (last.length() > Customer.MAX_LAST_NAME) {
201:                    throw new AirSentBusinessException("Exceeds maximum size");
202:                }
203:                try {
204:                    this .personDO.setLastName(last);
205:                } catch (Exception ex) {
206:                    throw new AirSentException(
207:                            "Error setting messenger's last name", ex);
208:                }
209:            }
210:
211:            /**
212:             * Gets the address.
213:             * @exception if an error occurs
214:             *
215:             * @return address
216:             * @exception if an error occurs
217:             */
218:            public Address getAddress() throws AirSentException {
219:                try {
220:                    AddressManager af = HomeManagerImpl.getInstance()
221:                            .getAddressManager();
222:                    return af.create(personDO.getAddressID());
223:                } catch (Exception ex) {
224:                    throw new AirSentBusinessException(
225:                            "Error getting messenger's address", ex);
226:                }
227:            }
228:
229:            /**
230:             * Get badge.
231:             *
232:             * @return badge
233:             * @exception if an error occurs
234:             */
235:            public String getBadge() throws AirSentException {
236:                try {
237:                    return messengerDO.getBadge();
238:                } catch (Exception ex) {
239:                    throw new AirSentBusinessException(
240:                            "Error getting messenger's badge", ex);
241:                }
242:            }
243:
244:            /**
245:             *
246:             * @exception if an error occurs
247:             * @exception if business rules are violated
248:             */
249:            public void setBadge(String badge) throws AirSentException,
250:                    AirSentBusinessException {
251:                if (badge.length() > Messenger.MAX_BADGE) {
252:                    throw new AirSentBusinessException("Exceeds maximum size");
253:                }
254:                try {
255:                    this .messengerDO.setBadge(badge);
256:                } catch (Exception ex) {
257:                    throw new AirSentException(
258:                            "Error setting messenger's badge", ex);
259:                }
260:            }
261:
262:            /**
263:             * Get password.
264:             *
265:             * @return password
266:             * @exception if an error occurs
267:             */
268:            public String getPassword() throws AirSentException {
269:                try {
270:                    return messengerDO.getPassword();
271:                } catch (Exception ex) {
272:                    throw new AirSentException(
273:                            "Error getting customers's lastname", ex);
274:                }
275:            }
276:
277:            /**
278:             * Set password.
279:             *
280:             * @exception if an error occurs
281:             * @exception if business rules are violated
282:             */
283:            public void setPassword(String password) throws AirSentException,
284:                    AirSentBusinessException {
285:                if (password.length() > Messenger.MAX_PASSWORD) {
286:                    throw new AirSentBusinessException("Exceeds maximum size");
287:                }
288:                try {
289:                    this .messengerDO.setPassword(password);
290:                } catch (Exception ex) {
291:                    throw new AirSentException(
292:                            "Error setting customers's last name", ex);
293:                }
294:            }
295:
296:            /**
297:             * Gets the geocode. NOT currently used.
298:             *
299:             * @return code
300:             * @exception if an error occurs
301:             */
302:            public String getGeocode() throws AirSentException {
303:                try {
304:                    return messengerDO.getGeocode();
305:                } catch (Exception ex) {
306:                    throw new AirSentException(
307:                            "Error getting messenger's geocode", ex);
308:                }
309:            }
310:
311:            /**
312:             * Saves the messenger.
313:             *
314:             * @exception if an error occurs
315:             */
316:            public void save() throws AirSentException {
317:                try {
318:                    this .messengerDO.commit();
319:                } catch (Exception ex) {
320:                    throw new AirSentException("Error saving address", ex);
321:                }
322:            }
323:
324:            /**
325:             * Deletes the messenger.
326:             *
327:             * @exception if an error occurs
328:             */
329:            public void delete() throws AirSentException {
330:                try {
331:                    this .messengerDO.delete();
332:                } catch (Exception ex) {
333:                    throw new AirSentException("Error deleting address", ex);
334:                }
335:            }
336:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.