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

  1 karl  1.8 //%2006////////////////////////////////////////////////////////////////////////
  2 kumpf 1.1 //
  3 karl  1.3 // 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 kumpf 1.1 // IBM Corp.; EMC Corporation, The Open Group.
  7 karl  1.3 // 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.4 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 10           // EMC Corporation; VERITAS Software Corporation; The Open Group.
 11 karl  1.8 // 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           // 
 21           // 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 carolann.graves 1.6 // Author: Carol Ann Krug Graves, Hewlett-Packard Company
 33 kumpf           1.1 //             (carolann_graves@hp.com)
 34                     //
 35 carolann.graves 1.6 // Modified By:
 36 kumpf           1.1 //
 37                     //%/////////////////////////////////////////////////////////////////////////////
 38                     
 39                     #ifndef Pegasus_SubscriptionRepository_h
 40                     #define Pegasus_SubscriptionRepository_h
 41                     
 42                     #include <Pegasus/Common/Config.h>
 43                     #include <Pegasus/Server/Linkage.h>
 44                     #include <Pegasus/Common/Array.h>
 45                     #include <Pegasus/Common/String.h>
 46                     #include <Pegasus/Common/CIMName.h>
 47                     #include <Pegasus/Common/CIMInstance.h>
 48                     #include <Pegasus/Common/CIMObjectPath.h>
 49 kumpf           1.7 #include <Pegasus/Common/AcceptLanguageList.h>
 50                     #include <Pegasus/Common/ContentLanguageList.h>
 51 kumpf           1.1 #include <Pegasus/Repository/CIMRepository.h>
 52                     
 53                     
 54                     PEGASUS_NAMESPACE_BEGIN
 55                     
 56                     /**
 57                     
 58                         The SubscriptionRepository class manages Subscription, Filter, and
 59 carolann.graves 1.6     Handler instances in the Repository.
 60 kumpf           1.1 
 61                         @author  Hewlett-Packard Company
 62                     
 63                      */
 64                     
 65                     class PEGASUS_SERVER_LINKAGE SubscriptionRepository
 66                     {
 67                     public:
 68                     
 69                         /**
 70                             Constructs SubscriptionRepository instance.
 71                          */
 72                         SubscriptionRepository (
 73                             CIMRepository * repository);
 74                     
 75                         /**
 76                             Destructs SubscriptionRepository instance.
 77                          */
 78                         ~SubscriptionRepository (void);
 79                     
 80                         /**
 81 carolann.graves 1.6         Adds a Filter, Handler or Subscription instance in the repository.
 82 kumpf           1.1         Adds or sets properties as necessary.
 83                     
 84                             @param   instance              instance to be added
 85                             @param   nameSpace             namespace in which instance to be added
 86                             @param   userName              user issuing request
 87                             @param   acceptLanguages       acceptLanguages of request
 88                             @param   contentLanguages      contentLanguages of request
 89 carolann.graves 1.6         @param   enabled               indicates instance is a subscription
 90 kumpf           1.1                                          instance and is enabled
 91                     
 92                             @return  the CIMObjectPath for the instance
 93                          */
 94                         CIMObjectPath createInstance (
 95                             CIMInstance instance,
 96                             const CIMNamespaceName & nameSpace,
 97                             const String & userName,
 98 kumpf           1.7         const AcceptLanguageList & acceptLanguages,
 99                             const ContentLanguageList & contentLanguages,
100 kumpf           1.1         Boolean enabled);
101                     
102                         /**
103                             Retrieves list of enabled subscription instances in all namespaces from
104 carolann.graves 1.6         the repository.  If an invalid instance is found, it is skipped, and
105 kumpf           1.1         processing of remaining valid subscriptions continues.
106                     
107                             @param   activeSubscriptions  the returned subscription instances
108                     
109                             @return  True, if an invalid instance was found;
110                                      False otherwise
111                          */
112                         Boolean getActiveSubscriptions (
113                             Array <CIMInstance> & activeSubscriptions) const;
114                     
115                         /**
116 carolann.graves 1.6         Retrieves list of all subscription instances (including inactive
117                             disabled subscriptions) in all namespaces from the repository.
118                     
119                             @return  List of all subscriptions
120                          */
121                         Array <CIMInstance> getAllSubscriptions () const;
122                     
123                         /**
124 kumpf           1.1         Retrieves list of subscriptions in the specified namespace.
125                     
126                             @param   nameSpace             the namespace
127                     
128                             @return   List of subscription instances
129                          */
130                         Array <CIMInstance> getSubscriptions (
131 carolann.graves 1.5         const CIMNamespaceName & nameSpace) const;
132 kumpf           1.1 
133                         /**
134                             Gets the value of the SubscriptionState property from the specified
135                             Subscription instance.  If this function returns False, the value of
136                             the state parameter is unchanged.
137                     
138                             @param   instance              subscription instance
139                             @param   state                 value of SubscriptionState property if
140                                                            retrieved
141                     
142                             @return  True, if the value of the SubscriptionState property was
143                                            retrieved;
144                                      False if SubscriptionState property was missing, null, or of an
145                                            incorrect type
146                          */
147                         Boolean getState (
148                             const CIMInstance & instance,
149                             Uint16 & state) const;
150                     
151                         /**
152 carolann.graves 1.6         Deletes the specified subscription.
153 kumpf           1.1 
154 carolann.graves 1.6         Note: If the specified subscription cannot be successfully retrieved,
155                             it may have already been deleted by another thread.  In that case, an
156 kumpf           1.1         uninitialized CIMInstance is returned.
157                     
158                             @param   subscription          the subscription object path
159                     
160                             @return  CIMInstance representing deleted subscription
161                          */
162                         CIMInstance deleteSubscription (
163                             CIMObjectPath & subscription);
164                     
165                         /**
166 carolann.graves 1.6         Deletes subscriptions referencing the specified handler.  All namespaces
167                             are searched for subscriptions that reference the handler to be deleted.
168 kumpf           1.1 
169 carolann.graves 1.6         @param   nameSpace             the name space of the handler being
170                                                                deleted
171 kumpf           1.1         @param   referenceProperty     the name of the reference property in the
172                                                                subscription instance
173                             @param   handler               the handler reference
174                     
175                             @return  Array of CIMInstance objects representing deleted subscriptions
176                          */
177                         Array <CIMInstance> deleteReferencingSubscriptions (
178                             const CIMNamespaceName & nameSpace,
179                             const CIMName & referenceProperty,
180                             const CIMObjectPath & handler);
181                     
182                         /**
183                             Retrieves the Handler CIMInstance representing the handler of the
184                             specified subscription.
185                     
186                             @param   subscription          the subscription
187                     
188                             @return  a Handler CIMInstance for the subscription's handler
189                          */
190                         CIMInstance getHandler (
191                             const CIMInstance & subscription) const;
192 kumpf           1.1 
193                         /**
194                             Determines if specified handler is Transient.
195                     
196                             @param   nameSpace             the name space
197                             @param   handler               the handler reference
198                     
199                             @return  True, if the Handler is Transient;
200                                      False otherwise
201                          */
202                         Boolean isTransient (
203                             const CIMNamespaceName & nameSpace,
204                             const CIMObjectPath & handler) const;
205                     
206                         /**
207                             Retrieves the values of the filter query, source namespace,
208                             and query language properties for the specified subscription instance.
209                     
210                             @param   subscription      Input subscription instance
211                             @param   query             Output query for the filter
212                             @param   sourceNameSpace   Output source namespace for the filter
213 kumpf           1.1                                        subscription
214                             @param   queryLanguage     Output query language in which the filter
215                                                            query is expressed
216                          */
217                         void getFilterProperties (
218                             const CIMInstance & subscription,
219                             String & query,
220                             CIMNamespaceName & sourceNameSpace,
221                             String & queryLanguage);
222                     
223                         /**
224                             Retrieves the values of the filter query and source namespace
225                             properties for the specified subscription instance.
226                     
227                             @param   subscription      Input subscription instance
228                             @param   query             Output query for the filter
229                             @param   sourceNameSpace   Output source namespace for the filter
230                                                            subscription
231                          */
232                         void getFilterProperties (
233                             const CIMInstance & subscription,
234 kumpf           1.1         String & query,
235                             CIMNamespaceName & sourceNameSpace);
236                     
237                         /**
238 carolann.graves 1.6         Retrieves the value of the filter query property
239 kumpf           1.1         for the specified subscription instance.
240                     
241                             @param   subscription      Input subscription instance
242                             @param   query             Output query for the filter
243                          */
244                         void getFilterProperties (
245                             const CIMInstance & subscription,
246                             String & query);
247                     
248                         /**
249 carolann.graves 1.6         Validates that the specified class is a subclass of the Indication
250 kumpf           1.1         class.
251                     
252                             @param   indicationClassName   the class name to be validated
253                             @param   nameSpaceName         the namespace
254                     
255                             @return  String containing the indication class name
256                          */
257                         Boolean validateIndicationClassName (
258                             const CIMName & indicationClassName,
259                             const CIMNamespaceName & nameSpaceName) const;
260                     
261                         /**
262                             Retrieves the subclass names of the specified indication class.
263                     
264                             @param   nameSpace             the namespace
265                             @param   indicationClassName   the indication class name
266                     
267                             @return  List of indication subclass names, including original class
268                          */
269                         Array <CIMName> getIndicationSubclasses (
270                             const CIMNamespaceName & nameSpace,
271 kumpf           1.1         const CIMName & indicationClassName) const;
272                     
273                         /**
274                             Implements the subscription's On Fatal Error Policy.
275                             This function is called when a fatal error has occurred in the
276                             indication provider or indication handler, and the subscription can no
277                             longer be served.
278                             If the subscription's policy is Disable, the Subscription State is
279                             set to Disabled.
280 carolann.graves 1.6         If the subscription's policy is Remove, the subscription instance is
281 kumpf           1.1         deleted.
282                     
283                             @param   subscription          the subscription instance
284                     
285                             @return  True, if the subscription has been disabled or deleted;
286                                      False otherwise
287                          */
288                         Boolean reconcileFatalError (
289                             const CIMInstance subscription);
290                     
291                         /**
292                             Retrieves the specified class object from the repository.
293                     
294                             @param   nameSpaceName         the namespace
295                             @param   className             the class name
296                             @param   localOnly             return only local elements
297                             @param   includeQualifiers     return qualifier elements
298                             @param   includeClassOrigin    return ClassOrigin attribute
299                             @param   propertyList          return specified properties
300                     
301                             @return  CIMClass object for the specified class
302 kumpf           1.1      */
303                         CIMClass getClass (
304                             const CIMNamespaceName & nameSpaceName,
305                             const CIMName & className,
306                             Boolean localOnly = true,
307                             Boolean includeQualifiers = true,
308                             Boolean includeClassOrigin = false,
309                             const CIMPropertyList & propertyList = CIMPropertyList()) const;
310                     
311                         /**
312                             Retrieves the specified instance object from the repository.
313                     
314 carolann.graves 1.5         @param   nameSpace             the namespace
315 kumpf           1.1         @param   instanceName          the instance object path
316                             @param   localOnly             return only local elements
317                             @param   includeQualifiers     return qualifier elements
318                             @param   includeClassOrigin    return ClassOrigin attribute
319                             @param   propertyList          return specified properties
320                     
321                             @return  CIMInstance object for the specified instance
322                          */
323                         CIMInstance getInstance (
324                             const CIMNamespaceName & nameSpace,
325                             const CIMObjectPath & instanceName,
326                             Boolean localOnly = true,
327                             Boolean includeQualifiers = false,
328                             Boolean includeClassOrigin = false,
329                             const CIMPropertyList & propertyList = CIMPropertyList ());
330                     
331                         /**
332                             Modifies the specified instance in the repository.
333                     
334 carolann.graves 1.5         @param   nameSpace             the namespace
335 kumpf           1.1         @param   modifiedInstance      the modified instance object
336                             @param   includeQualifiers     return qualifier elements
337                             @param   propertyList          return specified properties
338                          */
339                         void modifyInstance (
340                             const CIMNamespaceName & nameSpace,
341                             const CIMInstance & modifiedInstance,
342                             Boolean includeQualifiers = true,
343                             const CIMPropertyList & propertyList = CIMPropertyList ());
344                     
345                         /**
346                             Deletes the specified instance from the repository.
347                     
348 carolann.graves 1.5         @param   nameSpace             the namespace
349 kumpf           1.1         @param   instanceName          the instance object path
350                          */
351                         void deleteInstance (
352                             const CIMNamespaceName & nameSpace,
353                             const CIMObjectPath & instanceName);
354                     
355                         /**
356                             Enumerates instances of the specified class from the repository.
357                     
358 carolann.graves 1.5         @param   nameSpace             the namespace
359 kumpf           1.1         @param   className             the class name
360                             @param   deepInheritance       return inherited properties
361                             @param   localOnly             return only local elements
362                             @param   includeQualifiers     return qualifier elements
363                             @param   includeClassOrigin    return ClassOrigin attribute
364                             @param   propertyList          return specified properties
365                     
366                             @return  Array of CIMInstance objects for the specified enumeration
367                          */
368                         Array <CIMInstance> enumerateInstancesForClass (
369                             const CIMNamespaceName & nameSpace,
370                             const CIMName & className,
371                             Boolean localOnly = true,
372                             Boolean includeQualifiers = false,
373                             Boolean includeClassOrigin = false,
374                             const CIMPropertyList & propertyList = CIMPropertyList ());
375                     
376                         /**
377                             Enumerates instance names of the specified class from the repository.
378                     
379 carolann.graves 1.5         @param   nameSpace             the namespace
380 kumpf           1.1         @param   className             the class name
381                     
382                             @return  Array of CIMObjectPath objects for the specified enumeration
383                          */
384                         Array <CIMObjectPath> enumerateInstanceNamesForClass (
385                             const CIMNamespaceName & nameSpace,
386 kumpf           1.9         const CIMName & className);
387 kumpf           1.1 
388                     private:
389                     
390                         /**
391                             Disables the subscription.
392                             This function is called when a fatal error has occurred in the
393                             indication provider or indication handler, the subscription can no
394                             longer be served, and the subscription's policy is Disable.
395                             The Subscription State is set to Disabled.
396                     
397                             @param   subscription          the subscription instance
398                          */
399                         void _disableSubscription (
400                             CIMInstance subscription);
401                     
402                         /**
403                             Deletes the subscription instance.
404                             This function is called when a fatal error has occurred in the
405                             indication provider or indication handler, the subscription can no
406                             longer be served, and the subscription's policy is Remove.
407                             The subscription instance is deleted.
408 kumpf           1.1 
409                             @param   subscription          the subscription instance
410                          */
411                         void _deleteSubscription (
412                             const CIMInstance subscription);
413                     
414                         CIMRepository * _repository;
415                     };
416                     
417                     PEGASUS_NAMESPACE_END
418                     
419                     #endif  /* Pegasus_SubscriptionRepository_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2