Source Code Cross Referenced for PSServicemoduleImpl.java in  » UML » MetaBoss » com » metaboss » sdlctools » domains » enterprisemodel » storage » xmlfileimpl » 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 » UML » MetaBoss » com.metaboss.sdlctools.domains.enterprisemodel.storage.xmlfileimpl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // THIS SOFTWARE IS PROVIDED BY SOFTARIS PTY.LTD. AND OTHER METABOSS
002:        // CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
003:        // BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
004:        // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTARIS PTY.LTD.
005:        // OR OTHER METABOSS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
006:        // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
007:        // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
008:        // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
009:        // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
010:        // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
011:        // EVEN IF SOFTARIS PTY.LTD. OR OTHER METABOSS CONTRIBUTORS ARE ADVISED OF THE
012:        // POSSIBILITY OF SUCH DAMAGE.
013:        //
014:        // Copyright 2000-2005 © Softaris Pty.Ltd. All Rights Reserved.
015:        package com.metaboss.sdlctools.domains.enterprisemodel.storage.xmlfileimpl;
016:
017:        import java.util.Iterator;
018:        import java.util.List;
019:        import java.util.StringTokenizer;
020:
021:        import javax.xml.bind.JAXBException;
022:
023:        import com.metaboss.enterprise.ps.PSDataSourceOperationInvocationException;
024:        import com.metaboss.enterprise.ps.PSException;
025:        import com.metaboss.sdlctools.domains.enterprisemodel.storage.PSServicemodule;
026:        import com.metaboss.sdlctools.domains.enterprisemodel.storage.STServicemodule;
027:        import com.metaboss.sdlctools.domains.enterprisemodel.storage.xmlfileimpl.dom.MessageDefListType;
028:        import com.metaboss.sdlctools.domains.enterprisemodel.storage.xmlfileimpl.dom.ServiceDefListType;
029:        import com.metaboss.sdlctools.domains.enterprisemodel.storage.xmlfileimpl.dom.ServicemoduleDefType;
030:        import com.metaboss.sdlctools.domains.enterprisemodel.storage.xmlfileimpl.dom.StructureDefListType;
031:        import com.metaboss.sdlctools.domains.enterprisemodel.storage.xmlfileimpl.dom.SystemDefType;
032:
033:        public class PSServicemoduleImpl implements  PSServicemodule {
034:            /** Returns  details entity corresponding to given reference or null struct if definition not found */
035:            public STServicemodule getServicemodule(String pServicemoduleRef)
036:                    throws PSException {
037:                ServicemoduleDefType lServicemoduleDef = Storage
038:                        .getServicemodule(pServicemoduleRef);
039:                if (lServicemoduleDef == null)
040:                    return null;
041:                STServicemodule lStruct = new STServicemodule();
042:                lStruct.ServicemoduleRef = lServicemoduleDef
043:                        .getServicemoduleRef();
044:                lStruct.Description = lServicemoduleDef.getDescription();
045:                return lStruct;
046:            }
047:
048:            /* Returns list of all services comprising given service module */
049:            public String[] getServicemoduleServiceRefs(String pServicemoduleRef)
050:                    throws PSException {
051:                return Storage.getServicemoduleServiceRefs(pServicemoduleRef);
052:            }
053:
054:            /* Returns list of all structures declared within given service module */
055:            public String[] getServicemoduleStructureRefs(
056:                    String pServicemoduleRef) throws PSException {
057:                return Storage.getServicemoduleStructureRefs(pServicemoduleRef);
058:            }
059:
060:            /* Returns list of all messages declared within given service module */
061:            public String[] getServicemoduleMessageRefs(String pServicemoduleRef)
062:                    throws PSException {
063:                return Storage.getServicemoduleMessageRefs(pServicemoduleRef);
064:            }
065:
066:            /** Inserts one or more new structure records into the database */
067:            public void insertServicemodule(STServicemodule pNewRecord)
068:                    throws PSException {
069:                try {
070:                    ServicemoduleDefType lServicemoduleDef = Util
071:                            .getObjectFactory().createServicemoduleDef();
072:                    lServicemoduleDef
073:                            .setServicemoduleRef(pNewRecord.ServicemoduleRef);
074:                    lServicemoduleDef.setDescription(pNewRecord.Description);
075:                    StructureDefListType lStructureDefList = Util
076:                            .getObjectFactory().createStructureDefList();
077:                    lServicemoduleDef.setStructureDefList(lStructureDefList);
078:                    ServiceDefListType lServiceDefList = Util
079:                            .getObjectFactory().createServiceDefList();
080:                    lServicemoduleDef.setServiceDefList(lServiceDefList);
081:                    MessageDefListType lMessageDefList = Util
082:                            .getObjectFactory().createMessageDefList();
083:                    lServicemoduleDef.setMessageDefList(lMessageDefList);
084:                    Storage.insertServicemodule(lServicemoduleDef);
085:
086:                    // Now find out the system this servicemodule belongs to and insert reference to this servicemodule
087:                    // Servicemodule ref consists of three  parts - enterprise name . system name . servicemodule name
088:                    StringTokenizer lTokenizer = new StringTokenizer(
089:                            pNewRecord.ServicemoduleRef, ".", false);
090:                    SystemDefType lSystemDef = Storage.getSystem(lTokenizer
091:                            .nextToken()
092:                            + "." + lTokenizer.nextToken());
093:                    lSystemDef.getServicemoduleRefList().getServicemoduleRef()
094:                            .add(pNewRecord.ServicemoduleRef);
095:                    Storage.updateSystem(lSystemDef);
096:                } catch (JAXBException e) {
097:                    throw new PSDataSourceOperationInvocationException(e);
098:                }
099:            }
100:
101:            // Updates serviicemodule details in the database
102:            public void updateServicemodule(STServicemodule pUpdatedRecord)
103:                    throws PSException {
104:                ServicemoduleDefType lServicemoduleDef = Storage
105:                        .getServicemodule(pUpdatedRecord.ServicemoduleRef);
106:                if (lServicemoduleDef == null)
107:                    throw new PSException(
108:                            "Servicemodule not found. ServicemoduleRef : "
109:                                    + pUpdatedRecord.ServicemoduleRef);
110:                lServicemoduleDef.setDescription(pUpdatedRecord.Description);
111:                Storage.updateServicemodule(lServicemoduleDef);
112:                // Now find out the system this servicemodule belongs to and update it
113:                // Servicemodule ref consists of three  parts - enterprise name . system name . servicemodule name
114:                StringTokenizer lTokenizer = new StringTokenizer(
115:                        pUpdatedRecord.ServicemoduleRef, ".", false);
116:                SystemDefType lSystemDef = Storage.getSystem(lTokenizer
117:                        .nextToken()
118:                        + "." + lTokenizer.nextToken());
119:                Storage.updateSystem(lSystemDef);
120:            }
121:
122:            // Deletes existing servicemodule
123:            public void deleteServicemodule(String pServicemoduleRef)
124:                    throws PSException {
125:                Storage.deleteServicemodule(pServicemoduleRef);
126:                // Now find out the system this servicemodule belongs to and delete reference to this servicemodule
127:                // Servicemodule ref consists of three  parts - enterprise name . system name . servicemodule name
128:                StringTokenizer lTokenizer = new StringTokenizer(
129:                        pServicemoduleRef, ".", false);
130:                SystemDefType lSystemDef = Storage.getSystem(lTokenizer
131:                        .nextToken()
132:                        + "." + lTokenizer.nextToken());
133:                List lServicemoduleRefList = lSystemDef
134:                        .getServicemoduleRefList().getServicemoduleRef();
135:                Iterator lIter = lServicemoduleRefList.iterator();
136:                for (int i = 0; lIter.hasNext(); i++) {
137:                    String lServicemoduleRef = (String) lIter.next();
138:                    if (lServicemoduleRef.equals(pServicemoduleRef)) {
139:                        lServicemoduleRefList.remove(i);
140:                        Storage.updateSystem(lSystemDef);
141:                        break;
142:                    }
143:                }
144:            }
145:        }
w_w__w___.___ja___v_a2___s___._c__om | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.