version 1.4, 2001/02/06 17:04:03
|
version 1.10.2.3, 2007/11/08 23:20:50
|
|
|
//BEGIN_LICENSE |
//%2006//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000 The Open Group, BMC Software, Tivoli Systems, IBM |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
|
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.; |
|
// IBM Corp.; EMC Corporation, The Open Group. |
|
// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; |
|
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; Symantec Corporation; The Open Group. |
|
// |
|
// Permission is hereby granted, free of charge, to any person obtaining a copy |
|
// of this software and associated documentation files (the "Software"), to |
|
// deal in the Software without restriction, including without limitation the |
|
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
|
// sell copies of the Software, and to permit persons to whom the Software is |
|
// furnished to do so, subject to the following conditions: |
|
// |
|
// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN |
|
// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED |
|
// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT |
|
// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR |
|
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
|
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
|
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a |
//============================================================================== |
// copy of this software and associated documentation files (the "Software"), |
|
// to deal in the Software without restriction, including without limitation |
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense, |
|
// and/or sell copies of the Software, and to permit persons to whom the |
|
// Software is furnished to do so, subject to the following conditions: |
|
// | // |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
//%///////////////////////////////////////////////////////////////////////////// |
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
|
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
|
// DEALINGS IN THE SOFTWARE. |
|
// |
|
//END_LICENSE |
|
//BEGIN_HISTORY |
|
// |
|
// Author: |
|
// |
|
// $Log$ |
|
// Revision 1.4 2001/02/06 17:04:03 karl |
|
// add documentation |
|
// |
|
// Revision 1.3 2001/01/31 08:20:51 mike |
|
// Added dispatcher framework. |
|
// Added enumerateInstanceNames. |
|
// |
|
// Revision 1.2 2001/01/28 04:11:03 mike |
|
// fixed qualifier resolution |
|
// |
|
// Revision 1.1.1.1 2001/01/14 19:53:56 mike |
|
// Pegasus import |
|
// |
|
// |
|
//END_HISTORY |
|
| |
//////////////////////////////////////////////////////////////////////////////// |
#ifndef Pegasus_Repository_h |
// |
#define Pegasus_Repository_h |
// Repository.h |
|
// |
|
// This interface contains a method for each operation defined in |
|
// the "Specification for CIM Operations over HTTP". |
|
// |
|
//////////////////////////////////////////////////////////////////////////////// |
|
|
|
#ifndef PegasusRepository_Repository_h |
|
#define PegasusRepository_Repository_h |
|
| |
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
#include <Pegasus/Common/ClassDecl.h> |
#include <Pegasus/Common/CIMClass.h> |
#include <Pegasus/Common/InstanceDecl.h> |
#include <Pegasus/Common/CIMObject.h> |
#include <Pegasus/Common/QualifierDecl.h> |
#include <Pegasus/Common/CIMInstance.h> |
#include <Pegasus/Common/Operations.h> |
#include <Pegasus/Common/CIMPropertyList.h> |
|
#include <Pegasus/Common/CIMQualifierDecl.h> |
|
#include <Pegasus/Common/ContentLanguageList.h> |
|
#include <Pegasus/Common/HashTable.h> |
|
#include <Pegasus/Repository/Linkage.h> |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
class RepositoryDeclContext; | class RepositoryDeclContext; |
/** Class Repository - This class represents the repository interfaces. |
class compilerDeclContext; |
This class is derived from the Pegasus Operations interface adding certain |
|
methods specifically required for the repository. |
|
*/ |
|
| |
class PEGASUS_REPOSITORY_LINKAGE Repository : public Operations |
/** Virtual base class for CIMRepository implementations. |
|
*/ |
|
class Repository |
{ | { |
public: | public: |
/// Constructor |
|
Repository(const String& path); |
typedef HashTable <String, String, EqualNoCaseFunc, HashLowerCaseFunc> |
/// Descructor |
NameSpaceAttributes; |
|
|
|
Repository(); |
|
|
virtual ~Repository(); | virtual ~Repository(); |
/// virtual class ClassDecl. From the operations class |
|
virtual ClassDecl getClass( |
virtual CIMClass getClass( |
const String& nameSpace, |
bool lock, |
const String& className, |
const CIMNamespaceName& nameSpace, |
Boolean localOnly = true, |
const CIMName& className, |
Boolean includeQualifiers = true, |
Boolean localOnly, |
Boolean includeClassOrigin = false, |
Boolean includeQualifiers, |
const Array<String>& propertyList = _getStringArray()); |
Boolean includeClassOrigin, |
/// getInstance |
const CIMPropertyList& propertyList) = 0; |
virtual InstanceDecl getInstance( |
|
const String& nameSpace, |
virtual CIMInstance getInstance( |
const Reference& instanceName, |
bool lock, |
Boolean localOnly = true, |
const CIMNamespaceName& nameSpace, |
Boolean includeQualifiers = false, |
const CIMObjectPath& instanceName, |
Boolean includeClassOrigin = false, |
Boolean localOnly, |
const Array<String>& propertyList = _getStringArray()); |
Boolean includeQualifiers, |
/// deleteClass |
Boolean includeClassOrigin, |
|
const CIMPropertyList& propertyList) = 0; |
|
|
virtual void deleteClass( | virtual void deleteClass( |
const String& nameSpace, |
bool lock, |
const String& className); |
const CIMNamespaceName& nameSpace, |
/// deleteInstance |
const CIMName& className) = 0; |
|
|
virtual void deleteInstance( | virtual void deleteInstance( |
const String& nameSpace, |
bool lock, |
const Reference& instanceName); |
const CIMNamespaceName& nameSpace, |
/// createClass |
const CIMObjectPath& instanceName) = 0; |
|
|
virtual void createClass( | virtual void createClass( |
const String& nameSpace, |
bool lock, |
ClassDecl& newClass); |
const CIMNamespaceName& nameSpace, |
/// createInstance |
const CIMClass& newClass, |
virtual void createInstance( |
const ContentLanguageList& contentLangs) = 0; |
const String& nameSpace, |
|
const InstanceDecl& newInstance) ; |
virtual CIMObjectPath createInstance( |
/// modifyClass |
bool lock, |
|
const CIMNamespaceName& nameSpace, |
|
const CIMInstance& newInstance, |
|
const ContentLanguageList& contentLangs) = 0; |
|
|
virtual void modifyClass( | virtual void modifyClass( |
const String& nameSpace, |
bool lock, |
ClassDecl& modifiedClass); |
const CIMNamespaceName& nameSpace, |
/// modifyInstance |
const CIMClass& modifiedClass, |
virtual void modifyInstance( |
const ContentLanguageList& contentLangs) = 0; |
const String& nameSpace, |
|
const InstanceDecl& modifiedInstance); |
|
/// enumerateClasses |
|
virtual Array<ClassDecl> enumerateClasses( |
|
const String& nameSpace, |
|
const String& className = String::EMPTY, |
|
Boolean deepInheritance = false, |
|
Boolean localOnly = true, |
|
Boolean includeQualifiers = true, |
|
Boolean includeClassOrigin = false); |
|
/// enumerateClassNames |
|
virtual Array<String> enumerateClassNames( |
|
const String& nameSpace, |
|
const String& className = String::EMPTY, |
|
Boolean deepInheritance = false); |
|
/// enumerateInstances |
|
virtual Array<InstanceDecl> enumerateInstances( |
|
const String& nameSpace, |
|
const String& className, |
|
Boolean deepInheritance = true, |
|
Boolean localOnly = true, |
|
Boolean includeQualifiers = false, |
|
Boolean includeClassOrigin = false, |
|
const Array<String>& propertyList = _getStringArray()); |
|
/// enumerateInstanceNames |
|
virtual Array<Reference> enumerateInstanceNames( |
|
const String& nameSpace, |
|
const String& className); |
|
/// execQuery |
|
virtual Array<InstanceDecl> execQuery( |
|
const String& queryLanguage, |
|
const String& query) ; |
|
/// associators |
|
virtual Array<InstanceDecl> associators( |
|
const String& nameSpace, |
|
const Reference& objectName, |
|
const String& assocClass = String::EMPTY, |
|
const String& resultClass = String::EMPTY, |
|
const String& role = String::EMPTY, |
|
const String& resultRole = String::EMPTY, |
|
Boolean includeQualifiers = false, |
|
Boolean includeClassOrigin = false, |
|
const Array<String>& propertyList = _getStringArray()); |
|
/// associateNames |
|
virtual Array<Reference> associatorNames( |
|
const String& nameSpace, |
|
const Reference& objectName, |
|
const String& assocClass = String::EMPTY, |
|
const String& resultClass = String::EMPTY, |
|
const String& role = String::EMPTY, |
|
const String& resultRole = String::EMPTY); |
|
/// references |
|
virtual Array<InstanceDecl> references( |
|
const String& nameSpace, |
|
const Reference& objectName, |
|
const String& resultClass = String::EMPTY, |
|
const String& role = String::EMPTY, |
|
Boolean includeQualifiers = false, |
|
Boolean includeClassOrigin = false, |
|
const Array<String>& propertyList = _getStringArray()); |
|
/// referenceNames |
|
virtual Array<Reference> referenceNames( |
|
const String& nameSpace, |
|
const Reference& objectName, |
|
const String& resultClass = String::EMPTY, |
|
const String& role = String::EMPTY); |
|
/// getProperty |
|
virtual Value getProperty( |
|
const String& nameSpace, |
|
const Reference& instanceName, |
|
const String& propertyName); |
|
/// setProperty |
|
virtual void setProperty( |
|
const String& nameSpace, |
|
const Reference& instanceName, |
|
const String& propertyName, |
|
const Value& newValue = Value()); |
|
/// getQualifier |
|
virtual QualifierDecl getQualifier( |
|
const String& nameSpace, |
|
const String& qualifierName); |
|
/// setQualifier |
|
virtual void setQualifier( |
|
const String& nameSpace, |
|
const QualifierDecl& qualifierDecl); |
|
/// virtual deleteQualifier |
|
virtual void deleteQualifier( |
|
const String& nameSpace, |
|
const String& qualifierName); |
|
/// enumerateQualifiers |
|
virtual Array<QualifierDecl> enumerateQualifiers( |
|
const String& nameSpace); |
|
/// Virtual value |
|
virtual Value invokeMethod( |
|
const String& nameSpace, |
|
const Reference& instanceName, |
|
const String& methodName, |
|
const Array<Value>& inParameters, |
|
Array<Value>& outParameters); |
|
|
|
/** Method createNameSpace - Creates a new namespace in the repository |
|
@param String with the name of the namespace |
|
@exception - ??? |
|
ATTN: What happens if the namespace already exists. |
|
*/ |
|
void createNameSpace(const String& nameSpace); |
|
| |
/** Method enumerateNameSpaces - Get all of the namespaces in the |
virtual void modifyInstance( |
repository. \Ref{NAMESPACE} |
bool lock, |
@return Array of strings with the namespaces |
const CIMNamespaceName& nameSpace, |
*/ |
const CIMInstance& modifiedInstance, |
virtual Array<String> enumerateNameSpaces() const; |
Boolean includeQualifiers, |
|
const CIMPropertyList& propertyList, |
|
const ContentLanguageList& contentLangs) = 0; |
|
|
|
virtual Array<CIMClass> enumerateClasses( |
|
bool lock, |
|
const CIMNamespaceName& nameSpace, |
|
const CIMName& className, |
|
Boolean deepInheritance, |
|
Boolean localOnly, |
|
Boolean includeQualifiers, |
|
Boolean includeClassOrigin) = 0; |
|
|
|
virtual Array<CIMName> enumerateClassNames( |
|
bool lock, |
|
const CIMNamespaceName& nameSpace, |
|
const CIMName& className, |
|
Boolean deepInheritance) = 0; |
|
|
|
virtual Array<CIMInstance> enumerateInstancesForSubtree( |
|
bool lock, |
|
const CIMNamespaceName& nameSpace, |
|
const CIMName& className, |
|
Boolean deepInheritance, |
|
Boolean localOnly, |
|
Boolean includeQualifiers, |
|
Boolean includeClassOrigin, |
|
const CIMPropertyList& propertyList) = 0; |
|
|
|
virtual Array<CIMInstance> enumerateInstancesForClass( |
|
bool lock, |
|
const CIMNamespaceName& nameSpace, |
|
const CIMName& className, |
|
Boolean localOnly, |
|
Boolean includeQualifiers, |
|
Boolean includeClassOrigin, |
|
const CIMPropertyList& propertyList) = 0; |
|
|
|
virtual Array<CIMObjectPath> enumerateInstanceNamesForSubtree( |
|
bool lock, |
|
const CIMNamespaceName& nameSpace, |
|
const CIMName& className) = 0; |
|
|
|
virtual Array<CIMObjectPath> enumerateInstanceNamesForClass( |
|
bool lock, |
|
const CIMNamespaceName& nameSpace, |
|
const CIMName& className) = 0; |
| |
/** Method createMetaQualifiers - ATTN: |
virtual Array<CIMInstance> execQuery( |
This method must be invoked to create the appropriate meta-qualifiers |
bool lock, |
required by CIM (they are not part of the CIM schema; rather they are |
const String& queryLanguage, |
part of the meta-schema). |
const String& query) = 0; |
*/ |
|
| |
void createMetaQualifiers(const String& nameSpace); |
virtual Array<CIMObject> associators( |
|
bool lock, |
|
const CIMNamespaceName& nameSpace, |
|
const CIMObjectPath& objectName, |
|
const CIMName& assocClass, |
|
const CIMName& resultClass, |
|
const String& role, |
|
const String& resultRole, |
|
Boolean includeQualifiers, |
|
Boolean includeClassOrigin, |
|
const CIMPropertyList& propertyList) = 0; |
|
|
|
virtual Array<CIMObjectPath> associatorNames( |
|
bool lock, |
|
const CIMNamespaceName& nameSpace, |
|
const CIMObjectPath& objectName, |
|
const CIMName& assocClass, |
|
const CIMName& resultClass, |
|
const String& role, |
|
const String& resultRole) = 0; |
|
|
|
virtual Array<CIMObject> references( |
|
bool lock, |
|
const CIMNamespaceName& nameSpace, |
|
const CIMObjectPath& objectName, |
|
const CIMName& resultClass, |
|
const String& role, |
|
Boolean includeQualifiers, |
|
Boolean includeClassOrigin, |
|
const CIMPropertyList& propertyList) = 0; |
|
|
|
virtual Array<CIMObjectPath> referenceNames( |
|
bool lock, |
|
const CIMNamespaceName& nameSpace, |
|
const CIMObjectPath& objectName, |
|
const CIMName& resultClass, |
|
const String& role) = 0; |
|
|
|
virtual CIMValue getProperty( |
|
bool lock, |
|
const CIMNamespaceName& nameSpace, |
|
const CIMObjectPath& instanceName, |
|
const CIMName& propertyName) = 0; |
| |
private: |
virtual void setProperty( |
|
bool lock, |
|
const CIMNamespaceName& nameSpace, |
|
const CIMObjectPath& instanceName, |
|
const CIMName& propertyName, |
|
const CIMValue& newValue, |
|
const ContentLanguageList& contentLangs) = 0; |
|
|
|
virtual CIMQualifierDecl getQualifier( |
|
bool lock, |
|
const CIMNamespaceName& nameSpace, |
|
const CIMName& qualifierName) = 0; |
| |
static Array<String> _getStringArray() |
virtual void setQualifier( |
{ |
bool lock, |
return Array<String>(); |
const CIMNamespaceName& nameSpace, |
} |
const CIMQualifierDecl& qualifierDecl, |
|
const ContentLanguageList& contentLangs) = 0; |
| |
String _root; |
virtual void deleteQualifier( |
RepositoryDeclContext* _context; |
bool lock, |
|
const CIMNamespaceName& nameSpace, |
|
const CIMName& qualifierName) = 0; |
|
|
|
virtual Array<CIMQualifierDecl> enumerateQualifiers( |
|
bool lock, |
|
const CIMNamespaceName& nameSpace) = 0; |
|
|
|
virtual void createNameSpace( |
|
bool lock, |
|
const CIMNamespaceName& nameSpace, |
|
const NameSpaceAttributes& attributes) = 0; |
|
|
|
virtual void modifyNameSpace( |
|
bool lock, |
|
const CIMNamespaceName& nameSpace, |
|
const NameSpaceAttributes& attributes) = 0; |
|
|
|
virtual Array<CIMNamespaceName> enumerateNameSpaces( |
|
bool lock) const = 0; |
|
|
|
virtual void deleteNameSpace( |
|
bool lock, |
|
const CIMNamespaceName& nameSpace) = 0; |
|
|
|
virtual Boolean getNameSpaceAttributes( |
|
bool lock, |
|
const CIMNamespaceName& nameSpace, |
|
NameSpaceAttributes& attributes) = 0; |
|
|
|
virtual void setDeclContext( |
|
bool lock, |
|
RepositoryDeclContext* context) = 0; |
|
|
|
virtual Boolean isDefaultInstanceProvider( |
|
bool lock) = 0; |
|
|
|
virtual void getSubClassNames( |
|
bool lock, |
|
const CIMNamespaceName& nameSpace, |
|
const CIMName& className, |
|
Boolean deepInheritance, |
|
Array<CIMName>& subClassNames) const = 0; |
|
|
|
virtual void getSuperClassNames( |
|
bool lock, |
|
const CIMNamespaceName& nameSpace, |
|
const CIMName& className, |
|
Array<CIMName>& superClassNames) const = 0; |
|
|
|
virtual Boolean isRemoteNameSpace( |
|
bool lock, |
|
const CIMNamespaceName& nameSpace, |
|
String& remoteInfo) = 0; |
|
|
|
#ifdef PEGASUS_DEBUG |
|
virtual void DisplayCacheStatistics( |
|
bool lock) = 0; |
|
#endif |
}; | }; |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |
| |
#endif /* PegasusRepository_Repository_h */ |
#endif /* Pegasus_Repository_h */ |
|
|