1 j.alex 1.1.2.1 //%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 j.alex 1.1.2.1 // 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 // Author: John Alex, IBM (johnalex@us.ibm.com)
33 //
34 //%/////////////////////////////////////////////////////////////////////////////
35
36 #ifndef Pegasus_StressTestControllerException_h
37 #define Pegasus_StressTestControllerException_h
38
39 #include <Clients/cliutils/CommandException.h>
40
41 PEGASUS_NAMESPACE_BEGIN
42
43 j.alex 1.1.2.1 /**
44
45 StressTestControllerException signals that an exception has occurred in executing the
46 osinfo command.
47
48 @author Hewlett-Packard Company
49
50 */
51 class StressTestControllerException : public CommandException
52 {
53 public:
54 /**
55
56 Constructs an StressTestControllerException with a message corresponding to the
57 specified exception ID.
58
59 @param ID the integer exception identifier
60
61 */
62 StressTestControllerException (Uint32 ID);
63
64 j.alex 1.1.2.1 /**
65
66 Constructs an StressTestControllerException with a message corresponding to the
67 specified ID, appended with the specified String.
68
69 @param ID the integer exception identifier
70 @param appendString the string to append to the exception message
71
72 */
73 StressTestControllerException (Uint32 ID, const String& appendString);
74
75 /**
76
77 Constructs an StressTestControllerException with the specified message.
78
79 @param exceptionMessage a string containing the exception message
80
81 */
82 StressTestControllerException (const String& exceptionMessage);
83
84 //
85 j.alex 1.1.2.1 // Exception identifiers
86 //
87 // These are used to index into the messageStrings array to retrieve the
88 // appropriate exception message string. When a new identifier is added,
89 // the messageStrings array and MAX_ID must be updated appropriately.
90 //
91
92 /**
93
94 Default exception identifier. This identifier is used if the specified
95 identifier is out of range. This identifier corresponds to a default
96 (generic) message in the array of exception message strings.
97
98 */
99 static const Uint32 DEFAULT_ID;
100
101 /**
102
103 Minimum valid exception identifier.
104
105 */
106 j.alex 1.1.2.1 static const Uint32 MIN_ID;
107
108 /**
109
110 Exception identifier indicating a connection failure.
111
112 */
113
114 static const Uint32 CONNECT_FAIL;
115
116 /**
117
118 Exception identifier indicating timed out waiting for response.
119
120 */
121 static const Uint32 TIMED_OUT;
122
123 /**
124
125 Exception identifier indicating invalid input.
126
127 j.alex 1.1.2.1 */
128 static const Uint32 INVALID_INPUT;
129
130 /**
131
132 Maximum valid exception identifier. This value must be updated when
133 a new exception identifier and message are added.
134
135 */
136 static const Uint32 MAX_ID;
137
138 private:
139 /**
140
141 Exception message strings. The exception identifier is used as an
142 index into this array to retrieve the appropriate exception message
143 string. When a new identifier is added, this array must be updated
144 appropriately.
145
146 */
147 static const char* _messageStrings [];
148 j.alex 1.1.2.1 };
149
150 /**
151 ConfigFileSyntaxError Exception class
152 */
153 class ConfigFileSyntaxError : public Exception
154 {
155 public:
156 ConfigFileSyntaxError(const String& file, Uint32 line)
157 : Exception(_formatMessage(file, line)) { }
158
159 static String _formatMessage(const String& file, Uint32 line);
160 };
161
162 /**
163 InvalidPropertyValue Exception class
164 */
165 class InvalidPropertyValue : public Exception
166 {
167 public:
168 InvalidPropertyValue(const String& name, const String& value)
169 j.alex 1.1.2.1 : Exception(MessageLoaderParms("Config.ConfigExceptions.INVALID_PROPERTY_VALUE",
170 "Invalid property value: $0=$1",
171 name,
172 value )) { }
173 };
174
175 /**
176 InvalidClientPropertyValue Exception class
177 */
178 class InvalidClientPropertyValue : public Exception
179 {
180 public:
181 InvalidClientPropertyValue(const String& name, const String& value)
182 : Exception(MessageLoaderParms("Config.ConfigExceptions.INVALID_PROPERTY_VALUE",
183 "Invalid client property value: $0=$1",
184 name,
185 value )) { }
186 };
187
188 /**
189 DuplicateOption Exception class
190 j.alex 1.1.2.1 */
191 class DuplicateOption : public Exception
192 {
193 public:
194 DuplicateOption(const String& name)
195 : Exception(MessageLoaderParms("Config.ConfigExceptions.DUPLICATE_OPTION",
196 name)) { }
197 };
198
199 PEGASUS_NAMESPACE_END
200
201 #endif /* Pegasus_StressTestControllerException_h */
|