Update of /cvsroot/sblim/cmpi-dns/provider/Linux_DnsQueryACLForService In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20455/provider/Linux_DnsQueryACLForService Added Files: Linux_DnsQueryACLForServiceInstanceName.h Linux_DnsQueryACLForServiceDefaultImplementation.h Linux_DnsQueryACLForServiceInterface.h Linux_DnsQueryACLForServiceFakeFactory.cpp Linux_DnsQueryACLForServiceResourceAccess.h Linux_DnsQueryACLForServiceRepositoryInstance.cpp Linux_DnsQueryACLForServiceManualInstance.cpp Linux_DnsQueryACLForServiceRepositoryExternal.h Linux_DnsQueryACLForServiceInstanceName.cpp Linux_DnsQueryACLForServiceManualInstance.h Linux_DnsQueryACLForServiceDefaultImplementation.cpp CmpiLinux_DnsQueryACLForServiceProvider.cpp Linux_DnsQueryACLForServiceInstance.h Linux_DnsQueryACLForServiceExternal.cpp Linux_DnsQueryACLForServiceFactory.cpp CmpiLinux_DnsQueryACLForServiceProvider.h setting.provider makefile Linux_DnsQueryACLForServiceInstance.cpp Linux_DnsQueryACLForServiceExternal.h Linux_DnsQueryACLForServiceRepositoryExternal.cpp Linux_DnsQueryACLForServiceFactory.h Linux_DnsQueryACLForServiceResourceAccess.cpp Linux_DnsQueryACLForServiceRepositoryInstance.h Log Message: WBEM-SMT DNS provider component. First initial upload. This module includes: - CIM model for DNS - CMPI provider for DNS - Resource Access layer for DNS --- NEW FILE: setting.provider --- #Provider configuration #CPPFLAGS.provider LDFLAGS.provider=-ldnssupport --- NEW FILE: Linux_DnsQueryACLForServiceResourceAccess.cpp --- /** * Linux_DnsQueryACLForServiceResourceAccess.cpp * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * author: Murillo Bernardes <ber...@br...> * * Contributors: * */ #include "Linux_DnsQueryACLForServiceResourceAccess.h" #define DNS_ATTR_STR "allow-query" namespace genProvider { //Linux_DnsQueryACLForServiceResourceAccess::Linux_DnsQueryACLForServiceResourceAccess(); Linux_DnsQueryACLForServiceResourceAccess::~Linux_DnsQueryACLForServiceResourceAccess() { }; /* intrinsic methods */ void Linux_DnsQueryACLForServiceResourceAccess::enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsQueryACLForServiceInstanceNameEnumeration& instnames){ BINDOPTS *sopts = ReadOptions(); char *myoptvalue = getOption(sopts,DNS_ATTR_STR); if ( ! myoptvalue ) return; DnsArray list = DnsArray(myoptvalue); DnsArrayConstIterator iter; for ( iter = list.begin(); iter != list.end(); ++iter) { Linux_DnsQueryACLForServiceInstanceName Inst; Linux_DnsAddressMatchListInstanceName addrList; Linux_DnsServiceInstanceName serviceInstanceName; Inst.setNamespace( nsp ); addrList.setNamespace( nsp ); serviceInstanceName.setNamespace( nsp ); serviceInstanceName.setName( DEFAULT_SERVICE_NAME ); serviceInstanceName.setSystemCreationClassName( DEFAULT_SYSTEM_CREATION_CLASS_NAME ); serviceInstanceName.setSystemName( DEFAULT_SYSTEM_NAME ); serviceInstanceName.setCreationClassName( DEFAULT_CREATION_CLASS_NAME ); addrList.setName( (*iter).c_str() ); addrList.setServiceName( DEFAULT_SERVICE_NAME ); Inst.setSetting( addrList ); Inst.setElement( serviceInstanceName ); instnames.addElement(Inst); } freeOptions( sopts ); } void Linux_DnsQueryACLForServiceResourceAccess::enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsQueryACLForServiceManualInstanceEnumeration& instances){ BINDOPTS *sopts = ReadOptions(); char *myoptvalue = getOption(sopts,DNS_ATTR_STR); if ( ! myoptvalue ) return; DnsArray list = DnsArray( myoptvalue ); DnsArrayConstIterator iter; for ( iter = list.begin(); iter != list.end(); ++iter) { Linux_DnsQueryACLForServiceInstanceName Inst; Linux_DnsAddressMatchListInstanceName addrList; Linux_DnsServiceInstanceName serviceInstanceName; Inst.setNamespace( nsp ); addrList.setNamespace( nsp ); serviceInstanceName.setNamespace( nsp ); serviceInstanceName.setName( DEFAULT_SERVICE_NAME ); serviceInstanceName.setSystemCreationClassName( DEFAULT_SYSTEM_CREATION_CLASS_NAME ); serviceInstanceName.setSystemName( DEFAULT_SYSTEM_NAME ); serviceInstanceName.setCreationClassName( DEFAULT_CREATION_CLASS_NAME ); addrList.setName( (*iter).c_str() ); addrList.setServiceName( DEFAULT_SERVICE_NAME, 1 ); Inst.setSetting( addrList ); Inst.setElement( serviceInstanceName ); Linux_DnsQueryACLForServiceManualInstance manualInst; manualInst.setInstanceName( Inst ); instances.addElement(manualInst); } freeOptions( sopts ); }; Linux_DnsQueryACLForServiceManualInstance Linux_DnsQueryACLForServiceResourceAccess::getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsQueryACLForServiceInstanceName& instanceName){ Linux_DnsQueryACLForServiceManualInstance instance; Linux_DnsQueryACLForServiceManualInstance manualInst; manualInst.setInstanceName( instanceName ); return manualInst; } /* void Linux_DnsQueryACLForServiceResourceAccess::setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsQueryACLForServiceManualInstance&){};*/ void Linux_DnsQueryACLForServiceResourceAccess::createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsQueryACLForServiceManualInstance& anInstance){ BINDOPTS* sopts = ReadOptions(); char *myoptvalue = getOption(sopts,DNS_ATTR_STR); DnsArray list; if (myoptvalue) list.populate(myoptvalue); list.add( string(anInstance.getInstanceName().getSetting().getName()) ); setOption(sopts, DNS_ATTR_STR, list.toString().c_str()); freeOptions( sopts ); }; void Linux_DnsQueryACLForServiceResourceAccess::deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsQueryACLForServiceInstanceName& anInstanceName){ BINDOPTS* sopts = ReadOptions(); char *myoptvalue = getOption(sopts,DNS_ATTR_STR); DnsArray list; if (myoptvalue) list.populate(myoptvalue); list.remove( string(anInstanceName.getSetting().getName()) ); setOption(sopts, DNS_ATTR_STR, list.toString().c_str()); freeOptions( sopts ); }; /* Association Interface */ void Linux_DnsQueryACLForServiceResourceAccess::referencesElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsQueryACLForServiceManualInstanceEnumeration& instEnum) { BINDOPTS *sopts = ReadOptions(); char *myoptvalue = getOption(sopts,DNS_ATTR_STR); if ( ! myoptvalue ) return; DnsArray list = DnsArray(myoptvalue); DnsArrayConstIterator iter; for ( iter = list.begin(); iter != list.end(); ++iter) { if ( strcmp( (*iter).c_str(), sourceInst.getName()) ) continue; Linux_DnsServiceInstanceName serviceInstanceName; serviceInstanceName.setNamespace( nsp ); serviceInstanceName.setName( DEFAULT_SERVICE_NAME ); serviceInstanceName.setSystemCreationClassName( DEFAULT_SYSTEM_CREATION_CLASS_NAME ); serviceInstanceName.setSystemName( DEFAULT_SYSTEM_NAME ); serviceInstanceName.setCreationClassName( DEFAULT_CREATION_CLASS_NAME ); Linux_DnsQueryACLForServiceManualInstance inst; Linux_DnsQueryACLForServiceInstanceName instName; instName.setNamespace( nsp ); instName.setElement( serviceInstanceName ); instName.setSetting( sourceInst ); inst.setInstanceName( instName ); instEnum.addElement(inst); } }; void Linux_DnsQueryACLForServiceResourceAccess::referencesSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsQueryACLForServiceManualInstanceEnumeration& instEnum) { BINDOPTS *sopts = ReadOptions(); char *myoptvalue = getOption(sopts,DNS_ATTR_STR); if ( ! myoptvalue ) return; DnsArray list = DnsArray(myoptvalue); DnsArrayConstIterator iter; for ( iter = list.begin(); iter != list.end(); ++iter) { Linux_DnsQueryACLForServiceInstanceName Inst; Linux_DnsAddressMatchListInstanceName addrList; Linux_DnsServiceInstanceName serviceInstanceName; Inst.setNamespace( nsp ); addrList.setNamespace( nsp ); serviceInstanceName.setNamespace( nsp ); serviceInstanceName.setName( DEFAULT_SERVICE_NAME ); serviceInstanceName.setSystemCreationClassName( DEFAULT_SYSTEM_CREATION_CLASS_NAME ); serviceInstanceName.setSystemName( DEFAULT_SYSTEM_NAME ); serviceInstanceName.setCreationClassName( DEFAULT_CREATION_CLASS_NAME ); addrList.setName( (*iter).c_str() ); addrList.setServiceName( DEFAULT_SERVICE_NAME ); Inst.setNamespace( nsp ); Inst.setSetting( addrList ); Inst.setElement( serviceInstanceName ); Linux_DnsQueryACLForServiceManualInstance manualInst; manualInst.setInstanceName( Inst ); instEnum.addElement(manualInst); } freeOptions( sopts ); }; void Linux_DnsQueryACLForServiceResourceAccess::associatorsElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsServiceInstanceEnumeration& instEnum) { BINDOPTS *sopts = ReadOptions(); char *myoptvalue = getOption(sopts,DNS_ATTR_STR); if ( ! myoptvalue ) return; DnsArray list = DnsArray(myoptvalue); DnsArrayConstIterator iter; for ( iter = list.begin(); iter != list.end(); ++iter) { if ( strcmp( (*iter).c_str(), sourceInst.getName() )) continue; Linux_DnsServiceInstance inst; Linux_DnsServiceInstanceName instanceName; instanceName.setNamespace( nsp ); instanceName.setName( DEFAULT_SERVICE_NAME ); instanceName.setSystemCreationClassName( DEFAULT_SYSTEM_CREATION_CLASS_NAME ); instanceName.setSystemName( DEFAULT_SYSTEM_NAME ); instanceName.setCreationClassName( DEFAULT_CREATION_CLASS_NAME ); inst.setInstanceName(instanceName); instEnum.addElement(inst); } }; void Linux_DnsQueryACLForServiceResourceAccess::associatorsSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceEnumeration& instEnum) { ACL *list_acl = ReadACL(); BINDOPTS *sopts = ReadOptions(); char *myoptvalue = getOption(sopts,DNS_ATTR_STR); if ( ! myoptvalue ) return; DnsArray list = DnsArray(myoptvalue); DnsArrayConstIterator iter; for ( iter = list.begin(); iter != list.end(); ++iter) { Linux_DnsAddressMatchListInstance addrInst; Linux_DnsAddressMatchListInstanceName addrInstName; addrInstName.setNamespace( nsp ); addrInstName.setName( (*iter).c_str() ); addrInstName.setServiceName( DEFAULT_SERVICE_NAME ); addrInst.setInstanceName( addrInstName ); char *aclValue = getACL(list_acl, (*iter).c_str()); if ( ! aclValue ) continue; DnsArray aclArray = DnsArray( aclValue ); addrInst.setAddressList( aclArray.toArray(), aclArray.size() ); addrInst.setAddressListType( DNS_AMLTYPE_AML ); instEnum.addElement(addrInst); } freeOptions( sopts ); freeACL( list_acl ); }; /* extrinsic methods */ } --- NEW FILE: Linux_DnsQueryACLForServiceRepositoryExternal.cpp --- /** * Linux_DnsQueryACLForServiceRepositoryExternal.cpp * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * author: Murillo Bernardes <ber...@br...> * * Contributors: * */ #include "Linux_DnsQueryACLForServiceRepositoryExternal.h" namespace genProvider{ Linux_DnsQueryACLForServiceRepositoryExternal::Linux_DnsQueryACLForServiceRepositoryExternal( const CmpiBroker& brkr, const CmpiContext& ctx ) : broker(brkr), context(ctx) {}; const char * Linux_DnsQueryACLForServiceRepositoryExternal:: nsp="IBMShadow/cimv2"; Linux_DnsQueryACLForServiceRepositoryExternal:: ~Linux_DnsQueryACLForServiceRepositoryExternal(){}; void Linux_DnsQueryACLForServiceRepositoryExternal::enumInstanceNames( Linux_DnsQueryACLForServiceInstanceNameEnumeration& instnames) { CmpiObjectPath op(nsp,"Linux_DnsQueryACLForService"); CmpiEnumeration en=broker.enumInstanceNames(context,op); while(en.hasNext()) { CmpiObjectPath opi = en.getNext(); Linux_DnsQueryACLForServiceInstanceName iname(opi); instnames.addElement(iname); } }; void Linux_DnsQueryACLForServiceRepositoryExternal::enumInstances( const char* *properties, Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration& instances) { CmpiObjectPath op(nsp,"Linux_DnsQueryACLForService"); CmpiEnumeration en=broker.enumInstances(context,op,properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); Linux_DnsQueryACLForServiceRepositoryInstance instance(inst,nsp); instances.addElement(instance); } }; Linux_DnsQueryACLForServiceRepositoryInstance Linux_DnsQueryACLForServiceRepositoryExternal::getInstance( const char* *properties, const Linux_DnsQueryACLForServiceInstanceName& instanceName) { CmpiObjectPath op=instanceName.getObjectPath(); op.setNameSpace(nsp); CmpiInstance inst=broker.getInstance(context,op,properties); return Linux_DnsQueryACLForServiceRepositoryInstance(inst,nsp); } void Linux_DnsQueryACLForServiceRepositoryExternal::setInstance( const char* *properties, const Linux_DnsQueryACLForServiceRepositoryInstance& instance){ //make a copy of the given instance and set it to the right nameSpace Linux_DnsQueryACLForServiceInstanceName instanceName(instance.getInstanceName()); instanceName.setNamespace(nsp,1); Linux_DnsQueryACLForServiceRepositoryInstance copiedInstance(instance); copiedInstance.setInstanceName(instanceName); CmpiObjectPath op=instanceName.getObjectPath(); CmpiInstance inst=copiedInstance.getCmpiInstance(); broker.setInstance(context,op,inst,properties); } void Linux_DnsQueryACLForServiceRepositoryExternal::createInstance( const Linux_DnsQueryACLForServiceRepositoryInstance& instance){ //make a copy of the given instance and set it to the right nameSpace Linux_DnsQueryACLForServiceInstanceName instanceName(instance.getInstanceName()); instanceName.setNamespace(nsp,1); Linux_DnsQueryACLForServiceRepositoryInstance copiedInstance(instance); copiedInstance.setInstanceName(instanceName); CmpiObjectPath op=instanceName.getObjectPath(); CmpiInstance inst=copiedInstance.getCmpiInstance(); broker.createInstance(context,op,inst); } void Linux_DnsQueryACLForServiceRepositoryExternal::deleteInstance( const Linux_DnsQueryACLForServiceInstanceName& instanceName){ CmpiObjectPath op=instanceName.getObjectPath(); op.setNameSpace(nsp); broker.deleteInstance(context,op); } } --- NEW FILE: Linux_DnsQueryACLForServiceRepositoryInstance.cpp --- /** * Linux_DnsQueryACLForServiceRepositoryInstance.cpp * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * author: Murillo Bernardes <ber...@br...> * * Contributors: * */ #include "Linux_DnsQueryACLForServiceRepositoryInstance.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //Linux_DnsQueryACLForServiceRepositoryInstance //********************************************************* //empty constructor Linux_DnsQueryACLForServiceRepositoryInstance:: Linux_DnsQueryACLForServiceRepositoryInstance(){ init(); }; //copy constructor Linux_DnsQueryACLForServiceRepositoryInstance:: Linux_DnsQueryACLForServiceRepositoryInstance (const Linux_DnsQueryACLForServiceRepositoryInstance& original){ init(original); }; //constructor using CmpiInstance Linux_DnsQueryACLForServiceRepositoryInstance:: Linux_DnsQueryACLForServiceRepositoryInstance (const CmpiInstance& inst, const char* instanceNamespace){ CmpiData cmpiData; init(); CmpiObjectPath cop=inst.getObjectPath(); cop.setNameSpace(instanceNamespace); setInstanceName(Linux_DnsQueryACLForServiceInstanceName(cop)); } //Destructor Linux_DnsQueryACLForServiceRepositoryInstance:: ~Linux_DnsQueryACLForServiceRepositoryInstance(){ reset(); }; //copy operator Linux_DnsQueryACLForServiceRepositoryInstance& Linux_DnsQueryACLForServiceRepositoryInstance::operator= (const Linux_DnsQueryACLForServiceRepositoryInstance& original){ init(original); return *this; }; //converts to CmpiInstance CmpiInstance Linux_DnsQueryACLForServiceRepositoryInstance:: getCmpiInstance(const char** properties) const{ CmpiObjectPath objectPath=getInstanceName().getObjectPath(); CmpiInstance cmpiInstance(objectPath); getInstanceName().fillKeys(cmpiInstance); if (properties) { cmpiInstance.setPropertyFilter(properties,0); } return cmpiInstance; } //InstanceName related methods unsigned int Linux_DnsQueryACLForServiceRepositoryInstance:: isInstanceNameSet() const{ return isSet.instanceName; } const Linux_DnsQueryACLForServiceInstanceName& Linux_DnsQueryACLForServiceRepositoryInstance::getInstanceName() const{ if(!isSet.instanceName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "InstanceName not set in Linux_DnsQueryACLForService instance"); return m_instanceName; } void Linux_DnsQueryACLForServiceRepositoryInstance::setInstanceName( const Linux_DnsQueryACLForServiceInstanceName& val){ m_instanceName = val; isSet.instanceName=1; } //set isSet attributes to FALSE void Linux_DnsQueryACLForServiceRepositoryInstance::init(){ isSet.instanceName=0; }; //copies another instance properties in this void Linux_DnsQueryACLForServiceRepositoryInstance::init (const Linux_DnsQueryACLForServiceRepositoryInstance& original){ init(); if(original.isInstanceNameSet()){ setInstanceName(original.getInstanceName()); } } //reset the instance data void Linux_DnsQueryACLForServiceRepositoryInstance::reset(){ }; //********************************************************* //Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement //********************************************************* Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement:: Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement(){ m_elementP=0; m_nextP=0; }; Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement:: ~Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //Linux_DnsQueryACLForServiceRepositoryInstanceNameEnumeration //********************************************************* Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration:: Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration:: Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration( const Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration:: ~Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration::reset(){ currentElementP=firstElementP; }; bool Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration::hasNext() const{ return (currentElementP!=0); }; int Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration::getSize() const{ int size=0; Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const Linux_DnsQueryACLForServiceRepositoryInstance& Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration::getElement(int pos) const{ Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const Linux_DnsQueryACLForServiceRepositoryInstance& Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration::getNext() { Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration::addElement (const Linux_DnsQueryACLForServiceRepositoryInstance& elementP){ if(firstElementP==0){ firstElementP=new Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement(); firstElementP->m_elementP=new Linux_DnsQueryACLForServiceRepositoryInstance(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new Linux_DnsQueryACLForServiceRepositoryInstance(elementP); } }; } --- NEW FILE: Linux_DnsQueryACLForServiceDefaultImplementation.cpp --- /** * Linux_DnsQueryACLForServiceDefaultImplementation.cpp * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * author: Murillo Bernardes <ber...@br...> * * Contributors: * */ #include "Linux_DnsQueryACLForServiceDefaultImplementation.h" #include <iostream> using namespace std; namespace genProvider { /* intrinsic methods */ void Linux_DnsQueryACLForServiceDefaultImplementation::enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsQueryACLForServiceInstanceNameEnumeration& instnames){ cout<<"enumInstances not supported for Linux_DnsQueryACLForService"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "enumInstances not implemented for Linux_DnsQueryACLForService"); } void Linux_DnsQueryACLForServiceDefaultImplementation::enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsQueryACLForServiceManualInstanceEnumeration& instances){ cout<<"Using default enumInstances implementation for Linux_DnsQueryACLForService"<<endl; cout<<"LetŽs get the instanceNames"<<endl; Linux_DnsQueryACLForServiceInstanceNameEnumeration namesEnumeration; enumInstanceNames(ctx, mbp,nsp,namesEnumeration); cout<<"Getting each instance"<<endl; while(namesEnumeration.hasNext()){ Linux_DnsQueryACLForServiceInstanceName name= namesEnumeration.getNext(); cout<<"Getting an instance for instanceName"<<endl; Linux_DnsQueryACLForServiceManualInstance instance= getInstance(ctx, mbp, properties, name); cout<<"adding instance to enum"<<endl; instances.addElement(instance); cout<<"Added!"<<endl; }; } Linux_DnsQueryACLForServiceManualInstance Linux_DnsQueryACLForServiceDefaultImplementation::getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsQueryACLForServiceInstanceName&){ cout<<"getInstance not supported for Linux_DnsQueryACLForService"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "getInstance not implemented for Linux_DnsQueryACLForService"); } void Linux_DnsQueryACLForServiceDefaultImplementation::setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsQueryACLForServiceManualInstance&){ cout<<"setInstance not supported for Linux_DnsQueryACLForService"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "setInstance not implemented for Linux_DnsQueryACLForService"); } void Linux_DnsQueryACLForServiceDefaultImplementation:: createInstance(const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsQueryACLForServiceManualInstance&){ cout<<"createInstance not supported for Linux_DnsQueryACLForService"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "createInstance not implemented for Linux_DnsQueryACLForService"); } void Linux_DnsQueryACLForServiceDefaultImplementation:: deleteInstance(const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsQueryACLForServiceInstanceName&){ cout<<"deleteInstance not supported for Linux_DnsQueryACLForService"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "deleteInstance not implemented for Linux_DnsQueryACLForService"); } /* Association Interface */ void Linux_DnsQueryACLForServiceDefaultImplementation:: referencesElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsQueryACLForServiceManualInstanceEnumeration& instances){ throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "getElementReferences between Linux_DnsService and Linux_DnsAddressMatchList not implemented for Linux_DnsQueryACLForService"); } void Linux_DnsQueryACLForServiceDefaultImplementation:: referencesSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsQueryACLForServiceManualInstanceEnumeration& instances){ throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "getSettingReferences between Linux_DnsService and Linux_DnsAddressMatchList not implemented for Linux_DnsQueryACLForService"); } void Linux_DnsQueryACLForServiceDefaultImplementation:: associatorsElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsServiceInstanceEnumeration& instances){ std::cout<<"Linux_DnsQueryACLForService : associatorsLinux_DnsService() ... returns one instance"<<std::endl; Linux_DnsQueryACLForServiceManualInstanceEnumeration enumeration; referencesElement(ctx, mbp, sourceInst.getNamespace(), properties, sourceInst, enumeration); Linux_DnsServiceExternal external(mbp, ctx); while(enumeration.hasNext()) { const Linux_DnsQueryACLForServiceManualInstance instance = enumeration.getNext(); const Linux_DnsQueryACLForServiceInstanceName instanceName = instance.getInstanceName(); const Linux_DnsServiceInstanceName Element = instanceName.getElement(); Linux_DnsServiceInstance inst = external.getInstance(properties,Element); instances.addElement(inst); } } void Linux_DnsQueryACLForServiceDefaultImplementation:: associatorsSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceEnumeration& instances){ std::cout<<"Linux_DnsQueryACLForService : associatorsLinux_DnsAddressMatchList() ... returns one instance"<<std::endl; Linux_DnsQueryACLForServiceManualInstanceEnumeration enumeration; ... [truncated message content] |