1 martin 1.31 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.32 //
|
3 martin 1.31 // 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.32 //
|
10 martin 1.31 // 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.32 //
|
17 martin 1.31 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.32 //
|
20 martin 1.31 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.32 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.31 // 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.32 //
|
28 martin 1.31 //////////////////////////////////////////////////////////////////////////
|
29 kumpf 1.1 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
|
32 ks.madhusudan 1.28 #ifndef Pegasus_ProviderRegistrationProvider_h
33 #define Pegasus_ProviderRegistrationProvider_h
|
34 kumpf 1.1 #include <Pegasus/Common/Config.h>
|
35 chuck 1.10 #include <Pegasus/ControlProviders/ProviderRegistrationProvider/Linkage.h>
|
36 kumpf 1.1
37 #include <Pegasus/Provider/CIMInstanceProvider.h>
38 #include <Pegasus/Provider/CIMMethodProvider.h>
|
39 kumpf 1.18 #include <Pegasus/Common/ModuleController.h>
|
40 kumpf 1.1
|
41 kumpf 1.23 #include <Pegasus/Common/AcceptLanguageList.h>
|
42 chuck 1.15
|
43 karl 1.27 #include \
44 <Pegasus/Server/ProviderRegistrationManager/ProviderRegistrationManager.h>
|
45 kumpf 1.1
46 PEGASUS_NAMESPACE_BEGIN
47
48 class PEGASUS_PROVREGPROVIDER_LINKAGE ProviderRegistrationProvider :
49 public CIMInstanceProvider,
50 public CIMMethodProvider
51 {
52 public:
|
53 kumpf 1.3
54 class callback_data
55 {
56 public:
57
58 Message *reply;
59 Semaphore client_sem;
60 ProviderRegistrationProvider & cimom_handle;
61
62 callback_data(ProviderRegistrationProvider *handle)
63 : reply(0), client_sem(0), cimom_handle(*handle)
64 {
65 }
66 ~callback_data()
67 {
68 delete reply;
69 }
70
71 Message *get_reply(void)
72 {
73 Message *ret = reply;
74 kumpf 1.3 reply = NULL;
75 return ret;
76 }
77
78 private:
79 callback_data(void);
80 };
81
82
|
83 kumpf 1.1 ProviderRegistrationProvider(
84 ProviderRegistrationManager* providerRegistrationManager);
85 virtual ~ProviderRegistrationProvider(void);
86
|
87 karl 1.27 ProviderRegistrationProvider & operator=
88 (const ProviderRegistrationProvider & handle);
|
89 kumpf 1.3
|
90 kumpf 1.13 // CIMProvider interface
|
91 kumpf 1.26 // Note: The initialize() and terminate() methods are not called for
92 // Control Providers.
93 virtual void initialize(CIMOMHandle& cimom) { }
94 virtual void terminate() { }
|
95 kumpf 1.1
96 // CIMInstanceProvider interface
97 virtual void getInstance(
98 const OperationContext & context,
|
99 kumpf 1.5 const CIMObjectPath & instanceReference,
|
100 kumpf 1.12 const Boolean includeQualifiers,
101 const Boolean includeClassOrigin,
|
102 kumpf 1.2 const CIMPropertyList & propertyList,
|
103 kumpf 1.11 InstanceResponseHandler & handler);
|
104 kumpf 1.1
105 virtual void enumerateInstances(
106 const OperationContext & context,
|
107 kumpf 1.5 const CIMObjectPath & classReference,
|
108 kumpf 1.12 const Boolean includeQualifiers,
109 const Boolean includeClassOrigin,
|
110 kumpf 1.2 const CIMPropertyList & propertyList,
|
111 kumpf 1.11 InstanceResponseHandler & handler);
|
112 kumpf 1.1
113 virtual void enumerateInstanceNames(
114 const OperationContext & context,
|
115 kumpf 1.5 const CIMObjectPath & classReference,
|
116 kumpf 1.11 ObjectPathResponseHandler & handler);
|
117 kumpf 1.1
118 virtual void modifyInstance(
119 const OperationContext & context,
|
120 kumpf 1.5 const CIMObjectPath & instanceReference,
|
121 kumpf 1.1 const CIMInstance & instanceObject,
|
122 kumpf 1.12 const Boolean includeQualifiers,
|
123 kumpf 1.2 const CIMPropertyList & propertyList,
|
124 kumpf 1.11 ResponseHandler & handler);
|
125 kumpf 1.1
126 virtual void createInstance(
127 const OperationContext & context,
|
128 kumpf 1.5 const CIMObjectPath & instanceReference,
|
129 kumpf 1.1 const CIMInstance & instanceObject,
|
130 kumpf 1.11 ObjectPathResponseHandler & handler);
|
131 kumpf 1.1
132 virtual void deleteInstance(
133 const OperationContext & context,
|
134 kumpf 1.5 const CIMObjectPath & instanceReference,
|
135 kumpf 1.11 ResponseHandler & handler);
|
136 kumpf 1.1
137 // CIMMethodProvider interface
138 virtual void invokeMethod(
139 const OperationContext & context,
|
140 kumpf 1.5 const CIMObjectPath & objectReference,
|
141 kumpf 1.9 const CIMName & methodName,
|
142 kumpf 1.1 const Array<CIMParamValue> & inParameters,
|
143 kumpf 1.11 MethodResultResponseHandler & handler);
|
144 kumpf 1.1
145 protected:
|
146 kumpf 1.3
147 ModuleController * _controller;
148
|
149 kumpf 1.1 ProviderRegistrationManager* _providerRegistrationManager;
|
150 kumpf 1.3
151 MessageQueueService * _getProviderManagerService();
152 Array<Uint16> _sendDisableMessageToProviderManager(
|
153 karl 1.27 CIMDisableModuleRequestMessage * notify_req);
|
154 kumpf 1.3 Array<Uint16> _sendEnableMessageToProviderManager(
|
155 karl 1.27 CIMEnableModuleRequestMessage * notify_req);
|
156 kumpf 1.4 MessageQueueService * _getIndicationService();
157 void _sendTerminationMessageToSubscription(
|
158 karl 1.27 const CIMObjectPath & ref, const String & moduleName,
159 const Boolean disableProviderOnly,
|
160 kumpf 1.23 const AcceptLanguageList & al);
|
161 kumpf 1.14
|
162 kumpf 1.33 Sint16 _disableModule(const CIMObjectPath & moduleRef,
|
163 karl 1.27 const String & moduleName,
164 Boolean disableProviderOnly,
|
165 kumpf 1.23 const AcceptLanguageList & al);
|
166 kumpf 1.16
|
167 venkat.puvvada 1.34 Sint16 _setModuleGroupName(const CIMObjectPath & moduleRef,
168 const String & moduleName,
169 const String & moduleGroupName,
170 const AcceptLanguageList & al);
171
|
172 kumpf 1.16 //
173 // If the provider is an indication provider, return true
174 // otherwise, return false
175 //
176 Boolean _isIndicationProvider(const String & moduleName,
|
177 kumpf 1.20 const CIMInstance & instance);
|
178 kumpf 1.18
|
179 kumpf 1.33 Sint16 _enableModule(const CIMObjectPath & moduleRef,
|
180 karl 1.27 const String & moduleName,
|
181 kumpf 1.33 const AcceptLanguageList & al);
|
182 kumpf 1.18
183 void _sendEnableMessageToSubscription(
|
184 karl 1.27 const CIMInstance & mInstance,
185 const CIMInstance & pInstance,
186 const Array<CIMInstance> & capInstances,
187 const AcceptLanguageList & al);
|
188 kumpf 1.18
189 //
190 // get all the indication capability instances which belongs
191 // to the provider
192 //
193 Array<CIMInstance> _getIndicationCapInstances(
|
194 karl 1.27 const String & moduleName,
195 const CIMInstance & instance,
196 const CIMObjectPath & providerRef);
|
197 venkat.puvvada 1.30 private:
198
199 #ifdef PEGASUS_ENABLE_INTEROP_PROVIDER
200 CIMOMHandle _cimomHandle;
201 Mutex _updateMtx;
202 void _sendUpdateCacheMessagetoInteropProvider(
203 const OperationContext & context);
204 #endif
|
205 kumpf 1.18
|
206 kumpf 1.1 };
207
208 PEGASUS_NAMESPACE_END
|
209 mike 1.29
210 #endif
|