1 martin 1.3 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.4 //
|
3 martin 1.3 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
|
9 martin 1.4 //
|
10 martin 1.3 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
|
16 martin 1.4 //
|
17 martin 1.3 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.4 //
|
20 martin 1.3 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.4 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.3 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27 martin 1.4 //
|
28 martin 1.3 //////////////////////////////////////////////////////////////////////////
|
29 j.alex 1.2 //
30 // Author: John Alex, IBM (johnalex@us.ibm.com)
31 //
32 //
33 //%/////////////////////////////////////////////////////////////////////////////
34
35 #include <Pegasus/Common/Config.h>
36 #include <Pegasus/Common/Exception.h>
37 #include "StressTestControllerException.h"
38
39 PEGASUS_NAMESPACE_BEGIN
40
41
42 /**
|
43 kumpf 1.5
|
44 j.alex 1.2 Default exception identifier. This identifier is used if the specified
45 identifier is out of range. This identifier corresponds to a default
46 (generic) message in the array of exception message strings.
|
47 kumpf 1.5
|
48 j.alex 1.2 */
49 const Uint32 StressTestControllerException::DEFAULT_ID = 0;
50
51 /**
|
52 kumpf 1.5
|
53 j.alex 1.2 Minimum valid exception identifier.
|
54 kumpf 1.5
|
55 j.alex 1.2 */
56 const Uint32 StressTestControllerException::MIN_ID = DEFAULT_ID;
57
58 /**
|
59 kumpf 1.5
|
60 j.alex 1.2 Exception identifier indicating "Syntax Error" with client option.
|
61 kumpf 1.5
|
62 j.alex 1.2 */
63
64 const Uint32 StressTestControllerException::INVALID_OPTION = 1;
65
66 /**
|
67 kumpf 1.5
|
68 j.alex 1.2 Exception identifier indicating "Syntax Error" with client option operator.
|
69 kumpf 1.5
|
70 j.alex 1.2 */
71 const Uint32 StressTestControllerException::INVALID_OPERATOR = 2;
72
73 /**
|
74 kumpf 1.5
|
75 j.alex 1.2 Exception identifier indicating "Missing closing square brace".
|
76 kumpf 1.5
|
77 j.alex 1.2 */
78 const Uint32 StressTestControllerException::MISSING_BRACE = 3;
79
80 /**
|
81 kumpf 1.5
|
82 j.alex 1.2 Exception identifier indicating "Missing value for client option".
|
83 kumpf 1.5
|
84 j.alex 1.2 */
85 const Uint32 StressTestControllerException::MISSING_VALUE = 4;
86
87 /**
|
88 kumpf 1.5
|
89 j.alex 1.2 Maximum valid exception identifier. This value must be updated when
90 a new exception identifier and message are added.
|
91 kumpf 1.5
|
92 j.alex 1.2 */
|
93 kumpf 1.5 const Uint32 StressTestControllerException::MAX_ID =
|
94 j.alex 1.2 StressTestControllerException::MISSING_VALUE;
95
96 /**
97
98 Exception message strings. The exception identifier is used as an
99 index into this array to retrieve the appropriate exception message
100 string. When a new identifier is added, this array must be updated
101 appropriately.
102
103 */
104 const char* StressTestControllerException::_messageStrings [] =
105 {
106 "Error in TestStressTestController command: ",
107 "Syntax Error Client option name: ",
108 "Syntax Error Client option operator: ",
109 "Missing closing square brace: ",
110 "Missing value for client option: "
111 };
112
113 /**
|
114 kumpf 1.5
|
115 j.alex 1.2 Constructs a StressTestControllerException with a message corresponding to
116 the specified exception ID.
|
117 kumpf 1.5
|
118 j.alex 1.2 @param ID the integer exception identifier
|
119 kumpf 1.5
|
120 j.alex 1.2 */
121 StressTestControllerException::StressTestControllerException (
|
122 kumpf 1.5 Uint32 ID) : CommandException
|
123 j.alex 1.2 (_messageStrings [(ID > MAX_ID) ? DEFAULT_ID : ID])
124 {
125 }
126
127 /**
|
128 kumpf 1.5
|
129 j.alex 1.2 Constructs a StressTestControllerException with the specified message.
|
130 kumpf 1.5
|
131 j.alex 1.2 @param exceptionMessage a string containing the exception message
|
132 kumpf 1.5
|
133 j.alex 1.2 */
134 StressTestControllerException::StressTestControllerException (
135 const String& exceptionMessage) : CommandException (exceptionMessage)
136 {
137 }
138
139 PEGASUS_NAMESPACE_END
|