Source Code Cross Referenced for ProjectImpl.java in  » J2EE » Enhydra-Demos » projectmanagement » business » project » 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 » projectmanagement.business.project 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package projectmanagement.business.project;
002:
003:        import projectmanagement.business.customer.*;
004:        import projectmanagement.business.ProjectManagementBusinessException;
005:        import projectmanagement.data.project.*;
006:        import com.lutris.appserver.server.sql.DatabaseManagerException;
007:        import com.lutris.appserver.server.sql.ObjectIdException;
008:        import com.lutris.dods.builder.generator.query.DataObjectException;
009:
010:        import projectmanagement.spec.project.*;
011:        import projectmanagement.spec.customer.*;
012:
013:        /**
014:         * Represents a project.
015:         *
016:         * @author Sasa Bojanic
017:         * @version 1.0
018:         */
019:        public class ProjectImpl implements  Project {
020:            /**
021:             * The DO of the Project.
022:             */
023:            protected ProjectDO myDO = null;
024:
025:            /**
026:             * The public constructor.
027:             */
028:            public ProjectImpl() throws ProjectManagementBusinessException {
029:                try {
030:                    this .myDO = ProjectDO.createVirgin();
031:                } catch (DatabaseManagerException ex) {
032:                    throw new ProjectManagementBusinessException(
033:                            "Error creating empty project", ex);
034:                } catch (ObjectIdException ex) {
035:                    throw new ProjectManagementBusinessException(
036:                            "Error creating object ID for project", ex);
037:                }
038:            }
039:
040:            /** The public constructor
041:             *
042:             * @param theProject. The data object of the project.
043:             */
044:            public ProjectImpl(ProjectDO theProject) {
045:                this .myDO = theProject;
046:            }
047:
048:            /**
049:             * Gets the DO object for the project
050:             *
051:             * @return the DO object.
052:             * @exception ProjectManagementBusinessException if an error occurs
053:             *   retrieving data.
054:             */
055:            public ProjectDO getDO() throws ProjectManagementBusinessException {
056:                if (this .myDO != null) {
057:                    return this .myDO;
058:                } else {
059:                    throw new ProjectManagementBusinessException(
060:                            "Error getting DO object for project");
061:                }
062:            }
063:
064:            /**
065:             * Gets the object id for the project
066:             *
067:             * @return the object id.
068:             * @exception ProjectManagementBusinessException if an error occurs
069:             *   retrieving data (usually due to an underlying data layer
070:             *   error).
071:             */
072:            public String getHandle() throws ProjectManagementBusinessException {
073:                try {
074:                    return this .myDO.getHandle();
075:                } catch (DatabaseManagerException ex) {
076:                    throw new ProjectManagementBusinessException(
077:                            "Error getting handle for project", ex);
078:                }
079:            }
080:
081:            /**
082:             * Sets the name for the project.
083:             *
084:             * @param the name.
085:             * @exception ProjectManagementBusinessException if an error occurs
086:             *   setting the data (usually due to an underlying data layer
087:             *   error).
088:             */
089:            public void setName(String name)
090:                    throws ProjectManagementBusinessException {
091:                try {
092:                    myDO.setName(name);
093:                } catch (DataObjectException ex) {
094:                    throw new ProjectManagementBusinessException(
095:                            "Error setting project name", ex);
096:                }
097:            }
098:
099:            /**
100:             * Gets the name for the project
101:             *
102:             * @return the name.
103:             * @exception ProjectManagementBusinessException if an error occurs
104:             *   retrieving data (usually due to an underlying data layer
105:             *   error).
106:             */
107:            public String getName() throws ProjectManagementBusinessException {
108:                try {
109:                    return myDO.getName();
110:                } catch (DataObjectException ex) {
111:                    throw new ProjectManagementBusinessException(
112:                            "Error getting project name", ex);
113:                }
114:            }
115:
116:            /**
117:             * Sets the money per hour for the project.
118:             *
119:             * @param the money per hour.
120:             * @exception ProjectManagementBusinessException if an error occurs
121:             *   setting the data (usually due to an underlying data layer
122:             *   error).
123:             */
124:            public void setMoneyPerHour(double moneyPerHour)
125:                    throws ProjectManagementBusinessException {
126:                try {
127:                    myDO.setMoneyPerHour(moneyPerHour);
128:                } catch (DataObjectException ex) {
129:                    throw new ProjectManagementBusinessException(
130:                            "Error setting money per hour", ex);
131:                }
132:            }
133:
134:            /**
135:             * Gets the money per hour for the project
136:             *
137:             * @return the money per hour.
138:             * @exception ProjectManagementBusinessException if an error occurs
139:             *   retrieving data (usually due to an underlying data layer
140:             *   error).
141:             */
142:            public double getMoneyPerHour()
143:                    throws ProjectManagementBusinessException {
144:                try {
145:                    return myDO.getMoneyPerHour();
146:                } catch (DataObjectException ex) {
147:                    throw new ProjectManagementBusinessException(
148:                            "Error getting money per hour", ex);
149:                }
150:            }
151:
152:            /**
153:             * Sets the customer for the project.
154:             *
155:             * @param the customer.
156:             * @exception ProjectManagementBusinessException if an error occurs
157:             *   setting the data (usually due to an underlying data layer
158:             *   error).
159:             */
160:            public void setCustomer(Customer customer)
161:                    throws ProjectManagementBusinessException {
162:                try {
163:                    myDO.setCustomer(((CustomerImpl) customer).getDO());
164:                } catch (DataObjectException ex) {
165:                    throw new ProjectManagementBusinessException(
166:                            "Error setting customer", ex);
167:                }
168:            }
169:
170:            /**
171:             * Gets the customer.
172:             *
173:             * @return the customer.
174:             * @exception ProjectManagementBusinessException if an error occurs
175:             *   retrieving data (usually due to an underlying data layer
176:             *   error).
177:             */
178:            public Customer getCustomer()
179:                    throws ProjectManagementBusinessException {
180:                try {
181:                    return new CustomerImpl(myDO.getCustomer());
182:                } catch (DataObjectException ex) {
183:                    throw new ProjectManagementBusinessException(
184:                            "Error getting customer", ex);
185:                }
186:            }
187:
188:            /**
189:             * Commits all changes to the database.
190:             *
191:             * @exception ProjectManagementBusinessException if an error occurs
192:             *   retrieving data (usually due to an underlying data layer
193:             *   error).
194:             */
195:            public void save() throws ProjectManagementBusinessException {
196:                try {
197:                    this .myDO.save();
198:                } catch (Exception ex) {
199:                    throw new ProjectManagementBusinessException(
200:                            "Error saving project", ex);
201:                }
202:            }
203:
204:            /**
205:             * Deletes the project from database.
206:             *
207:             * @exception ProjectManagementBusinessException if an error occurs
208:             *   deleting data (usually due to an underlying data layer
209:             *   error).
210:             */
211:            public void delete() throws ProjectManagementBusinessException {
212:                try {
213:                    this .myDO.delete();
214:                } catch (Exception ex) {
215:                    throw new ProjectManagementBusinessException(
216:                            "Error deleting project", ex);
217:                }
218:            }
219:
220:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.