1 //%/////-*-c++-*-///////////////////////////////////////////////////////////////
3 // Copyright (c) 2000, 2001 BMC Software, Hewlett-Packard Company, IBM,
4 // The Open Group, Tivoli Systems
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
7 // of this software and associated documentation files (the "Software"), to
8 // deal in the Software without restriction, including without limitation the
9 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 // sell copies of the Software, and to permit persons to whom the Software is
11 // furnished to do so, subject to the following conditions:
13 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
14 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
15 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
16 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
17 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 //==============================================================================
24 // Author: Mike Brasher (mbrasher@bmc.com)
26 // Modified By: Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com)
28 // Nag Boranna, Hewlett-Packard Company (nagaraja_boranna@hp.com)
30 //%/////////////////////////////////////////////////////////////////////////////
32 #ifndef Pegasus_Client_h
33 #define Pegasus_Client_h
36 #include <Pegasus/Common/Config.h>
37 #include <Pegasus/Common/String.h>
38 #include <Pegasus/Common/Monitor.h>
39 #include <Pegasus/Common/HTTPConnector.h>
40 #include <Pegasus/Common/CIMMessage.h>
41 #include <Pegasus/Common/MessageQueueService.h>
42 #include <Pegasus/Common/CIMObject.h>
43 #include <Pegasus/Common/Exception.h>
44 #include <Pegasus/Client/ClientAuthenticator.h>
45 #include <Pegasus/ExportClient/Linkage.h>
47 PEGASUS_NAMESPACE_BEGIN
50 class CIMExportResponseDecoder;
51 class CIMExportRequestEncoder;
53 /** This class provides the interface that a client uses to communicate
56 class PEGASUS_EXPORT_CLIENT_LINKAGE CIMExportClient : public MessageQueueService
59 typedef MessageQueueService Base;
62 enum { DEFAULT_TIMEOUT_MILLISECONDS = 20000 };
67 HTTPConnector* httpConnector,
68 Uint32 timeOutMilliseconds = DEFAULT_TIMEOUT_MILLISECONDS);
74 virtual void handleEnqueue(Message *);
75 virtual void handleEnqueue();
77 /** Returns the queue name. */
78 virtual const char* getQueueName() const;
81 Uint32 getTimeOut() const
83 return _timeOutMilliseconds;
87 void setTimeOut(Uint32 timeOutMilliseconds)
89 _timeOutMilliseconds = timeOutMilliseconds;
93 void connect(const String& address);
96 // Connection used by local clients
99 const String& address,
100 const String& userName = String::EMPTY);
103 virtual void exportIndication(
104 const String& nameSpace,
105 const CIMInstance& instanceName);
109 Message* _waitForResponse(
110 const Uint32 messageType,
111 const String& messageId,
112 const Uint32 timeOutMilliseconds = DEFAULT_TIMEOUT_MILLISECONDS);
114 void _checkError(const CIMResponseMessage* responseMessage);
117 HTTPConnector* _httpConnector;
118 Uint32 _timeOutMilliseconds;
120 CIMExportResponseDecoder* _responseDecoder;
121 CIMExportRequestEncoder* _requestEncoder;
122 ClientAuthenticator* _authenticator;
125 PEGASUS_NAMESPACE_END
127 #endif /* Pegasus_Client_h */