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 // $Log$
26 //
27 //END_HISTORY
28
29 ////////////////////////////////////////////////////////////////////////////////
30 //
31 // Repository.h
32 //
33 // This interface contains a method for each operation defined in
34 // the "Specification for CIM Operations over HTTP".
35 //
36 ////////////////////////////////////////////////////////////////////////////////
37
38 #ifndef PegasusRepository_Repository_h
39 #define PegasusRepository_Repository_h
40
41 #include <Pegasus/Common/Config.h>
42 #include <Pegasus/Common/ClassDecl.h>
43 mike 1.1 #include <Pegasus/Common/InstanceDecl.h>
44 #include <Pegasus/Common/QualifierDecl.h>
45 #include <Pegasus/Common/Operations.h>
46
47 PEGASUS_NAMESPACE_BEGIN
48
49 class RepositoryDeclContext;
50
51 class PEGASUS_REPOSITORY_LINKAGE Repository : public Operations
52 {
53 public:
54
55 Repository(const String& path);
56
57 virtual ~Repository();
58
59 virtual ClassDecl getClass(
60 const String& nameSpace,
61 const String& className,
62 Boolean localOnly = true,
63 Boolean includeQualifiers = true,
64 mike 1.1 Boolean includeClassOrigin = false,
65 const Array<String>& propertyList = _getStringArray());
66
67 virtual InstanceDecl getInstance(
68 const String& nameSpace,
69 const Reference& instanceName,
70 Boolean localOnly = true,
71 Boolean includeQualifiers = false,
72 Boolean includeClassOrigin = false,
73 const Array<String>& propertyList = _getStringArray());
74
75 virtual void deleteClass(
76 const String& nameSpace,
77 const String& className);
78
79 virtual void deleteInstance(
80 const String& nameSpace,
81 const Reference& instanceName);
82
83 virtual void createClass(
84 const String& nameSpace,
85 mike 1.1 ClassDecl& newClass);
86
87 virtual void createInstance(
88 const String& nameSpace,
89 const InstanceDecl& newInstance) ;
90
91 virtual void modifyClass(
92 const String& nameSpace,
93 ClassDecl& modifiedClass);
94
95 virtual void modifyInstance(
96 const String& nameSpace,
97 const InstanceDecl& modifiedInstance);
98
99 virtual Array<ClassDecl> enumerateClasses(
100 const String& nameSpace,
101 const String& className = String::EMPTY,
102 Boolean deepInheritance = false,
103 Boolean localOnly = true,
104 Boolean includeQualifiers = true,
105 Boolean includeClassOrigin = false);
106 mike 1.1
107 virtual Array<String> enumerateClassNames(
108 const String& nameSpace,
109 const String& className = String::EMPTY,
110 Boolean deepInheritance = false);
111
112 virtual Array<InstanceDecl> enumerateInstances(
113 const String& nameSpace,
114 const String& className,
115 Boolean deepInheritance = true,
116 Boolean localOnly = true,
117 Boolean includeQualifiers = false,
118 Boolean includeClassOrigin = false,
119 const Array<String>& propertyList = _getStringArray());
120
121 virtual Array<String> enumerateInstanceNames(
122 const String& nameSpace,
123 const String& className);
124
125 virtual Array<InstanceDecl> execQuery(
126 const String& queryLanguage,
127 mike 1.1 const String& query) ;
128
129 virtual Array<InstanceDecl> associators(
130 const String& nameSpace,
131 const Reference& objectName,
132 const String& assocClass = String::EMPTY,
133 const String& resultClass = String::EMPTY,
134 const String& role = String::EMPTY,
135 const String& resultRole = String::EMPTY,
136 Boolean includeQualifiers = false,
137 Boolean includeClassOrigin = false,
138 const Array<String>& propertyList = _getStringArray());
139
140 virtual Array<Reference> associatorNames(
141 const String& nameSpace,
142 const Reference& objectName,
143 const String& assocClass = String::EMPTY,
144 const String& resultClass = String::EMPTY,
145 const String& role = String::EMPTY,
146 const String& resultRole = String::EMPTY);
147
148 mike 1.1 virtual Array<InstanceDecl> references(
149 const String& nameSpace,
150 const Reference& objectName,
151 const String& resultClass = String::EMPTY,
152 const String& role = String::EMPTY,
153 Boolean includeQualifiers = false,
154 Boolean includeClassOrigin = false,
155 const Array<String>& propertyList = _getStringArray());
156
157 virtual Array<Reference> referenceNames(
158 const String& nameSpace,
159 const Reference& objectName,
160 const String& resultClass = String::EMPTY,
161 const String& role = String::EMPTY);
162
163 virtual Value getProperty(
164 const String& nameSpace,
165 const Reference& instanceName,
166 const String& propertyName);
167
168 virtual void setProperty(
169 mike 1.1 const String& nameSpace,
170 const Reference& instanceName,
171 const String& propertyName,
172 const Value& newValue = Value());
173
174 virtual QualifierDecl getQualifier(
175 const String& nameSpace,
176 const String& qualifierName);
177
178 virtual void setQualifier(
179 const String& nameSpace,
180 const QualifierDecl& qualifierDecl);
181
182 virtual void deleteQualifier(
183 const String& nameSpace,
184 const String& qualifierName);
185
186 virtual Array<QualifierDecl> enumerateQualifiers(
187 const String& nameSpace);
188
189 virtual Value invokeMethod(
190 mike 1.1 const String& nameSpace,
191 const Reference& instanceName,
192 const String& methodName,
193 const Array<Value>& inParameters,
194 Array<Value>& outParameters);
195
196 void createNameSpace(const String& nameSpace);
197
198 virtual Array<String> enumerateNameSpaces() const;
199
200 private:
201
202 static Array<String> _getStringArray()
203 {
204 return Array<String>();
205 }
206
207 String _root;
208 RepositoryDeclContext* _context;
209 };
210
211 mike 1.1 PEGASUS_NAMESPACE_END
212
213 #endif /* PegasusRepository_Repository_h */
|