7 karl 1.1 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to
10 // deal in the Software without restriction, including without limitation the
11 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12 // sell copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
|
15 karl 1.1 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
16 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
17 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
18 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
19 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 //
24 //==============================================================================
25 //
26 // Author: Karl Schopmeyer (k.schopmeyer@opengrooup.org)
27 //
28 // Modified By:
29 //
30 //%////////////////////////////////////////////////////////////////////////////
31
32
33 #ifndef InteropProvider_h
34 #define InteropProvider_h
35
36 karl 1.1 ///////////////////////////////////////////////////////////////////////////////
37 // Interop Provider
38 ///////////////////////////////////////////////////////////////////////////////
39
40 #include <Pegasus/Common/Config.h>
41 #include <Pegasus/ControlProviders/InteropProvider/Linkage.h>
42
43 #include <Pegasus/Common/String.h>
44 #include <Pegasus/Common/System.h>
45 #include <Pegasus/Common/ArrayInternal.h>
46 #include <Pegasus/Common/CIMType.h>
47 #include <Pegasus/Common/CIMInstance.h>
48 #include <Pegasus/Common/CIMObjectPath.h>
49 #include <Pegasus/Common/InternalException.h>
50 #include <Pegasus/Common/CIMStatusCode.h>
51 #include <Pegasus/Common/Tracer.h>
52 #include <Pegasus/Config/ConfigManager.h>
53
54 #include <Pegasus/Repository/CIMRepository.h>
55 #include <Pegasus/Provider/CIMInstanceProvider.h>
56 #include <Pegasus/Provider/CIMAssociationProvider.h>
57 karl 1.1
58 PEGASUS_NAMESPACE_BEGIN
59
60 /**
61 The InteropProvider provides information and manipulates the
62 following classes from the DMTF CIM_Interop schema:
63 CIM_Namespace - Creation and deletion of namespaces
64 __Namespace - Creation and deletion of namespaces (deprecated)
65 CIM_ObjectManager - Reports on the status of the object manager
66 CIM_ObjectManagerCommunicationMechanism - Reports on CIMOM communications
67 COM_CIMXMLCommunicationMechanism - Reports on CIMXML communications
68 CIM_ProtocolAdapter
69
70 Associations
71 NamespaceinManager
72
73 creation and deletion of namespaces using the __namespace class
74 Note however, that the DMTF specification model does not define a class for
75 __namespace so that it is, a "false" class. We assume that it has the
76 same characteristics as the CIM_namespace class defined in CIM 2.6.
77
78 karl 1.1 This provider implements the following functions:
79 - createInstance ( adds a new namespace to the repository)
80 - getInstance ( Gets one instance containing a namespace name)
81 - modifyInstance ( Not supported )
82 - enumerateInstances ( Lists all namespaces as Instances)
83 - enumerateInstanceNames ( Lists all namespace names )
84 TBD
85 */
86
87 class PEGASUS_INTEROPPROVIDER_LINKAGE InteropProvider :
88 public CIMInstanceProvider, public CIMAssociationProvider
89 {
90 public:
91
92 InteropProvider(CIMRepository* repository)
93 {
94 PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,"InteropProvider::InteropProvider");
95 _repository = repository;
96 PEG_METHOD_EXIT();
97 }
98
99 karl 1.1 virtual ~InteropProvider()
100 {
101 PEG_METHOD_ENTER(TRC_CONTROLPROVIDER,"InteropProvider::~InteropProvider");
102
103 PEG_METHOD_EXIT();
104 }
105
106 virtual void createInstance(
107 const OperationContext & context,
108 const CIMObjectPath & instanceReference,
109 const CIMInstance& myInstance,
110 ObjectPathResponseHandler & handler);
111
112 virtual void deleteInstance(
113 const OperationContext & context,
114 const CIMObjectPath& instanceName,
115 ResponseHandler & handler);
116
117 virtual void getInstance(
118 const OperationContext & context,
119 const CIMObjectPath& instanceName,
120 karl 1.1 const Boolean includeQualifiers,
121 const Boolean includeClassOrigin,
122 const CIMPropertyList& propertyList,
123 InstanceResponseHandler & handler);
124
125 void modifyInstance(
126 const OperationContext & context,
127 const CIMObjectPath & instanceReference,
128 const CIMInstance& modifiedIns,
129 const Boolean includeQualifiers,
130 const CIMPropertyList& propertyList,
131 ResponseHandler & handler)
132 {
133 throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, "");
134 }
135
136 virtual void enumerateInstances(
137 const OperationContext & context,
138 const CIMObjectPath & ref,
139 const Boolean includeQualifiers,
140 const Boolean includeClassOrigin,
141 karl 1.1 const CIMPropertyList& propertyList,
142 InstanceResponseHandler & handler);
143
144 virtual void enumerateInstanceNames(
145 const OperationContext & context,
146 const CIMObjectPath & classReference,
147 ObjectPathResponseHandler & handler);
148
149 // Association Interfaces
150
151 // CIMAssociationProvider interface
152 virtual void associators(
153 const OperationContext & context,
154 const CIMObjectPath & objectName,
155 const CIMName & associationClass,
156 const CIMName & resultClass,
157 const String & role,
158 const String & resultRole,
159 const Boolean includeQualifiers,
160 const Boolean includeClassOrigin,
161 const CIMPropertyList & propertyList,
162 karl 1.1 ObjectResponseHandler & handler);
163
164 virtual void associatorNames(
165 const OperationContext & context,
166 const CIMObjectPath & objectName,
167 const CIMName & associationClass,
168 const CIMName & resultClass,
169 const String & role,
170 const String & resultRole,
171 ObjectPathResponseHandler & handler);
172
173 virtual void references(
174 const OperationContext & context,
175 const CIMObjectPath & objectName,
176 const CIMName & resultClass,
177 const String & role,
178 const Boolean includeQualifiers,
179 const Boolean includeClassOrigin,
180 const CIMPropertyList & propertyList,
181 ObjectResponseHandler & handler);
182
183 karl 1.1 virtual void referenceNames(
184 const OperationContext & context,
185 const CIMObjectPath & objectName,
186 const CIMName & resultClass,
187 const String & role,
188 ObjectPathResponseHandler & handler);
189
190 /**
191 Standard initialization function for the provider.
192 */
193 void initialize(CIMOMHandle& cimomHandle)
194 {
195 }
196
197 void terminate(void)
198 {
199 }
200
201 private:
202
|
220 tony 1.4 CIMInstance _buildInstancePGCIMXMLCommunicationMechanism(
221 const String& namespaceType,
222 const String& IPAddress,
223 const Boolean& includeQualifiers,
224 const Boolean& includeClassOrigin,
225 const CIMPropertyList& propertyList);
226
227 Array<CIMInstance> _buildInstancesPGCIMXMLCommunicationMechanism(
228 const Boolean includeQualifiers,
229 const Boolean includeClassOrigin,
230 const CIMPropertyList& propertyList);
231
232 CIMInstance _buildInstanceCIMObjectManager(const Boolean includeQualifiers,
233 const Boolean includeClassOrigin,
234 const CIMPropertyList& propertyList);
235
236 Array<CIMInstance> _getInstancesCIMNamespace(const Boolean& includeQualifiers,
237 const Boolean& includeClassOrigin,
238 const CIMPropertyList& propertyList);
239
240
241 tony 1.4 CIMInstance _getInstanceCIMNamespace(const CIMNamespaceName & nameSpace);
|