1 karl 1.2 //%2004////////////////////////////////////////////////////////////////////////
|
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 kumpf 1.1 //
10 // Permission is hereby granted, free of charge, to any person obtaining a copy
11 // of this software and associated documentation files (the "Software"), to
12 // deal in the Software without restriction, including without limitation the
13 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
14 // sell copies of the Software, and to permit persons to whom the Software is
15 // furnished to do so, subject to the following conditions:
|
16 karl 1.2 //
|
17 kumpf 1.1 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
18 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
19 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
20 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
21 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 //
26 //==============================================================================
27 //
28 // Author: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
29 // Jenny Yu, Hewlett-Packard Company (jenny_yu@hp.com)
30 //
31 // Modified By:
32 //
33 //%/////////////////////////////////////////////////////////////////////////////
34
35 #ifndef Pegasus_OOPProviderManagerRouter_h
36 #define Pegasus_OOPProviderManagerRouter_h
37
38 kumpf 1.1 #include <Pegasus/Common/Config.h>
39 #include <Pegasus/Common/String.h>
40 #include <Pegasus/Common/HashTable.h>
41 #include <Pegasus/Common/CIMMessage.h>
42 #include <Pegasus/Common/IPC.h>
43
44 #include <Pegasus/ProviderManager2/ProviderManagerRouter.h>
45 #include <Pegasus/ProviderManager2/ProviderManager.h>
46 #include <Pegasus/ProviderManager2/Linkage.h>
47
48 PEGASUS_NAMESPACE_BEGIN
49
50 class ProviderAgentContainer;
51
52 typedef HashTable<String, ProviderAgentContainer*, EqualFunc<String>,
53 HashFunc<String> > ProviderAgentTable;
54
55 class PEGASUS_PPM_LINKAGE OOPProviderManagerRouter
56 : public ProviderManagerRouter
57 {
58 public:
59 kumpf 1.1 OOPProviderManagerRouter(PEGASUS_INDICATION_CALLBACK indicationCallback);
60
61 virtual ~OOPProviderManagerRouter();
62
63 virtual Message* processMessage(Message* message);
64
65 virtual Boolean hasActiveProviders();
66 virtual void unloadIdleProviders();
67
68 private:
69 //
70 // Private methods
71 //
72
73 /** Unimplemented */
74 OOPProviderManagerRouter();
75 /** Unimplemented */
76 OOPProviderManagerRouter(const OOPProviderManagerRouter&);
77 /** Unimplemented */
78 OOPProviderManagerRouter& operator=(const OOPProviderManagerRouter&);
79
80 kumpf 1.1 /**
81 Return a pointer to the ProviderAgentContainer for the specified
|
82 kumpf 1.3 moduleName and userName. If no ProviderAgentContainer exists for
83 this moduleName/userName pair, one is created in an uninitialized
84 state.
|
85 kumpf 1.1 */
|
86 kumpf 1.3 ProviderAgentContainer* _lookupProviderAgent(
87 const String& moduleName,
88 const String& userName);
89
90 /**
91 Return an array of pointers to ProviderAgentContainers for the
92 specified moduleName.
93 */
94 Array<ProviderAgentContainer*> _lookupProviderAgents(
95 const String& moduleName);
|
96 kumpf 1.1
97 /**
98 Send the specified CIMRequestMessage to all initialized Provider
99 Agents in the _providerAgentTable.
100 */
101 CIMResponseMessage* _forwardRequestToAllAgents(CIMRequestMessage* request);
102
103 //
104 // Private data
105 //
106
107 /**
108 Callback function to which all generated indications are sent for
109 processing.
110 */
111 PEGASUS_INDICATION_CALLBACK _indicationCallback;
112
113 /**
114 The _providerAgentTable contains a ProviderAgentContainer entry for
115 each of the Provider Agent processes for which a request has been
116 processed. ProviderAgentContainer objects are persistent; once one
117 kumpf 1.1 is created it is never deleted.
118 */
119 ProviderAgentTable _providerAgentTable;
120 /**
121 The _providerAgentTableMutex must be locked whenever the
122 _providerAgentTable is accessed.
123 */
124 Mutex _providerAgentTableMutex;
125 };
126
127 PEGASUS_NAMESPACE_END
128
129 #endif
|