1 a.dunfey 1.4.16.1 //%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 a.dunfey 1.4.16.1 // 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 class ProviderAgentContainer;
55
56 typedef HashTable<String, ProviderAgentContainer*, EqualFunc<String>,
57 HashFunc<String> > ProviderAgentTable;
58
59 class PEGASUS_PPM_LINKAGE OOPProviderManagerRouter
60 : public ProviderManagerRouter
61 {
62 public:
63 kumpf 1.1 OOPProviderManagerRouter(PEGASUS_INDICATION_CALLBACK indicationCallback);
64
65 virtual ~OOPProviderManagerRouter();
66
67 virtual Message* processMessage(Message* message);
68
69 virtual Boolean hasActiveProviders();
70 virtual void unloadIdleProviders();
71
72 private:
73 //
74 // Private methods
75 //
76
77 /** Unimplemented */
78 OOPProviderManagerRouter();
79 /** Unimplemented */
80 OOPProviderManagerRouter(const OOPProviderManagerRouter&);
81 /** Unimplemented */
82 OOPProviderManagerRouter& operator=(const OOPProviderManagerRouter&);
83
84 kumpf 1.1 /**
85 Return a pointer to the ProviderAgentContainer for the specified
|
86 kumpf 1.3 moduleName and userName. If no ProviderAgentContainer exists for
87 this moduleName/userName pair, one is created in an uninitialized
88 state.
|
89 kumpf 1.1 */
|
90 kumpf 1.3 ProviderAgentContainer* _lookupProviderAgent(
91 const String& moduleName,
92 const String& userName);
93
94 /**
95 Return an array of pointers to ProviderAgentContainers for the
96 specified moduleName.
97 */
98 Array<ProviderAgentContainer*> _lookupProviderAgents(
99 const String& moduleName);
|
100 kumpf 1.1
101 /**
102 Send the specified CIMRequestMessage to all initialized Provider
103 Agents in the _providerAgentTable.
104 */
105 CIMResponseMessage* _forwardRequestToAllAgents(CIMRequestMessage* request);
106
107 //
108 // Private data
109 //
110
111 /**
112 Callback function to which all generated indications are sent for
113 processing.
114 */
115 PEGASUS_INDICATION_CALLBACK _indicationCallback;
116
117 /**
118 The _providerAgentTable contains a ProviderAgentContainer entry for
119 each of the Provider Agent processes for which a request has been
120 processed. ProviderAgentContainer objects are persistent; once one
121 kumpf 1.1 is created it is never deleted.
122 */
123 ProviderAgentTable _providerAgentTable;
124 /**
125 The _providerAgentTableMutex must be locked whenever the
126 _providerAgentTable is accessed.
127 */
128 Mutex _providerAgentTableMutex;
129 };
130
131 PEGASUS_NAMESPACE_END
132
133 #endif
|