(file) Return to CIMRepository.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Repository

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2