Source Code Cross Referenced for XINSCallResult.java in  » Web-Services » xins » org » xins » client » 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 » xins » org.xins.client 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: XINSCallResult.java,v 1.26 2007/03/15 17:08:27 agoubard Exp $
003:         *
004:         * Copyright 2003-2007 Orange Nederland Breedband B.V.
005:         * See the COPYRIGHT file for redistribution and use restrictions.
006:         */
007:        package org.xins.client;
008:
009:        import org.xins.common.MandatoryArgumentChecker;
010:        import org.xins.common.service.CallExceptionList;
011:        import org.xins.common.service.CallResult;
012:        import org.xins.common.service.TargetDescriptor;
013:        import org.xins.common.collections.PropertyReader;
014:        import org.xins.common.xml.Element;
015:
016:        /**
017:         * Successful result of a call to a XINS service. It may be that some targets
018:         * failed before a target returned a successful result. All the failures are
019:         * also stored in this object.
020:         *
021:         * <p>When a <code>XINSCallResult</code> instance is created, information must
022:         * be passed both about the successful call (which target successfully
023:         * returned a result, how long did it take, what was the result) and about the
024:         * unsuccessful calls (to which targets were they, what was the error, etc.)
025:         *
026:         * <p>While a {@link XINSCallResultData} object describes the result of a call
027:         * to an single target, a <code>XINSCallResultData</code> also describes all
028:         * failed calls that happened before.
029:         *
030:         * @version $Revision: 1.26 $ $Date: 2007/03/15 17:08:27 $
031:         * @author <a href="mailto:ernst@ernstdehaan.com">Ernst de Haan</a>
032:         *
033:         * @since XINS 1.0.0
034:         */
035:        public final class XINSCallResult extends CallResult implements 
036:                XINSCallResultData {
037:
038:            /**
039:             * The <code>XINSCallResultData</code> object that contains all the
040:             * information returned from the call. This field cannot be
041:             * <code>null</code>.
042:             */
043:            private final XINSCallResultData _data;
044:
045:            /**
046:             * Constructs a new <code>XINSCallResult</code> object.
047:             *
048:             * @param request
049:             *    the original {@link XINSCallRequest} that was used to perform the
050:             *    call, cannot be <code>null</code>.
051:             *
052:             * @param succeededTarget
053:             *    the {@link TargetDescriptor} that was used to successfully get the
054:             *    result, cannot be <code>null</code>.
055:             *
056:             * @param duration
057:             *    the call duration, should be &gt;= 0.
058:             *
059:             * @param exceptions
060:             *    the list of {@link org.xins.common.service.CallException}s, collected
061:             *    in a {@link CallExceptionList} object, or <code>null</code> if the
062:             *    first call attempt succeeded.
063:             *
064:             * @param data
065:             *    the {@link XINSCallResultData} returned from the call, cannot be
066:             *    <code>null</code>.
067:             *
068:             * @throws IllegalArgumentException
069:             *    if <code>request         ==   null
070:             *          || succeededTarget ==   null
071:             *          || data            ==   null
072:             *          || duration        &lt; 0</code>.
073:             */
074:            XINSCallResult(XINSCallRequest request,
075:                    TargetDescriptor succeededTarget, long duration,
076:                    CallExceptionList exceptions, XINSCallResultData data)
077:
078:            throws IllegalArgumentException {
079:
080:                super (request, succeededTarget, duration, exceptions);
081:
082:                _data = data;
083:            }
084:
085:            /**
086:             * Returns the error code. If <code>null</code> is returned the call was
087:             * successful and thus no error code was returned. Otherwise the call was
088:             * unsuccessful.
089:             *
090:             * <p>This method will never return an empty string, so if the result is
091:             * not <code>null</code>, then it is safe to assume the length of the
092:             * string is at least 1 character.
093:             *
094:             * @return
095:             *    the returned error code, or <code>null</code> if the call was
096:             *    successful.
097:             */
098:            public String getErrorCode() {
099:                return _data.getErrorCode();
100:            }
101:
102:            /**
103:             * Gets all parameters.
104:             *
105:             * @return
106:             *    a {@link PropertyReader} with all parameters, or <code>null</code>
107:             *    if there are none.
108:             */
109:            public PropertyReader getParameters() {
110:                return _data.getParameters();
111:            }
112:
113:            /**
114:             * Gets the value of the specified parameter.
115:             *
116:             * @param name
117:             *    the parameter element name, not <code>null</code>.
118:             *
119:             * @return
120:             *    string containing the value of the parameter element,
121:             *    or <code>null</code> if the parameter has no value.
122:             *
123:             * @throws IllegalArgumentException
124:             *    if <code>name == null</code>.
125:             */
126:            public String getParameter(String name)
127:                    throws IllegalArgumentException {
128:
129:                // Check preconditions
130:                MandatoryArgumentChecker.check("name", name);
131:
132:                PropertyReader params = getParameters();
133:
134:                // Short-circuit if there are no parameters at all
135:                if (params == null) {
136:                    return null;
137:                }
138:
139:                // Otherwise return the parameter value
140:                return params.get(name);
141:            }
142:
143:            /**
144:             * Returns the optional extra data. The data is an XML {@link Element},
145:             * or <code>null</code>.
146:             *
147:             * @return
148:             *    the extra data as an XML {@link Element}, can be
149:             *    <code>null</code>.
150:             */
151:            public Element getDataElement() {
152:                return _data.getDataElement();
153:            }
154:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.