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