1 mike 1.1 //BEGIN_LICENSE
2 //
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 //END_LICENSE
21 //BEGIN_HISTORY
22 mike 1.1 //
23 // Author:
24 //
|
25 mike 1.2 // $Log: Repository.h,v $
|
26 mike 1.7 // Revision 1.6 2001/02/11 05:45:33 mike
27 // Added case insensitive logic for files in Repository
28 //
|
29 mike 1.6 // Revision 1.5 2001/02/08 00:31:51 mike
30 // Clean up on Operations class.
31 // Reformmatted documentation.
32 //
|
33 mike 1.5 // Revision 1.4 2001/02/06 17:04:03 karl
34 // add documentation
35 //
|
36 karl 1.4 // Revision 1.3 2001/01/31 08:20:51 mike
37 // Added dispatcher framework.
38 // Added enumerateInstanceNames.
39 //
|
40 mike 1.3 // Revision 1.2 2001/01/28 04:11:03 mike
41 // fixed qualifier resolution
42 //
|
43 mike 1.2 // Revision 1.1.1.1 2001/01/14 19:53:56 mike
44 // Pegasus import
45 //
|
46 mike 1.1 //
47 //END_HISTORY
48
49 #ifndef PegasusRepository_Repository_h
50 #define PegasusRepository_Repository_h
51
52 #include <Pegasus/Common/Config.h>
53 #include <Pegasus/Common/ClassDecl.h>
54 #include <Pegasus/Common/InstanceDecl.h>
55 #include <Pegasus/Common/QualifierDecl.h>
56 #include <Pegasus/Common/Operations.h>
57
58 PEGASUS_NAMESPACE_BEGIN
59
60 class RepositoryDeclContext;
|
61 mike 1.7
62 /** This class derives from the Operations class and provides a simple
63 implementation of a CIM repository. It only implements the methods
64 for manipulating classes and instances. The others throw this exception:
65
66 <pre>
67 CimException(CimException::NOT_SUPPORTED)
68 </pre>
|
69 karl 1.4 */
|
70 mike 1.1
71 class PEGASUS_REPOSITORY_LINKAGE Repository : public Operations
72 {
73 public:
|
74 mike 1.6
|
75 karl 1.4 /// Constructor
|
76 mike 1.1 Repository(const String& path);
|
77 mike 1.6
|
78 karl 1.4 /// Descructor
|
79 mike 1.1 virtual ~Repository();
|
80 mike 1.6
|
81 karl 1.4 /// virtual class ClassDecl. From the operations class
|
82 mike 1.1 virtual ClassDecl getClass(
83 const String& nameSpace,
84 const String& className,
85 Boolean localOnly = true,
86 Boolean includeQualifiers = true,
87 Boolean includeClassOrigin = false,
88 const Array<String>& propertyList = _getStringArray());
|
89 mike 1.6
|
90 karl 1.4 /// getInstance
|
91 mike 1.1 virtual InstanceDecl getInstance(
92 const String& nameSpace,
93 const Reference& instanceName,
94 Boolean localOnly = true,
95 Boolean includeQualifiers = false,
96 Boolean includeClassOrigin = false,
97 const Array<String>& propertyList = _getStringArray());
|
98 mike 1.6
|
99 karl 1.4 /// deleteClass
|
100 mike 1.1 virtual void deleteClass(
101 const String& nameSpace,
102 const String& className);
|
103 mike 1.6
|
104 karl 1.4 /// deleteInstance
|
105 mike 1.1 virtual void deleteInstance(
106 const String& nameSpace,
107 const Reference& instanceName);
|
108 mike 1.6
|
109 karl 1.4 /// createClass
|
110 mike 1.1 virtual void createClass(
111 const String& nameSpace,
112 ClassDecl& newClass);
|
113 mike 1.6
|
114 karl 1.4 /// createInstance
|
115 mike 1.1 virtual void createInstance(
116 const String& nameSpace,
|
117 mike 1.7 InstanceDecl& newInstance);
|
118 mike 1.6
|
119 mike 1.1 virtual void modifyClass(
120 const String& nameSpace,
121 ClassDecl& modifiedClass);
|
122 mike 1.6
|
123 karl 1.4 /// modifyInstance
|
124 mike 1.1 virtual void modifyInstance(
125 const String& nameSpace,
126 const InstanceDecl& modifiedInstance);
|
127 mike 1.6
|
128 karl 1.4 /// enumerateClasses
|
129 mike 1.1 virtual Array<ClassDecl> enumerateClasses(
130 const String& nameSpace,
131 const String& className = String::EMPTY,
132 Boolean deepInheritance = false,
133 Boolean localOnly = true,
134 Boolean includeQualifiers = true,
135 Boolean includeClassOrigin = false);
|
136 mike 1.6
|
137 karl 1.4 /// enumerateClassNames
|
138 mike 1.1 virtual Array<String> enumerateClassNames(
139 const String& nameSpace,
140 const String& className = String::EMPTY,
141 Boolean deepInheritance = false);
|
142 mike 1.6
|
143 karl 1.4 /// enumerateInstances
|
144 mike 1.1 virtual Array<InstanceDecl> enumerateInstances(
145 const String& nameSpace,
146 const String& className,
147 Boolean deepInheritance = true,
148 Boolean localOnly = true,
149 Boolean includeQualifiers = false,
150 Boolean includeClassOrigin = false,
151 const Array<String>& propertyList = _getStringArray());
|
152 mike 1.6
|
153 karl 1.4 /// enumerateInstanceNames
|
154 mike 1.3 virtual Array<Reference> enumerateInstanceNames(
|
155 mike 1.1 const String& nameSpace,
156 const String& className);
|
157 mike 1.6
|
158 karl 1.4 /// execQuery
|
159 mike 1.1 virtual Array<InstanceDecl> execQuery(
160 const String& queryLanguage,
161 const String& query) ;
|
162 mike 1.6
|
163 karl 1.4 /// associators
|
164 mike 1.1 virtual Array<InstanceDecl> associators(
165 const String& nameSpace,
166 const Reference& objectName,
167 const String& assocClass = String::EMPTY,
168 const String& resultClass = String::EMPTY,
169 const String& role = String::EMPTY,
170 const String& resultRole = String::EMPTY,
171 Boolean includeQualifiers = false,
172 Boolean includeClassOrigin = false,
173 const Array<String>& propertyList = _getStringArray());
|
174 mike 1.6
|
175 karl 1.4 /// associateNames
|
176 mike 1.1 virtual Array<Reference> associatorNames(
177 const String& nameSpace,
178 const Reference& objectName,
179 const String& assocClass = String::EMPTY,
180 const String& resultClass = String::EMPTY,
181 const String& role = String::EMPTY,
182 const String& resultRole = String::EMPTY);
|
183 mike 1.6
|
184 karl 1.4 /// references
|
185 mike 1.1 virtual Array<InstanceDecl> references(
186 const String& nameSpace,
187 const Reference& objectName,
188 const String& resultClass = String::EMPTY,
189 const String& role = String::EMPTY,
190 Boolean includeQualifiers = false,
191 Boolean includeClassOrigin = false,
192 const Array<String>& propertyList = _getStringArray());
|
193 mike 1.6
|
194 karl 1.4 /// referenceNames
|
195 mike 1.1 virtual Array<Reference> referenceNames(
196 const String& nameSpace,
197 const Reference& objectName,
198 const String& resultClass = String::EMPTY,
199 const String& role = String::EMPTY);
|
200 mike 1.6
|
201 karl 1.4 /// getProperty
|
202 mike 1.1 virtual Value getProperty(
203 const String& nameSpace,
204 const Reference& instanceName,
205 const String& propertyName);
|
206 mike 1.6
|
207 karl 1.4 /// setProperty
|
208 mike 1.1 virtual void setProperty(
209 const String& nameSpace,
210 const Reference& instanceName,
211 const String& propertyName,
212 const Value& newValue = Value());
|
213 mike 1.6
|
214 karl 1.4 /// getQualifier
|
215 mike 1.1 virtual QualifierDecl getQualifier(
216 const String& nameSpace,
217 const String& qualifierName);
|
218 mike 1.6
|
219 karl 1.4 /// setQualifier
|
220 mike 1.1 virtual void setQualifier(
221 const String& nameSpace,
222 const QualifierDecl& qualifierDecl);
|
223 mike 1.6
|
224 karl 1.4 /// virtual deleteQualifier
|
225 mike 1.1 virtual void deleteQualifier(
226 const String& nameSpace,
227 const String& qualifierName);
|
228 mike 1.6
|
229 karl 1.4 /// enumerateQualifiers
|
230 mike 1.1 virtual Array<QualifierDecl> enumerateQualifiers(
231 const String& nameSpace);
|
232 mike 1.6
|
233 karl 1.4 /// Virtual value
|
234 mike 1.1 virtual Value invokeMethod(
235 const String& nameSpace,
236 const Reference& instanceName,
237 const String& methodName,
238 const Array<Value>& inParameters,
239 Array<Value>& outParameters);
240
|
241 karl 1.4 /** Method createNameSpace - Creates a new namespace in the repository
|
242 mike 1.6 @param String with the name of the namespace
243 @exception - ???
244 ATTN: What happens if the namespace already exists.
|
245 karl 1.4 */
|
246 mike 1.1 void createNameSpace(const String& nameSpace);
247
|
248 karl 1.4 /** Method enumerateNameSpaces - Get all of the namespaces in the
|
249 mike 1.6 repository. \Ref{NAMESPACE}
250 @return Array of strings with the namespaces
|
251 karl 1.4 */
|
252 mike 1.1 virtual Array<String> enumerateNameSpaces() const;
|
253 mike 1.2
|
254 karl 1.4 /** Method createMetaQualifiers - ATTN:
|
255 mike 1.2 This method must be invoked to create the appropriate meta-qualifiers
256 required by CIM (they are not part of the CIM schema; rather they are
257 part of the meta-schema).
258 */
259 void createMetaQualifiers(const String& nameSpace);
|
260 mike 1.1
261 private:
262
263 String _root;
264 RepositoryDeclContext* _context;
265 };
266
267 PEGASUS_NAMESPACE_END
268
269 #endif /* PegasusRepository_Repository_h */
|
270 karl 1.4
|