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; referencesSetting(ctx, mbp, sourceInst.getNamespace(), properties, sourceInst, enumeration); Linux_DnsAddressMatchListExternal external(mbp, ctx); while(enumeration.hasNext()) { const Linux_DnsQueryACLForServiceManualInstance instance = enumeration.getNext(); const Linux_DnsQueryACLForServiceInstanceName instanceName = instance.getInstanceName(); const Linux_DnsAddressMatchListInstanceName Setting = instanceName.getSetting(); Linux_DnsAddressMatchListInstance inst = external.getInstance(properties,Setting); instances.addElement(inst); } } /* extrinsic methods */ } --- NEW FILE: Linux_DnsQueryACLForServiceRepositoryInstance.h --- /** * Linux_DnsQueryACLForServiceRepositoryInstance.h * * (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: * */ #ifndef Linux_DnsQueryACLForServiceRepositoryInstance_h #define Linux_DnsQueryACLForServiceRepositoryInstance_h #include "cmpidt.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiBooleanData.h" #include "CmpiCharData.h" #include "CmpiDateTime.h" #include "Linux_DnsQueryACLForServiceInstanceName.h" namespace genProvider { class Linux_DnsQueryACLForServiceRepositoryInstance { public: Linux_DnsQueryACLForServiceRepositoryInstance(); Linux_DnsQueryACLForServiceRepositoryInstance (const Linux_DnsQueryACLForServiceRepositoryInstance& original); Linux_DnsQueryACLForServiceRepositoryInstance (const CmpiInstance& inst, const char* instanceNamespace); ~Linux_DnsQueryACLForServiceRepositoryInstance(); Linux_DnsQueryACLForServiceRepositoryInstance& operator= (const Linux_DnsQueryACLForServiceRepositoryInstance& original); CmpiInstance getCmpiInstance(const char** properties=0) const; unsigned int isInstanceNameSet() const; void setInstanceName( const Linux_DnsQueryACLForServiceInstanceName& val); const Linux_DnsQueryACLForServiceInstanceName& getInstanceName() const; private: void init(); void init(const Linux_DnsQueryACLForServiceRepositoryInstance& original); void reset(); Linux_DnsQueryACLForServiceInstanceName m_instanceName; struct isSetType{ unsigned int instanceName:1; } isSet; }; struct Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement{ Linux_DnsQueryACLForServiceRepositoryInstance* m_elementP; Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement* m_nextP; Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement(); ~Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement(); }; class Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration { private: Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement* firstElementP; Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement* currentElementP; Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement* endElementP; public: Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration(); Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration( const Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration& original); ~Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration(); void reset(); bool hasNext() const; const Linux_DnsQueryACLForServiceRepositoryInstance& getNext(); int getSize() const; const Linux_DnsQueryACLForServiceRepositoryInstance& getElement(int pos) const; void addElement(const Linux_DnsQueryACLForServiceRepositoryInstance& elementP); }; } #endif --- NEW FILE: Linux_DnsQueryACLForServiceDefaultImplementation.h --- /** * Linux_DnsQueryACLForServiceDefaultImplementation.h * * (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: * */ #ifndef Linux_DnsQueryACLForServiceDefaultImplementation_h #define Linux_DnsQueryACLForServiceDefaultImplementation_h #include "Linux_DnsQueryACLForServiceInstanceName.h" #include "Linux_DnsQueryACLForServiceManualInstance.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiDateTime.h" #include "CmpiBroker.h" #include "Linux_DnsServiceInstance.h" #include "Linux_DnsAddressMatchListInstance.h" #include "Linux_DnsServiceExternal.h" #include "Linux_DnsAddressMatchListExternal.h" #include "Linux_DnsQueryACLForServiceInterface.h" namespace genProvider { class Linux_DnsQueryACLForServiceDefaultImplementation: public Linux_DnsQueryACLForServiceInterface { public: virtual ~Linux_DnsQueryACLForServiceDefaultImplementation() { }; /* intrinsic methods */ virtual void enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsQueryACLForServiceInstanceNameEnumeration& instnames); virtual void enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsQueryACLForServiceManualInstanceEnumeration& instances); virtual Linux_DnsQueryACLForServiceManualInstance getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsQueryACLForServiceInstanceName&); virtual void setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsQueryACLForServiceManualInstance&); virtual void createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsQueryACLForServiceManualInstance&); virtual void deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsQueryACLForServiceInstanceName&); /* Association Interface */ virtual void referencesElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsQueryACLForServiceManualInstanceEnumeration& instances); virtual void referencesSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsQueryACLForServiceManualInstanceEnumeration& instances); virtual void associatorsElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsServiceInstanceEnumeration& instances); virtual void associatorsSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceEnumeration& instances); /* extrinsic methods */ }; } #endif --- NEW FILE: Linux_DnsQueryACLForServiceManualInstance.cpp --- /** * Linux_DnsQueryACLForServiceManualInstance.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_DnsQueryACLForServiceManualInstance.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //Linux_DnsQueryACLForServiceManualInstance //********************************************************* //empty constructor Linux_DnsQueryACLForServiceManualInstance:: Linux_DnsQueryACLForServiceManualInstance(){ init(); }; //copy constructor Linux_DnsQueryACLForServiceManualInstance:: Linux_DnsQueryACLForServiceManualInstance (const Linux_DnsQueryACLForServiceManualInstance& original){ init(original); }; //constructor using CmpiInstance Linux_DnsQueryACLForServiceManualInstance:: Linux_DnsQueryACLForServiceManualInstance (const CmpiInstance& inst, const char* instanceNamespace){ CmpiData cmpiData; init(); CmpiObjectPath cop=inst.getObjectPath(); cop.setNameSpace(instanceNamespace); setInstanceName(Linux_DnsQueryACLForServiceInstanceName(cop)); } //Destructor Linux_DnsQueryACLForServiceManualInstance:: ~Linux_DnsQueryACLForServiceManualInstance(){ reset(); }; //copy operator Linux_DnsQueryACLForServiceManualInstance& Linux_DnsQueryACLForServiceManualInstance::operator= (const Linux_DnsQueryACLForServiceManualInstance& original){ init(original); return *this; }; //converts to CmpiInstance CmpiInstance Linux_DnsQueryACLForServiceManualInstance:: 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_DnsQueryACLForServiceManualInstance:: isInstanceNameSet() const{ return isSet.instanceName; } const Linux_DnsQueryACLForServiceInstanceName& Linux_DnsQueryACLForServiceManualInstance::getInstanceName() const{ if(!isSet.instanceName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "InstanceName not set in Linux_DnsQueryACLForService instance"); return m_instanceName; } void Linux_DnsQueryACLForServiceManualInstance::setInstanceName( const Linux_DnsQueryACLForServiceInstanceName& val){ m_instanceName = val; isSet.instanceName=1; } //set isSet attributes to FALSE void Linux_DnsQueryACLForServiceManualInstance::init(){ isSet.instanceName=0; }; //copies another instance properties in this void Linux_DnsQueryACLForServiceManualInstance::init (const Linux_DnsQueryACLForServiceManualInstance& original){ init(); if(original.isInstanceNameSet()){ setInstanceName(original.getInstanceName()); } } //reset the instance data void Linux_DnsQueryACLForServiceManualInstance::reset(){ }; //********************************************************* //Linux_DnsQueryACLForServiceManualInstanceEnumerationElement //********************************************************* Linux_DnsQueryACLForServiceManualInstanceEnumerationElement:: Linux_DnsQueryACLForServiceManualInstanceEnumerationElement(){ m_elementP=0; m_nextP=0; }; Linux_DnsQueryACLForServiceManualInstanceEnumerationElement:: ~Linux_DnsQueryACLForServiceManualInstanceEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //Linux_DnsQueryACLForServiceManualInstanceNameEnumeration //********************************************************* Linux_DnsQueryACLForServiceManualInstanceEnumeration:: Linux_DnsQueryACLForServiceManualInstanceEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; Linux_DnsQueryACLForServiceManualInstanceEnumeration:: Linux_DnsQueryACLForServiceManualInstanceEnumeration( const Linux_DnsQueryACLForServiceManualInstanceEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; Linux_DnsQueryACLForServiceManualInstanceEnumeration:: ~Linux_DnsQueryACLForServiceManualInstanceEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void Linux_DnsQueryACLForServiceManualInstanceEnumeration::reset(){ currentElementP=firstElementP; }; bool Linux_DnsQueryACLForServiceManualInstanceEnumeration::hasNext() const{ return (currentElementP!=0); }; int Linux_DnsQueryACLForServiceManualInstanceEnumeration::getSize() const{ int size=0; Linux_DnsQueryACLForServiceManualInstanceEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const Linux_DnsQueryACLForServiceManualInstance& Linux_DnsQueryACLForServiceManualInstanceEnumeration::getElement(int pos) const{ Linux_DnsQueryACLForServiceManualInstanceEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const Linux_DnsQueryACLForServiceManualInstance& Linux_DnsQueryACLForServiceManualInstanceEnumeration::getNext() { Linux_DnsQueryACLForServiceManualInstanceEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void Linux_DnsQueryACLForServiceManualInstanceEnumeration::addElement (const Linux_DnsQueryACLForServiceManualInstance& elementP){ if(firstElementP==0){ firstElementP=new Linux_DnsQueryACLForServiceManualInstanceEnumerationElement(); firstElementP->m_elementP=new Linux_DnsQueryACLForServiceManualInstance(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new Linux_DnsQueryACLForServiceManualInstanceEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new Linux_DnsQueryACLForServiceManualInstance(elementP); } }; } --- NEW FILE: Linux_DnsQueryACLForServiceInstance.h --- /** * Linux_DnsQueryACLForServiceInstance.h * * (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: * */ #ifndef Linux_DnsQueryACLForServiceInstance_h #define Linux_DnsQueryACLForServiceInstance_h #include "cmpidt.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiBooleanData.h" #include "CmpiCharData.h" #include "CmpiDateTime.h" #include "Linux_DnsQueryACLForServiceInstanceName.h" namespace genProvider { class Linux_DnsQueryACLForServiceInstance { public: Linux_DnsQueryACLForServiceInstance(); Linux_DnsQueryACLForServiceInstance (const Linux_DnsQueryACLForServiceInstance& original); Linux_DnsQueryACLForServiceInstance (const CmpiInstance& inst, const char* instanceNamespace); ~Linux_DnsQueryACLForServiceInstance(); Linux_DnsQueryACLForServiceInstance& operator= (const Linux_DnsQueryACLForServiceInstance& original); CmpiInstance getCmpiInstance(const char** properties=0) const; unsigned int isInstanceNameSet() const; void setInstanceName( const Linux_DnsQueryACLForServiceInstanceName& val); const Linux_DnsQueryACLForServiceInstanceName& getInstanceName() const; private: void init(); void init(const Linux_DnsQueryACLForServiceInstance& original); void reset(); Linux_DnsQueryACLForServiceInstanceName m_instanceName; struct isSetType{ unsigned int instanceName:1; } isSet; }; struct Linux_DnsQueryACLForServiceInstanceEnumerationElement{ Linux_DnsQueryACLForServiceInstance* m_elementP; Linux_DnsQueryACLForServiceInstanceEnumerationElement* m_nextP; Linux_DnsQueryACLForServiceInstanceEnumerationElement(); ~Linux_DnsQueryACLForServiceInstanceEnumerationElement(); }; class Linux_DnsQueryACLForServiceInstanceEnumeration { private: Linux_DnsQueryACLForServiceInstanceEnumerationElement* firstElementP; Linux_DnsQueryACLForServiceInstanceEnumerationElement* currentElementP; Linux_DnsQueryACLForServiceInstanceEnumerationElement* endElementP; public: Linux_DnsQueryACLForServiceInstanceEnumeration(); Linux_DnsQueryACLForServiceInstanceEnumeration( const Linux_DnsQueryACLForServiceInstanceEnumeration& original); ~Linux_DnsQueryACLForServiceInstanceEnumeration(); void reset(); bool hasNext() const; const Linux_DnsQueryACLForServiceInstance& getNext(); int getSize() const; const Linux_DnsQueryACLForServiceInstance& getElement(int pos) const; void addElement(const Linux_DnsQueryACLForServiceInstance& elementP); }; } #endif --- NEW FILE: makefile --- include ../setting.cmpi include setting.provider CPPFLAGS=$(CPPFLAGS.provider) -I. -I$(CIMOMINC) -I$(COMMONINC) -I$(CIMOMINC)/cpp -I../CIM_CollectionOfMSEs -I../Linux_DnsService -I../Linux_DnsAddressMatchList -I../CIM_ConcreteJob -I../CIM_ManagedSystemElement -D_COMPILE_UNIX -DCMPI_STANDALONE CXXFLAGS=-Wall -g -fPIC -fno-implicit-templates LDFLAGS=-L. -L$(COMMONLIB) -L$(COMMONLIB_OUT) -shared -lLinux_DnsServiceSupport -lLinux_DnsAddressMatchListSupport -lcmpiCppImpl -lIBM_ProviderTooling OBJECTS=Linux_DnsQueryACLForServiceInstanceName.o \ Linux_DnsQueryACLForServiceInstance.o \ Linux_DnsQueryACLForServiceExternal.o \ Linux_DnsQueryACLForServiceRepositoryInstance.o \ Linux_DnsQueryACLForServiceRepositoryExternal.o \ Linux_DnsQueryACLForServiceManualInstance.o \ Linux_DnsQueryACLForServiceDefaultImplementation.o FAKEFACTORY= Linux_DnsQueryACLForServiceFakeFactory.o NORMALFACTORY= Linux_DnsQueryACLForServiceFactory.o RESOURCEOBJECT= Linux_DnsQueryACLForServiceResourceAccess.o PROVIDEROBJECT=CmpiLinux_DnsQueryACLForServiceProvider.o all: testfiles preinstall install buildall: clean all #------------------------------------------------------------------------------# compile: $(OBJECTS) $(FAKEFACTORY) $(NORMALFACTORY) $(RESOURCEOBJECT) $(PROVIDEROBJECT) #------------------------------------------------------------------------------# prelink: $(OBJECTS) $(FAKEFACTORY) $(LINK.cpp) -o libLinux_DnsQueryACLForServiceSupport.so $^ link: deleteFakeLib \ libLinux_DnsQueryACLForServiceSupport.so \ libLinux_DnsQueryACLForService.so libLinux_DnsQueryACLForServiceSupport.so: LDFLAGS+=$(LDFLAGS.provider) libLinux_DnsQueryACLForServiceSupport.so: $(OBJECTS) $(NORMALFACTORY) $(RESOURCEOBJECT) $(PROVIDEROBJECT) $(LINK.cpp) -o $@ $^ libLinux_DnsQueryACLForService.so: LDFLAGS+=-lLinux_DnsQueryACLForServiceSupport libLinux_DnsQueryACLForService.so: $(PROVIDEROBJECT) $(LINK.cpp) -o $@ $^ deleteFakeLib: $(RM) *.so #------------------------------------------------------------------------------# preinstall: prelink install libLinux_DnsQueryACLForServiceSupport.so $(COMMONLIB_OUT) #------------------------------------------------------------------------------# install: link install libLinux_DnsQueryACLForServiceSupport.so $(COMMONLIB_OUT) install libLinux_DnsQueryACLForService.so $(CIMOMLIB_OUT) # install -m 644 Linux_DnsQueryACLForService*.h $(COMMONINC) $(MAKE) -C mof -f $(MOFMAKEFILE) install #------------------------------------------------------------------------------# testfiles: @[ -d $(CIMOMLIB) ] || ( echo directory $(CIMOMLIB) does not exist && false) @[ -d $(CIMOMINC) ] || ( echo directory $(CIMOMINC) does not exist - please create manually && false) @[ -d $(CIMOMMOF) ] || ( echo directory $(CIMOMMOF) does not exist - please create manually && false) @[ -d $(COMMONINC) ] || ( echo directory $(COMMONINC) does not exist - please create manually && false) @[ -d $(COMMONLIB) ] || ( echo directory $(COMMONLIB) does not exist - please create manually && false) #------------------------------------------------------------------------------# clean: $(RM) *.so *.o *~ #------------------------------------------------------------------------------# uninstall: $(MAKE) -C mof -f $(MOFMAKEFILE) uninstall; # $(RM) $(COMMONINC)/Linux_DnsQueryACLForService*.h \ $(RM) $(COMMONLIB)/libLinux_DnsQueryACLForServiceSupport.so \ $(RM) $(CIMOMLIB)/libLinux_DnsQueryACLForService.so --- NEW FILE: Linux_DnsQueryACLForServiceInstanceName.h --- /** * Linux_DnsQueryACLForServiceInstanceName.h * * (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: * */ #ifndef Linux_DnsQueryACLForServiceInstanceName_h #define Linux_DnsQueryACLForServiceInstanceName_h #include "cmpidt.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiBooleanData.h" #include "CmpiCharData.h" #include "CmpiDateTime.h" #include "ArrayConverter.h" #include "CmpiErrorFormater.h" #include "Linux_DnsServiceInstanceName.h" #include "Linux_DnsAddressMatchListInstanceName.h" namespace genProvider { class Linux_DnsQueryACLForServiceInstanceName { public: Linux_DnsQueryACLForServiceInstanceName(); Linux_DnsQueryACLForServiceInstanceName (const Linux_DnsQueryACLForServiceInstanceName& original); Linux_DnsQueryACLForServiceInstanceName (const CmpiObjectPath& path); ~Linux_DnsQueryACLForServiceInstanceName(); Linux_DnsQueryACLForServiceInstanceName& operator= (const Linux_DnsQueryACLForServiceInstanceName& original); CmpiObjectPath getObjectPath() const; void fillKeys(CmpiInstance& cmpiInstance) const; unsigned int isNameSpaceSet() const; void setNamespace(const char * val, int makeCopy = 1); const char * getNamespace() const; unsigned int isElementSet() const; void setElement(const Linux_DnsServiceInstanceName& val); const Linux_DnsServiceInstanceName& getElement() const; unsigned int isSettingSet() const; void setSetting(const Linux_DnsAddressMatchListInstanceName& val); const Linux_DnsAddressMatchListInstanceName& getSetting() const; private: void init(); void init(const Linux_DnsQueryACLForServiceInstanceName& original); void reset(); const char* m_CIMClassNameP; const char* m_namespace; Linux_DnsServiceInstanceName m_Element; Linux_DnsAddressMatchListInstanceName m_Setting; struct isSetType{ unsigned int m_namespace:1; unsigned int Element:1; unsigned int Setting:1; } isSet; }; struct Linux_DnsQueryACLForServiceInstanceNameEnumerationElement{ Linux_DnsQueryACLForServiceInstanceName* m_elementP; Linux_DnsQueryACLForServiceInstanceNameEnumerationElement* m_nextP; Linux_DnsQueryACLForServiceInstanceNameEnumerationElement(); ~Linux_DnsQueryACLForServiceInstanceNameEnumerationElement(); }; class Linux_DnsQueryACLForServiceInstanceNameEnumeration { private: Linux_DnsQueryACLForServiceInstanceNameEnumerationElement* firstElementP; Linux_DnsQueryACLForServiceInstanceNameEnumerationElement* currentElementP; Linux_DnsQueryACLForServiceInstanceNameEnumerationElement* endElementP; public: Linux_DnsQueryACLForServiceInstanceNameEnumeration(); Linux_DnsQueryACLForServiceInstanceNameEnumeration(const CmpiArray& arr); Linux_DnsQueryACLForServiceInstanceNameEnumeration( const Linux_DnsQueryACLForServiceInstanceNameEnumeration& original); ~Linux_DnsQueryACLForServiceInstanceNameEnumeration(); void reset(); bool hasNext() const; const Linux_DnsQueryACLForServiceInstanceName& getNext(); int getSize() const; const Linux_DnsQueryACLForServiceInstanceName& getElement(int pos) const; //no copy of the element is done void addElement(const Linux_DnsQueryACLForServiceInstanceName& elementP); operator CmpiArray() const; }; } #endif --- NEW FILE: Linux_DnsQueryACLForServiceInterface.h --- /** * Linux_DnsQueryACLForServiceInterface.h * * (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: * */ #ifndef Linux_DnsQueryACLForServiceInterface_h #define Linux_DnsQueryACLForServiceInterface_h #include "Linux_DnsQueryACLForServiceInstanceName.h" #include "Linux_DnsQueryACLForServiceManualInstance.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiDateTime.h" #include "CmpiBroker.h" #include "Linux_DnsServiceInstance.h" #include "Linux_DnsAddressMatchListInstance.h" #include "Linux_DnsServiceExternal.h" #include "Linux_DnsAddressMatchListExternal.h" namespace genProvider { class Linux_DnsQueryACLForServiceInterface { public: virtual ~Linux_DnsQueryACLForServiceInterface() { }; /* intrinsic methods */ virtual void enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsQueryACLForServiceInstanceNameEnumeration& instnames) = 0; virtual void enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsQueryACLForServiceManualInstanceEnumeration& instances) = 0; virtual Linux_DnsQueryACLForServiceManualInstance getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsQueryACLForServiceInstanceName&) = 0; virtual void setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsQueryACLForServiceManualInstance&) = 0; virtual void createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsQueryACLForServiceManualInstance&) = 0; virtual void deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsQueryACLForServiceInstanceName&) = 0; /* Association Interface */ virtual void referencesElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsQueryACLForServiceManualInstanceEnumeration& instances) = 0; virtual void referencesSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsQueryACLForServiceManualInstanceEnumeration& instances) = 0; virtual void associatorsElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsServiceInstanceEnumeration& instances) = 0; virtual void associatorsSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceEnumeration& instances) = 0; /* extrinsic methods */ }; } #endif --- NEW FILE: Linux_DnsQueryACLForServiceFactory.h --- /** * Linux_DnsQueryACLForServiceFactory.h * * (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: * */ #ifndef Linux_DnsQueryACLForServiceFactory_h #define Linux_DnsQueryACLForServiceFactory_h #include "Linux_DnsQueryACLForServiceInterface.h" namespace genProvider{ class Linux_DnsQueryACLForServiceFactory{ public: Linux_DnsQueryACLForServiceFactory(){}; ~Linux_DnsQueryACLForServiceFactory(){}; static Linux_DnsQueryACLForServiceInterface* getImplementation(); }; } #endif --- NEW FILE: CmpiLinux_DnsQueryACLForServiceProvider.cpp --- /** * CmpiLinux_DnsQueryACL... [truncated message content] |