3 karl 1.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.;
|
13 kumpf 1.1 //
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 // 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: Carol Ann Krug Graves, Hewlett-Packard Company
33 // (carolann_graves@hp.com)
34 kumpf 1.1 //
35 // Modified By: Sushma Fernandes, Hewlett-Packard Company
36 // (sushma_fernandes@hp.com)
37 //
38 //%/////////////////////////////////////////////////////////////////////////////
39
40 #include <Pegasus/Common/Config.h>
41 #include <Pegasus/Common/ExceptionRep.h>
42 #include "OSInfoException.h"
43
44 PEGASUS_NAMESPACE_BEGIN
45
46
47 /**
48
49 Default exception identifier. This identifier is used if the specified
50 identifier is out of range. This identifier corresponds to a default
51 (generic) message in the array of exception message strings.
52
53 */
54 const Uint32 OSInfoException::DEFAULT_ID = 0;
55 kumpf 1.1
56 /**
57
58 Minimum valid exception identifier.
59
60 */
61 const Uint32 OSInfoException::MIN_ID = DEFAULT_ID;
62
63 /**
64
65 Exception identifier indicating a connection failure.
66
67 */
68
69 const Uint32 OSInfoException::CONNECT_FAIL = 1;
70
71 /**
72
73 Exception identifier indicating timed out waiting for response.
74
75 */
76 kumpf 1.1 const Uint32 OSInfoException::TIMED_OUT = 2;
77
78 /**
79
80 Exception identifier indicating invalid input.
81
82 */
83 const Uint32 OSInfoException::INVALID_INPUT = 3;
84
85 /**
86
87 Maximum valid exception identifier. This value must be updated when
88 a new exception identifier and message are added.
89
90 */
91 const Uint32 OSInfoException::MAX_ID = OSInfoException::INVALID_INPUT;
92
93 /**
94
95 Exception message strings. The exception identifier is used as an
96 index into this array to retrieve the appropriate exception message
97 kumpf 1.1 string. When a new identifier is added, this array must be updated
98 appropriately.
99
100 */
101 const char* OSInfoException::_messageStrings [] =
102 {
103 "Error in osinfo command ",
104 "Failed to connect to CIM server: ",
105 "Timed out waiting for response ",
106 "Invalid input"
107 };
108
109 /**
110
111 Constructs a OSInfoException with a message corresponding to the
112 specified exception ID.
113
114 @param ID the integer exception identifier
115
116 */
117 OSInfoException::OSInfoException (Uint32 ID) : CommandException
118 kumpf 1.1 (_messageStrings [(ID > MAX_ID) ? DEFAULT_ID : ID])
119 {
120 }
121
122 /**
123
124 Constructs a OSInfoException with a message corresponding to the
125 specified ID, appended with the specified String.
126
127 @param ID the integer exception identifier
128 @param appendString the string to append to the exception message
129
130 */
131 OSInfoException::OSInfoException (Uint32 ID, const String& appendString) :
132 CommandException (_messageStrings
133 [(ID > MAX_ID) ? DEFAULT_ID : ID])
134 {
135 _rep->message.append (appendString);
136 }
137
138 /**
139 kumpf 1.1
140 Constructs a OSInfoException with the specified message.
141
142 @param exceptionMessage a string containing the exception message
143
144 */
145 OSInfoException::OSInfoException (const String& exceptionMessage) :
146 CommandException (exceptionMessage)
147 {
148 }
149
150 PEGASUS_NAMESPACE_END
|