Source Code Cross Referenced for HttpPrefs.java in  » Web-Services » soapui-1.7.5 » com » eviware » soapui » actions » 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 » Web Services » soapui 1.7.5 » com.eviware.soapui.actions 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  soapUI, copyright (C) 2004-2007 eviware.com 
003:         *
004:         *  soapUI is free software; you can redistribute it and/or modify it under the 
005:         *  terms of version 2.1 of the GNU Lesser General Public License as published by 
006:         *  the Free Software Foundation.
007:         *
008:         *  soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without 
009:         *  even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
010:         *  See the GNU Lesser General Public License for more details at gnu.org.
011:         */
012:
013:        package com.eviware.soapui.actions;
014:
015:        import com.eviware.soapui.model.settings.Settings;
016:        import com.eviware.soapui.settings.HttpSettings;
017:        import com.eviware.soapui.support.components.SimpleForm;
018:        import com.eviware.soapui.support.types.StringToStringMap;
019:
020:        /**
021:         * Preferences class for HttpSettings
022:         * 
023:         * @author ole.matzura
024:         */
025:
026:        public class HttpPrefs implements  Prefs {
027:            public static final String AUTHENTICATE_PREEMPTIVELY = "Authenticate Preemptively";
028:            public static final String INCLUDE_REQUEST_IN_TIME_TAKEN = "Include request in time taken";
029:            public static final String INCLUDE_RESPONSE_IN_TIME_TAKEN = "Include response in time taken";
030:            public static final String CLOSE_CONNECTIONS_AFTER_REQUEST = "Close connections after request";
031:            public static final String USER_AGENT_HEADER = "User-Agent Header";
032:            public static final String SOCKET_TIMEOUT = "Socket Timeout";
033:            public static final String MAX_RESPONSE_SIZE = "Max response size";
034:            public static final String ENCODED_URLS = "Pre-encoded Endpoints";
035:            public static final String MAX_CONNECTIONS_PER_HOST = "Max Connections Per Host";
036:            public static final String MAX_TOTAL_CONNECTIONS = "Max Total Connections";
037:            public static final String BIND_ADDRESS = "Bind Address";
038:
039:            private SimpleForm httpForm;
040:            private final String title;
041:
042:            public HttpPrefs(String title) {
043:                this .title = title;
044:            }
045:
046:            public SimpleForm getForm() {
047:                if (httpForm == null) {
048:                    httpForm = new SimpleForm();
049:                    httpForm.addSpace(5);
050:                    httpForm
051:                            .appendTextField(HttpPrefs.USER_AGENT_HEADER,
052:                                    "User-Agent HTTP header to send, blank will send default");
053:                    httpForm
054:                            .appendCheckBox(
055:                                    HttpPrefs.CLOSE_CONNECTIONS_AFTER_REQUEST,
056:                                    "Closes the HTTP connection after each SOAP request",
057:                                    true);
058:                    httpForm
059:                            .appendCheckBox(
060:                                    HttpPrefs.AUTHENTICATE_PREEMPTIVELY,
061:                                    "Adds authentication information to outgoing request",
062:                                    true);
063:                    httpForm
064:                            .appendCheckBox(
065:                                    HttpPrefs.INCLUDE_REQUEST_IN_TIME_TAKEN,
066:                                    "Includes the time it took to write the request in time-taken",
067:                                    true);
068:                    httpForm
069:                            .appendCheckBox(
070:                                    HttpPrefs.INCLUDE_RESPONSE_IN_TIME_TAKEN,
071:                                    "Includes the time it took to read the entire response in time-taken",
072:                                    true);
073:                    httpForm.appendCheckBox(HttpPrefs.ENCODED_URLS,
074:                            "Do not URL-escape service endpoints", true);
075:                    httpForm.appendTextField(HttpPrefs.SOCKET_TIMEOUT,
076:                            "Socket timeout in milliseconds");
077:                    httpForm
078:                            .appendTextField(HttpPrefs.MAX_RESPONSE_SIZE,
079:                                    "Maximum size to read from response (0 = no limit)");
080:                    httpForm.appendSeparator();
081:                    httpForm.appendTextField(
082:                            HttpPrefs.MAX_CONNECTIONS_PER_HOST,
083:                            "Maximum number of Connections Per Host");
084:                    httpForm.appendTextField(HttpPrefs.MAX_TOTAL_CONNECTIONS,
085:                            "Maximum number of Total Connections");
086:                    httpForm
087:                            .appendTextField(HttpPrefs.BIND_ADDRESS,
088:                                    "Default local address to bind to when sending requests");
089:                    httpForm.addSpace(5);
090:                }
091:
092:                return httpForm;
093:            }
094:
095:            public void getFormValues(Settings settings) {
096:                StringToStringMap httpValues = new StringToStringMap();
097:                httpForm.getValues(httpValues);
098:                storeValues(httpValues, settings);
099:            }
100:
101:            public void storeValues(StringToStringMap httpValues,
102:                    Settings settings) {
103:                settings.setString(HttpSettings.USER_AGENT, httpValues
104:                        .get(USER_AGENT_HEADER));
105:                settings.setString(HttpSettings.CLOSE_CONNECTIONS, httpValues
106:                        .get(CLOSE_CONNECTIONS_AFTER_REQUEST));
107:                settings.setString(HttpSettings.AUTHENTICATE_PREEMPTIVELY,
108:                        httpValues.get(AUTHENTICATE_PREEMPTIVELY));
109:                settings.setString(HttpSettings.SOCKET_TIMEOUT, httpValues
110:                        .get(SOCKET_TIMEOUT));
111:                settings.setString(HttpSettings.ENCODED_URLS, httpValues
112:                        .get(ENCODED_URLS));
113:                settings.setString(HttpSettings.MAX_RESPONSE_SIZE, httpValues
114:                        .get(MAX_RESPONSE_SIZE));
115:                settings.setString(HttpSettings.INCLUDE_REQUEST_IN_TIME_TAKEN,
116:                        httpValues.get(INCLUDE_REQUEST_IN_TIME_TAKEN));
117:                settings.setString(HttpSettings.INCLUDE_RESPONSE_IN_TIME_TAKEN,
118:                        httpValues.get(INCLUDE_RESPONSE_IN_TIME_TAKEN));
119:                settings.setString(HttpSettings.MAX_CONNECTIONS_PER_HOST,
120:                        httpValues.get(MAX_CONNECTIONS_PER_HOST));
121:                settings.setString(HttpSettings.MAX_TOTAL_CONNECTIONS,
122:                        httpValues.get(MAX_TOTAL_CONNECTIONS));
123:                settings.setString(HttpSettings.BIND_ADDRESS, httpValues
124:                        .get(BIND_ADDRESS));
125:            }
126:
127:            public void setFormValues(Settings settings) {
128:                getForm().setValues(getValues(settings));
129:            }
130:
131:            public StringToStringMap getValues(Settings settings) {
132:                StringToStringMap httpValues = new StringToStringMap();
133:                httpValues.put(USER_AGENT_HEADER, settings.getString(
134:                        HttpSettings.USER_AGENT, null));
135:                httpValues.put(CLOSE_CONNECTIONS_AFTER_REQUEST, settings
136:                        .getString(HttpSettings.CLOSE_CONNECTIONS, null));
137:                httpValues.put(AUTHENTICATE_PREEMPTIVELY, settings.getString(
138:                        HttpSettings.AUTHENTICATE_PREEMPTIVELY, null));
139:                httpValues.put(INCLUDE_REQUEST_IN_TIME_TAKEN, settings
140:                        .getString(HttpSettings.INCLUDE_REQUEST_IN_TIME_TAKEN,
141:                                null));
142:                httpValues.put(INCLUDE_RESPONSE_IN_TIME_TAKEN, settings
143:                        .getString(HttpSettings.INCLUDE_RESPONSE_IN_TIME_TAKEN,
144:                                null));
145:                httpValues.put(SOCKET_TIMEOUT, settings.getString(
146:                        HttpSettings.SOCKET_TIMEOUT, null));
147:                httpValues.put(ENCODED_URLS, settings.getString(
148:                        HttpSettings.ENCODED_URLS, null));
149:                httpValues.put(MAX_RESPONSE_SIZE, settings.getString(
150:                        HttpSettings.MAX_RESPONSE_SIZE, "0"));
151:                httpValues.put(MAX_CONNECTIONS_PER_HOST, settings.getString(
152:                        HttpSettings.MAX_CONNECTIONS_PER_HOST, "500"));
153:                httpValues.put(MAX_TOTAL_CONNECTIONS, settings.getString(
154:                        HttpSettings.MAX_TOTAL_CONNECTIONS, "2000"));
155:                httpValues.put(BIND_ADDRESS, settings.getString(
156:                        HttpSettings.BIND_ADDRESS, ""));
157:                return httpValues;
158:            }
159:
160:            public String getTitle() {
161:                return title;
162:            }
163:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.