1 karl 1.23 //%2006////////////////////////////////////////////////////////////////////////
|
2 kumpf 1.1 //
|
3 karl 1.14 // 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 karl 1.3 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.14 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
|
9 karl 1.17 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.23 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
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 karl 1.23 //
|
21 kumpf 1.1 // 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 //%/////////////////////////////////////////////////////////////////////////////
33
34 #ifndef Pegasus_ClientRep_h
35 #define Pegasus_ClientRep_h
36
37 #include <Pegasus/Common/Config.h>
38 #include <Pegasus/Common/String.h>
39 #include <Pegasus/Common/CIMName.h>
40 #include <Pegasus/Common/SSLContext.h>
41 #include <Pegasus/Common/CIMObject.h>
42 kumpf 1.1 #include <Pegasus/Common/CIMClass.h>
43 #include <Pegasus/Common/CIMInstance.h>
44 #include <Pegasus/Common/CIMObjectPath.h>
45 #include <Pegasus/Common/CIMValue.h>
46 #include <Pegasus/Common/CIMParamValue.h>
47 #include <Pegasus/Common/CIMPropertyList.h>
48 #include <Pegasus/Common/CIMQualifierDecl.h>
49 #include <Pegasus/Common/Exception.h>
50 #include <Pegasus/Common/Constants.h>
51 #include <Pegasus/Common/FileSystem.h>
52 #include <Pegasus/Common/Monitor.h>
53 #include <Pegasus/Common/HTTPConnector.h>
54 #include <Pegasus/Common/CIMMessage.h>
55 #include <Pegasus/Common/HTTPConnection.h>
56 #include <Pegasus/Common/XmlWriter.h>
57 #include <Pegasus/Common/TimeValue.h>
|
58 kumpf 1.10 #include <Pegasus/Common/AutoPtr.h>
|
59 kumpf 1.1 #include <Pegasus/Client/CIMClientException.h>
60 #include <Pegasus/Client/Linkage.h>
61 #include <Pegasus/Client/CIMClientInterface.h>
|
62 a.dunfey 1.22 #include <Pegasus/Client/ClientPerfDataStore.h>
|
63 kumpf 1.1
64 #include "CIMOperationResponseDecoder.h"
65 #include "CIMOperationRequestEncoder.h"
|
66 w.white 1.16
|
67 kumpf 1.1
68 PEGASUS_NAMESPACE_BEGIN
69
70 ///////////////////////////////////////////////////////////////////////////////
71 //
72 // CIMClientRep
73 //
74 ///////////////////////////////////////////////////////////////////////////////
|
75 mike 1.24 class PEGASUS_CLIENT_LINKAGE CIMClientRep : public CIMClientInterface
|
76 kumpf 1.1 {
77 public:
78
79 // Timeout value defines the time the CIMClient will wait for a response
80 // to an outstanding request. If a request times out, the connection
81 // gets reset (disconnected and reconnected).
82 CIMClientRep(Uint32 timeoutMilliseconds = DEFAULT_TIMEOUT_MILLISECONDS);
83
84 ~CIMClientRep();
85
86 virtual void handleEnqueue();
87
88 virtual Uint32 getTimeout() const
89 {
90 return _timeoutMilliseconds;
91 }
92
93 virtual void setTimeout(Uint32 timeoutMilliseconds)
94 {
95 _timeoutMilliseconds = timeoutMilliseconds;
|
96 kumpf 1.27 if ((_connected) && (_httpConnection != 0))
|
97 marek 1.25 _httpConnection->setSocketWriteTimeout(_timeoutMilliseconds/1000+1);
|
98 kumpf 1.1 }
99
|
100 kumpf 1.21 AcceptLanguageList getRequestAcceptLanguages() const;
101 ContentLanguageList getRequestContentLanguages() const;
102 ContentLanguageList getResponseContentLanguages() const;
103 void setRequestAcceptLanguages(const AcceptLanguageList& langs);
104 void setRequestContentLanguages(const ContentLanguageList& langs);
|
105 kumpf 1.1 void setRequestDefaultLanguages();
106
107 void connect(
108 const String& host,
109 const Uint32 portNumber,
110 const String& userName,
111 const String& password
112 );
113
114 void connect(
115 const String& host,
116 const Uint32 portNumber,
117 const SSLContext& sslContext,
118 const String& userName,
119 const String& password
120 );
121
122 void connectLocal();
123
124 void disconnect();
125
|
126 david.dillard 1.19 Boolean isConnected() const throw();
|
127 marek 1.9
|
128 kumpf 1.1 virtual CIMClass getClass(
129 const CIMNamespaceName& nameSpace,
130 const CIMName& className,
131 Boolean localOnly = true,
132 Boolean includeQualifiers = true,
133 Boolean includeClassOrigin = false,
134 const CIMPropertyList& propertyList = CIMPropertyList()
135 );
136
137 virtual CIMInstance getInstance(
138 const CIMNamespaceName& nameSpace,
139 const CIMObjectPath& instanceName,
140 Boolean localOnly = true,
141 Boolean includeQualifiers = false,
142 Boolean includeClassOrigin = false,
143 const CIMPropertyList& propertyList = CIMPropertyList()
144 );
145
146 virtual void deleteClass(
147 const CIMNamespaceName& nameSpace,
148 const CIMName& className
149 kumpf 1.1 );
150
151 virtual void deleteInstance(
152 const CIMNamespaceName& nameSpace,
153 const CIMObjectPath& instanceName
154 );
155
156 virtual void createClass(
157 const CIMNamespaceName& nameSpace,
158 const CIMClass& newClass
159 );
160
161 virtual CIMObjectPath createInstance(
162 const CIMNamespaceName& nameSpace,
163 const CIMInstance& newInstance
164 );
165
166 virtual void modifyClass(
167 const CIMNamespaceName& nameSpace,
168 const CIMClass& modifiedClass
169 );
170 kumpf 1.1
171 virtual void modifyInstance(
172 const CIMNamespaceName& nameSpace,
173 const CIMInstance& modifiedInstance,
174 Boolean includeQualifiers = true,
175 const CIMPropertyList& propertyList = CIMPropertyList()
176 );
177
178 virtual Array<CIMClass> enumerateClasses(
179 const CIMNamespaceName& nameSpace,
180 const CIMName& className = CIMName(),
181 Boolean deepInheritance = false,
182 Boolean localOnly = true,
183 Boolean includeQualifiers = true,
184 Boolean includeClassOrigin = false
185 );
186
187 virtual Array<CIMName> enumerateClassNames(
188 const CIMNamespaceName& nameSpace,
189 const CIMName& className = CIMName(),
190 Boolean deepInheritance = false
191 kumpf 1.1 );
192
193 virtual Array<CIMInstance> enumerateInstances(
194 const CIMNamespaceName& nameSpace,
195 const CIMName& className,
196 Boolean deepInheritance = true,
197 Boolean localOnly = true,
198 Boolean includeQualifiers = false,
199 Boolean includeClassOrigin = false,
200 const CIMPropertyList& propertyList = CIMPropertyList()
201 );
202
203 virtual Array<CIMObjectPath> enumerateInstanceNames(
204 const CIMNamespaceName& nameSpace,
205 const CIMName& className
206 );
207
208 virtual Array<CIMObject> execQuery(
209 const CIMNamespaceName& nameSpace,
210 const String& queryLanguage,
211 const String& query
212 kumpf 1.1 );
213
214 virtual Array<CIMObject> associators(
215 const CIMNamespaceName& nameSpace,
216 const CIMObjectPath& objectName,
217 const CIMName& assocClass = CIMName(),
218 const CIMName& resultClass = CIMName(),
219 const String& role = String::EMPTY,
220 const String& resultRole = String::EMPTY,
221 Boolean includeQualifiers = false,
222 Boolean includeClassOrigin = false,
223 const CIMPropertyList& propertyList = CIMPropertyList()
224 );
225
226 virtual Array<CIMObjectPath> associatorNames(
227 const CIMNamespaceName& nameSpace,
228 const CIMObjectPath& objectName,
229 const CIMName& assocClass = CIMName(),
230 const CIMName& resultClass = CIMName(),
231 const String& role = String::EMPTY,
232 const String& resultRole = String::EMPTY
233 kumpf 1.1 );
234
235 virtual Array<CIMObject> references(
236 const CIMNamespaceName& nameSpace,
237 const CIMObjectPath& objectName,
238 const CIMName& resultClass = CIMName(),
239 const String& role = String::EMPTY,
240 Boolean includeQualifiers = false,
241 Boolean includeClassOrigin = false,
242 const CIMPropertyList& propertyList = CIMPropertyList()
243 );
244
245 virtual Array<CIMObjectPath> referenceNames(
246 const CIMNamespaceName& nameSpace,
247 const CIMObjectPath& objectName,
248 const CIMName& resultClass = CIMName(),
249 const String& role = String::EMPTY
250 );
251
252 virtual CIMValue getProperty(
253 const CIMNamespaceName& nameSpace,
254 kumpf 1.1 const CIMObjectPath& instanceName,
255 const CIMName& propertyName
256 );
257
258 virtual void setProperty(
259 const CIMNamespaceName& nameSpace,
260 const CIMObjectPath& instanceName,
261 const CIMName& propertyName,
262 const CIMValue& newValue = CIMValue()
263 );
264
265 virtual CIMQualifierDecl getQualifier(
266 const CIMNamespaceName& nameSpace,
267 const CIMName& qualifierName
268 );
269
270 virtual void setQualifier(
271 const CIMNamespaceName& nameSpace,
272 const CIMQualifierDecl& qualifierDeclaration
273 );
274
275 kumpf 1.1 virtual void deleteQualifier(
276 const CIMNamespaceName& nameSpace,
277 const CIMName& qualifierName
278 );
279
280 virtual Array<CIMQualifierDecl> enumerateQualifiers(
281 const CIMNamespaceName& nameSpace
282 );
283
284 virtual CIMValue invokeMethod(
285 const CIMNamespaceName& nameSpace,
286 const CIMObjectPath& instanceName,
287 const CIMName& methodName,
288 const Array<CIMParamValue>& inParameters,
289 Array<CIMParamValue>& outParameters
290 );
291
|
292 w.white 1.18 void registerClientOpPerformanceDataHandler(
293 ClientOpPerformanceDataHandler & handler);
|
294 david.dillard 1.19
|
295 w.white 1.18 void deregisterClientOpPerformanceDataHandler();
296
|
297 kumpf 1.1 private:
298
|
299 a.arora 1.13 void _connect();
|
300 kumpf 1.1
|
301 kumpf 1.4 void _disconnect();
302
|
303 kumpf 1.1 void _reconnect();
304
305 Message* _doRequest(
|
306 a.arora 1.12 AutoPtr<CIMRequestMessage>& request,
|
307 kumpf 1.1 const Uint32 expectedResponseMessageType);
308
309 String _getLocalHostName();
|
310 a.arora 1.12 AutoPtr<Monitor> _monitor;
311 AutoPtr<HTTPConnector> _httpConnector;
|
312 denise.eckstein 1.20 HTTPConnection* _httpConnection;
|
313 r.kieninger 1.11
|
314 dj.gorey 1.5
|
315 kumpf 1.1 Uint32 _timeoutMilliseconds;
316 Boolean _connected;
|
317 a.arora 1.12 AutoPtr<CIMOperationResponseDecoder> _responseDecoder;
318 AutoPtr<CIMOperationRequestEncoder> _requestEncoder;
|
319 kumpf 1.1 ClientAuthenticator _authenticator;
320 String _connectHost;
321 Uint32 _connectPortNumber;
|
322 kumpf 1.10 AutoPtr<SSLContext> _connectSSLContext;
|
323 a.dunfey 1.22 ClientPerfDataStore perfDataStore;
|
324 kumpf 1.1
|
325 kumpf 1.21 AcceptLanguageList requestAcceptLanguages;
326 ContentLanguageList requestContentLanguages;
327 ContentLanguageList responseContentLanguages;
|
328 kumpf 1.1 };
329
330 PEGASUS_NAMESPACE_END
331
332 #endif /* Pegasus_ClientRep_h */
|