1 //%LICENSE////////////////////////////////////////////////////////////////
3 // 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
10 // 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:
17 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // 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.
28 //////////////////////////////////////////////////////////////////////////
30 //%/////////////////////////////////////////////////////////////////////////////
32 #include "DeliveryRetryTestProvider.h"
34 PEGASUS_NAMESPACE_BEGIN
36 extern "C" PEGASUS_EXPORT CIMProvider* PegasusCreateProvider(
37 const String& providerName)
39 if(String::equalNoCase(providerName, "DeliveryRetryTestProvider"))
41 return(new DeliveryRetryTestProvider());
46 void DeliveryRetryTestProvider::_sendIndication()
48 CIMInstance indicationInstance(CIMName("DeliveryRetryTestClass"));
50 indicationInstance.setPath(_path);
52 CIMDateTime currentDateTime = CIMDateTime::getCurrentDateTime();
54 indicationInstance.addProperty(
55 CIMProperty("IndicationTime", currentDateTime));
57 indicationInstance.addProperty(
58 CIMProperty("sequenceId", CIMValue(Uint64(_nextIdentifier++))));
60 _handler->deliver(indicationInstance);
63 DeliveryRetryTestProvider::DeliveryRetryTestProvider()
67 _path.setNameSpace("test/TestProvider");
68 _path.setClassName("DeliveryRetryTestClass");
71 DeliveryRetryTestProvider::~DeliveryRetryTestProvider()
75 void DeliveryRetryTestProvider::initialize(CIMOMHandle& cimom)
80 void DeliveryRetryTestProvider::terminate()
85 void DeliveryRetryTestProvider::invokeMethod(
86 const OperationContext& context,
87 const CIMObjectPath& objectReference,
88 const CIMName& methodName,
89 const Array<CIMParamValue>& inParameters,
90 MethodResultResponseHandler& handler)
96 if (!objectReference.getClassName().equal("DeliveryRetryTestClass"))
98 throw CIMNotSupportedException(
99 objectReference.getClassName().getString());
102 if (methodName.equal("resetIdentifier"))
106 else if (methodName.equal("generateIndications"))
108 inParameters[0].getValue().get(count);
112 handler.deliver(CIMValue(0));
116 for (Uint32 i = 0; i < count; ++i)
120 handler.deliver(CIMValue(1));
125 handler.deliver(CIMValue(0));
130 void DeliveryRetryTestProvider::enableIndications (
131 IndicationResponseHandler & handler)
137 void DeliveryRetryTestProvider::disableIndications ()
142 void DeliveryRetryTestProvider::createSubscription (
143 const OperationContext & context,
144 const CIMObjectPath & subscriptionName,
145 const Array <CIMObjectPath> & classNames,
146 const CIMPropertyList & propertyList,
147 const Uint16 repeatNotificationPolicy)
151 void DeliveryRetryTestProvider::modifySubscription (
152 const OperationContext & context,
153 const CIMObjectPath & subscriptionName,
154 const Array <CIMObjectPath> & classNames,
155 const CIMPropertyList & propertyList,
156 const Uint16 repeatNotificationPolicy)
161 void DeliveryRetryTestProvider::deleteSubscription (
162 const OperationContext & context,
163 const CIMObjectPath & subscriptionName,
164 const Array <CIMObjectPath> & classNames)
168 PEGASUS_NAMESPACE_END