1 karl 1.5 //%2006////////////////////////////////////////////////////////////////////////
|
2 kumpf 1.1 //
|
3 karl 1.2 // 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 kumpf 1.1 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.2 // 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.4 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.5 // 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.2 //
|
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 // Author: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
33 // Jenny Yu, Hewlett-Packard Company (jenny_yu@hp.com)
34 //
35 // Modified By:
36 //
37 //%/////////////////////////////////////////////////////////////////////////////
38
39 #ifndef Pegasus_OOPProviderManagerRouter_h
40 #define Pegasus_OOPProviderManagerRouter_h
41
42 kumpf 1.1 #include <Pegasus/Common/Config.h>
43 #include <Pegasus/Common/String.h>
44 #include <Pegasus/Common/HashTable.h>
45 #include <Pegasus/Common/CIMMessage.h>
46 #include <Pegasus/Common/IPC.h>
47
48 #include <Pegasus/ProviderManager2/ProviderManagerRouter.h>
49 #include <Pegasus/ProviderManager2/ProviderManager.h>
50 #include <Pegasus/ProviderManager2/Linkage.h>
51
52 PEGASUS_NAMESPACE_BEGIN
53
|
54 carolann.graves 1.5.2.2 typedef void (*PEGASUS_PROVIDERMODULEFAIL_CALLBACK_T)(const String &,
55 const String &, Uint16);
56
|
57 kumpf 1.1 class ProviderAgentContainer;
58
59 typedef HashTable<String, ProviderAgentContainer*, EqualFunc<String>,
60 HashFunc<String> > ProviderAgentTable;
61
62 class PEGASUS_PPM_LINKAGE OOPProviderManagerRouter
63 : public ProviderManagerRouter
64 {
65 public:
|
66 kumpf 1.5.2.1 OOPProviderManagerRouter(
67 PEGASUS_INDICATION_CALLBACK_T indicationCallback,
|
68 carolann.graves 1.5.2.2 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback,
69 PEGASUS_PROVIDERMODULEFAIL_CALLBACK_T providerModuleFailCallback);
|
70 kumpf 1.1
71 virtual ~OOPProviderManagerRouter();
72
73 virtual Message* processMessage(Message* message);
74
75 virtual Boolean hasActiveProviders();
76 virtual void unloadIdleProviders();
77
78 private:
79 //
80 // Private methods
81 //
82
83 /** Unimplemented */
84 OOPProviderManagerRouter();
85 /** Unimplemented */
86 OOPProviderManagerRouter(const OOPProviderManagerRouter&);
87 /** Unimplemented */
88 OOPProviderManagerRouter& operator=(const OOPProviderManagerRouter&);
89
90 /**
91 kumpf 1.1 Return a pointer to the ProviderAgentContainer for the specified
|
92 carolann.graves 1.5.2.2 module instance and requesting user. If no appropriate
93 ProviderAgentContainer exists, one is created in an uninitialized state.
|
94 kumpf 1.1 */
|
95 kumpf 1.3 ProviderAgentContainer* _lookupProviderAgent(
|
96 carolann.graves 1.5.2.2 const CIMInstance& providerModule,
97 CIMRequestMessage* request);
|
98 kumpf 1.3
99 /**
100 Return an array of pointers to ProviderAgentContainers for the
101 specified moduleName.
102 */
103 Array<ProviderAgentContainer*> _lookupProviderAgents(
104 const String& moduleName);
|
105 kumpf 1.1
106 /**
107 Send the specified CIMRequestMessage to all initialized Provider
108 Agents in the _providerAgentTable.
109 */
110 CIMResponseMessage* _forwardRequestToAllAgents(CIMRequestMessage* request);
111
112 //
113 // Private data
114 //
115
116 /**
117 Callback function to which all generated indications are sent for
118 processing.
119 */
|
120 kumpf 1.5.2.1 PEGASUS_INDICATION_CALLBACK_T _indicationCallback;
121
122 /**
123 Callback function to which all response chunks are sent for processing.
124 */
125 PEGASUS_RESPONSE_CHUNK_CALLBACK_T _responseChunkCallback;
|
126 kumpf 1.1
127 /**
|
128 carolann.graves 1.5.2.2 Callback function to be called upon detection of failure of a
129 provider module.
130 */
131 PEGASUS_PROVIDERMODULEFAIL_CALLBACK_T _providerModuleFailCallback;
132
133 /**
|
134 kumpf 1.1 The _providerAgentTable contains a ProviderAgentContainer entry for
135 each of the Provider Agent processes for which a request has been
136 processed. ProviderAgentContainer objects are persistent; once one
137 is created it is never deleted.
138 */
139 ProviderAgentTable _providerAgentTable;
140 /**
141 The _providerAgentTableMutex must be locked whenever the
142 _providerAgentTable is accessed.
143 */
144 Mutex _providerAgentTableMutex;
145 };
146
147 PEGASUS_NAMESPACE_END
148
149 #endif
|