Update of /cvsroot/sblim/cmpi-dns/provider/Linux_DnsBlackholeACLForService In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20455/provider/Linux_DnsBlackholeACLForService Added Files: Linux_DnsBlackholeACLForServiceInstance.h Linux_DnsBlackholeACLForServiceFactory.h CmpiLinux_DnsBlackholeACLForServiceProvider.h Linux_DnsBlackholeACLForServiceRepositoryExternal.cpp Linux_DnsBlackholeACLForServiceFakeFactory.cpp makefile Linux_DnsBlackholeACLForServiceDefaultImplementation.h setting.provider Linux_DnsBlackholeACLForServiceDefaultImplementation.cpp Linux_DnsBlackholeACLForServiceRepositoryExternal.h Linux_DnsBlackholeACLForServiceManualInstance.h Linux_DnsBlackholeACLForServiceResourceAccess.h Linux_DnsBlackholeACLForServiceFactory.cpp Linux_DnsBlackholeACLForServiceRepositoryInstance.h Linux_DnsBlackholeACLForServiceInstance.cpp CmpiLinux_DnsBlackholeACLForServiceProvider.cpp Linux_DnsBlackholeACLForServiceInterface.h Linux_DnsBlackholeACLForServiceInstanceName.h Linux_DnsBlackholeACLForServiceManualInstance.cpp Linux_DnsBlackholeACLForServiceExternal.h Linux_DnsBlackholeACLForServiceRepositoryInstance.cpp Linux_DnsBlackholeACLForServiceResourceAccess.cpp Linux_DnsBlackholeACLForServiceExternal.cpp Linux_DnsBlackholeACLForServiceInstanceName.cpp 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_DnsBlackholeACLForServiceExternal.h --- /** * Linux_DnsBlackholeACLForServiceExternal.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_DnsBlackholeACLForServiceExternal_h #define Linux_DnsBlackholeACLForServiceExternal_h #include "Linux_DnsBlackholeACLForServiceInstance.h" #include "Linux_DnsServiceInstance.h" #include "Linux_DnsAddressMatchListInstance.h" #include "CmpiBroker.h" namespace genProvider { class Linux_DnsBlackholeACLForServiceExternal { public: Linux_DnsBlackholeACLForServiceExternal( const CmpiBroker& brkr, const CmpiContext& ctx); virtual ~Linux_DnsBlackholeACLForServiceExternal(); virtual void enumInstanceNames( const char *nsp, Linux_DnsBlackholeACLForServiceInstanceNameEnumeration&); virtual void enumInstances( const char *nsp, const char* *properties, Linux_DnsBlackholeACLForServiceInstanceEnumeration&); virtual Linux_DnsBlackholeACLForServiceInstance getInstance( const char* *properties, const Linux_DnsBlackholeACLForServiceInstanceName&); virtual void setInstance( const char* *properties, const Linux_DnsBlackholeACLForServiceInstance&); virtual void createInstance( const Linux_DnsBlackholeACLForServiceInstance&); virtual void deleteInstance( const Linux_DnsBlackholeACLForServiceInstanceName&); //association calls void referencesElement( const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsBlackholeACLForServiceInstanceEnumeration& instances); void referenceNamesElement( const char *nsp, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsBlackholeACLForServiceInstanceNameEnumeration& instanceNames); void referencesSetting( const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsBlackholeACLForServiceInstanceEnumeration& instances); void referenceNamesSetting( const char *nsp, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsBlackholeACLForServiceInstanceNameEnumeration& instanceNames); void associatorsElement( const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsServiceInstanceEnumeration& instances); void associatorNamesElement( const char *nsp, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsServiceInstanceNameEnumeration& instanceNames); void associatorsSetting( const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceEnumeration& instances); void associatorNamesSetting( const char *nsp, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceNameEnumeration& instanceNames); private: CmpiBroker broker; CmpiContext context; }; } #endif --- NEW FILE: Linux_DnsBlackholeACLForServiceFactory.h --- /** * Linux_DnsBlackholeACLForServiceFactory.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_DnsBlackholeACLForServiceFactory_h #define Linux_DnsBlackholeACLForServiceFactory_h #include "Linux_DnsBlackholeACLForServiceInterface.h" namespace genProvider{ class Linux_DnsBlackholeACLForServiceFactory{ public: Linux_DnsBlackholeACLForServiceFactory(){}; ~Linux_DnsBlackholeACLForServiceFactory(){}; static Linux_DnsBlackholeACLForServiceInterface* getImplementation(); }; } #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_DnsBlackholeACLForServiceInstanceName.o \ Linux_DnsBlackholeACLForServiceInstance.o \ Linux_DnsBlackholeACLForServiceExternal.o \ Linux_DnsBlackholeACLForServiceRepositoryInstance.o \ Linux_DnsBlackholeACLForServiceRepositoryExternal.o \ Linux_DnsBlackholeACLForServiceManualInstance.o \ Linux_DnsBlackholeACLForServiceDefaultImplementation.o FAKEFACTORY= Linux_DnsBlackholeACLForServiceFakeFactory.o NORMALFACTORY= Linux_DnsBlackholeACLForServiceFactory.o RESOURCEOBJECT= Linux_DnsBlackholeACLForServiceResourceAccess.o PROVIDEROBJECT=CmpiLinux_DnsBlackholeACLForServiceProvider.o all: testfiles preinstall install buildall: clean all #------------------------------------------------------------------------------# compile: $(OBJECTS) $(FAKEFACTORY) $(NORMALFACTORY) $(RESOURCEOBJECT) $(PROVIDEROBJECT) #------------------------------------------------------------------------------# prelink: $(OBJECTS) $(FAKEFACTORY) $(LINK.cpp) -o libLinux_DnsBlackholeACLForServiceSupport.so $^ link: deleteFakeLib \ libLinux_DnsBlackholeACLForServiceSupport.so \ libLinux_DnsBlackholeACLForService.so libLinux_DnsBlackholeACLForServiceSupport.so: LDFLAGS+=$(LDFLAGS.provider) libLinux_DnsBlackholeACLForServiceSupport.so: $(OBJECTS) $(NORMALFACTORY) $(RESOURCEOBJECT) $(PROVIDEROBJECT) $(LINK.cpp) -o $@ $^ libLinux_DnsBlackholeACLForService.so: LDFLAGS+=-lLinux_DnsBlackholeACLForServiceSupport libLinux_DnsBlackholeACLForService.so: $(PROVIDEROBJECT) $(LINK.cpp) -o $@ $^ deleteFakeLib: $(RM) *.so #------------------------------------------------------------------------------# preinstall: prelink install libLinux_DnsBlackholeACLForServiceSupport.so $(COMMONLIB_OUT) #------------------------------------------------------------------------------# install: link install libLinux_DnsBlackholeACLForServiceSupport.so $(COMMONLIB_OUT) install libLinux_DnsBlackholeACLForService.so $(CIMOMLIB_OUT) # install -m 644 Linux_DnsBlackholeACLForService*.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_DnsBlackholeACLForService*.h \ $(RM) $(COMMONLIB)/libLinux_DnsBlackholeACLForServiceSupport.so \ $(RM) $(CIMOMLIB)/libLinux_DnsBlackholeACLForService.so --- NEW FILE: Linux_DnsBlackholeACLForServiceInterface.h --- /** * Linux_DnsBlackholeACLForServiceInterface.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_DnsBlackholeACLForServiceInterface_h #define Linux_DnsBlackholeACLForServiceInterface_h #include "Linux_DnsBlackholeACLForServiceInstanceName.h" #include "Linux_DnsBlackholeACLForServiceManualInstance.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_DnsBlackholeACLForServiceInterface { public: virtual ~Linux_DnsBlackholeACLForServiceInterface() { }; /* intrinsic methods */ virtual void enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsBlackholeACLForServiceInstanceNameEnumeration& instnames) = 0; virtual void enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsBlackholeACLForServiceManualInstanceEnumeration& instances) = 0; virtual Linux_DnsBlackholeACLForServiceManualInstance getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsBlackholeACLForServiceInstanceName&) = 0; virtual void setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsBlackholeACLForServiceManualInstance&) = 0; virtual void createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsBlackholeACLForServiceManualInstance&) = 0; virtual void deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsBlackholeACLForServiceInstanceName&) = 0; /* Association Interface */ virtual void referencesElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsBlackholeACLForServiceManualInstanceEnumeration& instances) = 0; virtual void referencesSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsBlackholeACLForServiceManualInstanceEnumeration& 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_DnsBlackholeACLForServiceResourceAccess.cpp --- /** * Linux_DnsBlackholeACLForServiceResourceAccess.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_DnsBlackholeACLForServiceResourceAccess.h" #define DNS_ATTR_STR "blackhole" namespace genProvider { //Linux_DnsBlackholeACLForServiceResourceAccess::Linux_DnsBlackholeACLForServiceResourceAccess(); Linux_DnsBlackholeACLForServiceResourceAccess::~Linux_DnsBlackholeACLForServiceResourceAccess() { }; /* intrinsic methods */ void Linux_DnsBlackholeACLForServiceResourceAccess::enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsBlackholeACLForServiceInstanceNameEnumeration& 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_DnsBlackholeACLForServiceInstanceName 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); } } void Linux_DnsBlackholeACLForServiceResourceAccess::enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsBlackholeACLForServiceManualInstanceEnumeration& 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_DnsBlackholeACLForServiceInstanceName 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_DnsBlackholeACLForServiceManualInstance manualInst; manualInst.setInstanceName( Inst ); instances.addElement(manualInst); } }; Linux_DnsBlackholeACLForServiceManualInstance Linux_DnsBlackholeACLForServiceResourceAccess::getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsBlackholeACLForServiceInstanceName& instanceName){ Linux_DnsBlackholeACLForServiceManualInstance manualInst; manualInst.setInstanceName( instanceName ); return manualInst; } /* void Linux_DnsBlackholeACLForServiceResourceAccess::setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsBlackholeACLForServiceManualInstance&){}; */ void Linux_DnsBlackholeACLForServiceResourceAccess::createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsBlackholeACLForServiceManualInstance& 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()); }; void Linux_DnsBlackholeACLForServiceResourceAccess::deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsBlackholeACLForServiceInstanceName& 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()); }; /* Association Interface */ /* We support only one local service, so we just return it */ void Linux_DnsBlackholeACLForServiceResourceAccess::referencesElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsBlackholeACLForServiceManualInstanceEnumeration& 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_DnsBlackholeACLForServiceManualInstance inst; Linux_DnsBlackholeACLForServiceInstanceName instName; instName.setNamespace( nsp ); instName.setElement( serviceInstanceName ); instName.setSetting( sourceInst ); inst.setInstanceName( instName ); instEnum.addElement(inst); } }; void Linux_DnsBlackholeACLForServiceResourceAccess::referencesSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsBlackholeACLForServiceManualInstanceEnumeration& 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_DnsBlackholeACLForServiceInstanceName 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_DnsBlackholeACLForServiceManualInstance manualInst; manualInst.setInstanceName( Inst ); instEnum.addElement(manualInst); } }; void Linux_DnsBlackholeACLForServiceResourceAccess::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_DnsBlackholeACLForServiceResourceAccess::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); } freeACL( list_acl ); }; /* extrinsic methods */ } --- NEW FILE: Linux_DnsBlackholeACLForServiceFakeFactory.cpp --- /** * Linux_DnsBlackholeACLForServiceFakeFactory.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 <iostream> #include <strings.h> #include "Linux_DnsBlackholeACLForServiceFactory.h" using namespace std; namespace genProvider{ Linux_DnsBlackholeACLForServiceInterface* Linux_DnsBlackholeACLForServiceFactory::getImplementation(){ cout<<"ERROR: incomplete support library is being used"<<endl; cout<<" in provider from class Linux_DnsBlackholeACLForService"<<endl; cout<<" Use the link-install options for the makefile"<<endl; return 0; }; } --- NEW FILE: Linux_DnsBlackholeACLForServiceInstanceName.cpp --- /** * Linux_DnsBlackholeACLForServiceInstanceName.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_DnsBlackholeACLForServiceInstanceName.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //Linux_DnsBlackholeACLForServiceInstanceName //********************************************************* //empty constructor Linux_DnsBlackholeACLForServiceInstanceName:: Linux_DnsBlackholeACLForServiceInstanceName(){ init(); }; //copy constructor Linux_DnsBlackholeACLForServiceInstanceName:: Linux_DnsBlackholeACLForServiceInstanceName (const Linux_DnsBlackholeACLForServiceInstanceName& original){ init(original); }; //contructor using CmpiObjectPath Linux_DnsBlackholeACLForServiceInstanceName:: Linux_DnsBlackholeACLForServiceInstanceName (const CmpiObjectPath& path){ init(); m_CIMClassNameP=path.getClassName().charPtr(); CmpiString namespaceOP; namespaceOP=path.getNameSpace(); setNamespace(namespaceOP.charPtr(),1); CmpiObjectPath Element = path.getKey("Element"); setElement(Linux_DnsServiceInstanceName(Element)); CmpiObjectPath Setting = path.getKey("Setting"); setSetting(Linux_DnsAddressMatchListInstanceName(Setting)); } //destructor Linux_DnsBlackholeACLForServiceInstanceName:: ~Linux_DnsBlackholeACLForServiceInstanceName(){ reset(); }; //copy operator Linux_DnsBlackholeACLForServiceInstanceName& Linux_DnsBlackholeACLForServiceInstanceName::operator= (const Linux_DnsBlackholeACLForServiceInstanceName& original){ init(original); return *this; } //returns the related CmpiObjectPath CmpiObjectPath Linux_DnsBlackholeACLForServiceInstanceName:: getObjectPath() const{ CmpiObjectPath objectPath(m_namespace, m_CIMClassNameP); objectPath.setKey("Element",CmpiData(m_Element.getObjectPath())); objectPath.setKey("Setting",CmpiData(m_Setting.getObjectPath())); return objectPath; } //adds the related CmpiObjectPath to an existing cmpiInstance void Linux_DnsBlackholeACLForServiceInstanceName::fillKeys(CmpiInstance& cmpiInstance) const{ if(isSet.Element){ cmpiInstance.setProperty("Element",CmpiData(m_Element.getObjectPath())); } if(isSet.Setting){ cmpiInstance.setProperty("Setting",CmpiData(m_Setting.getObjectPath())); } } //NameSpace related methods unsigned int Linux_DnsBlackholeACLForServiceInstanceName:: isNameSpaceSet() const{ return isSet.m_namespace; } const char * Linux_DnsBlackholeACLForServiceInstanceName:: getNamespace() const { if(!isSet.m_namespace) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "NameSpace not set in Linux_DnsBlackholeACLForService instanceName"); return m_namespace; } void Linux_DnsBlackholeACLForServiceInstanceName:: setNamespace(const char* val, int makeCopy){ if (isSet.m_namespace) { delete m_namespace; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_namespace = tmpval; } else { m_namespace = val; } isSet.m_namespace=1; } //Element related methods unsigned int Linux_DnsBlackholeACLForServiceInstanceName::isElementSet() const{ return isSet.Element; } void Linux_DnsBlackholeACLForServiceInstanceName:: setElement(const Linux_DnsServiceInstanceName& val){ m_Element = val; isSet.Element=1; } const Linux_DnsServiceInstanceName& Linux_DnsBlackholeACLForServiceInstanceName:: getElement() const{ if(!isSet.Element) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Element not set"); return m_Element; } //Setting related methods unsigned int Linux_DnsBlackholeACLForServiceInstanceName::isSettingSet() const{ return isSet.Setting; } void Linux_DnsBlackholeACLForServiceInstanceName:: setSetting(const Linux_DnsAddressMatchListInstanceName& val){ m_Setting = val; isSet.Setting=1; } const Linux_DnsAddressMatchListInstanceName& Linux_DnsBlackholeACLForServiceInstanceName:: getSetting() const{ if(!isSet.Setting) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Setting not set"); return m_Setting; } //set isSet variables to FALSE void Linux_DnsBlackholeACLForServiceInstanceName::init(){ m_CIMClassNameP="Linux_DnsBlackholeACLForService"; isSet.m_namespace=0; isSet.Element=0; isSet.Setting=0; } //copies another instance properties in this void Linux_DnsBlackholeACLForServiceInstanceName::init (const Linux_DnsBlackholeACLForServiceInstanceName& original){ init(); m_CIMClassNameP=original.m_CIMClassNameP; if(original.isNameSpaceSet()){ setNamespace(original.getNamespace(),1); } if(original.isElementSet()){ const Linux_DnsServiceInstanceName& ElementOriginal=original.getElement(); setElement(ElementOriginal); } if(original.isSettingSet()){ const Linux_DnsAddressMatchListInstanceName& SettingOriginal=original.getSetting(); setSetting(SettingOriginal); } } //reset the instanceName data void Linux_DnsBlackholeACLForServiceInstanceName::reset(){ if (isSet.m_namespace) delete(m_namespace); }; //********************************************************* //Linux_DnsBlackholeACLForServiceInstanceNameEnumerationElement //********************************************************* Linux_DnsBlackholeACLForServiceInstanceNameEnumerationElement:: Linux_DnsBlackholeACLForServiceInstanceNameEnumerationElement(){ m_elementP=0; m_nextP=0; }; Linux_DnsBlackholeACLForServiceInstanceNameEnumerationElement:: ~Linux_DnsBlackholeACLForServiceInstanceNameEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //Linux_DnsBlackholeACLForServiceInstanceNameEnumeration //********************************************************* Linux_DnsBlackholeACLForServiceInstanceNameEnumeration:: Linux_DnsBlackholeACLForServiceInstanceNameEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; Linux_DnsBlackholeACLForServiceInstanceNameEnumeration:: Linux_DnsBlackholeACLForServiceInstanceNameEnumeration(const CmpiArray& arr){ firstElementP=0; currentElementP=0; endElementP=0; int size = arr.size(); for (int i=0; i < size; i++) { addElement(Linux_DnsBlackholeACLForServiceInstanceName(arr[i])); } } Linux_DnsBlackholeACLForServiceInstanceNameEnumeration:: Linux_DnsBlackholeACLForServiceInstanceNameEnumeration( const Linux_DnsBlackholeACLForServiceInstanceNameEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; Linux_DnsBlackholeACLForServiceInstanceNameEnumeration:: ~Linux_DnsBlackholeACLForServiceInstanceNameEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void Linux_DnsBlackholeACLForServiceInstanceNameEnumeration::reset(){ currentElementP=firstElementP; }; bool Linux_DnsBlackholeACLForServiceInstanceNameEnumeration::hasNext() const{ return (currentElementP!=0); }; int Linux_DnsBlackholeACLForServiceInstanceNameEnumeration::getSize() const{ int size=0; Linux_DnsBlackholeACLForServiceInstanceNameEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const Linux_DnsBlackholeACLForServiceInstanceName& Linux_DnsBlackholeACLForServiceInstanceNameEnumeration::getElement(int pos) const{ Linux_DnsBlackholeACLForServiceInstanceNameEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const Linux_DnsBlackholeACLForServiceInstanceName& Linux_DnsBlackholeACLForServiceInstanceNameEnumeration::getNext() { Linux_DnsBlackholeACLForServiceInstanceNameEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void Linux_DnsBlackholeACLForServiceInstanceNameEnumeration::addElement (const Linux_DnsBlackholeACLForServiceInstanceName& elementP){ if(firstElementP==0){ firstElementP=new Linux_DnsBlackholeACLForServiceInstanceNameEnumerationElement(); firstElementP->m_elementP=new Linux_DnsBlackholeACLForServiceInstanceName(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new Linux_DnsBlackholeACLForServiceInstanceNameEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new Linux_DnsBlackholeACLForServiceInstanceName(elementP); } }; Linux_DnsBlackholeACLForServiceInstanceNameEnumeration::operator CmpiArray() const{ int size=getSize(); CmpiArray arr=CmpiArray(size,CMPI_instance); for(int i=0;i<size;i++){ arr[i]=getElement(i).getObjectPath(); } return arr; }; } --- NEW FILE: CmpiLinux_DnsBlackholeACLForServiceProvider.h --- /** * CmpiLinux_DnsBlackholeACLForServiceProvider.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 CmpiLinux_DnsBlackholeACLForServiceProvider_h #define CmpiLinux_DnsBlackholeACLForServiceProvider_h #include "CmpiInstanceMI.h" #include "CmpiMethodMI.h" #include "Linux_DnsBlackholeACLForServiceFactory.h" #include "CmpiAssociationMI.h" namespace genProvider{ class CmpiLinux_DnsBlackholeACLForServiceProvider : public CmpiInstanceMI, public CmpiMethodMI, public CmpiAssociationMI{ private: Linux_DnsBlackholeACLForServiceInterface* interfaceP; const static char * shadowNameSpaceP; CmpiBroker cppBroker; void completeInstance ( const Linux_DnsBlackholeACLForServiceInstanceName& intanceNameP, CmpiInstance& target, const CmpiContext& ctx); void copyShadowData ( const CmpiInstance* source, CmpiInstance* target); CmpiInstance* getShadowInstance ( const CmpiInstance& original, const Linux_DnsBlackholeACLForServiceInstanceName& intanceName); void removeDanglingShadowInstances ( const Linux_DnsBlackholeACLForServiceInstanceNameEnumeration& dinInsNames); public: CmpiLinux_DnsBlackholeACLForServiceProvider ( const CmpiBroker &mbp, const CmpiContext& ctx); ~CmpiLinux_DnsBlackholeACLForServiceProvider (); int isUnloadable() const; CmpiStatus enumInstanceNames ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop); CmpiStatus enumInstances ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop, const char* *properties); CmpiStatus getInstance ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop, const char* *properties); virtual CmpiStatus createInstance ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop, const CmpiInstance& inst); virtual CmpiStatus setInstance ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop, const CmpiInstance& inst, const char* *properties); virtual CmpiStatus deleteInstance ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop); /* virtual CmpiStatus execQuery ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop, const char* language, const char* query); */ virtual CmpiStatus invokeMethod ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& ref, const char* methodName, const CmpiArgs& in, CmpiArgs& out); CmpiStatus associationLogic (const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop, const int instances, const int references, const char** properties=0); CmpiStatus associators ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties); CmpiStatus associatorNames ( const CmpiContext & ctx, CmpiResult & rslt, const CmpiObjectPath & cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole); CmpiStatus references ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop, const char* assocClass, const char* role, const char** properties); CmpiStatus referenceNames ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop, const char* assocClass, const char* role); }; } #endif --- NEW FILE: Linux_DnsBlackholeACLForServiceInstanceName.h --- /** * Linux_DnsBlackholeACLForServiceInstanceName.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_DnsBlackholeACLForServiceInstanceName_h #define Linux_DnsBlackholeACLForServiceInstanceName_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_DnsBlackholeACLForServiceInstanceName { public: Linux_DnsBlackholeACLForServiceInstanceName(); Linux_DnsBlackholeACLForServiceInstanceName (const Linux_DnsBlackholeACLForServiceInstanceName& original); Linux_DnsBlackholeACLForServiceInstanceName (const CmpiObjectPath& path); ~Linux_DnsBlackholeACLForServiceInstanceName(); Linux_DnsBlackholeACLForServiceInstanceName& operator= (const Linux_DnsBlackholeACLForServiceInstanceName& 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_DnsBlackholeACLForServiceInstanceName& 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_DnsBlackholeACLForServiceInstanceNameEnumerationElement{ Linux_DnsBlackholeACLForServiceInstanceName* m_elementP; Linux_DnsBlackholeACLForServiceInstanceNameEnumerationElement* m_nextP; Linux_DnsBlackholeACLForServiceInstanceNameEnumerationElement(); ~Linux_DnsBlackholeACLForServiceInstanceNameEnumerationElement(); }; class Linux_DnsBlackholeACLForServiceInstanceNameEnumeration { private: Linux_DnsBlackholeACLForServiceInstanceNameEnumerationElement* firstElementP; Linux_DnsBlackholeACLForServiceInstanceNameEnumerationElement* currentElementP; Linux_DnsBlackholeACLForServiceInstanceNameEnumerationElement* endElementP; public: Linux_DnsBlackholeACLForServiceInstanceNameEnumeration(); Linux_DnsBlackholeACLForServiceInstanceNameEnumeration(const CmpiArray& arr); Linux_DnsBlackholeACLForServiceInstanceNameEnumeration( const Linux_DnsBlackholeACLForServiceInstanceNameEnumeration& original); ~Linux_DnsBlackholeACLForServiceInstanceNameEnumeration(); void reset(); bool hasNext() const; const Linux_DnsBlackholeACLForServiceInstanceName& getNext(); int getSize() const; const Linux_DnsBlackholeACLForServiceInstanceName& getElement(int pos) const; //no copy of the element is done void addElement(const Linux_DnsBlackholeACLForServiceInstanceName& elementP); operator CmpiArray() const; }; } #endif --- NEW FILE: Linux_DnsBlackholeACLForServiceManualInstance.h --- /** * Linux_DnsBlackholeACLForServiceManualInstance.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_DnsBlackholeACLForServiceManualInstance_h #define Linux_DnsBlackholeACLForServiceManualInstance_h #include "cmpidt.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiBooleanData.h" #include "CmpiCharData.h" #include "CmpiDateTime.h" #include "Linux_DnsBlackholeACLForServiceInstanceName.h" namespace genProvider { class Linux_DnsBlackholeACLForServiceManualInstance { public: Linux_DnsBlackholeACLForServiceManualInstance(); Linux_DnsBlackholeACLForServiceManualInstance (const Linux_DnsBlackholeACLForServiceManualInstance& original); Linux_DnsBlackholeACLForServiceManualInstance (const CmpiInstance& inst, const char* instanceNamespace); ~Linux_DnsBlackholeACLForServiceManualInstance(); Linux_DnsBlackholeACLForServiceManualInstance& operator= (const Linux_DnsBlackholeACLForServiceManualInstance& original); CmpiInstance getCmpiInstance(const char** properties=0) const; unsigned int isInstanceNameSet() const; void setInstanceName( const Linux_DnsBlackholeACLForServiceInstanceName& val); const Linux_DnsBlackholeACLForServiceInstanceName& getInstanceName() const; private: void init(); void init(const Linux_DnsBlackholeACLForServiceManualInstance& original); void reset(); Linux_DnsBlackholeACLForServiceInstanceName m_instanceName; struct isSetType{ unsigned int instanceName:1; } isSet; }; struct Linux_DnsBlackholeACLForServiceManualInstanceEnumerationElement{ Linux_DnsBlackholeACLForServiceManualInstance* m_elementP; Linux_DnsBlackholeACLForServiceManualInstanceEnumerationElement* m_nextP; Linux_DnsBlackholeACLForServiceManualInstanceEnumerationElement(); ~Linux_DnsBlackholeACLForServiceManualInstanceEnumerationElement(); }; class Linux_DnsBlackholeACLForServiceManualInstanceEnumeration { private: Linux_DnsBlackholeACLForServiceManualInstanceEnumerationElement* firstElementP; Linux_DnsBlackholeACLForServiceManualInstanceEnumerationElement* currentElementP; Linux_DnsBlackholeACLForServiceManualInstanceEnumerationElement* endElementP; public: Linux_DnsBlackholeACLForServiceManualInstanceEnumeration(); Linux_DnsBlackholeACLForServiceManualInstanceEnumeration( const Linux_DnsBlackholeACLForServiceManualInstanceEnumeration& original); ~Linux_DnsBlackholeACLForServiceManualInstanceEnumeration(); void reset(); bool hasNext() const; const Linux_DnsBlackholeACLForServiceManualInstance& getNext(); int getSize() const; const Linux_DnsBlackholeACLForServiceManualInstance& getElement(int pos) const; void addElement(const Linux_DnsBlackholeACLForServiceManualInstance& elementP); }; } #endif --- NEW FILE: Linux_DnsBlackholeACLForServiceFactory.cpp --- /** * Linux_DnsBlackholeACLForServiceFactory.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_DnsBlackholeACLForServiceFactory.h" #include "Linux_DnsBlackholeACLForServiceResourceAccess.h" namespace genProvider{ Linux_DnsBlackholeACLForServiceInterface* Linux_DnsBlackholeACLForServiceFactory::getImplementation(){ return (new Linux_DnsBlackholeACLForServiceResourceAccess()); }; } --- NEW FILE: Linux_DnsBlackholeACLForServiceRepositoryExternal.h --- /** * Linux_DnsBlackholeACLForServiceRepositoryExternal.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_DnsBlackholeACLForServiceRepositoryExternal_h #define Linux_DnsBlackholeACLForServiceRepositoryExternal_h #include "Linux_DnsBlackholeACLForServiceInstanceName.h" #include "Linux_DnsBlackholeACLForServiceRepositoryInstance.h" #include "CmpiBroker.h" namespace genProvider { class Linux_DnsBlackholeACLForServiceRepositoryExternal { public: Linux_DnsBlackholeACLForServiceRepositoryExternal( const CmpiBroker& brkr, const CmpiContext& ctx); virtual ~Linux_DnsBlackholeACLForServiceRepositoryExternal(); virtual void enumInstanceNames( Linux_DnsBlackholeACLForServiceInstanceNameEnumeration&); virtual void enumInstances( const char* *properties, Linux_DnsBlackholeACLForServiceRepositoryInstanceEnumeration&); virtual Linux_DnsBlackholeACLForServiceRepositoryInstance getInstance( const char* *properties, const Linux_DnsBlackholeACLForServiceInstanceName&); virtual void setInstance( const char* *properties, const Linux_DnsBlackholeACLForServiceRepositoryInstance&); virtual void createInstance( const Linux_DnsBlackholeACLForServiceRepositoryInstance&); virtual void deleteInstance( const Linux_DnsBlackholeACLForServiceInstanceName&); private: CmpiBroker broker; CmpiContext context; const static char *nsp; }; } #endif --- NEW FILE: Linux_DnsBlackholeACLForServiceResourceAccess.h --- /** * Linux_DnsBlackholeACLForServiceResourceAccess.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_DnsBlackholeACLForServiceResourceAccess_h #define Linux_DnsBlackholeACLForServiceResourceAccess_h #include "Linux_DnsBlackholeACLForServiceInstanceName.h" #include "Linux_DnsBlackholeACLForServiceManualInstance.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiDateTime.h" #include "CmpiBroker.h" #include "Linux_DnsServiceInstance.h" #include "Linux_DnsServiceInstanceName.h" #include "Linux_DnsServiceManualInstance.h" #include "Linux_DnsAddressMatchListInstanceName.h" #include "Linux_DnsAddressMatchListInstance.h" #include "Linux_DnsAddressMatchListManualInstance.h" #include "Linux_DnsServiceExternal.h" #include "Linux_DnsAddressMatchListExternal.h" #include "Linux_DnsBlackholeACLForServiceDefaultImplementation.h" #include <string> #include <list> using namespace std; #include "dnssupport.h" #include "defaultvalues.h" #include "DnsArray.h" #include "DnsValueMap.h" namespace genProvider { class Linux_DnsBlackholeACLForServiceResourceAccess: public Linux_DnsBlackholeACLForServiceDefaultImplementation { public: /*Linux_DnsBlackholeACLForServiceResourceAccess();*/ virtual ~Linux_DnsBlackholeACLForServiceResourceAccess() ; /* intrinsic methods */ virtual void enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsBlackholeACLForServiceInstanceNameEnumeration& instnames); virtual void enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsBlackholeACLForServiceManualInstanceEnumeration& instances); virtual Linux_DnsBlackholeACLForServiceManualInstance getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsBlackholeACLForServiceInstanceName&); /*virtual void setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsBlackholeACLForServiceManualInstance&);*/ virtual void createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsBlackholeACLForServiceManualInstance&); virtual void deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsBlackholeACLForServiceInstanceName&); /* Association Interface */ virtual void referencesElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsBlackholeACLForServiceManualInstanceEnumeration& instances); virtual void referencesSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsBlackholeACLForServiceManualInstanceEnumeration& 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: CmpiLinux_DnsBlackholeACLForServiceProvider.cpp --- /** * CmpiLinux_DnsBlackholeACLForServiceProvider.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 "CmpiLinux_DnsBlackholeACLForServiceProvider.h" #include "ArrayConverter.h" #include "Linux_DnsBlackholeACLForServiceManualInstance.h" #include "Linux_DnsBlackholeACLForServiceRepositoryInstance.h" #include "Linux_DnsServiceInstance.h" #include "Linux_DnsAddressMatchListInstance.h" #include <iostream> #include <strings.h> using namespace std; namespace genProvider { CmpiLinux_DnsBlackholeACLForServiceProvider:: CmpiLinux_DnsBlackholeACLForServiceProvider ( const CmpiBroker &mbp, const CmpiContext& ctx): CmpiBaseMI(mbp, ctx), CmpiInstanceMI(mbp,ctx), CmpiMethodMI(mbp,ctx), CmpiAssociationMI(mbp,ctx), cppBroker(mbp) { interfaceP=Linux_DnsBlackholeACLForServiceFactory::getImplementation(); cout<<"Provider was constructed"<<endl; }; const char * CmpiLinux_DnsBlackholeACLForServiceProvider:: shadowNameSpaceP="IBMShadow/cimv2"; CmpiLinux_DnsBlackholeACLForServiceProvider:: ~CmpiLinux_DnsBlackholeACLForServiceProvider(){ delete interfaceP; }; int CmpiLinux_DnsBlackholeACLForServiceProvider::isUnloadable() const{ return 0; } /* -----------------------------------------------------------------------*/ /* Adding shadow properties */ /* -----------------------------------------------------------------------*/ void CmpiLinux_DnsBlackholeACLForServiceProvider::completeInstance( const Linux_DnsBlackholeACLForServiceInstanceName& instanceName, CmpiInstance& target, const CmpiContext& ctx){ Linux_DnsBlackholeACLForServiceInstanceName shadowInstanceName(instanceName); shadowInstanceName.setNamespace(shadowNameSpaceP); CmpiObjectPath cmpiObjectPath=shadowInstanceName.getObjectPath(); try{ const char* propertiesP=0; CmpiInstance shadowInstance=cppBroker.getInstance ( ctx, cmpiObjectPath,&propertiesP); copyShadowData(&shadowInstance,&target); }catch(const CmpiStatus& rc){}; }; void CmpiLinux_DnsBlackholeACLForServiceProvider::copyShadowData ( const CmpiInstance* source, CmpiInstance* target){ }; /* -----------------------------------------------------------------------*/ /* Extracting shadow instance */ /* -----------------------------------------------------------------------*/ CmpiInstance* CmpiLinux_DnsBlackholeACLForServiceProvider:: getShadowInstance (const CmpiInstance& original, const Linux_DnsBlackholeACLForServiceInstanceName& instanceName){ Linux_DnsBlackholeACLForServiceInstanceName shadowInstanceName(instanceName); shadowInstanceName.setNamespace(shadowNameSpaceP); CmpiObjectPath cmpiObjectPath=shadowInstanceName.getObjectPath(); CmpiInstance* targetP=new CmpiInstance(cmpiObjectPath); copyShadowData(&original,targetP); if(targetP->getPropertyCount()==0) return 0; else return targetP; } /* -----------------------------------------------------------------------*/ /* House keeping */ /* -----------------------------------------------------------------------*/ void CmpiLinux_DnsBlackholeACLForServiceProvider::removeDanglingShadowInstances ( const Linux_DnsBlackholeACLForServiceInstanceNameEnumeration& dinInsNames){ //TODO: enumerate shadow instance names and remove those not included // in dinInsNames }; /* -----------------------------------------------------------------------*/ /* Provider Factory */ /* -----------------------------------------------------------------------*/ CMProviderBase(CmpiLinux_DnsBlackholeACLForServiceProvider); CMInstanceMIFactory( CmpiLinux_DnsBlackholeACLForServiceProvider, CmpiLinux_DnsBlackholeACLForServiceProvider); CMMethodMIFactory( CmpiLinux_DnsBlackholeACLForServiceProvider, CmpiLinux_DnsBlackholeACLForServiceProvider); CMAssociationMIFactory( CmpiLinux_DnsBlackholeACLForServiceProvider, CmpiLinux_DnsBlackholeACLForServiceProvider); /* -----------------------------------------------------------------------*/ /* Instance Provider Interface */ /* -----------------------------------------------------------------------*/ //enumInstanceNames CmpiStatus CmpiLinux_DnsBlackholeACLForServiceProvider::enumInstanceNames ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop){ cout<<"enumerating instanceNames"<<endl; CmpiString nameSpace=cop.getNameSpace(); const char* nameSpaceP=nameSpace.charPtr(); Linux_DnsBlackholeACLForServiceInstanceNameEnumeration enumeration; interfaceP->enumInstanceNames(ctx, cppBroker, nameSpaceP, enumeration); while ( enumeration.hasNext() ){ const Linux_DnsBlackholeACLForServiceInstanceName& instanceName= enumeration.getNext(); CmpiObjectPath objectPath=instanceName.getObjectPath(); rslt.returnData(objectPath); } //we make housekeeping removeDanglingShadowInstances(enumeration); rslt.returnDone(); return CmpiStatus(CMPI_RC_OK); }; //enumInstances CmpiStatus CmpiLinux_DnsBlackholeACLForServiceProvider::enumInstances ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop, const char* *properties){ cout<<"enumerating instances"<<endl; CmpiString nameSpace=cop.getNameSpace(); const char* nameSpaceP=nameSpace.charPtr(); Linux_DnsBlackholeACLForServiceManualInstanceEnumeration enumeration; interfaceP->enumInstances(ctx, cppBroker, nameSpaceP, properties, enumeration); cout<<"enumerated"<<endl; while ( enumeration.hasNext() ){ const Linux_DnsBlackholeACLForServiceManualInstance& instance= enumeration.getNext(); cout<<"enumerating getNext"<<endl; CmpiInstance... [truncated message content] |