(file) Return to OOPProviderManagerRouter.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / ProviderManager2

  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           
 47           #include <Pegasus/ProviderManager2/ProviderManagerRouter.h>
 48           #include <Pegasus/ProviderManager2/ProviderManager.h>
 49           #include <Pegasus/ProviderManager2/Linkage.h>
 50           
 51           PEGASUS_NAMESPACE_BEGIN
 52           
 53 carolann.graves 1.7 typedef void (*PEGASUS_PROVIDERMODULEFAIL_CALLBACK_T)(const String &,
 54                         const String &, Uint16);
 55                     
 56 kumpf           1.1 class ProviderAgentContainer;
 57                     
 58                     typedef HashTable<String, ProviderAgentContainer*, EqualFunc<String>,
 59                         HashFunc<String> > ProviderAgentTable;
 60                     
 61                     class PEGASUS_PPM_LINKAGE OOPProviderManagerRouter
 62                         : public ProviderManagerRouter
 63                     {
 64                     public:
 65 kumpf           1.6     OOPProviderManagerRouter(
 66                             PEGASUS_INDICATION_CALLBACK_T indicationCallback,
 67 carolann.graves 1.7         PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback,
 68                             PEGASUS_PROVIDERMODULEFAIL_CALLBACK_T providerModuleFailCallback);
 69 kumpf           1.1 
 70                         virtual ~OOPProviderManagerRouter();
 71                     
 72                         virtual Message* processMessage(Message* message);
 73                     
 74                         virtual Boolean hasActiveProviders();
 75                         virtual void unloadIdleProviders();
 76                     
 77                     private:
 78                         //
 79                         // Private methods
 80                         //
 81                     
 82                         /** Unimplemented */
 83                         OOPProviderManagerRouter();
 84                         /** Unimplemented */
 85                         OOPProviderManagerRouter(const OOPProviderManagerRouter&);
 86                         /** Unimplemented */
 87                         OOPProviderManagerRouter& operator=(const OOPProviderManagerRouter&);
 88                     
 89                         /**
 90 kumpf           1.1         Return a pointer to the ProviderAgentContainer for the specified
 91 carolann.graves 1.7         module instance and requesting user.  If no appropriate
 92                             ProviderAgentContainer exists, one is created in an uninitialized state.
 93 kumpf           1.1      */
 94 kumpf           1.3     ProviderAgentContainer* _lookupProviderAgent(
 95 carolann.graves 1.7         const CIMInstance& providerModule,
 96                             CIMRequestMessage* request);
 97 kumpf           1.3 
 98                         /**
 99                             Return an array of pointers to ProviderAgentContainers for the
100                             specified moduleName.
101                          */
102                         Array<ProviderAgentContainer*> _lookupProviderAgents(
103                             const String& moduleName);
104 kumpf           1.1 
105                         /**
106                             Send the specified CIMRequestMessage to all initialized Provider
107                             Agents in the _providerAgentTable.
108                          */
109                         CIMResponseMessage* _forwardRequestToAllAgents(CIMRequestMessage* request);
110                     
111                         //
112                         // Private data
113                         //
114                     
115                         /**
116                             Callback function to which all generated indications are sent for
117                             processing.
118                          */
119 kumpf           1.6     PEGASUS_INDICATION_CALLBACK_T _indicationCallback;
120                     
121                         /**
122                             Callback function to which all response chunks are sent for processing.
123                          */
124                         PEGASUS_RESPONSE_CHUNK_CALLBACK_T _responseChunkCallback;
125 kumpf           1.1 
126                         /**
127 carolann.graves 1.7         Callback function to be called upon detection of failure of a
128                             provider module.
129                          */
130                         PEGASUS_PROVIDERMODULEFAIL_CALLBACK_T _providerModuleFailCallback;
131                     
132                         /**
133 kumpf           1.1         The _providerAgentTable contains a ProviderAgentContainer entry for
134                             each of the Provider Agent processes for which a request has been
135                             processed.  ProviderAgentContainer objects are persistent; once one
136                             is created it is never deleted.
137                          */
138                         ProviderAgentTable _providerAgentTable;
139                         /**
140                             The _providerAgentTableMutex must be locked whenever the
141                             _providerAgentTable is accessed.
142                          */
143                         Mutex _providerAgentTableMutex;
144                     };
145                     
146                     PEGASUS_NAMESPACE_END
147                     
148                     #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2