BUG#: 2656
[tpot/pegasus/.git] / src / Pegasus / HandlerService / IndicationHandlerService.h
1 //%2005////////////////////////////////////////////////////////////////////////
2 //
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.;
6 // IBM Corp.; EMC Corporation, The Open Group.
7 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
9 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
11 //
12 // Permission is hereby granted, free of charge, to any person obtaining a copy
13 // of this software and associated documentation files (the "Software"), to
14 // deal in the Software without restriction, including without limitation the
15 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
16 // sell copies of the Software, and to permit persons to whom the Software is
17 // furnished to do so, subject to the following conditions:
18 // 
19 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
20 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
21 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
22 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
23 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
24 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
25 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 //
28 //==============================================================================
29 //
30 // Author: Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com)
31 //
32 // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company
33 //                (carolann_graves@hp.com)
34 //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
35 //
36 //%/////////////////////////////////////////////////////////////////////////////
37
38
39 #ifndef Pegasus_IndicationHandlerService_h
40 #define Pegasus_IndicationHandlerService_h
41
42 #include <Pegasus/Common/Config.h>
43 #include <sys/types.h>
44 #include <iostream>
45 #include <stdio.h>
46 #include <string.h>
47
48 #include <Pegasus/Common/Config.h>
49 #include <Pegasus/Common/AsyncOpNode.h>
50 #include <Pegasus/Common/MessageQueueService.h>
51 #include <Pegasus/Common/CIMMessage.h>
52 #include <Pegasus/Handler/CIMHandler.h>
53 #include <Pegasus/Repository/CIMRepository.h>
54
55 #include "HandlerTable.h"
56
57 #include <Pegasus/HandlerService/Linkage.h>
58
59 PEGASUS_NAMESPACE_BEGIN
60
61 class PEGASUS_HANDLER_SERVICE_LINKAGE IndicationHandlerService 
62    : public MessageQueueService
63 {
64    public:
65     
66       typedef MessageQueueService Base;
67     
68       IndicationHandlerService(CIMRepository* repository);
69
70       IndicationHandlerService(void);
71
72       ~IndicationHandlerService(void) { } ;
73       
74       virtual void _handle_async_request(AsyncRequest *req);
75
76       virtual void handleEnqueue(Message *);
77
78       virtual void handleEnqueue(void);
79
80       static void _handleIndicationCallBack(AsyncOpNode *, 
81                                             MessageQueue *, 
82                                             void *);
83       
84       AtomicInt dienow;
85
86    protected:
87
88       CIMHandleIndicationResponseMessage* _handleIndication(
89           CIMHandleIndicationRequestMessage* request);
90
91       HandlerTable _handlerTable;
92
93       CIMHandler* _lookupHandlerForClass(const CIMName& className);
94
95       String _parseDestination(String dest);
96
97    private:
98       CIMRepository* _repository;
99 };
100
101 PEGASUS_NAMESPACE_END
102
103 #endif