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

  1 martin 1.29 //%LICENSE////////////////////////////////////////////////////////////////
  2 martin 1.30 //
  3 martin 1.29 // 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 martin 1.30 //
 10 martin 1.29 // 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 martin 1.30 //
 17 martin 1.29 // The above copyright notice and this permission notice shall be included
 18             // in all copies or substantial portions of the Software.
 19 martin 1.30 //
 20 martin 1.29 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 21 martin 1.30 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 22 martin 1.29 // 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 martin 1.30 //
 28 martin 1.29 //////////////////////////////////////////////////////////////////////////
 29 kumpf  1.1  //
 30             //%/////////////////////////////////////////////////////////////////////////////
 31             
 32             
 33 kumpf  1.3  #ifndef Pegasus_IndicationHandlerService_h
 34             #define Pegasus_IndicationHandlerService_h
 35 kumpf  1.1  
 36             #include <sys/types.h>
 37             #include <iostream>
 38             #include <stdio.h>
 39             #include <string.h>
 40             
 41             #include <Pegasus/Common/Config.h>
 42             #include <Pegasus/Common/AsyncOpNode.h>
 43             #include <Pegasus/Common/MessageQueueService.h>
 44             #include <Pegasus/Common/CIMMessage.h>
 45             #include <Pegasus/Handler/CIMHandler.h>
 46             #include <Pegasus/Repository/CIMRepository.h>
 47             
 48 kumpf  1.27 #include <Pegasus/HandlerService/HandlerTable.h>
 49 chuck  1.13 #include <Pegasus/HandlerService/Linkage.h>
 50 kumpf  1.1  
 51 venkat.puvvada 1.32 #ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
 52                     #include <Pegasus/HandlerService/DestinationQueue.h>
 53                     #endif
 54                     
 55 kumpf          1.1  PEGASUS_NAMESPACE_BEGIN
 56                     
 57 kumpf          1.27 class PEGASUS_HANDLER_SERVICE_LINKAGE IndicationHandlerService :
 58                         public MessageQueueService
 59 kumpf          1.1  {
 60 kumpf          1.27 public:
 61 kumpf          1.31 
 62 kumpf          1.27     typedef MessageQueueService Base;
 63 kumpf          1.31 
 64 kumpf          1.27     IndicationHandlerService(CIMRepository* repository);
 65 kumpf          1.3  
 66 venkat.puvvada 1.32     ~IndicationHandlerService();
 67 kumpf          1.31 
 68 kumpf          1.27     virtual void _handle_async_request(AsyncRequest* req);
 69 kumpf          1.4  
 70 kumpf          1.27     virtual void handleEnqueue(Message*);
 71 kumpf          1.4  
 72 kumpf          1.27     virtual void handleEnqueue();
 73 kumpf          1.1  
 74 kumpf          1.27     AtomicInt dienow;
 75 carolann.graves 1.26 
 76 kumpf           1.27 private:
 77                          IndicationHandlerService();  //  unimplemented
 78 kumpf           1.3  
 79 kumpf           1.27     CIMRepository* _repository;
 80 anusha.kandepu  1.33     
 81                          void filterInstance(bool includeQualifiers,bool includeClassOrigin,
 82                              const CIMPropertyList& propertyList,CIMInstance & newInstance);
 83 kumpf           1.1  
 84 kumpf           1.27     CIMHandleIndicationResponseMessage* _handleIndication(
 85 venkat.puvvada  1.36         CIMHandleIndicationRequestMessage* request);
 86 kumpf           1.1  
 87 kumpf           1.27     HandlerTable _handlerTable;
 88 kumpf           1.1  
 89 kumpf           1.27     CIMHandler* _lookupHandlerForClass(const CIMName& className);
 90 yi.zhou         1.22 
 91 kumpf           1.27     Boolean _loadHandler(
 92                              CIMHandleIndicationRequestMessage* request,
 93                              CIMException& cimException);
 94 venkat.puvvada  1.32 
 95                          Boolean _loadHandler(
 96                              const OperationContext& context,
 97                              const String nameSpace,
 98                              CIMInstance& indicationInstance,
 99                              CIMInstance& indicationHandlerInstance,
100                              CIMInstance& indicationSubscriptionInstance,
101 venkat.puvvada  1.37         CIMException& cimException,
102                              IndicationExportConnection **connection);
103 venkat.puvvada  1.32 
104                      #ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
105                      
106                          /**
107                              This method is called when HandlerService receives the
108                              CIMNotifySubscriptionNotActiveRequestMessage. Indications matching the
109                              subscription will be discarded from the queue and traced.
110                          */
111                          CIMNotifySubscriptionNotActiveResponseMessage*
112                              _handleSubscriptionNotActiveRequest(
113                                  CIMNotifySubscriptionNotActiveRequestMessage *message);
114                      
115                          /**
116                              This method is called when HandlerService receives the
117                              CIMNotifySubscriptionNotActiveRequestMessage. Queue will be deleted.
118                          */
119                          CIMNotifyListenerNotActiveResponseMessage* _handleListenerNotActiveRequest(
120                              CIMNotifyListenerNotActiveRequestMessage *message);
121                      
122                          /**
123                              This method is called to stop dispatcher thread when HandlerService
124 venkat.puvvada  1.32         receives the CimServiceStop request.
125                          */
126                          void _stopDispatcher();
127                      
128                          /**
129                              Tries to deliver the indication, returns true if delivery is successful
130                              else false.
131                          */
132                          void _deliverIndication(IndicationInfo *info);
133                      
134                          /**
135                              This method is called when indication in the form of
136                              CIMHandleIndicationRequestMessage arrives to HandlerService  from
137                              IndicationService. This method sets the sequence-identfier to the
138 marek           1.34         indication and enqueues the indication into the destination queue.
139 venkat.puvvada  1.32    */
140 marek           1.34     void _setSequenceIdentifierAndEnqueue(
141 venkat.puvvada  1.32         CIMHandleIndicationRequestMessage *message);
142                      
143                          /**
144 marek           1.34         Starts the dispatcher thread.
145                          */
146                          void  _startDispatcher();
147 venkat.puvvada  1.32 
148                          /**
149                              This method is called when indication delivery has failed.
150                              This method enqueues the indication on to the DestinationQueue.
151                         */
152                          void _destinationQueueEnqueue(
153                              CIMHandleIndicationRequestMessage *message);
154                      
155                          CIMResponseMessage*
156                              _handleEnumerateInstancesRequest(
157                                  CIMEnumerateInstancesRequestMessage *message);
158                      
159                          CIMResponseMessage*
160                              _handleEnumerateInstanceNamesRequest(
161                                  CIMEnumerateInstanceNamesRequestMessage *message);
162                      
163                          /**
164                              Gets the Queue name from either subscriptionName or handlerName,
165                              constructed as follows.
166                              namespace:ClassName.Name=\"HandlerName\".
167                          */
168 venkat.puvvada  1.32     String _getQueueName(
169                              const CIMObjectPath &instancePath);
170                      
171                          typedef HashTable<
172                                      String,
173                                      DestinationQueue*,
174                                      EqualFunc<String>,
175                                      HashFunc<String> > DestinationQueueTable;
176                      
177                          DestinationQueueTable _destinationQueueTable;
178                          ReadWriteSem _destinationQueueTableLock;
179                      
180                          AtomicInt _deliveryThreadsRunningCount;
181                          AtomicInt _dispatcherThreadRunning;
182                          List<IndicationInfo, Mutex> _deliveryQueue;
183                          ThreadPool _deliveryThreadPool;
184                          Thread _dispatcherThread;
185                          AtomicInt _stopDispatcherThread;
186                          const Uint32 _maxDeliveryThreads;
187 marek           1.34     Semaphore _dispatcherWaitSemaphore;
188 venkat.puvvada  1.32     static ThreadReturnType PEGASUS_THREAD_CDECL
189                              _dispatcherRoutine(void *param);
190                          static ThreadReturnType PEGASUS_THREAD_CDECL _deliveryRoutine(void *param);
191                      #endif
192 kumpf           1.1  };
193                      
194                      PEGASUS_NAMESPACE_END
195                      
196                      #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2