1 j.alex 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 j.alex 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 // Author: John Alex, IBM (johnalex@us.ibm.com)
33 //
34 //
35 //%/////////////////////////////////////////////////////////////////////////////
36
37 #include <Pegasus/Common/Config.h>
38 #include <Pegasus/Common/Exception.h>
39 #include "StressTestControllerException.h"
40
41 PEGASUS_NAMESPACE_BEGIN
42
43 j.alex 1.2
44 /**
45
46 Default exception identifier. This identifier is used if the specified
47 identifier is out of range. This identifier corresponds to a default
48 (generic) message in the array of exception message strings.
49
50 */
51 const Uint32 StressTestControllerException::DEFAULT_ID = 0;
52
53 /**
54
55 Minimum valid exception identifier.
56
57 */
58 const Uint32 StressTestControllerException::MIN_ID = DEFAULT_ID;
59
60 /**
61
62 Exception identifier indicating "Syntax Error" with client option.
63
64 j.alex 1.2 */
65
66 const Uint32 StressTestControllerException::INVALID_OPTION = 1;
67
68 /**
69
70 Exception identifier indicating "Syntax Error" with client option operator.
71
72 */
73 const Uint32 StressTestControllerException::INVALID_OPERATOR = 2;
74
75 /**
76
77 Exception identifier indicating "Missing closing square brace".
78
79 */
80 const Uint32 StressTestControllerException::MISSING_BRACE = 3;
81
82 /**
83
84 Exception identifier indicating "Missing value for client option".
85 j.alex 1.2
86 */
87 const Uint32 StressTestControllerException::MISSING_VALUE = 4;
88
89 /**
90
91 Maximum valid exception identifier. This value must be updated when
92 a new exception identifier and message are added.
93
94 */
95 const Uint32 StressTestControllerException::MAX_ID =
96 StressTestControllerException::MISSING_VALUE;
97
98 /**
99
100 Exception message strings. The exception identifier is used as an
101 index into this array to retrieve the appropriate exception message
102 string. When a new identifier is added, this array must be updated
103 appropriately.
104
105 */
106 j.alex 1.2 const char* StressTestControllerException::_messageStrings [] =
107 {
108 "Error in TestStressTestController command: ",
109 "Syntax Error Client option name: ",
110 "Syntax Error Client option operator: ",
111 "Missing closing square brace: ",
112 "Missing value for client option: "
113 };
114
115 /**
116
117 Constructs a StressTestControllerException with a message corresponding to
118 the specified exception ID.
119
120 @param ID the integer exception identifier
121
122 */
123 StressTestControllerException::StressTestControllerException (
124 Uint32 ID) : CommandException
125 (_messageStrings [(ID > MAX_ID) ? DEFAULT_ID : ID])
126 {
127 j.alex 1.2 }
128
129 /**
130
131 Constructs a StressTestControllerException with the specified message.
132
133 @param exceptionMessage a string containing the exception message
134
135 */
136 StressTestControllerException::StressTestControllerException (
137 const String& exceptionMessage) : CommandException (exceptionMessage)
138 {
139 }
140
141 PEGASUS_NAMESPACE_END
|