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

  1 s.kodali 1.1 //%LICENSE////////////////////////////////////////////////////////////////
  2              //
  3              // Licensed to The Open Group (TOG) under one or more contributor license
  4              // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
  5              // this work for additional information regarding copyright ownership.
  6              // Each contributor licenses this file to you under the OpenPegasus Open
  7              // Source License; you may not use this file except in compliance with the
  8              // License.
  9              //
 10              // Permission is hereby granted, free of charge, to any person obtaining a
 11              // copy of this software and associated documentation files (the "Software"),
 12              // to deal in the Software without restriction, including without limitation
 13              // the rights to use, copy, modify, merge, publish, distribute, sublicense,
 14              // and/or sell copies of the Software, and to permit persons to whom the
 15              // Software is furnished to do so, subject to the following conditions:
 16              //
 17              // The above copyright notice and this permission notice shall be included
 18              // in all copies or substantial portions of the Software.
 19              //
 20              // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 21              // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 22 s.kodali 1.1 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 23              // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 24              // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 25              // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 26              // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 27              //
 28              //////////////////////////////////////////////////////////////////////////
 29              //
 30              //%/////////////////////////////////////////////////////////////////////////////
 31              
 32              #ifndef Pegasus_OOPProviderManagerRouter_h
 33              #define Pegasus_OOPProviderManagerRouter_h
 34              
 35              #include <Pegasus/Common/Config.h>
 36              #include <Pegasus/Common/String.h>
 37              #include <Pegasus/Common/HashTable.h>
 38              #include <Pegasus/Common/CIMMessage.h>
 39              
 40              #include <Pegasus/ProviderManager2/ProviderManager.h>
 41              #include <Pegasus/ProviderManagerRouter/ProviderManagerRouter.h>
 42              #include <Pegasus/ProviderManagerRouter/Linkage.h>
 43 s.kodali 1.1 
 44              PEGASUS_NAMESPACE_BEGIN
 45              
 46              typedef void (*PEGASUS_PROVIDERMODULEGROUPFAIL_CALLBACK_T)(const String &,
 47                  const String &, Uint16, Boolean);
 48              
 49              typedef void (*PEGASUS_ASYNC_RESPONSE_CALLBACK_T)(
 50                  CIMRequestMessage* request, CIMResponseMessage* response);
 51              
 52              class ProviderAgentContainer;
 53              
 54              typedef HashTable<String, ProviderAgentContainer*, EqualFunc<String>,
 55                  HashFunc<String> > ProviderAgentTable;
 56              
 57              class PEGASUS_PMR_LINKAGE OOPProviderManagerRouter
 58                  : public ProviderManagerRouter
 59              {
 60              public:
 61                  OOPProviderManagerRouter(
 62                      PEGASUS_INDICATION_CALLBACK_T indicationCallback,
 63                      PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback,
 64 s.kodali 1.1         PEGASUS_PROVIDERMODULEGROUPFAIL_CALLBACK_T 
 65                          providerModuleGroupFailCallback,
 66                      PEGASUS_ASYNC_RESPONSE_CALLBACK_T asyncResponseCallback);
 67              
 68                  virtual ~OOPProviderManagerRouter();
 69              
 70                  virtual Message* processMessage(Message* message);
 71              
 72                  virtual void idleTimeCleanup();
 73              
 74              private:
 75                  //
 76                  // Private methods
 77                  //
 78              
 79                  /** determine moduleName from providerModule, function sets moduleName */
 80                  void _getProviderModuleName(
 81                      const CIMInstance & providerModule,
 82                      String & moduleName);
 83              
 84                  /**
 85 s.kodali 1.1         Determine groupName from the providerModule. Function sets
 86                      groupName. A type prefix(grp or mod) is added to distinguish
 87                      between group and module names.
 88                      If ModuleGroupName property value is not specified, moduleName is set
 89                      to groupName.
 90                  */
 91                  void _getGroupNameWithType(
 92                      const CIMInstance &providerModule,
 93                      String &groupNameWithType);
 94              
 95                  /** Unimplemented */
 96                  OOPProviderManagerRouter();
 97                  /** Unimplemented */
 98                  OOPProviderManagerRouter(const OOPProviderManagerRouter&);
 99                  /** Unimplemented */
100                  OOPProviderManagerRouter& operator=(const OOPProviderManagerRouter&);
101              
102                  /**
103                      Return a pointer to the ProviderAgentContainer for the specified
104                      module instance and requesting user.  If no appropriate
105                      ProviderAgentContainer exists, one is created in an uninitialized state.
106 s.kodali 1.1      */
107                  ProviderAgentContainer* _lookupProviderAgent(
108                      const CIMInstance& providerModule,
109                      CIMRequestMessage* request);
110              
111 karl     1.1.2.2     /** Function creates a copy of _providerAgentTable. Do NOT inline this 
112                          method ever since it needs obtain the _providerAgentTableMutex and also
113                          does have to release the mutex before returning. When inlined the
114                          AutoMutex will not unlock.
115                        */
116                      Array<ProviderAgentContainer*> _getProviderAgentContainerCopy();
117                  
118 s.kodali 1.1         /**
119                          Return an array of pointers to ProviderAgentContainers for the
120                          specified moduleName.
121                       */
122                      Array<ProviderAgentContainer*> _lookupProviderAgents(
123                          const String& moduleName);
124                  
125                      /**
126                          Send the specified CIMRequestMessage to all initialized Provider
127                          Agents in the _providerAgentTable.
128                       */
129                      CIMResponseMessage* _forwardRequestToAllAgents(CIMRequestMessage* request);
130                  
131 karl     1.1.2.1     void _handleIndicationDeliveryResponse(CIMResponseMessage *response);
132                  
133 s.kodali 1.1         //
134                      // Private data
135                      //
136                  
137                      /**
138                          Callback function to which all generated indications are sent for
139                          processing.
140                       */
141                      PEGASUS_INDICATION_CALLBACK_T _indicationCallback;
142                  
143                      /**
144                          Callback function to which all response chunks are sent for processing.
145                       */
146                      PEGASUS_RESPONSE_CHUNK_CALLBACK_T _responseChunkCallback;
147                  
148                      /**
149                          Callback function to be called upon detection of failure of a
150                          provider module.
151                       */
152                      PEGASUS_PROVIDERMODULEGROUPFAIL_CALLBACK_T _providerModuleGroupFailCallback;
153                  
154 s.kodali 1.1         /**
155                         Callback function to be called for all async responses.
156                      */
157                      PEGASUS_ASYNC_RESPONSE_CALLBACK_T _asyncResponseCallback;
158                  
159                      /**
160                          The _providerAgentTable contains a ProviderAgentContainer entry for
161                          each of the Provider Agent processes for which a request has been
162                          processed.  ProviderAgentContainer objects are persistent; once one
163                          is created it is never deleted.
164                       */
165                      ProviderAgentTable _providerAgentTable;
166                      /**
167                          The _providerAgentTableMutex must be locked whenever the
168                          _providerAgentTable is accessed.
169                       */
170                      Mutex _providerAgentTableMutex;
171                  
172                      /**
173                          Pointer to the MessageQueueService thread pool.
174                      */
175 s.kodali 1.1         ThreadPool *_threadPool;
176                  
177                  };
178                  
179                  PEGASUS_NAMESPACE_END
180                  
181                  #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2