1 kumpf 1.2 //%2006////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
6 // IBM Corp.; EMC Corporation, The Open Group.
7 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
9 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
11 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
13 //
14 // Permission is hereby granted, free of charge, to any person obtaining a copy
15 // of this software and associated documentation files (the "Software"), to
16 // deal in the Software without restriction, including without limitation the
17 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
18 // sell copies of the Software, and to permit persons to whom the Software is
19 // furnished to do so, subject to the following conditions:
20 //
21 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
22 kumpf 1.2 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
24 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
27 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30 //=============================================================================
31 //
32 //%////////////////////////////////////////////////////////////////////////////
33
34 #ifndef Pegasus_WsmFault_h
35 #define Pegasus_WsmFault_h
36
37 #include <Pegasus/Common/Config.h>
38 #include <Pegasus/Common/Linkage.h>
39 #include <Pegasus/Common/String.h>
40 #include <Pegasus/Common/ContentLanguageList.h>
41 #include <Pegasus/Common/MessageLoader.h>
42 #include <Pegasus/WsmServer/WsmRequest.h>
43 kumpf 1.2 #include <Pegasus/WsmServer/WsmUtils.h>
44
45 PEGASUS_NAMESPACE_BEGIN
46
47
48 class PEGASUS_WSMSERVER_LINKAGE WsmFault
49 {
50 public:
51
52 enum Code
53 {
54 s_Sender,
55 s_Receiver
56 };
57
58 enum Subcode
59 {
60 wsman_AccessDenied,
61 wsa_ActionNotSupported,
62 wsman_AlreadyExists,
63 wsen_CannotProcessFilter,
64 kumpf 1.2 wsman_Concurrency,
65 wse_DeliveryModeRequestedUnavailable,
66 wsman_DeliveryRefused,
67 wsa_DestinationUnreachable,
68 wsman_EncodingLimit,
69 wsa_EndpointUnavailable,
70 wse_EventSourceUnableToProcess,
71 wsen_FilterDialectRequestedUnavailable,
72 wse_FilteringNotSupported,
73 wsen_FilteringNotSupported,
74 wse_FilteringRequestedUnavailable,
75 wsman_InternalError,
76 wsman_FragmentDialectNotSupported,
77 wsman_InvalidBookmark,
78 wsen_InvalidEnumerationContext,
79 wse_InvalidExpirationTime,
80 wsen_InvalidExpirationTime,
81 wse_InvalidMessage,
82 wsa_InvalidMessageInformationHeader,
83 wsman_InvalidOptions,
84 wsman_InvalidParameter,
85 kumpf 1.2 wxf_InvalidRepresentation,
86 wsman_InvalidSelectors,
87 wsa_MessageInformationHeaderRequired,
88 wsman_NoAck,
89 wsman_QuotaLimit,
90 wsman_SchemaValidationError,
91 wsen_TimedOut,
92 wsman_TimedOut,
93 wse_UnableToRenew,
94 wse_UnsupportedExpirationType,
95 wsen_UnsupportedExpirationType,
96 wsman_UnsupportedFeature
97 };
98
99 struct FaultTableEntry
100 {
101 Code code;
102 Subcode subcode;
103 WsmNamespaces::Type nsType;
104 const char* subcodeStr;
105 };
106 kumpf 1.2
107 WsmFault(
108 Subcode subcode,
109 const MessageLoaderParms& msgParms,
110 const String& faultDetail = String::EMPTY);
111
112 WsmFault(
113 Subcode subcode,
114 const String& reason = String::EMPTY,
115 const ContentLanguageList& reasonLanguage = ContentLanguageList(),
116 const String& faultDetail = String::EMPTY);
117
118 WsmFault(const WsmFault& fault);
119
120 ~WsmFault()
121 {
122 }
123
124 const char* getAction() const;
125 String getCode() const;
126 String getSubcode() const;
127 kumpf 1.2 String getReason() const;
128 ContentLanguageList getReasonLanguage() const;
129 String getFaultDetail() const;
130 // Note: Other types of s:Detail data are not supported.
131
132 private:
133
134 static FaultTableEntry _faultTable[];
135
136 Subcode _subcode;
137 String _reason;
138 ContentLanguageList _reasonLanguage;
139 String _faultDetail;
140 };
141
142 class PEGASUS_WSMSERVER_LINKAGE SoapNotUnderstoodFault
143 {
144 public:
145
146 SoapNotUnderstoodFault(
147 const String& nameSpace,
148 kumpf 1.2 const String& headerName);
149
150 String getNamespace() const;
151 String getHeaderName() const;
152 String getMessage() const;
153 ContentLanguageList getMessageLanguage() const;
154
155 private:
156
157 String _nameSpace;
158 String _headerName;
159 String _message;
160 ContentLanguageList _messageLanguage;
161 };
162
163 PEGASUS_NAMESPACE_END
164
165 #endif /* Pegasus_WsmFault_h */
|