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

  1 karl  1.5 //%2005////////////////////////////////////////////////////////////////////////
  2 kumpf 1.1 //
  3 karl  1.4 // 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 karl  1.2 // IBM Corp.; EMC Corporation, The Open Group.
  7 karl  1.4 // 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.5 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 10           // EMC Corporation; VERITAS Software Corporation; The Open Group.
 11 kumpf 1.1 //
 12           // Permission is hereby granted, free of charge, to any person obtaining a copy
 13           // of this software and associated documentation files (the "Software"), to
 14           // deal in the Software without restriction, including without limitation the
 15           // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 16           // sell copies of the Software, and to permit persons to whom the Software is
 17           // furnished to do so, subject to the following conditions:
 18 david.dillard 1.10 //
 19 kumpf         1.1  // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 20                    // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 21                    // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 22                    // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 23                    // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 24                    // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 25                    // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 26                    // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 27                    //
 28                    //==============================================================================
 29                    //
 30 david.dillard 1.10 // Author: Carol Ann Krug Graves, Hewlett-Packard Company
 31 kumpf         1.1  //             (carolann_graves@hp.com)
 32                    //
 33 kumpf         1.8  // Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
 34 aruran.ms     1.9  //              Aruran, IBM (ashanmug@in.ibm.com) for Bug# 3601
 35 david.dillard 1.10 //              David Dillard, VERITAS Software Corp.
 36                    //                  (david.dillard@veritas.com)
 37 kumpf         1.1  //
 38                    //%/////////////////////////////////////////////////////////////////////////////
 39                    
 40                    #ifndef Pegasus_IndicationOperationAggregate_h
 41                    #define Pegasus_IndicationOperationAggregate_h
 42                    
 43                    #include <Pegasus/Common/Config.h>
 44                    #include <Pegasus/Common/CIMMessage.h>
 45                    #include <Pegasus/Common/CIMName.h>
 46                    #include <Pegasus/Common/String.h>
 47                    #include <Pegasus/Server/Linkage.h>
 48                    
 49                    #include "ProviderClassList.h"
 50                    
 51                    PEGASUS_NAMESPACE_BEGIN
 52                    
 53                    /**
 54                    
 55 david.dillard 1.10     IndicationOperationAggregate is the class that manages the aggregation of
 56                        indication provider responses to requests sent by the IndicationService.
 57 kumpf         1.1      This class is modeled on the OperationAggregate class used by the
 58                        CIMOperationRequestDispatcher.
 59                    
 60                        @author  Hewlett-Packard Company
 61                    
 62                     */
 63                    class PEGASUS_SERVER_LINKAGE IndicationOperationAggregate
 64                    {
 65                    public:
 66                    
 67                        /**
 68                            Constructs an IndicationOperationAggregate instance.
 69                    
 70                            @param   origRequest           the original request, if any, received by
 71                                                               the Indication Service
 72                            @param   indicationSubclasses  the list of indication subclasses for the
 73                                                               subscription
 74                         */
 75 kumpf         1.8      IndicationOperationAggregate(
 76                            CIMRequestMessage* origRequest,
 77                            const Array<CIMName>& indicationSubclasses);
 78 kumpf         1.1  
 79 kumpf         1.8      ~IndicationOperationAggregate();
 80 kumpf         1.1  
 81                        /**
 82 david.dillard 1.10         Determines if the instance is valid, based on the magic number set
 83 kumpf         1.1          in the constructor.
 84                    
 85                            @return  TRUE, if valid
 86                                     FALSE, otherwise
 87                        */
 88 david.dillard 1.10     Boolean isValid() const;
 89                    
 90 kumpf         1.1      /**
 91 david.dillard 1.10         Gets the original request, if any,  received by the IndicationService
 92                            for this aggregation.  The original request may be Create Instance,
 93                            Modify Instance, or Delete Instance.  In the cases of Deletion of an
 94 carolann.graves 1.7          Expired or Referencing Subscription, there is no original request.
 95 kumpf           1.1  
 96                              @return  a pointer to the request, if there is a request
 97                                       0, otherwise
 98                          */
 99 aruran.ms       1.9      CIMRequestMessage* getOrigRequest() const;
100 kumpf           1.1  
101                          /**
102 david.dillard   1.10         Gets the message type of the original request, if any, received by the
103 kumpf           1.1          IndicationService.
104                      
105                              @return  the request type, if there is a request
106                                       0, otherwise
107                          */
108 aruran.ms       1.9      Uint32 getOrigType() const;
109 kumpf           1.1  
110                          /**
111 david.dillard   1.10         Gets the message ID of the original request, if any, received by the
112 kumpf           1.1          IndicationService.
113                      
114                              @return  the message ID, if there is a request
115                                       String::EMPTY, otherwise
116                          */
117 aruran.ms       1.9      String getOrigMessageId() const;
118 kumpf           1.1  
119                          /**
120 david.dillard   1.10         Gets the destination of the original request, if any, received by the
121 kumpf           1.1          IndicationService.
122                      
123                              @return  the destination, if there is a request
124                                       0, otherwise
125                          */
126 aruran.ms       1.9      Uint32 getOrigDest() const;
127 kumpf           1.1  
128                          /**
129 david.dillard   1.10         Determines if the original request requires a response, based on the
130 kumpf           1.1          type of the original request.  Create Instance, Modify Instance, and
131                              Delete Instance requests require a response.
132                      
133                              @return  TRUE, if original request requires a response
134                                       FALSE, otherwise
135                          */
136 aruran.ms       1.9      Boolean requiresResponse() const;
137 david.dillard   1.10 
138 kumpf           1.1      /**
139                              Gets the list of indication subclasses for the subscription.
140                      
141                              @return  the list of indication subclasses
142                          */
143 kumpf           1.8      Array<CIMName>& getIndicationSubclasses();
144 kumpf           1.1  
145                          /**
146 david.dillard   1.10         Stores the object path of the created instance in the operation
147                              aggregate object, if original request was to create a subscription
148 kumpf           1.3          instance.
149                      
150                              @param   path                  the object path of the created instance
151                          */
152 kumpf           1.8      void setPath(const CIMObjectPath& path);
153 kumpf           1.3  
154                          /**
155                              Gets the object path of the created instance, if original request was
156                              to create a subscription instance.
157                      
158                              @return  CIMObjectPath of the created instance
159                          */
160 kumpf           1.8      const CIMObjectPath& getPath();
161 kumpf           1.3  
162                          /**
163 kumpf           1.1          Gets the number of requests to be issued for this aggregation.
164                      
165                              @return  number of requests to be issued
166                          */
167 aruran.ms       1.9      Uint32 getNumberIssued() const;
168 kumpf           1.1  
169                          /**
170                              Sets the number of requests to be issued for this aggregation.
171                      
172 carolann.graves 1.11         Note: It is the responsibility of the caller to set the number of
173                              requests correctly.
174                      
175 kumpf           1.1          @param   i                     the number of requests
176                          */
177 kumpf           1.8      void setNumberIssued(Uint32 i);
178 kumpf           1.1  
179                          /**
180 david.dillard   1.10         Appends a new response to the response list for this aggregation.
181 kumpf           1.1  
182 carolann.graves 1.11         Note: The _appendResponseMutex is used to synchronize appending of
183                              responses by multiple threads.
184                      
185                              Note: The correctness of the return value from this method depends on
186                              the caller having correctly set the number of requests with the
187                              setNumberIssued() method.
188                      
189 kumpf           1.1          @param   response              the response
190                      
191                              @return  TRUE, if all expected responses have now been received
192                                       FALSE, otherwise
193                          */
194 kumpf           1.8      Boolean appendResponse(CIMResponseMessage* response);
195 kumpf           1.1  
196                          /**
197                              Gets the count of responses received for this aggregation.
198                      
199                              @return  count of responses received
200                          */
201 aruran.ms       1.9      Uint32 getNumberResponses() const;
202 kumpf           1.1  
203                          /**
204 david.dillard   1.10         Gets the response at the specified position in the list for this
205 kumpf           1.1          aggregation.
206                      
207 carolann.graves 1.11         Note: It is the responsibility of the caller to ensure that all threads
208                              are done using the appendResponse() method before any thread uses the
209                              getResponse() method.
210                      
211 kumpf           1.1          @return  a pointer to the response
212                          */
213 aruran.ms       1.9      CIMResponseMessage* getResponse(Uint32 pos) const;
214 kumpf           1.1  
215                          /**
216 carolann.graves 1.11         Appends a new request to the request list for this aggregation.
217 kumpf           1.1  
218 carolann.graves 1.11         Note: The _appendRequestMutex is used to synchronize appending of
219                              requests by multiple threads.
220 kumpf           1.1  
221                              @param   request               the request
222                          */
223 kumpf           1.8      void appendRequest(CIMRequestMessage* request);
224 kumpf           1.1  
225                          /**
226                              Gets the count of requests issued for this aggregation.
227                      
228                              @return  count of requests issued
229                          */
230 aruran.ms       1.9      Uint32 getNumberRequests() const;
231 kumpf           1.1  
232                          /**
233 david.dillard   1.10         Gets the request at the specified position in the list for this
234 kumpf           1.1          aggregation.
235                      
236 carolann.graves 1.11         Note: It is the responsibility of the caller to ensure that all threads
237                              are done using the appendRequest() method before any thread uses the
238                              getRequest() method.
239                      
240 kumpf           1.1          @return  a pointer to the request
241                          */
242 aruran.ms       1.9      CIMRequestMessage* getRequest(Uint32 pos) const;
243 kumpf           1.1  
244                          /**
245 carolann.graves 1.11         Finds the provider that sent the response with the specified message ID.
246 kumpf           1.1  
247 carolann.graves 1.11         Note: It is the responsibility of the caller to ensure that all threads
248                              are done using the appendRequest() method before any thread uses the
249                              findProvider() method.
250 kumpf           1.1  
251 david.dillard   1.10         @return  a ProviderClassList struct for the provider that sent the
252 kumpf           1.1                       response
253                          */
254 aruran.ms       1.9      ProviderClassList findProvider(const String& messageId) const;
255 david.dillard   1.10 
256 kumpf           1.1  private:
257 david.dillard   1.10     /**
258 kumpf           1.8          Hidden (unimplemented) default constructor
259                           */
260                          IndicationOperationAggregate();
261                      
262 david.dillard   1.10     /**
263 kumpf           1.1          Hidden (unimplemented) copy constructor
264                           */
265 kumpf           1.8      IndicationOperationAggregate(const IndicationOperationAggregate& x);
266                      
267 david.dillard   1.10     /**
268 kumpf           1.8          Hidden (unimplemented) assignment operator
269                           */
270                          IndicationOperationAggregate& operator==(
271                              const IndicationOperationAggregate& x);
272 kumpf           1.1  
273 carolann.graves 1.11     /**
274                              Deletes the request at the specified position in the list for this
275                              aggregation.
276                      
277                              Note: Only the destructor uses this method.
278                      
279                              @param   pos                   the position in the list of the request
280                                                                 to be deleted
281                          */
282                          void _deleteRequest (Uint32 pos);
283                      
284                          /**
285                              Deletes the response at the specified position in the list for this
286                              aggregation.
287                      
288                              Note: Only the destructor uses this method.
289                      
290                              @param   pos                   the position in the list of the response
291                                                                 to be deleted
292                          */
293                          void _deleteResponse (Uint32 pos);
294 carolann.graves 1.11 
295 kumpf           1.8      CIMRequestMessage* _origRequest;
296                          Array<CIMName> _indicationSubclasses;
297 kumpf           1.3      CIMObjectPath _path;
298 kumpf           1.1      Uint32 _numberIssued;
299 kumpf           1.8      Array<CIMRequestMessage*> _requestList;
300 kumpf           1.1      Mutex _appendRequestMutex;
301 kumpf           1.8      Array<CIMResponseMessage*> _responseList;
302 kumpf           1.1      Mutex _appendResponseMutex;
303                          Uint32 _magicNumber;
304                          static const Uint32 _theMagicNumber;
305                      };
306                      
307                      PEGASUS_NAMESPACE_END
308                      
309                      #endif /* Pegasus_IndicationOperationAggregate_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2