1 mike 1.7 //%/////////////////////////////////////////////////////////////////////////////
|
2 mike 1.1 //
3 // Copyright (c) 2000 The Open Group, BMC Software, Tivoli Systems, IBM
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a
6 // copy of this software and associated documentation files (the "Software"),
7 // to deal in the Software without restriction, including without limitation
8 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 // and/or sell copies of the Software, and to permit persons to whom the
10 // Software is furnished to do so, subject to the following conditions:
11 //
12 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
15 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18 // DEALINGS IN THE SOFTWARE.
19 //
|
20 mike 1.7 //==============================================================================
|
21 mike 1.1 //
|
22 mike 1.7 // Author: Mike Brasher (mbrasher@bmc.com)
|
23 mike 1.1 //
|
24 mike 1.7 // Modified By:
|
25 mike 1.6 //
|
26 mike 1.7 //%/////////////////////////////////////////////////////////////////////////////
|
27 mike 1.1
28 #ifndef PegasusRepository_Repository_h
29 #define PegasusRepository_Repository_h
30
31 #include <Pegasus/Common/Config.h>
32 #include <Pegasus/Common/CIMClass.h>
33 #include <Pegasus/Common/CIMInstance.h>
34 #include <Pegasus/Common/CIMQualifierDecl.h>
35 #include <Pegasus/Common/CIMOperations.h>
|
36 mike 1.10 #include <Pegasus/Repository/NameSpaceManager.h>
|
37 mike 1.1
38 PEGASUS_NAMESPACE_BEGIN
39
40 class RepositoryDeclContext;
41
42 /** This class derives from the CIMOperations class and provides a simple
43 implementation of a CIM repository. It only implements the methods
44 for manipulating classes and instances. The others throw this exception:
45
46 <pre>
|
47 mike 1.3 CIMException(CIMException::NOT_SUPPORTED)
|
48 mike 1.1 </pre>
49 */
50
|
51 mike 1.2 class PEGASUS_REPOSITORY_LINKAGE CIMRepository : public CIMOperations
|
52 mike 1.1 {
53 public:
54
55 /// Constructor
|
56 mike 1.10 CIMRepository(const String& repositoryRoot);
|
57 mike 1.1
58 /// Descructor
|
59 mike 1.2 virtual ~CIMRepository();
|
60 mike 1.1
61 /// virtual class CIMClass. From the operations class
62 virtual CIMClass getClass(
63 const String& nameSpace,
64 const String& className,
65 Boolean localOnly = true,
66 Boolean includeQualifiers = true,
67 Boolean includeClassOrigin = false,
|
68 mike 1.13 const Array<String>& propertyList = EmptyStringArray());
|
69 mike 1.1
70 /// getInstance
71 virtual CIMInstance getInstance(
72 const String& nameSpace,
73 const CIMReference& instanceName,
74 Boolean localOnly = true,
75 Boolean includeQualifiers = false,
76 Boolean includeClassOrigin = false,
|
77 mike 1.13 const Array<String>& propertyList = EmptyStringArray());
|
78 mike 1.1
79 /// deleteClass
80 virtual void deleteClass(
81 const String& nameSpace,
82 const String& className);
83
84 /// deleteInstance
85 virtual void deleteInstance(
86 const String& nameSpace,
87 const CIMReference& instanceName);
88
89 /// createClass
90 virtual void createClass(
91 const String& nameSpace,
92 CIMClass& newClass);
93
94 /// createInstance
95 virtual void createInstance(
96 const String& nameSpace,
97 CIMInstance& newInstance);
98
|
99 karl 1.4 /// modifyClass
|
100 mike 1.1 virtual void modifyClass(
101 const String& nameSpace,
102 CIMClass& modifiedClass);
103
104 /// modifyInstance
105 virtual void modifyInstance(
106 const String& nameSpace,
|
107 mike 1.13 CIMInstance& modifiedInstance);
|
108 mike 1.1
109 /// enumerateClasses
110 virtual Array<CIMClass> enumerateClasses(
111 const String& nameSpace,
112 const String& className = String::EMPTY,
113 Boolean deepInheritance = false,
114 Boolean localOnly = true,
115 Boolean includeQualifiers = true,
116 Boolean includeClassOrigin = false);
117
118 /// enumerateClassNames
119 virtual Array<String> enumerateClassNames(
120 const String& nameSpace,
121 const String& className = String::EMPTY,
122 Boolean deepInheritance = false);
123
124 /// enumerateInstances
125 virtual Array<CIMInstance> enumerateInstances(
126 const String& nameSpace,
127 const String& className,
128 Boolean deepInheritance = true,
129 mike 1.1 Boolean localOnly = true,
130 Boolean includeQualifiers = false,
131 Boolean includeClassOrigin = false,
|
132 mike 1.13 const Array<String>& propertyList = EmptyStringArray());
|
133 mike 1.1
134 /// enumerateInstanceNames
135 virtual Array<CIMReference> enumerateInstanceNames(
136 const String& nameSpace,
137 const String& className);
138
139 /// execQuery
140 virtual Array<CIMInstance> execQuery(
141 const String& queryLanguage,
142 const String& query) ;
143
144 /// associators
145 virtual Array<CIMInstance> associators(
146 const String& nameSpace,
147 const CIMReference& objectName,
148 const String& assocClass = String::EMPTY,
149 const String& resultClass = String::EMPTY,
150 const String& role = String::EMPTY,
151 const String& resultRole = String::EMPTY,
152 Boolean includeQualifiers = false,
153 Boolean includeClassOrigin = false,
|
154 mike 1.13 const Array<String>& propertyList = EmptyStringArray());
|
155 mike 1.1
156 /// associateNames
157 virtual Array<CIMReference> associatorNames(
158 const String& nameSpace,
159 const CIMReference& objectName,
160 const String& assocClass = String::EMPTY,
161 const String& resultClass = String::EMPTY,
162 const String& role = String::EMPTY,
163 const String& resultRole = String::EMPTY);
164
165 /// references
166 virtual Array<CIMInstance> references(
167 const String& nameSpace,
168 const CIMReference& objectName,
169 const String& resultClass = String::EMPTY,
170 const String& role = String::EMPTY,
171 Boolean includeQualifiers = false,
172 Boolean includeClassOrigin = false,
|
173 mike 1.13 const Array<String>& propertyList = EmptyStringArray());
|
174 mike 1.1
175 /// referenceNames
176 virtual Array<CIMReference> referenceNames(
177 const String& nameSpace,
178 const CIMReference& objectName,
179 const String& resultClass = String::EMPTY,
180 const String& role = String::EMPTY);
181
182 /// getProperty
183 virtual CIMValue getProperty(
184 const String& nameSpace,
185 const CIMReference& instanceName,
186 const String& propertyName);
187
188 /// setProperty
189 virtual void setProperty(
190 const String& nameSpace,
191 const CIMReference& instanceName,
192 const String& propertyName,
193 const CIMValue& newValue = CIMValue());
194
195 mike 1.1 /// getQualifier
196 virtual CIMQualifierDecl getQualifier(
197 const String& nameSpace,
198 const String& qualifierName);
199
200 /// setQualifier
201 virtual void setQualifier(
202 const String& nameSpace,
203 const CIMQualifierDecl& qualifierDecl);
204
205 /// virtual deleteQualifier
206 virtual void deleteQualifier(
207 const String& nameSpace,
208 const String& qualifierName);
209
210 /// enumerateQualifiers
211 virtual Array<CIMQualifierDecl> enumerateQualifiers(
212 const String& nameSpace);
213
|
214 karl 1.4 /// invokeMethod
|
215 mike 1.1 virtual CIMValue invokeMethod(
216 const String& nameSpace,
217 const CIMReference& instanceName,
218 const String& methodName,
219 const Array<CIMValue>& inParameters,
220 Array<CIMValue>& outParameters);
221
222 /** CIMMethod createNameSpace - Creates a new namespace in the repository
223 @param String with the name of the namespace
|
224 karl 1.4 @exception - Throws "Already_Exists if the Namespace exits.
225 Throws "CannotCreateDirectory" if there are problems in the
226 creation.
|
227 mike 1.1 */
228 void createNameSpace(const String& nameSpace);
229
230 /** CIMMethod enumerateNameSpaces - Get all of the namespaces in the
231 repository. \Ref{NAMESPACE}
232 @return Array of strings with the namespaces
233 */
234 virtual Array<String> enumerateNameSpaces() const;
|
235 karl 1.4
|
236 karl 1.5 /** CIMMethod deleteNameSpace - Deletes a namespace in the repository.
237 The deleteNameSpace method will only delete a namespace if there are
|
238 mike 1.9 no classed defined in the namespace. Today this is a Pegasus
239 characteristics and not defined as part of the DMTF standards.
|
240 karl 1.5 @param String with the name of the namespace
|
241 mike 1.9 @exception - Throws NoSuchDirectory if the Namespace does not exist.
242 */
|
243 karl 1.4 void deleteNameSpace(const String& nameSpace);
244
|
245 mike 1.12 private:
246
247 Boolean _getInstanceIndex(
248 const String& nameSpace,
249 const CIMReference& instanceName,
250 String& className,
251 Uint32& index,
252 Boolean searchSuperClasses = false) const;
|
253 mike 1.1
|
254 mike 1.12 String _getIndexFilePath(
255 const String& nameSpace,
256 const String& className) const;
257
258 String _getInstanceFilePath(
259 const String& nameSpace,
260 const String& className,
261 Uint32 index) const;
|
262 mike 1.6
|
263 mike 1.14 void _createAssociationEntries(
264 const String& nameSpace,
265 const CIMConstClass& cimClass,
266 const CIMInstance& cimInstance);
267
|
268 mike 1.10 String _repositoryRoot;
|
269 mike 1.1 RepositoryDeclContext* _context;
|
270 mike 1.10 NameSpaceManager _nameSpaceManager;
|
271 mike 1.1 };
272
273 PEGASUS_NAMESPACE_END
274
275 #endif /* PegasusRepository_Repository_h */
276
|