made changes to support new interface for MessageQueueService::handleEnqueue
[tpot/pegasus/.git] / src / Pegasus / ExportServer / CIMExportRequestDispatcher.h
1 //%///////-*-c++-*-/////////////////////////////////////////////////////////////
2 //
3 // Copyright (c) 2000, 2001 BMC Software, Hewlett-Packard Company, IBM,
4 // The Open Group, Tivoli Systems
5 //
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:
12 //
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.
21 //
22 //==============================================================================
23 //
24 // Author: Mike Brasher (mbrasher@bmc.com)
25 //
26 // Modified By: Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com)
27 //
28 //%/////////////////////////////////////////////////////////////////////////////
29
30 #ifndef Pegasus_CIMExportRequestDispatcher_h
31 #define Pegasus_CIMExportRequestDispatcher_h
32
33 #include <Pegasus/Common/Config.h>
34 #include <Pegasus/Common/MessageQueueService.h>
35 #include <Pegasus/Common/CIMMessage.h>
36 #include <Pegasus/Common/Config.h>
37 #include <Pegasus/Common/CIMObject.h>
38 #include <Pegasus/Consumer/CIMIndicationConsumer.h>
39 #include <Pegasus/ExportServer/Linkage.h>
40
41 #include "ConsumerTable.h"
42
43 PEGASUS_NAMESPACE_BEGIN
44
45 /** This class dispatches CIM export requests. For now it simply
46 */
47 class PEGASUS_EXPORT_SERVER_LINKAGE CIMExportRequestDispatcher
48     : public MessageQueueService
49 {
50 public:
51
52   typedef MessageQueueService Base;
53
54     CIMExportRequestDispatcher();
55
56     CIMExportRequestDispatcher(
57         Boolean dynamicReg,
58         Boolean staticConsumers,
59         Boolean persistence);
60
61     virtual ~CIMExportRequestDispatcher();
62
63 protected:
64
65     CIMIndicationConsumer* _lookupConsumer(const String& url);
66
67     virtual void _handle_async_request(AsyncRequest *req);
68
69     void handleEnqueue(Message *);
70
71     AtomicInt dienow;
72
73     virtual const char* getQueueName() const;
74         
75 private:
76
77     void _handleExportIndicationRequest(
78         CIMExportIndicationRequestMessage* request);
79
80     ConsumerTable _consumerTable;
81
82     Boolean _dynamicReg;
83     Boolean _staticConsumers;
84     Boolean _persistence;
85 };
86
87 PEGASUS_NAMESPACE_END
88
89 #endif /* Pegasus_CIMExportRequestDispatcher_h */