Update of /cvsroot/sblim/cmpi-dns/provider/Linux_DnsAllowQueryACLForZone In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20455/provider/Linux_DnsAllowQueryACLForZone Added Files: Linux_DnsAllowQueryACLForZoneManualInstance.h Linux_DnsAllowQueryACLForZoneInterface.h Linux_DnsAllowQueryACLForZoneInstanceName.cpp Linux_DnsAllowQueryACLForZoneFactory.h Linux_DnsAllowQueryACLForZoneDefaultImplementation.cpp Linux_DnsAllowQueryACLForZoneDefaultImplementation.h setting.provider Linux_DnsAllowQueryACLForZoneResourceAccess.cpp Linux_DnsAllowQueryACLForZoneRepositoryExternal.h Linux_DnsAllowQueryACLForZoneInstanceName.h Linux_DnsAllowQueryACLForZoneFactory.cpp Linux_DnsAllowQueryACLForZoneResourceAccess.h Linux_DnsAllowQueryACLForZoneExternal.h Linux_DnsAllowQueryACLForZoneRepositoryInstance.h makefile Linux_DnsAllowQueryACLForZoneManualInstance.cpp Linux_DnsAllowQueryACLForZoneRepositoryInstance.cpp Linux_DnsAllowQueryACLForZoneRepositoryExternal.cpp Linux_DnsAllowQueryACLForZoneFakeFactory.cpp Linux_DnsAllowQueryACLForZoneInstance.h Linux_DnsAllowQueryACLForZoneExternal.cpp CmpiLinux_DnsAllowQueryACLForZoneProvider.h Linux_DnsAllowQueryACLForZoneInstance.cpp CmpiLinux_DnsAllowQueryACLForZoneProvider.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_DnsAllowQueryACLForZoneRepositoryExternal.cpp --- /** * Linux_DnsAllowQueryACLForZoneRepositoryExternal.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_DnsAllowQueryACLForZoneRepositoryExternal.h" namespace genProvider{ Linux_DnsAllowQueryACLForZoneRepositoryExternal::Linux_DnsAllowQueryACLForZoneRepositoryExternal( const CmpiBroker& brkr, const CmpiContext& ctx ) : broker(brkr), context(ctx) {}; const char * Linux_DnsAllowQueryACLForZoneRepositoryExternal:: nsp="IBMShadow/cimv2"; Linux_DnsAllowQueryACLForZoneRepositoryExternal:: ~Linux_DnsAllowQueryACLForZoneRepositoryExternal(){}; void Linux_DnsAllowQueryACLForZoneRepositoryExternal::enumInstanceNames( Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration& instnames) { CmpiObjectPath op(nsp,"Linux_DnsAllowQueryACLForZone"); CmpiEnumeration en=broker.enumInstanceNames(context,op); while(en.hasNext()) { CmpiObjectPath opi = en.getNext(); Linux_DnsAllowQueryACLForZoneInstanceName iname(opi); instnames.addElement(iname); } }; void Linux_DnsAllowQueryACLForZoneRepositoryExternal::enumInstances( const char* *properties, Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumeration& instances) { CmpiObjectPath op(nsp,"Linux_DnsAllowQueryACLForZone"); CmpiEnumeration en=broker.enumInstances(context,op,properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); Linux_DnsAllowQueryACLForZoneRepositoryInstance instance(inst,nsp); instances.addElement(instance); } }; Linux_DnsAllowQueryACLForZoneRepositoryInstance Linux_DnsAllowQueryACLForZoneRepositoryExternal::getInstance( const char* *properties, const Linux_DnsAllowQueryACLForZoneInstanceName& instanceName) { CmpiObjectPath op=instanceName.getObjectPath(); op.setNameSpace(nsp); CmpiInstance inst=broker.getInstance(context,op,properties); return Linux_DnsAllowQueryACLForZoneRepositoryInstance(inst,nsp); } void Linux_DnsAllowQueryACLForZoneRepositoryExternal::setInstance( const char* *properties, const Linux_DnsAllowQueryACLForZoneRepositoryInstance& instance){ //make a copy of the given instance and set it to the right nameSpace Linux_DnsAllowQueryACLForZoneInstanceName instanceName(instance.getInstanceName()); instanceName.setNamespace(nsp,1); Linux_DnsAllowQueryACLForZoneRepositoryInstance copiedInstance(instance); copiedInstance.setInstanceName(instanceName); CmpiObjectPath op=instanceName.getObjectPath(); CmpiInstance inst=copiedInstance.getCmpiInstance(); broker.setInstance(context,op,inst,properties); } void Linux_DnsAllowQueryACLForZoneRepositoryExternal::createInstance( const Linux_DnsAllowQueryACLForZoneRepositoryInstance& instance){ //make a copy of the given instance and set it to the right nameSpace Linux_DnsAllowQueryACLForZoneInstanceName instanceName(instance.getInstanceName()); instanceName.setNamespace(nsp,1); Linux_DnsAllowQueryACLForZoneRepositoryInstance copiedInstance(instance); copiedInstance.setInstanceName(instanceName); CmpiObjectPath op=instanceName.getObjectPath(); CmpiInstance inst=copiedInstance.getCmpiInstance(); broker.createInstance(context,op,inst); } void Linux_DnsAllowQueryACLForZoneRepositoryExternal::deleteInstance( const Linux_DnsAllowQueryACLForZoneInstanceName& instanceName){ CmpiObjectPath op=instanceName.getObjectPath(); op.setNameSpace(nsp); broker.deleteInstance(context,op); } } --- NEW FILE: Linux_DnsAllowQueryACLForZoneResourceAccess.cpp --- /** * Linux_DnsAllowQueryACLForZoneResourceAccess.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_DnsAllowQueryACLForZoneResourceAccess.h" #define DNS_ATTR_STR "allow-query" namespace genProvider { //Linux_DnsAllowQueryACLForZoneResourceAccess::Linux_DnsAllowQueryACLForZoneResourceAccess(); Linux_DnsAllowQueryACLForZoneResourceAccess::~Linux_DnsAllowQueryACLForZoneResourceAccess() { }; /* intrinsic methods */ void Linux_DnsAllowQueryACLForZoneResourceAccess::enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration& instnames){ DNSZONE * zones, all_zones; zones = getZones(); if ( ! zones) return; for (; zones->zoneName ; zones++) { ZONEOPTS *zopts = findOptsInZone(zones,DNS_ATTR_STR); if ( ( ! zopts ) || ( !zopts->value ) ) continue; DnsArray da = DnsArray( zopts->value ); DnsArrayConstIterator iter; for ( iter = da.begin(); iter != da.end(); ++iter) { Linux_DnsAllowQueryACLForZoneInstanceName AuInst; Linux_DnsAddressMatchListInstanceName addrList; Linux_DnsZoneInstanceName zoneInst; AuInst.setNamespace( nsp ); zoneInst.setNamespace( nsp ); addrList.setNamespace( nsp ); zoneInst.setName( zones->zoneName ); addrList.setName( (*iter).c_str() ); addrList.setServiceName( DEFAULT_SERVICE_NAME ); AuInst.setSetting( addrList ); AuInst.setElement( zoneInst ); instnames.addElement(AuInst); } } freeZones( zones ); } void Linux_DnsAllowQueryACLForZoneResourceAccess::enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsAllowQueryACLForZoneManualInstanceEnumeration& instances){ DNSZONE * zones, *all_zones; zones = getZones(); all_zones = zones; if ( ! zones) return; for (; zones->zoneName ; zones++) { ZONEOPTS *zopts = findOptsInZone(zones,DNS_ATTR_STR); if ( ( ! zopts ) || ( !zopts->value ) ) continue; DnsArray da = DnsArray( zopts->value ); DnsArrayConstIterator iter; for ( iter = da.begin(); iter != da.end(); ++iter) { Linux_DnsAllowQueryACLForZoneInstanceName AuInstName; Linux_DnsAllowQueryACLForZoneManualInstance AuInst; Linux_DnsAddressMatchListInstanceName addrList; Linux_DnsZoneInstanceName zoneInst; AuInstName.setNamespace( nsp ); zoneInst.setNamespace( nsp ); addrList.setNamespace( nsp ); zoneInst.setName( zones->zoneName ); addrList.setName( (*iter).c_str() ); addrList.setServiceName( DEFAULT_SERVICE_NAME ); AuInstName.setSetting( addrList ); AuInstName.setElement( zoneInst ); AuInst.setInstanceName( AuInstName ); instances.addElement(AuInst); } } freeZones( zones ); }; Linux_DnsAllowQueryACLForZoneManualInstance Linux_DnsAllowQueryACLForZoneResourceAccess::getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsAllowQueryACLForZoneInstanceName& instanceName){ Linux_DnsAllowQueryACLForZoneManualInstance AuInst; AuInst.setInstanceName( instanceName ); return AuInst; } /* void Linux_DnsAllowQueryACLForZoneResourceAccess::setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsAllowQueryACLForZoneManualInstance&){}; */ void Linux_DnsAllowQueryACLForZoneResourceAccess::createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsAllowQueryACLForZoneManualInstance& anInstance){ cout << "Linux_DnsAllowQueryACLForZoneResourceAccess::createInstance()" << endl; DNSZONE *zones = getZones(); DNSZONE *zone; // Find the requested zone. If that does not exist throw an exception zone = findZone(zones, anInstance.getInstanceName().getElement().getName() ); if ( ! zone ) { throw CmpiStatus(CMPI_RC_ERR_INVALID_PARAMETER,"The indicated Zone does not exist"); } /* Now zone points to the _desired_ zone */ ZONEOPTS* zopts = findOptsInZone(zone,DNS_ATTR_STR); DnsArray iplist; // If already exist masters put them in the list. if (zopts) { iplist.populate(zopts->value); iplist.add( string( anInstance.getInstanceName().getSetting().getName() ) ); free(zopts->value); zopts->value = strdup( iplist.toString().c_str() ); updateZones( zones ); freeZones( zones ); return; } iplist.add( string(anInstance.getInstanceName().getSetting().getName()) ); addOptsToZone(zone, DNS_ATTR_STR, iplist.toString().c_str()); updateZones( zones ); freeZones( zones ); }; void Linux_DnsAllowQueryACLForZoneResourceAccess::deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsAllowQueryACLForZoneInstanceName& anInstanceName){ DNSZONE *zones = getZones(); DNSZONE *zone; // Find the requested zone. If that does not exist throw an exception zone = findZone(zones, anInstanceName.getElement().getName() ); if (!zone) { throw CmpiStatus(CMPI_RC_ERR_INVALID_PARAMETER,"The indicated Zone does not exist"); } /* Now zone points to the _desired_ zone */ ZONEOPTS* zopts = findOptsInZone(zone,DNS_ATTR_STR); DnsArray iplist; // If already exist masters put them in the list. if (zopts) { iplist.populate(zopts->value); iplist.remove( string( anInstanceName.getSetting().getName() ) ); free(zopts->value); zopts->value = strdup( iplist.toString().c_str() ); updateZones( zones ); freeZones( zones ); return; } }; /* Association Interface */ void Linux_DnsAllowQueryACLForZoneResourceAccess::referencesElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsAllowQueryACLForZoneManualInstanceEnumeration& instEnum) { cout << "Linux_DnsAllowQueryACLForZoneResourceAccess::referencesElement()" << endl; DNSZONE *zones = getZones(); DNSZONE *all_zones = zones; if ( ! zones) throw CmpiStatus(CMPI_RC_ERR_INVALID_PARAMETER,"The indicated Zone does not exist"); for (; zones->zoneName ; zones++) { ZONEOPTS *zopts = findOptsInZone(zones,DNS_ATTR_STR); if ( ( ! zopts ) || ( !zopts->value ) ) continue; DnsArray da = DnsArray( zopts->value ); DnsArrayConstIterator iter; for ( iter = da.begin(); iter != da.end(); ++iter) { if ( strcmp( (*iter).c_str(), sourceInst.getName() ) != 0 ) continue; Linux_DnsAllowQueryACLForZoneInstanceName AuInstName; Linux_DnsAllowQueryACLForZoneManualInstance AuInst; // AddressMatchList -> Setting /*Linux_DnsAddressMatchListInstance addrList; addrList.setInstanceName( sourceInst ); char *aclValue = getACL(list_acl, (*iter).c_str()); if ( ! aclValue ) continue; DnsArray aclArray = DnsArray( aclValue ); addrList.setAddressList( aclArray.toArray(), aclArray.size() );*/ // // Zone -> Element Linux_DnsZoneInstance zoneInst; Linux_DnsZoneInstanceName zoneInstName; zoneInstName.setNamespace( nsp ); zoneInstName.setName( zones->zoneName ); zoneInst.setInstanceName( zoneInstName ); if ( strcmp(zones->zoneType, "master") == 0 ) zoneInst.setType( DNS_ZONETYPE_MASTER ); else if ( strcmp(zones->zoneType, "slave") == 0 ) zoneInst.setType( DNS_ZONETYPE_SLAVE ); else if ( strcmp(zones->zoneType, "forward") == 0 ) zoneInst.setType( DNS_ZONETYPE_FORWARD ); else if ( strcmp(zones->zoneType, "hint") == 0 ) zoneInst.setType( DNS_ZONETYPE_HINT ); else zoneInst.setType( DNS_ZONETYPE_UNKNOWN ); zoneInst.setResourceRecordFile( zones->zoneFileName ); // AuInstName.setNamespace( nsp ); AuInstName.setElement( zoneInstName ); AuInstName.setSetting( sourceInst ); AuInst.setInstanceName( AuInstName ); instEnum.addElement( AuInst ); } } freeZones( all_zones ); }; void Linux_DnsAllowQueryACLForZoneResourceAccess::referencesSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsZoneInstanceName& sourceInst, Linux_DnsAllowQueryACLForZoneManualInstanceEnumeration& instEnum) { cout << "Linux_DnsAllowQueryACLForZoneResourceAccess::referencesSetting()" << endl; // ACL *list_acl = ReadACL(); DNSZONE *zones = getZones(); DNSZONE *all_zones = zones; if ( ! zones) throw CmpiStatus(CMPI_RC_ERR_INVALID_PARAMETER,"The indicated Zone does not exist"); for (; zones->zoneName ; zones++) { if ( strcmp( zones->zoneName, sourceInst.getName() ) != 0 ) continue; ZONEOPTS *zopts = findOptsInZone(zones,DNS_ATTR_STR); if ( ( ! zopts ) || ( !zopts->value ) ) continue; DnsArray da = DnsArray( zopts->value ); DnsArrayConstIterator iter; for ( iter = da.begin(); iter != da.end(); ++iter) { Linux_DnsAllowQueryACLForZoneManualInstance AuInst; Linux_DnsAllowQueryACLForZoneInstanceName AuInstName; // AddressMatchList -> Setting Linux_DnsAddressMatchListInstance addrList; Linux_DnsAddressMatchListInstanceName addrListName; addrListName.setNamespace( nsp ); addrListName.setName( (*iter).c_str() ); addrListName.setServiceName( DEFAULT_SERVICE_NAME ); /* addrList.setInstanceName( addrListName ); char *aclValue = getACL(list_acl, (*iter).c_str()); if ( ! aclValue ) continue; DnsArray aclArray = DnsArray( aclValue ); addrList.setAddressList( aclArray.toArray(), aclArray.size() ); */ // // Zone -> Element AuInstName.setElement( sourceInst ); AuInstName.setSetting( addrListName ); AuInst.setInstanceName( AuInstName ); instEnum.addElement( AuInst ); } } freeZones( all_zones ); }; void Linux_DnsAllowQueryACLForZoneResourceAccess::associatorsElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsZoneInstanceEnumeration& instEnum) { cout << "Linux_DnsAllowQueryACLForZoneResourceAccess::associatorsElement()" << endl; DNSZONE *zones = getZones(); DNSZONE *all_zones = zones; if ( ! zones) throw CmpiStatus(CMPI_RC_ERR_INVALID_PARAMETER,"The indicated Zone does not exist"); for (; zones->zoneName ; zones++) { ZONEOPTS *zopts = findOptsInZone(zones,DNS_ATTR_STR); if ( ( ! zopts ) || ( !zopts->value ) ) continue; DnsArray da = DnsArray( zopts->value ); DnsArrayConstIterator iter; for ( iter = da.begin(); iter != da.end(); ++iter) { if ( strcmp( (*iter).c_str(), sourceInst.getName() ) != 0 ) continue; // Zone -> Element Linux_DnsZoneInstance zoneInst; Linux_DnsZoneInstanceName zoneInstName; zoneInstName.setNamespace( nsp ); zoneInstName.setName( zones->zoneName ); zoneInst.setInstanceName( zoneInstName ); if ( strcmp(zones->zoneType, "master") == 0 ) zoneInst.setType( DNS_ZONETYPE_MASTER ); else if ( strcmp(zones->zoneType, "slave") == 0 ) zoneInst.setType( DNS_ZONETYPE_SLAVE ); else if ( strcmp(zones->zoneType, "forward") == 0 ) zoneInst.setType( DNS_ZONETYPE_FORWARD ); else if ( strcmp(zones->zoneType, "hint") == 0 ) zoneInst.setType( DNS_ZONETYPE_HINT ); else zoneInst.setType( DNS_ZONETYPE_UNKNOWN ); zoneInst.setResourceRecordFile( zones->zoneFileName ); // instEnum.addElement( zoneInst ); } } freeZones( all_zones ); }; void Linux_DnsAllowQueryACLForZoneResourceAccess::associatorsSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsZoneInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceEnumeration& instEnum) { cout << "Linux_DnsAllowQueryACLForZoneResourceAccess::associatorsSetting()" << endl; DNSZONE *zones = getZones(); DNSZONE *all_zones = zones; ACL *list_acl = ReadACL(); if ( ! zones) throw CmpiStatus(CMPI_RC_ERR_INVALID_PARAMETER,"The indicated Zone does not exist"); for (; zones->zoneName && list_acl ; zones++) { if ( strcmp( zones->zoneName, sourceInst.getName() ) != 0 ) continue; ZONEOPTS *zopts = findOptsInZone(zones,DNS_ATTR_STR); if ( ( ! zopts ) || ( !zopts->value ) ) continue; DnsArray da = DnsArray( zopts->value ); DnsArrayConstIterator iter; for ( iter = da.begin(); iter != da.end(); ++iter) { // AddressMatchList -> Setting Linux_DnsAddressMatchListInstance addrList; Linux_DnsAddressMatchListInstanceName addrListName; addrListName.setNamespace( nsp ); addrListName.setName( (*iter).c_str() ); addrListName.setServiceName( DEFAULT_SERVICE_NAME ); addrList.setInstanceName( addrListName ); char *aclValue = getACL(list_acl, (*iter).c_str()); if ( ! aclValue ) continue; DnsArray aclArray = DnsArray( aclValue ); addrList.setAddressList( aclArray.toArray(), aclArray.size() ); addrList.setAddressListType( DNS_AMLTYPE_AML ); instEnum.addElement( addrList ); } } freeZones( all_zones ); }; /* extrinsic methods */ } --- NEW FILE: Linux_DnsAllowQueryACLForZoneInstance.cpp --- /** * Linux_DnsAllowQueryACLForZoneInstance.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_DnsAllowQueryACLForZoneInstance.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //Linux_DnsAllowQueryACLForZoneInstance //********************************************************* //empty constructor Linux_DnsAllowQueryACLForZoneInstance:: Linux_DnsAllowQueryACLForZoneInstance(){ init(); }; //copy constructor Linux_DnsAllowQueryACLForZoneInstance:: Linux_DnsAllowQueryACLForZoneInstance (const Linux_DnsAllowQueryACLForZoneInstance& original){ init(original); }; //constructor using CmpiInstance Linux_DnsAllowQueryACLForZoneInstance:: Linux_DnsAllowQueryACLForZoneInstance (const CmpiInstance& inst, const char* instanceNamespace){ CmpiData cmpiData; init(); CmpiObjectPath cop=inst.getObjectPath(); cop.setNameSpace(instanceNamespace); setInstanceName(Linux_DnsAllowQueryACLForZoneInstanceName(cop)); } //Destructor Linux_DnsAllowQueryACLForZoneInstance:: ~Linux_DnsAllowQueryACLForZoneInstance(){ reset(); }; //copy operator Linux_DnsAllowQueryACLForZoneInstance& Linux_DnsAllowQueryACLForZoneInstance::operator= (const Linux_DnsAllowQueryACLForZoneInstance& original){ init(original); return *this; }; //converts to CmpiInstance CmpiInstance Linux_DnsAllowQueryACLForZoneInstance:: 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_DnsAllowQueryACLForZoneInstance:: isInstanceNameSet() const{ return isSet.instanceName; } const Linux_DnsAllowQueryACLForZoneInstanceName& Linux_DnsAllowQueryACLForZoneInstance::getInstanceName() const{ if(!isSet.instanceName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "InstanceName not set in Linux_DnsAllowQueryACLForZone instance"); return m_instanceName; } void Linux_DnsAllowQueryACLForZoneInstance::setInstanceName( const Linux_DnsAllowQueryACLForZoneInstanceName& val){ m_instanceName = val; isSet.instanceName=1; } //set isSet attributes to FALSE void Linux_DnsAllowQueryACLForZoneInstance::init(){ isSet.instanceName=0; }; //copies another instance properties in this void Linux_DnsAllowQueryACLForZoneInstance::init (const Linux_DnsAllowQueryACLForZoneInstance& original){ init(); if(original.isInstanceNameSet()){ setInstanceName(original.getInstanceName()); } } //reset the instance data void Linux_DnsAllowQueryACLForZoneInstance::reset(){ }; //********************************************************* //Linux_DnsAllowQueryACLForZoneInstanceEnumerationElement //********************************************************* Linux_DnsAllowQueryACLForZoneInstanceEnumerationElement:: Linux_DnsAllowQueryACLForZoneInstanceEnumerationElement(){ m_elementP=0; m_nextP=0; }; Linux_DnsAllowQueryACLForZoneInstanceEnumerationElement:: ~Linux_DnsAllowQueryACLForZoneInstanceEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration //********************************************************* Linux_DnsAllowQueryACLForZoneInstanceEnumeration:: Linux_DnsAllowQueryACLForZoneInstanceEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; Linux_DnsAllowQueryACLForZoneInstanceEnumeration:: Linux_DnsAllowQueryACLForZoneInstanceEnumeration( const Linux_DnsAllowQueryACLForZoneInstanceEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; Linux_DnsAllowQueryACLForZoneInstanceEnumeration:: ~Linux_DnsAllowQueryACLForZoneInstanceEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void Linux_DnsAllowQueryACLForZoneInstanceEnumeration::reset(){ currentElementP=firstElementP; }; bool Linux_DnsAllowQueryACLForZoneInstanceEnumeration::hasNext() const{ return (currentElementP!=0); }; int Linux_DnsAllowQueryACLForZoneInstanceEnumeration::getSize() const{ int size=0; Linux_DnsAllowQueryACLForZoneInstanceEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const Linux_DnsAllowQueryACLForZoneInstance& Linux_DnsAllowQueryACLForZoneInstanceEnumeration::getElement(int pos) const{ Linux_DnsAllowQueryACLForZoneInstanceEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const Linux_DnsAllowQueryACLForZoneInstance& Linux_DnsAllowQueryACLForZoneInstanceEnumeration::getNext() { Linux_DnsAllowQueryACLForZoneInstanceEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void Linux_DnsAllowQueryACLForZoneInstanceEnumeration::addElement (const Linux_DnsAllowQueryACLForZoneInstance& elementP){ if(firstElementP==0){ firstElementP=new Linux_DnsAllowQueryACLForZoneInstanceEnumerationElement(); firstElementP->m_elementP=new Linux_DnsAllowQueryACLForZoneInstance(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new Linux_DnsAllowQueryACLForZoneInstanceEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new Linux_DnsAllowQueryACLForZoneInstance(elementP); } }; } --- NEW FILE: Linux_DnsAllowQueryACLForZoneManualInstance.h --- /** * Linux_DnsAllowQueryACLForZoneManualInstance.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_DnsAllowQueryACLForZoneManualInstance_h #define Linux_DnsAllowQueryACLForZoneManualInstance_h #include "cmpidt.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiBooleanData.h" #include "CmpiCharData.h" #include "CmpiDateTime.h" #include "Linux_DnsAllowQueryACLForZoneInstanceName.h" namespace genProvider { class Linux_DnsAllowQueryACLForZoneManualInstance { public: Linux_DnsAllowQueryACLForZoneManualInstance(); Linux_DnsAllowQueryACLForZoneManualInstance (const Linux_DnsAllowQueryACLForZoneManualInstance& original); Linux_DnsAllowQueryACLForZoneManualInstance (const CmpiInstance& inst, const char* instanceNamespace); ~Linux_DnsAllowQueryACLForZoneManualInstance(); Linux_DnsAllowQueryACLForZoneManualInstance& operator= (const Linux_DnsAllowQueryACLForZoneManualInstance& original); CmpiInstance getCmpiInstance(const char** properties=0) const; unsigned int isInstanceNameSet() const; void setInstanceName( const Linux_DnsAllowQueryACLForZoneInstanceName& val); const Linux_DnsAllowQueryACLForZoneInstanceName& getInstanceName() const; private: void init(); void init(const Linux_DnsAllowQueryACLForZoneManualInstance& original); void reset(); Linux_DnsAllowQueryACLForZoneInstanceName m_instanceName; struct isSetType{ unsigned int instanceName:1; } isSet; }; struct Linux_DnsAllowQueryACLForZoneManualInstanceEnumerationElement{ Linux_DnsAllowQueryACLForZoneManualInstance* m_elementP; Linux_DnsAllowQueryACLForZoneManualInstanceEnumerationElement* m_nextP; Linux_DnsAllowQueryACLForZoneManualInstanceEnumerationElement(); ~Linux_DnsAllowQueryACLForZoneManualInstanceEnumerationElement(); }; class Linux_DnsAllowQueryACLForZoneManualInstanceEnumeration { private: Linux_DnsAllowQueryACLForZoneManualInstanceEnumerationElement* firstElementP; Linux_DnsAllowQueryACLForZoneManualInstanceEnumerationElement* currentElementP; Linux_DnsAllowQueryACLForZoneManualInstanceEnumerationElement* endElementP; public: Linux_DnsAllowQueryACLForZoneManualInstanceEnumeration(); Linux_DnsAllowQueryACLForZoneManualInstanceEnumeration( const Linux_DnsAllowQueryACLForZoneManualInstanceEnumeration& original); ~Linux_DnsAllowQueryACLForZoneManualInstanceEnumeration(); void reset(); bool hasNext() const; const Linux_DnsAllowQueryACLForZoneManualInstance& getNext(); int getSize() const; const Linux_DnsAllowQueryACLForZoneManualInstance& getElement(int pos) const; void addElement(const Linux_DnsAllowQueryACLForZoneManualInstance& elementP); }; } #endif --- NEW FILE: Linux_DnsAllowQueryACLForZoneFactory.h --- /** * Linux_DnsAllowQueryACLForZoneFactory.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_DnsAllowQueryACLForZoneFactory_h #define Linux_DnsAllowQueryACLForZoneFactory_h #include "Linux_DnsAllowQueryACLForZoneInterface.h" namespace genProvider{ class Linux_DnsAllowQueryACLForZoneFactory{ public: Linux_DnsAllowQueryACLForZoneFactory(){}; ~Linux_DnsAllowQueryACLForZoneFactory(){}; static Linux_DnsAllowQueryACLForZoneInterface* getImplementation(); }; } #endif --- NEW FILE: Linux_DnsAllowQueryACLForZoneInstanceName.cpp --- /** * Linux_DnsAllowQueryACLForZoneInstanceName.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_DnsAllowQueryACLForZoneInstanceName.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //Linux_DnsAllowQueryACLForZoneInstanceName //********************************************************* //empty constructor Linux_DnsAllowQueryACLForZoneInstanceName:: Linux_DnsAllowQueryACLForZoneInstanceName(){ init(); }; //copy constructor Linux_DnsAllowQueryACLForZoneInstanceName:: Linux_DnsAllowQueryACLForZoneInstanceName (const Linux_DnsAllowQueryACLForZoneInstanceName& original){ init(original); }; //contructor using CmpiObjectPath Linux_DnsAllowQueryACLForZoneInstanceName:: Linux_DnsAllowQueryACLForZoneInstanceName (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_DnsZoneInstanceName(Element)); CmpiObjectPath Setting = path.getKey("Setting"); setSetting(Linux_DnsAddressMatchListInstanceName(Setting)); } //destructor Linux_DnsAllowQueryACLForZoneInstanceName:: ~Linux_DnsAllowQueryACLForZoneInstanceName(){ reset(); }; //copy operator Linux_DnsAllowQueryACLForZoneInstanceName& Linux_DnsAllowQueryACLForZoneInstanceName::operator= (const Linux_DnsAllowQueryACLForZoneInstanceName& original){ init(original); return *this; } //returns the related CmpiObjectPath CmpiObjectPath Linux_DnsAllowQueryACLForZoneInstanceName:: 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_DnsAllowQueryACLForZoneInstanceName::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_DnsAllowQueryACLForZoneInstanceName:: isNameSpaceSet() const{ return isSet.m_namespace; } const char * Linux_DnsAllowQueryACLForZoneInstanceName:: getNamespace() const { if(!isSet.m_namespace) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "NameSpace not set in Linux_DnsAllowQueryACLForZone instanceName"); return m_namespace; } void Linux_DnsAllowQueryACLForZoneInstanceName:: 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_DnsAllowQueryACLForZoneInstanceName::isElementSet() const{ return isSet.Element; } void Linux_DnsAllowQueryACLForZoneInstanceName:: setElement(const Linux_DnsZoneInstanceName& val){ m_Element = val; isSet.Element=1; } const Linux_DnsZoneInstanceName& Linux_DnsAllowQueryACLForZoneInstanceName:: getElement() const{ if(!isSet.Element) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Element not set"); return m_Element; } //Setting related methods unsigned int Linux_DnsAllowQueryACLForZoneInstanceName::isSettingSet() const{ return isSet.Setting; } void Linux_DnsAllowQueryACLForZoneInstanceName:: setSetting(const Linux_DnsAddressMatchListInstanceName& val){ m_Setting = val; isSet.Setting=1; } const Linux_DnsAddressMatchListInstanceName& Linux_DnsAllowQueryACLForZoneInstanceName:: getSetting() const{ if(!isSet.Setting) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Setting not set"); return m_Setting; } //set isSet variables to FALSE void Linux_DnsAllowQueryACLForZoneInstanceName::init(){ m_CIMClassNameP="Linux_DnsAllowQueryACLForZone"; isSet.m_namespace=0; isSet.Element=0; isSet.Setting=0; } //copies another instance properties in this void Linux_DnsAllowQueryACLForZoneInstanceName::init (const Linux_DnsAllowQueryACLForZoneInstanceName& original){ init(); m_CIMClassNameP=original.m_CIMClassNameP; if(original.isNameSpaceSet()){ setNamespace(original.getNamespace(),1); } if(original.isElementSet()){ const Linux_DnsZoneInstanceName& ElementOriginal=original.getElement(); setElement(ElementOriginal); } if(original.isSettingSet()){ const Linux_DnsAddressMatchListInstanceName& SettingOriginal=original.getSetting(); setSetting(SettingOriginal); } } //reset the instanceName data void Linux_DnsAllowQueryACLForZoneInstanceName::reset(){ if (isSet.m_namespace) delete(m_namespace); }; //********************************************************* //Linux_DnsAllowQueryACLForZoneInstanceNameEnumerationElement //********************************************************* Linux_DnsAllowQueryACLForZoneInstanceNameEnumerationElement:: Linux_DnsAllowQueryACLForZoneInstanceNameEnumerationElement(){ m_elementP=0; m_nextP=0; }; Linux_DnsAllowQueryACLForZoneInstanceNameEnumerationElement:: ~Linux_DnsAllowQueryACLForZoneInstanceNameEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration //********************************************************* Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration:: Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration:: Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration(const CmpiArray& arr){ firstElementP=0; currentElementP=0; endElementP=0; int size = arr.size(); for (int i=0; i < size; i++) { addElement(Linux_DnsAllowQueryACLForZoneInstanceName(arr[i])); } } Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration:: Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration( const Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration:: ~Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration::reset(){ currentElementP=firstElementP; }; bool Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration::hasNext() const{ return (currentElementP!=0); }; int Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration::getSize() const{ int size=0; Linux_DnsAllowQueryACLForZoneInstanceNameEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const Linux_DnsAllowQueryACLForZoneInstanceName& Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration::getElement(int pos) const{ Linux_DnsAllowQueryACLForZoneInstanceNameEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const Linux_DnsAllowQueryACLForZoneInstanceName& Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration::getNext() { Linux_DnsAllowQueryACLForZoneInstanceNameEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration::addElement (const Linux_DnsAllowQueryACLForZoneInstanceName& elementP){ if(firstElementP==0){ firstElementP=new Linux_DnsAllowQueryACLForZoneInstanceNameEnumerationElement(); firstElementP->m_elementP=new Linux_DnsAllowQueryACLForZoneInstanceName(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new Linux_DnsAllowQueryACLForZoneInstanceNameEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new Linux_DnsAllowQueryACLForZoneInstanceName(elementP); } }; Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration::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: Linux_DnsAllowQueryACLForZoneInstanceName.h --- /** * Linux_DnsAllowQueryACLForZoneInstanceName.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_DnsAllowQueryACLForZoneInstanceName_h #define Linux_DnsAllowQueryACLForZoneInstanceName_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_DnsZoneInstanceName.h" #include "Linux_DnsAddressMatchListInstanceName.h" namespace genProvider { class Linux_DnsAllowQueryACLForZoneInstanceName { public: Linux_DnsAllowQueryACLForZoneInstanceName(); Linux_DnsAllowQueryACLForZoneInstanceName (const Linux_DnsAllowQueryACLForZoneInstanceName& original); Linux_DnsAllowQueryACLForZoneInstanceName (const CmpiObjectPath& path); ~Linux_DnsAllowQueryACLForZoneInstanceName(); Linux_DnsAllowQueryACLForZoneInstanceName& operator= (const Linux_DnsAllowQueryACLForZoneInstanceName& 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_DnsZoneInstanceName& val); const Linux_DnsZoneInstanceName& getElement() const; unsigned int isSettingSet() const; void setSetting(const Linux_DnsAddressMatchListInstanceName& val); const Linux_DnsAddressMatchListInstanceName& getSetting() const; private: void init(); void init(const Linux_DnsAllowQueryACLForZoneInstanceName& original); void reset(); const char* m_CIMClassNameP; const char* m_namespace; Linux_DnsZoneInstanceName m_Element; Linux_DnsAddressMatchListInstanceName m_Setting; struct isSetType{ unsigned int m_namespace:1; unsigned int Element:1; unsigned int Setting:1; } isSet; }; struct Linux_DnsAllowQueryACLForZoneInstanceNameEnumerationElement{ Linux_DnsAllowQueryACLForZoneInstanceName* m_elementP; Linux_DnsAllowQueryACLForZoneInstanceNameEnumerationElement* m_nextP; Linux_DnsAllowQueryACLForZoneInstanceNameEnumerationElement(); ~Linux_DnsAllowQueryACLForZoneInstanceNameEnumerationElement(); }; class Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration { private: Linux_DnsAllowQueryACLForZoneInstanceNameEnumerationElement* firstElementP; Linux_DnsAllowQueryACLForZoneInstanceNameEnumerationElement* currentElementP; Linux_DnsAllowQueryACLForZoneInstanceNameEnumerationElement* endElementP; public: Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration(); Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration(const CmpiArray& arr); Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration( const Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration& original); ~Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration(); void reset(); bool hasNext() const; const Linux_DnsAllowQueryACLForZoneInstanceName& getNext(); int getSize() const; const Linux_DnsAllowQueryACLForZoneInstanceName& getElement(int pos) const; //no copy of the element is done void addElement(const Linux_DnsAllowQueryACLForZoneInstanceName& elementP); operator CmpiArray() const; }; } #endif --- NEW FILE: Linux_DnsAllowQueryACLForZoneRepositoryInstance.cpp --- /** * Linux_DnsAllowQueryACLForZoneRepositoryInstance.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_DnsAllowQueryACLForZoneRepositoryInstance.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //Linux_DnsAllowQueryACLForZoneRepositoryInstance //********************************************************* //empty constructor Linux_DnsAllowQueryACLForZoneRepositoryInstance:: Linux_DnsAllowQueryACLForZoneRepositoryInstance(){ init(); }; //copy constructor Linux_DnsAllowQueryACLForZoneRepositoryInstance:: Linux_DnsAllowQueryACLForZoneRepositoryInstance (const Linux_DnsAllowQueryACLForZoneRepositoryInstance& original){ init(original); }; //constructor using CmpiInstance Linux_DnsAllowQueryACLForZoneRepositoryInstance:: Linux_DnsAllowQueryACLForZoneRepositoryInstance (const CmpiInstance& inst, const char* instanceNamespace){ CmpiData cmpiData; init(); CmpiObjectPath cop=inst.getObjectPath(); cop.setNameSpace(instanceNamespace); setInstanceName(Linux_DnsAllowQueryACLForZoneInstanceName(cop)); } //Destructor Linux_DnsAllowQueryACLForZoneRepositoryInstance:: ~Linux_DnsAllowQueryACLForZoneRepositoryInstance(){ reset(); }; //copy operator Linux_DnsAllowQueryACLForZoneRepositoryInstance& Linux_DnsAllowQueryACLForZoneRepositoryInstance::operator= (const Linux_DnsAllowQueryACLForZoneRepositoryInstance& original){ init(original); return *this; }; //converts to CmpiInstance CmpiInstance Linux_DnsAllowQueryACLForZoneRepositoryInstance:: 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_DnsAllowQueryACLForZoneRepositoryInstance:: isInstanceNameSet() const{ return isSet.instanceName; } const Linux_DnsAllowQueryACLForZoneInstanceName& Linux_DnsAllowQueryACLForZoneRepositoryInstance::getInstanceName() const{ if(!isSet.instanceName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "InstanceName not set in Linux_DnsAllowQueryACLForZone instance"); return m_instanceName; } void Linux_DnsAllowQueryACLForZoneRepositoryInstance::setInstanceName( const Linux_DnsAllowQueryACLForZoneInstanceName& val){ m_instanceName = val; isSet.instanceName=1; } //set isSet attributes to FALSE void Linux_DnsAllowQueryACLForZoneRepositoryInstance::init(){ isSet.instanceName=0; }; //copies another instance properties in this void Linux_DnsAllowQueryACLForZoneRepositoryInstance::init (const Linux_DnsAllowQueryACLForZoneRepositoryInstance& original){ init(); if(original.isInstanceNameSet()){ setInstanceName(original.getInstanceName()); } } //reset the instance data void Linux_DnsAllowQueryACLForZoneRepositoryInstance::reset(){ }; //********************************************************* //Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumerationElement //********************************************************* Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumerationElement:: Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumerationElement(){ m_elementP=0; m_nextP=0; }; Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumerationElement:: ~Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //Linux_DnsAllowQueryACLForZoneRepositoryInstanceNameEnumeration //********************************************************* Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumeration:: Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumeration:: Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumeration( const Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumeration:: ~Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumeration::reset(){ currentElementP=firstElementP; }; bool Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumeration::hasNext() const{ return (currentElementP!=0); }; int Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumeration::getSize() const{ int size=0; Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const Linux_DnsAllowQueryACLForZoneRepositoryInstance& Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumeration::getElement(int pos) const{ Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const Linux_DnsAllowQueryACLForZoneRepositoryInstance& Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumeration::getNext() { Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumeration::addElement (const Linux_DnsAllowQueryACLForZoneRepositoryInstance& elementP){ if(firstElementP==0){ firstElementP=new Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumerationElement(); firstElementP->m_elementP=new Linux_DnsAllowQueryACLForZoneRepositoryInstance(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new Linux_DnsAllowQueryACLForZoneRepositoryInstance(elementP); } }; } --- NEW FILE: Linux_DnsAllowQueryACLForZoneRepositoryExternal.h --- /** * Linux_DnsAllowQueryACLForZoneRepositoryExternal.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_DnsAllowQueryACLForZoneRepositoryExternal_h #define Linux_DnsAllowQueryACLForZoneRepositoryExternal_h #include "Linux_DnsAllowQueryACLForZoneInstanceName.h" #include "Linux_DnsAllowQueryACLForZoneRepositoryInstance.h" #include "CmpiBroker.h" namespace genProvider { class Linux_DnsAllowQueryACLForZoneRepositoryExternal { public: Linux_DnsAllowQueryACLForZoneRepositoryExternal( const CmpiBroker& brkr, const CmpiContext& ctx); virtual ~Linux_DnsAllowQueryACLForZoneRepositoryExternal(); virtual void enumInstanceNames( Linux_DnsAllowQueryACLForZoneInstanceNameEnumeration&); virtual void enumInstances( const char* *properties, Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumeration&); virtual Linux_DnsAllowQueryACLForZoneRepositoryInstance getInstance( const char* *properties, const Linux_DnsAllowQueryACLForZoneInstanceName&); virtual void setInstance( const char* *properties, const Linux_DnsAllowQueryACLForZoneRepositoryInstance&); virtual void createInstance( const Linux_DnsAllowQueryACLForZoneRepositoryInstance&); virtual void deleteInstance( const Linux_DnsAllowQueryACLForZoneInstanceName&); private: CmpiBroker broker; CmpiContext context; const static char *nsp; }; } #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_DnsZone -I../Linux_DnsAddressMatchList -I../CIM_ManagedSystemElement -D_COMPILE_UNIX -DCMPI_STANDALONE CXXFLAGS=-Wall -g -fPIC -fno-implicit-templates LDFLAGS=-L. -L$(COMMONLIB) -L$(COMMONLIB_OUT) -shared -lLinux_DnsZoneSupport -lLinux_DnsAddressMatchListSupport -lcmpiCppImpl -lIBM_ProviderTooling OBJECTS=Linux_DnsAllowQueryACLForZoneInstanceName.o \ Linux_DnsAllowQueryACLForZoneInstance.o \ Linux_DnsAllowQueryACLForZoneExternal.o \ Linux_DnsAllowQueryACLForZoneRepositoryInstance.o \ Linux_DnsAllowQueryACLForZoneRepositoryExternal.o \ Linux_DnsAllowQueryACLForZoneManualInstance.o \ Linux_DnsAllowQueryACLForZoneDefaultImplementation.o FAKEFACTORY= Linux_DnsAllowQueryACLForZoneFakeFactory.o NORMALFACTORY= Linux_DnsAllowQueryACLForZoneFactory.o RESOURCEOBJECT= Linux_DnsAllowQueryACLForZoneResourceAccess.o PROVIDEROBJECT=CmpiLinux_DnsAllowQueryACLForZoneProvider.o all: testfiles preinstall install buildall: clean all #------------------------------------------------------------------------------# compile: $(OBJECTS) $(FAKEFACTORY) $(NORMALFACTORY) $(RESOURCEOBJECT) $(PROVIDEROBJECT) #------------------------------------------------------------------------------# prelink: $(OBJECTS) $(FAKEFACTORY) $(LINK.cpp) -o libLinux_DnsAllowQueryACLForZoneSupport.so $^ link: deleteFakeLib \ libLinux_DnsAllowQueryACLForZoneSupport.so \ libLinux_DnsAllowQueryACLForZone.so libLinux_DnsAllowQueryACLForZoneSupport.so: LDFLAGS+=$(LDFLAGS.provider) libLinux_DnsAllowQueryACLForZoneSupport.so: $(OBJECTS) $(NORMALFACTORY) $(RESOURCEOBJECT) $(PROVIDEROBJECT) $(LINK.cpp) -o $@ $^ libLinux_DnsAllowQueryACLForZone.so: LDFLAGS+=-lLinux_DnsAllowQueryACLForZoneSupport libLinux_DnsAllowQueryACLForZone.so: $(PROVIDEROBJECT) $(LINK.cpp) -o $@ $^ deleteFakeLib: $(RM) *.so #------------------------------------------------------------------------------# preinstall: prelink install libLinux_DnsAllowQueryACLForZoneSupport.so $(COMMONLIB_OUT) #------------------------------------------------------------------------------# install: link install libLinux_DnsAllowQueryACLForZoneSupport.so $(COMMONLIB_OUT) install libLinux_DnsAllowQueryACLForZone.so $(CIMOMLIB_OUT) # install -m 644 Linux_DnsAllowQueryACLForZone*.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_DnsAllowQueryACLForZone*.h \ $(RM) $(COMMONLIB)/libLinux_DnsAllowQueryACLForZoneSupport.so \ $(RM) $(CIMOMLIB)/libLinux_DnsAllowQueryACLForZone.so --- NEW FILE: Linux_DnsAllowQueryACLForZoneRepositoryInstance.h --- /** * Linux_DnsAllowQueryACLForZoneRepositoryInstance.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_DnsAllowQueryACLForZoneRepositoryInstance_h #define Linux_DnsAllowQueryACLForZoneRepositoryInstance_h #include "cmpidt.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiBooleanData.h" #include "CmpiCharData.h" #include "CmpiDateTime.h" #include "Linux_DnsAllowQueryACLForZoneInstanceName.h" namespace genProvider { class Linux_DnsAllowQueryACLForZoneRepositoryInstance { public: Linux_DnsAllowQueryACLForZoneRepositoryInstance(); Linux_DnsAllowQueryACLForZoneRepositoryInstance (const Linux_DnsAllowQueryACLForZoneRepositoryInstance& original); Linux_DnsAllowQueryACLForZoneRepositoryInstance (const CmpiInstance& inst, const char* instanceNamespace); ~Linux_DnsAllowQueryACLForZoneRepositoryInstance(); Linux_DnsAllowQueryACLForZoneRepositoryInstance& operator= (const Linux_DnsAllowQueryACLForZoneRepositoryInstance& original); CmpiInstance getCmpiInstance(const char** properties=0) const; unsigned int isInstanceNameSet() const; void setInstanceName( const Linux_DnsAllowQueryACLForZoneInstanceName& val); const Linux_DnsAllowQueryACLForZoneInstanceName& getInstanceName() const; private: void init(); void init(const Linux_DnsAllowQueryACLForZoneRepositoryInstance& original); void reset(); Linux_DnsAllowQueryACLForZoneInstanceName m_instanceName; struct isSetType{ unsigned int instanceName:1; } isSet; }; struct Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumerationElement{ Linux_DnsAllowQueryACLForZoneRepositoryInstance* m_elementP; Linux_DnsAllowQueryACLForZoneRepositoryInstanceEnumerationElement* m_nextP; Linux_DnsAllowQueryACLForZoneRepositoryI... [truncated message content] |