1 martin 1.16 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.17 //
|
3 martin 1.16 // 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.17 //
|
10 martin 1.16 // 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.17 //
|
17 martin 1.16 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.17 //
|
20 martin 1.16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.17 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.16 // 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.17 //
|
28 martin 1.16 //////////////////////////////////////////////////////////////////////////
|
29 kumpf 1.1 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef Pegasus_IndicationOperationAggregate_h
33 #define Pegasus_IndicationOperationAggregate_h
34
35 #include <Pegasus/Common/Config.h>
36 #include <Pegasus/Common/CIMMessage.h>
37 #include <Pegasus/Common/CIMName.h>
38 #include <Pegasus/Common/String.h>
|
39 kumpf 1.13 #include <Pegasus/Common/Magic.h>
|
40 kumpf 1.14 #include <Pegasus/Common/Mutex.h>
|
41 kumpf 1.1 #include <Pegasus/Server/Linkage.h>
42
43 #include "ProviderClassList.h"
44
45 PEGASUS_NAMESPACE_BEGIN
46
47 /**
48
|
49 david.dillard 1.10 IndicationOperationAggregate is the class that manages the aggregation of
50 indication provider responses to requests sent by the IndicationService.
|
51 kumpf 1.1 This class is modeled on the OperationAggregate class used by the
52 CIMOperationRequestDispatcher.
53
54 @author Hewlett-Packard Company
55
56 */
57 class PEGASUS_SERVER_LINKAGE IndicationOperationAggregate
58 {
59 public:
60
61 /**
62 Constructs an IndicationOperationAggregate instance.
63
64 @param origRequest the original request, if any, received by
65 the Indication Service
|
66 venkat.puvvada 1.18 @param controlProviderName Name of the control provider if the
67 request destination is control provider.
|
68 kumpf 1.1 @param indicationSubclasses the list of indication subclasses for the
69 subscription
70 */
|
71 kumpf 1.8 IndicationOperationAggregate(
72 CIMRequestMessage* origRequest,
|
73 venkat.puvvada 1.18 const String &controlProviderName,
|
74 venkat.puvvada 1.19 const Array<NamespaceClassList>& indicationSubclasses);
|
75 kumpf 1.1
|
76 kumpf 1.8 ~IndicationOperationAggregate();
|
77 kumpf 1.1
78 /**
|
79 david.dillard 1.10 Gets the original request, if any, received by the IndicationService
80 for this aggregation. The original request may be Create Instance,
81 Modify Instance, or Delete Instance. In the cases of Deletion of an
|
82 carolann.graves 1.7 Expired or Referencing Subscription, there is no original request.
|
83 kumpf 1.1
84 @return a pointer to the request, if there is a request
85 0, otherwise
86 */
|
87 aruran.ms 1.9 CIMRequestMessage* getOrigRequest() const;
|
88 kumpf 1.1
89 /**
|
90 david.dillard 1.10 Gets the message type of the original request, if any, received by the
|
91 kumpf 1.1 IndicationService.
92
93 @return the request type, if there is a request
94 0, otherwise
95 */
|
96 kumpf 1.15 MessageType getOrigType() const;
|
97 kumpf 1.1
98 /**
|
99 david.dillard 1.10 Determines if the original request requires a response, based on the
|
100 kumpf 1.1 type of the original request. Create Instance, Modify Instance, and
101 Delete Instance requests require a response.
102
103 @return TRUE, if original request requires a response
104 FALSE, otherwise
105 */
|
106 aruran.ms 1.9 Boolean requiresResponse() const;
|
107 david.dillard 1.10
|
108 kumpf 1.1 /**
109 Gets the list of indication subclasses for the subscription.
110
111 @return the list of indication subclasses
112 */
|
113 venkat.puvvada 1.19 Array<NamespaceClassList>& getIndicationSubclasses();
|
114 kumpf 1.1
115 /**
116 Gets the number of requests to be issued for this aggregation.
117
118 @return number of requests to be issued
119 */
|
120 aruran.ms 1.9 Uint32 getNumberIssued() const;
|
121 kumpf 1.1
122 /**
123 Sets the number of requests to be issued for this aggregation.
124
|
125 carolann.graves 1.11 Note: It is the responsibility of the caller to set the number of
126 requests correctly.
127
|
128 kumpf 1.1 @param i the number of requests
129 */
|
130 kumpf 1.8 void setNumberIssued(Uint32 i);
|
131 kumpf 1.1
132 /**
|
133 david.dillard 1.10 Appends a new response to the response list for this aggregation.
|
134 kumpf 1.1
|
135 carolann.graves 1.11 Note: The _appendResponseMutex is used to synchronize appending of
136 responses by multiple threads.
137
138 Note: The correctness of the return value from this method depends on
139 the caller having correctly set the number of requests with the
140 setNumberIssued() method.
141
|
142 kumpf 1.1 @param response the response
143
144 @return TRUE, if all expected responses have now been received
145 FALSE, otherwise
146 */
|
147 kumpf 1.8 Boolean appendResponse(CIMResponseMessage* response);
|
148 kumpf 1.1
149 /**
150 Gets the count of responses received for this aggregation.
151
152 @return count of responses received
153 */
|
154 aruran.ms 1.9 Uint32 getNumberResponses() const;
|
155 kumpf 1.1
156 /**
|
157 david.dillard 1.10 Gets the response at the specified position in the list for this
|
158 kumpf 1.1 aggregation.
159
|
160 carolann.graves 1.11 Note: It is the responsibility of the caller to ensure that all threads
161 are done using the appendResponse() method before any thread uses the
162 getResponse() method.
163
|
164 kumpf 1.1 @return a pointer to the response
165 */
|
166 aruran.ms 1.9 CIMResponseMessage* getResponse(Uint32 pos) const;
|
167 kumpf 1.1
168 /**
|
169 carolann.graves 1.11 Appends a new request to the request list for this aggregation.
|
170 kumpf 1.1
|
171 carolann.graves 1.11 Note: The _appendRequestMutex is used to synchronize appending of
172 requests by multiple threads.
|
173 kumpf 1.1
174 @param request the request
175 */
|
176 kumpf 1.8 void appendRequest(CIMRequestMessage* request);
|
177 kumpf 1.1
178 /**
179 Gets the count of requests issued for this aggregation.
180
181 @return count of requests issued
182 */
|
183 aruran.ms 1.9 Uint32 getNumberRequests() const;
|
184 kumpf 1.1
185 /**
|
186 david.dillard 1.10 Gets the request at the specified position in the list for this
|
187 kumpf 1.1 aggregation.
188
|
189 carolann.graves 1.11 Note: It is the responsibility of the caller to ensure that all threads
190 are done using the appendRequest() method before any thread uses the
191 getRequest() method.
192
|
193 kumpf 1.1 @return a pointer to the request
194 */
|
195 aruran.ms 1.9 CIMRequestMessage* getRequest(Uint32 pos) const;
|
196 kumpf 1.1
197 /**
|
198 carolann.graves 1.11 Finds the provider that sent the response with the specified message ID.
|
199 kumpf 1.1
|
200 carolann.graves 1.11 Note: It is the responsibility of the caller to ensure that all threads
201 are done using the appendRequest() method before any thread uses the
202 findProvider() method.
|
203 kumpf 1.1
|
204 david.dillard 1.10 @return a ProviderClassList struct for the provider that sent the
|
205 kumpf 1.1 response
206 */
|
207 aruran.ms 1.9 ProviderClassList findProvider(const String& messageId) const;
|
208 david.dillard 1.10
|
209 kumpf 1.1 private:
|
210 david.dillard 1.10 /**
|
211 kumpf 1.8 Hidden (unimplemented) default constructor
212 */
213 IndicationOperationAggregate();
214
|
215 david.dillard 1.10 /**
|
216 kumpf 1.1 Hidden (unimplemented) copy constructor
217 */
|
218 kumpf 1.8 IndicationOperationAggregate(const IndicationOperationAggregate& x);
219
|
220 david.dillard 1.10 /**
|
221 kumpf 1.8 Hidden (unimplemented) assignment operator
222 */
223 IndicationOperationAggregate& operator==(
224 const IndicationOperationAggregate& x);
|
225 kumpf 1.1
|
226 kumpf 1.8 CIMRequestMessage* _origRequest;
|
227 venkat.puvvada 1.18 String _controlProviderName;
|
228 venkat.puvvada 1.19 Array<NamespaceClassList> _indicationSubclasses;
|
229 kumpf 1.1 Uint32 _numberIssued;
|
230 kumpf 1.8 Array<CIMRequestMessage*> _requestList;
|
231 kumpf 1.1 Mutex _appendRequestMutex;
|
232 kumpf 1.8 Array<CIMResponseMessage*> _responseList;
|
233 kumpf 1.1 Mutex _appendResponseMutex;
|
234 kumpf 1.13 Magic<0x872FB41C> _magic;
|
235 kumpf 1.1 };
236
237 PEGASUS_NAMESPACE_END
238
239 #endif /* Pegasus_IndicationOperationAggregate_h */
|