Source Code Cross Referenced for HTTPComponent.java in  » ESB » cbesb-1.2 » com » bostechcorp » cbesb » common » sa » component » 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 » ESB » cbesb 1.2 » com.bostechcorp.cbesb.common.sa.component 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * ChainBuilder ESB
003:         *          Visual Enterprise Integration
004:         * 
005:         * Copyright (C) 2006 Bostech Corporation
006:         * 
007:         * This program is free software; you can redistribute it and/or modify it 
008:         * under the terms of the GNU General Public License as published by the 
009:         * Free Software Foundation; either version 2 of the License, or (at your option) 
010:         * any later version.
011:         *
012:         * This program is distributed in the hope that it will be useful, 
013:         * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
014:         * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
015:         * for more details.
016:         * 
017:         * You should have received a copy of the GNU General Public License along with 
018:         * this program; if not, write to the Free Software Foundation, Inc., 
019:         * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020:         *
021:         *
022:         * $Id$
023:         */
024:        package com.bostechcorp.cbesb.common.sa.component;
025:
026:        import java.io.File;
027:        import java.util.List;
028:
029:        import javax.wsdl.WSDLException;
030:
031:        import org.eclipse.core.runtime.Path;
032:
033:        import com.bostechcorp.cbesb.common.i18n.Message;
034:        import com.bostechcorp.cbesb.common.i18n.Messages;
035:        import com.bostechcorp.cbesb.common.sa.service.EndPoint;
036:        import com.bostechcorp.cbesb.common.sa.service.PropertiesKey;
037:        import com.bostechcorp.cbesb.common.sa.service.PropertyUtil;
038:        import com.bostechcorp.cbesb.common.util.EsbPathHelper;
039:        import com.bostechcorp.cbesb.common.util.FileUtil;
040:        import com.bostechcorp.cbesb.common.util.generators.wsdl.generators.AbstractWsdlGenaretor;
041:        import com.bostechcorp.cbesb.common.util.generators.wsdl.generators.HttpWsdlGenerator;
042:
043:        public class HTTPComponent extends AbstractComponent {
044:
045:            public HTTPComponent() {
046:                super ();
047:            }
048:
049:            public String getComponentName() {
050:                return "ChainBuilderESB-BC-HTTP";
051:            }
052:
053:            @Override
054:            public void generateWSDL(String path, String saName)
055:                    throws Exception {
056:                for (int i = 0; i < getEndPointList().size(); i++) {
057:                    EndPoint endPoint = this .endPointList.get(i);
058:                    // String endPointName = endPoint.getName();
059:                    String role = endPoint.getRole();
060:
061:                    // if it is client and SOAP is enable then
062:                    // use HTTP-MERGER instead of HTTp generator
063:                    if ("true".equals(endPoint.getSettings().getProperty(
064:                            PropertiesKey.HTTP_SOAP_ENABLE))
065:                            && !PropertyUtil.isConsumer(role)) {
066:
067:                        //				HttpWsdlMerger mmerger = new HttpWsdlMerger(path, saName,
068:                        //						getName(), this.getComponentType(), endPoint, endPoint
069:                        //								.getSettings().getProperty(
070:                        //										PropertiesKey.HTTP_SOAP_WSDLRESOURCE));
071:                        //				mmerger.writeToFile();
072:
073:                        //Copy wsdlResourceFile to required location
074:                        //Copy the files from src/wsdl/{SU_NAME} folder 
075:                        //into the src/SUs/{SU_NAME}/wsdlPublic
076:                        File file = new File(
077:                                EsbPathHelper
078:                                        .getFullPathForDef(endPoint
079:                                                .getSettings()
080:                                                .getProperty(
081:                                                        PropertiesKey.HTTP_SOAP_WSDLRESOURCE)));
082:                        Path auxPp = new Path(EsbPathHelper
083:                                .getCbesbUiWorkSpace());
084:                        auxPp = (Path) auxPp.append(saName).append("src")
085:                                .append("SUs").append(saName + "_" + getName())
086:                                .append("wsdlPublic");
087:                        String newPath = auxPp.toString();
088:                        File dirs = new File(newPath);
089:                        dirs.mkdirs();
090:                        FileUtil.copyFile(file, newPath);
091:                        //change the wsdlResource path
092:                        String impWSdl = endPoint.getSettings().getProperty(
093:                                PropertiesKey.HTTP_SOAP_WSDLRESOURCE);
094:                        String fileName = new Path(EsbPathHelper
095:                                .getFullPathForDef(impWSdl)).lastSegment();
096:                        endPoint.getSettings().setProperty(
097:                                PropertiesKey.HTTP_SOAP_WSDLRESOURCE,
098:                                "wsdlPublic/" + fileName);
099:                        //generate WSDL FIle
100:                        AbstractWsdlGenaretor generator = getWsdlGenerator(
101:                                path, saName, endPoint);
102:                        generator.writeToFile();
103:                    } else {
104:                        AbstractWsdlGenaretor generator = getWsdlGenerator(
105:                                path, saName, endPoint);
106:                        generator.writeToFile();
107:                    }
108:
109:                    //This generatio is tranfered to the Wizard 
110:                    //			if ("consumer".equals(role) ) {
111:                    //				//writePublicWsdlFile(path, saName, endPoint);
112:                    //				
113:                    //				Path auxPath = new Path(path);
114:                    //				auxPath=(Path)auxPath.removeLastSegments(2);
115:                    //				auxPath=(Path)auxPath.append("wsdl").append(getName());
116:                    //				
117:                    //				HttpDefaultPublicWsdlGenerator.newPublicWsdl(auxPath.toString(),
118:                    //						saName, getName(), this.getComponentType(), endPoint);
119:                    //			}
120:                }
121:            }
122:
123:            @Override
124:            public void validateBase(List<String> list) {
125:                super .validateBase(list);
126:                for (int i = 0; i < getEndPointList().size(); i++) {
127:                    EndPoint endPoint = getEndPointList().get(i);
128:                    if (endPoint.getName() == null
129:                            || "".equals(endPoint.getName())) {
130:                        list.add(new Message(
131:                                Messages.FLOWEDITOR_MISSING_ENDPOINTNAME,
132:                                getName()).getMessage());
133:                    }
134:
135:                    if (endPoint.getSettings().getProperty(
136:                            PropertiesKey.HTTP_LOCATIONURL) == null
137:                            || "".equals(endPoint.getSettings().getProperty(
138:                                    PropertiesKey.HTTP_LOCATIONURL))) {
139:                        list.add(new Message(
140:                                Messages.HTTPCOMPONENT_MISSING_LOCATIONURL,
141:                                getName()).getMessage());
142:                    }
143:                }
144:            }
145:
146:            // Bug88:
147:            // In component flow editor wizards, we need to implement the following
148:            // rules:
149:            // - the UseCCSL default to be "true"
150:            // - Is using HTTP as sever and Enable Soap is "true", the UseCCSL needs to
151:            // be
152:            // "true".
153:            // - Take out the "AddRecord" and "StripRecord" from the wizard. (in the
154:            // properties view, they should be "false" for all components except HTTP.
155:            // They
156:            // should be "false" for HTTP server with SOAP enabled and "true" for all
157:            // other
158:            // HTTP.
159:            //
160:            // In the properties view, the useSendMessage should always be "false"
161:            // except it
162:            // is HTTP server with SOAP enabled.
163:            /*
164:             * public void validateCCSL(List<String> list) { for (int i = 0; i <
165:             * getEndPointList().size(); i++) { EndPoint endPoint =
166:             * getEndPointList().get(i); String prefix=PropertiesKey.CCSL;
167:             * 
168:             * if (endPoint.isConumer() &&
169:             * endPoint.getSettings().getProperty(PropertiesKey.HTTP_SOAP_ENABLE).equals("true")) {
170:             * if(!endPoint.getSettings().getProperty(PropertiesKey.USECCSL).equals("true")){
171:             * list.add(new Message(
172:             * Messages.HTTP_PROVIDER_USECCSL,getName()).getMessage()); }
173:             * if(!(endPoint.getSettings().getProperty(prefix+PropertiesKey.CCSL_ADDRECORD).equals("false") &&
174:             * endPoint.getSettings().getProperty(prefix+PropertiesKey.CCSL_STRIPRECORD).equals("false")) ){
175:             * list.add(new Message(
176:             * Messages.HTTP_PROVIDER_ADDRECORD_STRIPRECORD,getName()).getMessage()); }
177:             * if(!endPoint.getSettings().getProperty(prefix+PropertiesKey.CCSL_USESENDMESSAGE).equals("true") ){
178:             * list.add(new Message(
179:             * Messages.HTTP_PROVIDER_USESENDMESSAGE,getName()).getMessage()); } } else
180:             * if(endPoint.getSettings().getProperty(PropertiesKey.USECCSL).equals("true")){
181:             * if(!(endPoint.getSettings().getProperty(prefix+PropertiesKey.CCSL_ADDRECORD).equals("true") &&
182:             * endPoint.getSettings().getProperty(prefix+PropertiesKey.CCSL_STRIPRECORD).equals("true")) ){
183:             * list.add(new Message(
184:             * Messages.HTTP_OTHERS_ADDRECORD_STRIPRECORD,getName()).getMessage()); }
185:             * if(!endPoint.getSettings().getProperty(prefix+PropertiesKey.CCSL_USESENDMESSAGE).equals("false") ){
186:             * list.add(new Message(
187:             * Messages.HTTP_OTHERS_USESENDMESSAGE,getName()).getMessage()); } } } }
188:             */
189:            @Override
190:            public void validateCCSL(java.util.List<String> list) {
191:                for (int i = 0; i < getEndPointList().size(); i++) {
192:                    EndPoint endPoint = getEndPointList().get(i);
193:                    String prefix = PropertiesKey.CCSL;
194:                    if (endPoint.getSettings().getProperty(
195:                            PropertiesKey.USECCSL) != null
196:                            && endPoint.getSettings().getProperty(
197:                                    PropertiesKey.USECCSL).equals("true")) {
198:                        if (endPoint.getSettings().getProperty(
199:                                prefix + PropertiesKey.CCSL_ADDRECORD).equals(
200:                                "true")
201:                                || endPoint
202:                                        .getSettings()
203:                                        .getProperty(
204:                                                prefix
205:                                                        + PropertiesKey.CCSL_STRIPRECORD)
206:                                        .equals("true")
207:                                || endPoint
208:                                        .getSettings()
209:                                        .getProperty(
210:                                                prefix
211:                                                        + PropertiesKey.CCSL_USESENDMESSAGE)
212:                                        .equals("true")) {
213:                            list.add(new Message(Messages.COMPONENT_WRONG_CCSL,
214:                                    getName()).getMessage());
215:                        }
216:
217:                    }
218:                }
219:            }
220:
221:            @Override
222:            protected AbstractWsdlGenaretor getWsdlGenerator(String path,
223:                    String saName, EndPoint ep) throws WSDLException {
224:                return new HttpWsdlGenerator(path, saName, getName(), this
225:                        .getComponentType(), ep);
226:            }
227:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.