(file) Return to CIMClientRep.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Client

  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 marek    1.28     CIMClientRep(Uint32 timeoutMilliseconds =
 83                                PEGASUS_DEFAULT_CLIENT_TIMEOUT_MILLISECONDS);
 84 kumpf    1.1  
 85                   ~CIMClientRep();
 86               
 87                   virtual void handleEnqueue();
 88               
 89                   virtual Uint32 getTimeout() const
 90                   {
 91                       return _timeoutMilliseconds;
 92                   }
 93               
 94                   virtual void setTimeout(Uint32 timeoutMilliseconds)
 95                   {
 96                       _timeoutMilliseconds = timeoutMilliseconds;
 97 kumpf    1.27         if ((_connected) && (_httpConnection != 0))
 98 marek    1.28            _httpConnection->setSocketWriteTimeout(_timeoutMilliseconds/1000+1);
 99 kumpf    1.1      }
100               
101 kumpf    1.21     AcceptLanguageList getRequestAcceptLanguages() const;
102                   ContentLanguageList getRequestContentLanguages() const;
103                   ContentLanguageList getResponseContentLanguages() const;
104                   void setRequestAcceptLanguages(const AcceptLanguageList& langs);
105                   void setRequestContentLanguages(const ContentLanguageList& langs);
106 kumpf    1.1      void setRequestDefaultLanguages();
107               
108                   void connect(
109                       const String& host,
110                       const Uint32 portNumber,
111                       const String& userName,
112                       const String& password
113                   );
114               
115                   void connect(
116                       const String& host,
117                       const Uint32 portNumber,
118                       const SSLContext& sslContext,
119                       const String& userName,
120                       const String& password
121                   );
122               
123                   void connectLocal();
124               
125                   void disconnect();
126               
127 david.dillard 1.19     Boolean isConnected() const throw();
128 marek         1.9  
129 kumpf         1.1      virtual CIMClass getClass(
130                            const CIMNamespaceName& nameSpace,
131                            const CIMName& className,
132                            Boolean localOnly = true,
133                            Boolean includeQualifiers = true,
134                            Boolean includeClassOrigin = false,
135                            const CIMPropertyList& propertyList = CIMPropertyList()
136                        );
137                    
138                        virtual CIMInstance getInstance(
139                            const CIMNamespaceName& nameSpace,
140                            const CIMObjectPath& instanceName,
141                            Boolean localOnly = true,
142                            Boolean includeQualifiers = false,
143                            Boolean includeClassOrigin = false,
144                            const CIMPropertyList& propertyList = CIMPropertyList()
145                        );
146                    
147                        virtual void deleteClass(
148                            const CIMNamespaceName& nameSpace,
149                            const CIMName& className
150 kumpf         1.1      );
151                    
152                        virtual void deleteInstance(
153                            const CIMNamespaceName& nameSpace,
154                            const CIMObjectPath& instanceName
155                        );
156                    
157                        virtual void createClass(
158                            const CIMNamespaceName& nameSpace,
159                            const CIMClass& newClass
160                        );
161                    
162                        virtual CIMObjectPath createInstance(
163                            const CIMNamespaceName& nameSpace,
164                            const CIMInstance& newInstance
165                        );
166                    
167                        virtual void modifyClass(
168                            const CIMNamespaceName& nameSpace,
169                            const CIMClass& modifiedClass
170                        );
171 kumpf         1.1  
172                        virtual void modifyInstance(
173                            const CIMNamespaceName& nameSpace,
174                            const CIMInstance& modifiedInstance,
175                            Boolean includeQualifiers = true,
176                            const CIMPropertyList& propertyList = CIMPropertyList()
177                        );
178                    
179                        virtual Array<CIMClass> enumerateClasses(
180                            const CIMNamespaceName& nameSpace,
181                            const CIMName& className = CIMName(),
182                            Boolean deepInheritance = false,
183                            Boolean localOnly = true,
184                            Boolean includeQualifiers = true,
185                            Boolean includeClassOrigin = false
186                        );
187                    
188                        virtual Array<CIMName> enumerateClassNames(
189                            const CIMNamespaceName& nameSpace,
190                            const CIMName& className = CIMName(),
191                            Boolean deepInheritance = false
192 kumpf         1.1      );
193                    
194                        virtual Array<CIMInstance> enumerateInstances(
195                            const CIMNamespaceName& nameSpace,
196                            const CIMName& className,
197                            Boolean deepInheritance = true,
198                            Boolean localOnly = true,
199                            Boolean includeQualifiers = false,
200                            Boolean includeClassOrigin = false,
201                            const CIMPropertyList& propertyList = CIMPropertyList()
202                        );
203                    
204                        virtual Array<CIMObjectPath> enumerateInstanceNames(
205                            const CIMNamespaceName& nameSpace,
206                            const CIMName& className
207                        );
208                    
209                        virtual Array<CIMObject> execQuery(
210                            const CIMNamespaceName& nameSpace,
211                            const String& queryLanguage,
212                            const String& query
213 kumpf         1.1      );
214                    
215                        virtual Array<CIMObject> associators(
216                            const CIMNamespaceName& nameSpace,
217                            const CIMObjectPath& objectName,
218                            const CIMName& assocClass = CIMName(),
219                            const CIMName& resultClass = CIMName(),
220                            const String& role = String::EMPTY,
221                            const String& resultRole = String::EMPTY,
222                            Boolean includeQualifiers = false,
223                            Boolean includeClassOrigin = false,
224                            const CIMPropertyList& propertyList = CIMPropertyList()
225                        );
226                    
227                        virtual Array<CIMObjectPath> associatorNames(
228                            const CIMNamespaceName& nameSpace,
229                            const CIMObjectPath& objectName,
230                            const CIMName& assocClass = CIMName(),
231                            const CIMName& resultClass = CIMName(),
232                            const String& role = String::EMPTY,
233                            const String& resultRole = String::EMPTY
234 kumpf         1.1      );
235                    
236                        virtual Array<CIMObject> references(
237                            const CIMNamespaceName& nameSpace,
238                            const CIMObjectPath& objectName,
239                            const CIMName& resultClass = CIMName(),
240                            const String& role = String::EMPTY,
241                            Boolean includeQualifiers = false,
242                            Boolean includeClassOrigin = false,
243                            const CIMPropertyList& propertyList = CIMPropertyList()
244                        );
245                    
246                        virtual Array<CIMObjectPath> referenceNames(
247                            const CIMNamespaceName& nameSpace,
248                            const CIMObjectPath& objectName,
249                            const CIMName& resultClass = CIMName(),
250                            const String& role = String::EMPTY
251                        );
252                    
253                        virtual CIMValue getProperty(
254                            const CIMNamespaceName& nameSpace,
255 kumpf         1.1          const CIMObjectPath& instanceName,
256                            const CIMName& propertyName
257                        );
258                    
259                        virtual void setProperty(
260                            const CIMNamespaceName& nameSpace,
261                            const CIMObjectPath& instanceName,
262                            const CIMName& propertyName,
263                            const CIMValue& newValue = CIMValue()
264                        );
265                    
266                        virtual CIMQualifierDecl getQualifier(
267                            const CIMNamespaceName& nameSpace,
268                            const CIMName& qualifierName
269                        );
270                    
271                        virtual void setQualifier(
272                            const CIMNamespaceName& nameSpace,
273                            const CIMQualifierDecl& qualifierDeclaration
274                        );
275                    
276 kumpf         1.1      virtual void deleteQualifier(
277                            const CIMNamespaceName& nameSpace,
278                            const CIMName& qualifierName
279                        );
280                    
281                        virtual Array<CIMQualifierDecl> enumerateQualifiers(
282                            const CIMNamespaceName& nameSpace
283                        );
284                    
285                        virtual CIMValue invokeMethod(
286                            const CIMNamespaceName& nameSpace,
287                            const CIMObjectPath& instanceName,
288                            const CIMName& methodName,
289                            const Array<CIMParamValue>& inParameters,
290                            Array<CIMParamValue>& outParameters
291                        );
292                    
293 w.white       1.18     void registerClientOpPerformanceDataHandler(
294                            ClientOpPerformanceDataHandler & handler);
295 david.dillard 1.19 
296 w.white       1.18     void deregisterClientOpPerformanceDataHandler();
297                    
298 mike          1.31     void setBinaryResponse(bool x) { _binaryResponse = x; }
299                    
300                        void setBinaryRequest(bool x) { _binaryRequest = x; }
301                    
302 kumpf         1.1  private:
303                    
304 mike          1.31     void _connect(bool binaryRequest, bool binaryResponse);
305 kumpf         1.4      void _disconnect();
306                    
307 kumpf         1.1      Message* _doRequest(
308 a.arora       1.12         AutoPtr<CIMRequestMessage>& request,
309 kumpf         1.30         MessageType expectedResponseMessageType);
310 kumpf         1.1  
311 a.arora       1.12     AutoPtr<Monitor> _monitor;
312                        AutoPtr<HTTPConnector> _httpConnector;
313 denise.eckstein 1.20     HTTPConnection* _httpConnection;
314 r.kieninger     1.11 
315 kumpf           1.1      Uint32 _timeoutMilliseconds;
316                          Boolean _connected;
317 kumpf           1.29     /**
318                              The CIMExportClient uses a lazy reconnect algorithm.  A reconnection
319                              is necessary when the server (listener) sends a Connection: Close
320                              header in the HTTP response or when a connection timeout occurs
321                              while waiting for a response.  In these cases, a disconnect is
322                              performed immediately and the _doReconnect flag is set.  The
323                              connection is re-established only when required to perform another
324                              operation.  Note that in the case of a connection timeout, the
325                              challenge status must be reset in the ClientAuthenticator to allow
326                              authentication to be performed properly on the new connection.
327                          */
328                          Boolean _doReconnect;
329                      
330 a.arora         1.12     AutoPtr<CIMOperationResponseDecoder> _responseDecoder;
331                          AutoPtr<CIMOperationRequestEncoder> _requestEncoder;
332 kumpf           1.1      ClientAuthenticator _authenticator;
333                          String _connectHost;
334                          Uint32 _connectPortNumber;
335 kumpf           1.10     AutoPtr<SSLContext> _connectSSLContext;
336 a.dunfey        1.22     ClientPerfDataStore perfDataStore;
337 kumpf           1.1  
338 kumpf           1.21     AcceptLanguageList requestAcceptLanguages;
339                          ContentLanguageList requestContentLanguages;
340                          ContentLanguageList responseContentLanguages;
341 mike            1.31     bool _binaryRequest;
342                          bool _binaryResponse;
343 kumpf           1.1  };
344                      
345                      PEGASUS_NAMESPACE_END
346                      
347                      #endif /* Pegasus_ClientRep_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2