You can subscribe to this list here.
2005 |
Jan
|
Feb
(1) |
Mar
(45) |
Apr
(150) |
May
(145) |
Jun
(150) |
Jul
(79) |
Aug
(313) |
Sep
(160) |
Oct
(309) |
Nov
(115) |
Dec
(60) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(160) |
Feb
(144) |
Mar
(127) |
Apr
(48) |
May
(102) |
Jun
(54) |
Jul
(245) |
Aug
(94) |
Sep
(152) |
Oct
(162) |
Nov
(166) |
Dec
(740) |
2007 |
Jan
(752) |
Feb
(437) |
Mar
(328) |
Apr
(373) |
May
(569) |
Jun
(399) |
Jul
(369) |
Aug
(627) |
Sep
(100) |
Oct
(306) |
Nov
(166) |
Dec
(282) |
2008 |
Jan
(68) |
Feb
(145) |
Mar
(180) |
Apr
(160) |
May
(277) |
Jun
(229) |
Jul
(1188) |
Aug
(51) |
Sep
(97) |
Oct
(99) |
Nov
(95) |
Dec
(170) |
2009 |
Jan
(39) |
Feb
(73) |
Mar
(120) |
Apr
(121) |
May
(104) |
Jun
(262) |
Jul
(57) |
Aug
(171) |
Sep
(131) |
Oct
(88) |
Nov
(64) |
Dec
(83) |
2010 |
Jan
(55) |
Feb
(67) |
Mar
(124) |
Apr
(64) |
May
(130) |
Jun
(75) |
Jul
(164) |
Aug
(64) |
Sep
(44) |
Oct
(17) |
Nov
(43) |
Dec
(31) |
2011 |
Jan
(21) |
Feb
(10) |
Mar
(43) |
Apr
(46) |
May
(52) |
Jun
(71) |
Jul
(7) |
Aug
(16) |
Sep
(51) |
Oct
(14) |
Nov
(33) |
Dec
(15) |
2012 |
Jan
(12) |
Feb
(61) |
Mar
(129) |
Apr
(76) |
May
(70) |
Jun
(52) |
Jul
(29) |
Aug
(41) |
Sep
(32) |
Oct
(23) |
Nov
(38) |
Dec
(26) |
2013 |
Jan
(35) |
Feb
(37) |
Mar
(51) |
Apr
(15) |
May
(52) |
Jun
(15) |
Jul
(23) |
Aug
(21) |
Sep
(46) |
Oct
(69) |
Nov
(57) |
Dec
(26) |
2014 |
Jan
(5) |
Feb
(13) |
Mar
(17) |
Apr
(1) |
May
(5) |
Jun
|
Jul
(2) |
Aug
(2) |
Sep
(1) |
Oct
(16) |
Nov
(8) |
Dec
(4) |
2015 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
(4) |
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
Update of /cvsroot/sblim/cmpi-dns/provider/Linux_DnsMastersOfSlaveZone In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20455/provider/Linux_DnsMastersOfSlaveZone Added Files: Linux_DnsMastersOfSlaveZoneInstanceName.cpp Linux_DnsMastersOfSlaveZoneResourceAccess.cpp Linux_DnsMastersOfSlaveZoneInstanceName.h Linux_DnsMastersOfSlaveZoneInstance.cpp CmpiLinux_DnsMastersOfSlaveZoneProvider.cpp makefile Linux_DnsMastersOfSlaveZoneExternal.h Linux_DnsMastersOfSlaveZoneRepositoryExternal.h Linux_DnsMastersOfSlaveZoneExternal.cpp Linux_DnsMastersOfSlaveZoneDefaultImplementation.cpp Linux_DnsMastersOfSlaveZoneRepositoryExternal.cpp CmpiLinux_DnsMastersOfSlaveZoneProvider.h setting.provider Linux_DnsMastersOfSlaveZoneFactory.h Linux_DnsMastersOfSlaveZoneManualInstance.cpp Linux_DnsMastersOfSlaveZoneInterface.h Linux_DnsMastersOfSlaveZoneDefaultImplementation.h Linux_DnsMastersOfSlaveZoneInstance.h Linux_DnsMastersOfSlaveZoneRepositoryInstance.cpp Linux_DnsMastersOfSlaveZoneRepositoryInstance.h Linux_DnsMastersOfSlaveZoneFactory.cpp Linux_DnsMastersOfSlaveZoneManualInstance.h Linux_DnsMastersOfSlaveZoneFakeFactory.cpp Linux_DnsMastersOfSlaveZoneResourceAccess.h Log Message: WBEM-SMT DNS provider component. First initial upload. This module includes: - CIM model for DNS - CMPI provider for DNS - Resource Access layer for DNS --- NEW FILE: setting.provider --- #Provider configuration #CPPFLAGS.provider LDFLAGS.provider=-ldnssupport --- NEW FILE: Linux_DnsMastersOfSlaveZoneInstance.h --- /** * Linux_DnsMastersOfSlaveZoneInstance.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_DnsMastersOfSlaveZoneInstance_h #define Linux_DnsMastersOfSlaveZoneInstance_h #include "cmpidt.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiBooleanData.h" #include "CmpiCharData.h" #include "CmpiDateTime.h" #include "Linux_DnsMastersOfSlaveZoneInstanceName.h" namespace genProvider { class Linux_DnsMastersOfSlaveZoneInstance { public: Linux_DnsMastersOfSlaveZoneInstance(); Linux_DnsMastersOfSlaveZoneInstance (const Linux_DnsMastersOfSlaveZoneInstance& original); Linux_DnsMastersOfSlaveZoneInstance (const CmpiInstance& inst, const char* instanceNamespace); ~Linux_DnsMastersOfSlaveZoneInstance(); Linux_DnsMastersOfSlaveZoneInstance& operator= (const Linux_DnsMastersOfSlaveZoneInstance& original); CmpiInstance getCmpiInstance(const char** properties=0) const; unsigned int isInstanceNameSet() const; void setInstanceName( const Linux_DnsMastersOfSlaveZoneInstanceName& val); const Linux_DnsMastersOfSlaveZoneInstanceName& getInstanceName() const; private: void init(); void init(const Linux_DnsMastersOfSlaveZoneInstance& original); void reset(); Linux_DnsMastersOfSlaveZoneInstanceName m_instanceName; struct isSetType{ unsigned int instanceName:1; } isSet; }; struct Linux_DnsMastersOfSlaveZoneInstanceEnumerationElement{ Linux_DnsMastersOfSlaveZoneInstance* m_elementP; Linux_DnsMastersOfSlaveZoneInstanceEnumerationElement* m_nextP; Linux_DnsMastersOfSlaveZoneInstanceEnumerationElement(); ~Linux_DnsMastersOfSlaveZoneInstanceEnumerationElement(); }; class Linux_DnsMastersOfSlaveZoneInstanceEnumeration { private: Linux_DnsMastersOfSlaveZoneInstanceEnumerationElement* firstElementP; Linux_DnsMastersOfSlaveZoneInstanceEnumerationElement* currentElementP; Linux_DnsMastersOfSlaveZoneInstanceEnumerationElement* endElementP; public: Linux_DnsMastersOfSlaveZoneInstanceEnumeration(); Linux_DnsMastersOfSlaveZoneInstanceEnumeration( const Linux_DnsMastersOfSlaveZoneInstanceEnumeration& original); ~Linux_DnsMastersOfSlaveZoneInstanceEnumeration(); void reset(); bool hasNext() const; const Linux_DnsMastersOfSlaveZoneInstance& getNext(); int getSize() const; const Linux_DnsMastersOfSlaveZoneInstance& getElement(int pos) const; void addElement(const Linux_DnsMastersOfSlaveZoneInstance& elementP); }; } #endif --- NEW FILE: Linux_DnsMastersOfSlaveZoneManualInstance.cpp --- /** * Linux_DnsMastersOfSlaveZoneManualInstance.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_DnsMastersOfSlaveZoneManualInstance.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //Linux_DnsMastersOfSlaveZoneManualInstance //********************************************************* //empty constructor Linux_DnsMastersOfSlaveZoneManualInstance:: Linux_DnsMastersOfSlaveZoneManualInstance(){ init(); }; //copy constructor Linux_DnsMastersOfSlaveZoneManualInstance:: Linux_DnsMastersOfSlaveZoneManualInstance (const Linux_DnsMastersOfSlaveZoneManualInstance& original){ init(original); }; //constructor using CmpiInstance Linux_DnsMastersOfSlaveZoneManualInstance:: Linux_DnsMastersOfSlaveZoneManualInstance (const CmpiInstance& inst, const char* instanceNamespace){ CmpiData cmpiData; init(); CmpiObjectPath cop=inst.getObjectPath(); cop.setNameSpace(instanceNamespace); setInstanceName(Linux_DnsMastersOfSlaveZoneInstanceName(cop)); } //Destructor Linux_DnsMastersOfSlaveZoneManualInstance:: ~Linux_DnsMastersOfSlaveZoneManualInstance(){ reset(); }; //copy operator Linux_DnsMastersOfSlaveZoneManualInstance& Linux_DnsMastersOfSlaveZoneManualInstance::operator= (const Linux_DnsMastersOfSlaveZoneManualInstance& original){ init(original); return *this; }; //converts to CmpiInstance CmpiInstance Linux_DnsMastersOfSlaveZoneManualInstance:: 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_DnsMastersOfSlaveZoneManualInstance:: isInstanceNameSet() const{ return isSet.instanceName; } const Linux_DnsMastersOfSlaveZoneInstanceName& Linux_DnsMastersOfSlaveZoneManualInstance::getInstanceName() const{ if(!isSet.instanceName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "InstanceName not set in Linux_DnsMastersOfSlaveZone instance"); return m_instanceName; } void Linux_DnsMastersOfSlaveZoneManualInstance::setInstanceName( const Linux_DnsMastersOfSlaveZoneInstanceName& val){ m_instanceName = val; isSet.instanceName=1; } //set isSet attributes to FALSE void Linux_DnsMastersOfSlaveZoneManualInstance::init(){ isSet.instanceName=0; }; //copies another instance properties in this void Linux_DnsMastersOfSlaveZoneManualInstance::init (const Linux_DnsMastersOfSlaveZoneManualInstance& original){ init(); if(original.isInstanceNameSet()){ setInstanceName(original.getInstanceName()); } } //reset the instance data void Linux_DnsMastersOfSlaveZoneManualInstance::reset(){ }; //********************************************************* //Linux_DnsMastersOfSlaveZoneManualInstanceEnumerationElement //********************************************************* Linux_DnsMastersOfSlaveZoneManualInstanceEnumerationElement:: Linux_DnsMastersOfSlaveZoneManualInstanceEnumerationElement(){ m_elementP=0; m_nextP=0; }; Linux_DnsMastersOfSlaveZoneManualInstanceEnumerationElement:: ~Linux_DnsMastersOfSlaveZoneManualInstanceEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //Linux_DnsMastersOfSlaveZoneManualInstanceNameEnumeration //********************************************************* Linux_DnsMastersOfSlaveZoneManualInstanceEnumeration:: Linux_DnsMastersOfSlaveZoneManualInstanceEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; Linux_DnsMastersOfSlaveZoneManualInstanceEnumeration:: Linux_DnsMastersOfSlaveZoneManualInstanceEnumeration( const Linux_DnsMastersOfSlaveZoneManualInstanceEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; Linux_DnsMastersOfSlaveZoneManualInstanceEnumeration:: ~Linux_DnsMastersOfSlaveZoneManualInstanceEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void Linux_DnsMastersOfSlaveZoneManualInstanceEnumeration::reset(){ currentElementP=firstElementP; }; bool Linux_DnsMastersOfSlaveZoneManualInstanceEnumeration::hasNext() const{ return (currentElementP!=0); }; int Linux_DnsMastersOfSlaveZoneManualInstanceEnumeration::getSize() const{ int size=0; Linux_DnsMastersOfSlaveZoneManualInstanceEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const Linux_DnsMastersOfSlaveZoneManualInstance& Linux_DnsMastersOfSlaveZoneManualInstanceEnumeration::getElement(int pos) const{ Linux_DnsMastersOfSlaveZoneManualInstanceEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const Linux_DnsMastersOfSlaveZoneManualInstance& Linux_DnsMastersOfSlaveZoneManualInstanceEnumeration::getNext() { Linux_DnsMastersOfSlaveZoneManualInstanceEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void Linux_DnsMastersOfSlaveZoneManualInstanceEnumeration::addElement (const Linux_DnsMastersOfSlaveZoneManualInstance& elementP){ if(firstElementP==0){ firstElementP=new Linux_DnsMastersOfSlaveZoneManualInstanceEnumerationElement(); firstElementP->m_elementP=new Linux_DnsMastersOfSlaveZoneManualInstance(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new Linux_DnsMastersOfSlaveZoneManualInstanceEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new Linux_DnsMastersOfSlaveZoneManualInstance(elementP); } }; } --- NEW FILE: Linux_DnsMastersOfSlaveZoneManualInstance.h --- /** * Linux_DnsMastersOfSlaveZoneManualInstance.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_DnsMastersOfSlaveZoneManualInstance_h #define Linux_DnsMastersOfSlaveZoneManualInstance_h #include "cmpidt.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiBooleanData.h" #include "CmpiCharData.h" #include "CmpiDateTime.h" #include "Linux_DnsMastersOfSlaveZoneInstanceName.h" namespace genProvider { class Linux_DnsMastersOfSlaveZoneManualInstance { public: Linux_DnsMastersOfSlaveZoneManualInstance(); Linux_DnsMastersOfSlaveZoneManualInstance (const Linux_DnsMastersOfSlaveZoneManualInstance& original); Linux_DnsMastersOfSlaveZoneManualInstance (const CmpiInstance& inst, const char* instanceNamespace); ~Linux_DnsMastersOfSlaveZoneManualInstance(); Linux_DnsMastersOfSlaveZoneManualInstance& operator= (const Linux_DnsMastersOfSlaveZoneManualInstance& original); CmpiInstance getCmpiInstance(const char** properties=0) const; unsigned int isInstanceNameSet() const; void setInstanceName( const Linux_DnsMastersOfSlaveZoneInstanceName& val); const Linux_DnsMastersOfSlaveZoneInstanceName& getInstanceName() const; private: void init(); void init(const Linux_DnsMastersOfSlaveZoneManualInstance& original); void reset(); Linux_DnsMastersOfSlaveZoneInstanceName m_instanceName; struct isSetType{ unsigned int instanceName:1; } isSet; }; struct Linux_DnsMastersOfSlaveZoneManualInstanceEnumerationElement{ Linux_DnsMastersOfSlaveZoneManualInstance* m_elementP; Linux_DnsMastersOfSlaveZoneManualInstanceEnumerationElement* m_nextP; Linux_DnsMastersOfSlaveZoneManualInstanceEnumerationElement(); ~Linux_DnsMastersOfSlaveZoneManualInstanceEnumerationElement(); }; class Linux_DnsMastersOfSlaveZoneManualInstanceEnumeration { private: Linux_DnsMastersOfSlaveZoneManualInstanceEnumerationElement* firstElementP; Linux_DnsMastersOfSlaveZoneManualInstanceEnumerationElement* currentElementP; Linux_DnsMastersOfSlaveZoneManualInstanceEnumerationElement* endElementP; public: Linux_DnsMastersOfSlaveZoneManualInstanceEnumeration(); Linux_DnsMastersOfSlaveZoneManualInstanceEnumeration( const Linux_DnsMastersOfSlaveZoneManualInstanceEnumeration& original); ~Linux_DnsMastersOfSlaveZoneManualInstanceEnumeration(); void reset(); bool hasNext() const; const Linux_DnsMastersOfSlaveZoneManualInstance& getNext(); int getSize() const; const Linux_DnsMastersOfSlaveZoneManualInstance& getElement(int pos) const; void addElement(const Linux_DnsMastersOfSlaveZoneManualInstance& elementP); }; } #endif --- NEW FILE: Linux_DnsMastersOfSlaveZoneInstance.cpp --- /** * Linux_DnsMastersOfSlaveZoneInstance.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_DnsMastersOfSlaveZoneInstance.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //Linux_DnsMastersOfSlaveZoneInstance //********************************************************* //empty constructor Linux_DnsMastersOfSlaveZoneInstance:: Linux_DnsMastersOfSlaveZoneInstance(){ init(); }; //copy constructor Linux_DnsMastersOfSlaveZoneInstance:: Linux_DnsMastersOfSlaveZoneInstance (const Linux_DnsMastersOfSlaveZoneInstance& original){ init(original); }; //constructor using CmpiInstance Linux_DnsMastersOfSlaveZoneInstance:: Linux_DnsMastersOfSlaveZoneInstance (const CmpiInstance& inst, const char* instanceNamespace){ CmpiData cmpiData; init(); CmpiObjectPath cop=inst.getObjectPath(); cop.setNameSpace(instanceNamespace); setInstanceName(Linux_DnsMastersOfSlaveZoneInstanceName(cop)); } //Destructor Linux_DnsMastersOfSlaveZoneInstance:: ~Linux_DnsMastersOfSlaveZoneInstance(){ reset(); }; //copy operator Linux_DnsMastersOfSlaveZoneInstance& Linux_DnsMastersOfSlaveZoneInstance::operator= (const Linux_DnsMastersOfSlaveZoneInstance& original){ init(original); return *this; }; //converts to CmpiInstance CmpiInstance Linux_DnsMastersOfSlaveZoneInstance:: 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_DnsMastersOfSlaveZoneInstance:: isInstanceNameSet() const{ return isSet.instanceName; } const Linux_DnsMastersOfSlaveZoneInstanceName& Linux_DnsMastersOfSlaveZoneInstance::getInstanceName() const{ if(!isSet.instanceName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "InstanceName not set in Linux_DnsMastersOfSlaveZone instance"); return m_instanceName; } void Linux_DnsMastersOfSlaveZoneInstance::setInstanceName( const Linux_DnsMastersOfSlaveZoneInstanceName& val){ m_instanceName = val; isSet.instanceName=1; } //set isSet attributes to FALSE void Linux_DnsMastersOfSlaveZoneInstance::init(){ isSet.instanceName=0; }; //copies another instance properties in this void Linux_DnsMastersOfSlaveZoneInstance::init (const Linux_DnsMastersOfSlaveZoneInstance& original){ init(); if(original.isInstanceNameSet()){ setInstanceName(original.getInstanceName()); } } //reset the instance data void Linux_DnsMastersOfSlaveZoneInstance::reset(){ }; //********************************************************* //Linux_DnsMastersOfSlaveZoneInstanceEnumerationElement //********************************************************* Linux_DnsMastersOfSlaveZoneInstanceEnumerationElement:: Linux_DnsMastersOfSlaveZoneInstanceEnumerationElement(){ m_elementP=0; m_nextP=0; }; Linux_DnsMastersOfSlaveZoneInstanceEnumerationElement:: ~Linux_DnsMastersOfSlaveZoneInstanceEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //Linux_DnsMastersOfSlaveZoneInstanceNameEnumeration //********************************************************* Linux_DnsMastersOfSlaveZoneInstanceEnumeration:: Linux_DnsMastersOfSlaveZoneInstanceEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; Linux_DnsMastersOfSlaveZoneInstanceEnumeration:: Linux_DnsMastersOfSlaveZoneInstanceEnumeration( const Linux_DnsMastersOfSlaveZoneInstanceEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; Linux_DnsMastersOfSlaveZoneInstanceEnumeration:: ~Linux_DnsMastersOfSlaveZoneInstanceEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void Linux_DnsMastersOfSlaveZoneInstanceEnumeration::reset(){ currentElementP=firstElementP; }; bool Linux_DnsMastersOfSlaveZoneInstanceEnumeration::hasNext() const{ return (currentElementP!=0); }; int Linux_DnsMastersOfSlaveZoneInstanceEnumeration::getSize() const{ int size=0; Linux_DnsMastersOfSlaveZoneInstanceEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const Linux_DnsMastersOfSlaveZoneInstance& Linux_DnsMastersOfSlaveZoneInstanceEnumeration::getElement(int pos) const{ Linux_DnsMastersOfSlaveZoneInstanceEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const Linux_DnsMastersOfSlaveZoneInstance& Linux_DnsMastersOfSlaveZoneInstanceEnumeration::getNext() { Linux_DnsMastersOfSlaveZoneInstanceEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void Linux_DnsMastersOfSlaveZoneInstanceEnumeration::addElement (const Linux_DnsMastersOfSlaveZoneInstance& elementP){ if(firstElementP==0){ firstElementP=new Linux_DnsMastersOfSlaveZoneInstanceEnumerationElement(); firstElementP->m_elementP=new Linux_DnsMastersOfSlaveZoneInstance(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new Linux_DnsMastersOfSlaveZoneInstanceEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new Linux_DnsMastersOfSlaveZoneInstance(elementP); } }; } --- NEW FILE: Linux_DnsMastersOfSlaveZoneExternal.h --- /** * Linux_DnsMastersOfSlaveZoneExternal.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_DnsMastersOfSlaveZoneExternal_h #define Linux_DnsMastersOfSlaveZoneExternal_h #include "Linux_DnsMastersOfSlaveZoneInstance.h" #include "Linux_DnsSlaveZoneInstance.h" #include "Linux_DnsIPAddressInstance.h" #include "CmpiBroker.h" namespace genProvider { class Linux_DnsMastersOfSlaveZoneExternal { public: Linux_DnsMastersOfSlaveZoneExternal( const CmpiBroker& brkr, const CmpiContext& ctx); virtual ~Linux_DnsMastersOfSlaveZoneExternal(); virtual void enumInstanceNames( const char *nsp, Linux_DnsMastersOfSlaveZoneInstanceNameEnumeration&); virtual void enumInstances( const char *nsp, const char* *properties, Linux_DnsMastersOfSlaveZoneInstanceEnumeration&); virtual Linux_DnsMastersOfSlaveZoneInstance getInstance( const char* *properties, const Linux_DnsMastersOfSlaveZoneInstanceName&); virtual void setInstance( const char* *properties, const Linux_DnsMastersOfSlaveZoneInstance&); virtual void createInstance( const Linux_DnsMastersOfSlaveZoneInstance&); virtual void deleteInstance( const Linux_DnsMastersOfSlaveZoneInstanceName&); //association calls void referencesElement( const char *nsp, const char** properties, const Linux_DnsIPAddressInstanceName& sourceInst, Linux_DnsMastersOfSlaveZoneInstanceEnumeration& instances); void referenceNamesElement( const char *nsp, const Linux_DnsIPAddressInstanceName& sourceInst, Linux_DnsMastersOfSlaveZoneInstanceNameEnumeration& instanceNames); void referencesSetting( const char *nsp, const char** properties, const Linux_DnsSlaveZoneInstanceName& sourceInst, Linux_DnsMastersOfSlaveZoneInstanceEnumeration& instances); void referenceNamesSetting( const char *nsp, const Linux_DnsSlaveZoneInstanceName& sourceInst, Linux_DnsMastersOfSlaveZoneInstanceNameEnumeration& instanceNames); void associatorsElement( const char *nsp, const char** properties, const Linux_DnsIPAddressInstanceName& sourceInst, Linux_DnsSlaveZoneInstanceEnumeration& instances); void associatorNamesElement( const char *nsp, const Linux_DnsIPAddressInstanceName& sourceInst, Linux_DnsSlaveZoneInstanceNameEnumeration& instanceNames); void associatorsSetting( const char *nsp, const char** properties, const Linux_DnsSlaveZoneInstanceName& sourceInst, Linux_DnsIPAddressInstanceEnumeration& instances); void associatorNamesSetting( const char *nsp, const Linux_DnsSlaveZoneInstanceName& sourceInst, Linux_DnsIPAddressInstanceNameEnumeration& instanceNames); private: CmpiBroker broker; CmpiContext context; }; } #endif --- NEW FILE: Linux_DnsMastersOfSlaveZoneFakeFactory.cpp --- /** * Linux_DnsMastersOfSlaveZoneFakeFactory.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_DnsMastersOfSlaveZoneFactory.h" using namespace std; namespace genProvider{ Linux_DnsMastersOfSlaveZoneInterface* Linux_DnsMastersOfSlaveZoneFactory::getImplementation(){ cout<<"ERROR: incomplete support library is being used"<<endl; cout<<" in provider from class Linux_DnsMastersOfSlaveZone"<<endl; cout<<" Use the link-install options for the makefile"<<endl; return 0; }; } --- 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_DnsSlaveZone -I../Linux_DnsIPAddress -I../CIM_ManagedSystemElement -D_COMPILE_UNIX -DCMPI_STANDALONE CXXFLAGS=-Wall -g -fPIC -fno-implicit-templates LDFLAGS=-L. -L$(COMMONLIB) -L$(COMMONLIB_OUT) -shared -lLinux_DnsSlaveZoneSupport -lLinux_DnsIPAddressSupport -lcmpiCppImpl -lIBM_ProviderTooling OBJECTS=Linux_DnsMastersOfSlaveZoneInstanceName.o \ Linux_DnsMastersOfSlaveZoneInstance.o \ Linux_DnsMastersOfSlaveZoneExternal.o \ Linux_DnsMastersOfSlaveZoneRepositoryInstance.o \ Linux_DnsMastersOfSlaveZoneRepositoryExternal.o \ Linux_DnsMastersOfSlaveZoneManualInstance.o \ Linux_DnsMastersOfSlaveZoneDefaultImplementation.o FAKEFACTORY= Linux_DnsMastersOfSlaveZoneFakeFactory.o NORMALFACTORY= Linux_DnsMastersOfSlaveZoneFactory.o RESOURCEOBJECT= Linux_DnsMastersOfSlaveZoneResourceAccess.o PROVIDEROBJECT=CmpiLinux_DnsMastersOfSlaveZoneProvider.o all: testfiles preinstall install buildall: clean all #------------------------------------------------------------------------------# compile: $(OBJECTS) $(FAKEFACTORY) $(NORMALFACTORY) $(RESOURCEOBJECT) $(PROVIDEROBJECT) #------------------------------------------------------------------------------# prelink: $(OBJECTS) $(FAKEFACTORY) $(LINK.cpp) -o libLinux_DnsMastersOfSlaveZoneSupport.so $^ link: deleteFakeLib \ libLinux_DnsMastersOfSlaveZoneSupport.so \ libLinux_DnsMastersOfSlaveZone.so libLinux_DnsMastersOfSlaveZoneSupport.so: LDFLAGS+=$(LDFLAGS.provider) libLinux_DnsMastersOfSlaveZoneSupport.so: $(OBJECTS) $(NORMALFACTORY) $(RESOURCEOBJECT) $(PROVIDEROBJECT) $(LINK.cpp) -o $@ $^ libLinux_DnsMastersOfSlaveZone.so: LDFLAGS+=-lLinux_DnsMastersOfSlaveZoneSupport libLinux_DnsMastersOfSlaveZone.so: $(PROVIDEROBJECT) $(LINK.cpp) -o $@ $^ deleteFakeLib: $(RM) *.so #------------------------------------------------------------------------------# preinstall: prelink install libLinux_DnsMastersOfSlaveZoneSupport.so $(COMMONLIB_OUT) #------------------------------------------------------------------------------# install: link install libLinux_DnsMastersOfSlaveZoneSupport.so $(COMMONLIB_OUT) install libLinux_DnsMastersOfSlaveZone.so $(CIMOMLIB_OUT) # install -m 644 Linux_DnsMastersOfSlaveZone*.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_DnsMastersOfSlaveZone*.h \ $(RM) $(COMMONLIB)/libLinux_DnsMastersOfSlaveZoneSupport.so \ $(RM) $(CIMOMLIB)/libLinux_DnsMastersOfSlaveZone.so --- NEW FILE: Linux_DnsMastersOfSlaveZoneResourceAccess.cpp --- /** * Linux_DnsMastersOfSlaveZoneResourceAccess.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_DnsMastersOfSlaveZoneResourceAccess.h" namespace genProvider { //Linux_DnsMastersOfSlaveZoneResourceAccess::Linux_DnsMastersOfSlaveZoneResourceAccess(); Linux_DnsMastersOfSlaveZoneResourceAccess::~Linux_DnsMastersOfSlaveZoneResourceAccess() { }; /* intrinsic methods */ /* void Linux_DnsMastersOfSlaveZoneResourceAccess::enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsMastersOfSlaveZoneInstanceNameEnumeration& instnames){ int numInstanceNames=1; for(int i=0;i<numInstanceNames;i++){ //place here the code retrieving your instanceName Linux_DnsMastersOfSlaveZoneInstanceName instanceName; } } */ /* void Linux_DnsMastersOfSlaveZoneResourceAccess::enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsMastersOfSlaveZoneManualInstanceEnumeration& instances){}; */ /* Linux_DnsMastersOfSlaveZoneManualInstance Linux_DnsMastersOfSlaveZoneResourceAccess::getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsMastersOfSlaveZoneInstanceName&){ Linux_DnsMastersOfSlaveZoneManualInstance instance; } */ /* void Linux_DnsMastersOfSlaveZoneResourceAccess::setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsMastersOfSlaveZoneManualInstance&){}; */ /* void Linux_DnsMastersOfSlaveZoneResourceAccess::createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMastersOfSlaveZoneManualInstance&){}; */ /* void Linux_DnsMastersOfSlaveZoneResourceAccess::deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMastersOfSlaveZoneInstanceName&){}; */ /* Association Interface */ void Linux_DnsMastersOfSlaveZoneResourceAccess::referencesElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsIPAddressInstanceName& sourceInst, Linux_DnsMastersOfSlaveZoneManualInstanceEnumeration& instEnum) { DNSZONE *zones = getZones(); DNSZONE *all_zones = zones; for (;zones && zones->zoneName; zones++) { if ( strcmp( zones->zoneType, "slave") ) continue; ZONEOPTS *zopts = findOptsInZone(zones,"masters"); if (zopts && zopts->key && zopts->value ) { DnsArray iplist = DnsArray(zopts->value); DnsArrayConstIterator iter; for ( iter = iplist.begin(); iter != iplist.end(); ++iter ) { if ( strcmp((*iter).c_str(), sourceInst.getIPAddress() ) != 0 ) continue; Linux_DnsSlaveZoneInstanceName zoneInstName; zoneInstName.setName( zones->zoneName ); Linux_DnsMastersOfSlaveZoneManualInstance manualInstance; Linux_DnsMastersOfSlaveZoneInstanceName instanceName; instanceName.setNamespace( nsp ); instanceName.setElement( zoneInstName ); instanceName.setSetting( sourceInst); manualInstance.setInstanceName( instanceName ); instEnum.addElement( manualInstance ); } } } freeZones( all_zones ); }; void Linux_DnsMastersOfSlaveZoneResourceAccess::referencesSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsSlaveZoneInstanceName& sourceInst, Linux_DnsMastersOfSlaveZoneManualInstanceEnumeration& instEnum) { DNSZONE *zones = getZones(); DNSZONE *all_zones = zones; for (;zones && zones->zoneName; zones++) { if ( strcmp( zones->zoneName, sourceInst.getName() ) ) continue; ZONEOPTS *zopts = findOptsInZone(zones,"masters"); if (zopts && zopts->key && zopts->value ) { DnsArray iplist = DnsArray(zopts->value); DnsArrayConstIterator iter; for ( iter = iplist.begin(); iter != iplist.end(); ++iter ) { Linux_DnsIPAddressInstanceName ipInstanceName; ipInstanceName.setNamespace(nsp); ipInstanceName.setZoneName(zones->zoneName); ipInstanceName.setIPAddress( (*iter).c_str() ); Linux_DnsMastersOfSlaveZoneManualInstance manualInstance; Linux_DnsMastersOfSlaveZoneInstanceName instanceName; instanceName.setNamespace( nsp ); instanceName.setElement( sourceInst ); instanceName.setSetting( ipInstanceName ); manualInstance.setInstanceName( instanceName ); instEnum.addElement( manualInstance ); } } } freeZones( all_zones ); }; void Linux_DnsMastersOfSlaveZoneResourceAccess::associatorsElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsIPAddressInstanceName& sourceInst, Linux_DnsSlaveZoneInstanceEnumeration& instEnum) { DNSZONE *zones = getZones(); DNSZONE *all_zones = zones; for (;zones && zones->zoneName; zones++) { if ( strcmp( zones->zoneType, "slave" ) ) continue; ZONEOPTS *zopts = findOptsInZone(zones,"masters"); if (zopts && zopts->key && zopts->value ) { DnsArray iplist = DnsArray(zopts->value); DnsArrayConstIterator iter; for ( iter = iplist.begin(); iter != iplist.end(); ++iter ) { if ( strcmp((*iter).c_str(), sourceInst.getIPAddress() ) != 0 ) continue; Linux_DnsSlaveZoneInstanceName zoneInstName; zoneInstName.setName( zones->zoneName ); Linux_DnsSlaveZoneInstance zoneInst; zoneInst.setInstanceName( zoneInstName ); zoneInst.setType(DNS_ZONETYPE_SLAVE); zoneInst.setResourceRecordFile(zones->zoneFileName); instEnum.addElement( zoneInst ); } } } freeZones( all_zones ); }; void Linux_DnsMastersOfSlaveZoneResourceAccess::associatorsSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsSlaveZoneInstanceName& sourceInst, Linux_DnsIPAddressInstanceEnumeration& instEnum) { DNSZONE *zones = getZones(); DNSZONE *all_zones = zones; while (zones && zones->zoneName) { if ( strcmp( zones->zoneName, sourceInst.getName() ) != 0) continue; ZONEOPTS *zopts = findOptsInZone(zones,"masters"); if (zopts && zopts->key && zopts->value ) { DnsArray iplist = DnsArray(zopts->value); DnsArrayConstIterator iter; for ( iter = iplist.begin(); iter != iplist.end(); ++iter ) { Linux_DnsIPAddressInstanceName ipInstanceName; ipInstanceName.setNamespace(nsp); ipInstanceName.setZoneName(zones->zoneName); ipInstanceName.setIPAddress( (*iter).c_str() ); Linux_DnsIPAddressInstance ipInstance; instEnum.addElement( ipInstance ); } } zones++; } freeZones( all_zones ); }; /* extrinsic methods */ } --- NEW FILE: Linux_DnsMastersOfSlaveZoneFactory.cpp --- /** * Linux_DnsMastersOfSlaveZoneFactory.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_DnsMastersOfSlaveZoneFactory.h" #include "Linux_DnsMastersOfSlaveZoneResourceAccess.h" namespace genProvider{ Linux_DnsMastersOfSlaveZoneInterface* Linux_DnsMastersOfSlaveZoneFactory::getImplementation(){ return (new Linux_DnsMastersOfSlaveZoneResourceAccess()); }; } --- NEW FILE: CmpiLinux_DnsMastersOfSlaveZoneProvider.h --- /** * CmpiLinux_DnsMastersOfSlaveZoneProvider.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_DnsMastersOfSlaveZoneProvider_h #define CmpiLinux_DnsMastersOfSlaveZoneProvider_h #include "CmpiInstanceMI.h" #include "CmpiMethodMI.h" #include "Linux_DnsMastersOfSlaveZoneFactory.h" #include "CmpiAssociationMI.h" namespace genProvider{ class CmpiLinux_DnsMastersOfSlaveZoneProvider : public CmpiInstanceMI, public CmpiMethodMI, public CmpiAssociationMI{ private: Linux_DnsMastersOfSlaveZoneInterface* interfaceP; const static char * shadowNameSpaceP; CmpiBroker cppBroker; void completeInstance ( const Linux_DnsMastersOfSlaveZoneInstanceName& intanceNameP, CmpiInstance& target, const CmpiContext& ctx); void copyShadowData ( const CmpiInstance* source, CmpiInstance* target); CmpiInstance* getShadowInstance ( const CmpiInstance& original, const Linux_DnsMastersOfSlaveZoneInstanceName& intanceName); void removeDanglingShadowInstances ( const Linux_DnsMastersOfSlaveZoneInstanceNameEnumeration& dinInsNames); public: CmpiLinux_DnsMastersOfSlaveZoneProvider ( const CmpiBroker &mbp, const CmpiContext& ctx); ~CmpiLinux_DnsMastersOfSlaveZoneProvider (); 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_DnsMastersOfSlaveZoneRepositoryInstance.cpp --- /** * Linux_DnsMastersOfSlaveZoneRepositoryInstance.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_DnsMastersOfSlaveZoneRepositoryInstance.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //Linux_DnsMastersOfSlaveZoneRepositoryInstance //********************************************************* //empty constructor Linux_DnsMastersOfSlaveZoneRepositoryInstance:: Linux_DnsMastersOfSlaveZoneRepositoryInstance(){ init(); }; //copy constructor Linux_DnsMastersOfSlaveZoneRepositoryInstance:: Linux_DnsMastersOfSlaveZoneRepositoryInstance (const Linux_DnsMastersOfSlaveZoneRepositoryInstance& original){ init(original); }; //constructor using CmpiInstance Linux_DnsMastersOfSlaveZoneRepositoryInstance:: Linux_DnsMastersOfSlaveZoneRepositoryInstance (const CmpiInstance& inst, const char* instanceNamespace){ CmpiData cmpiData; init(); CmpiObjectPath cop=inst.getObjectPath(); cop.setNameSpace(instanceNamespace); setInstanceName(Linux_DnsMastersOfSlaveZoneInstanceName(cop)); } //Destructor Linux_DnsMastersOfSlaveZoneRepositoryInstance:: ~Linux_DnsMastersOfSlaveZoneRepositoryInstance(){ reset(); }; //copy operator Linux_DnsMastersOfSlaveZoneRepositoryInstance& Linux_DnsMastersOfSlaveZoneRepositoryInstance::operator= (const Linux_DnsMastersOfSlaveZoneRepositoryInstance& original){ init(original); return *this; }; //converts to CmpiInstance CmpiInstance Linux_DnsMastersOfSlaveZoneRepositoryInstance:: 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_DnsMastersOfSlaveZoneRepositoryInstance:: isInstanceNameSet() const{ return isSet.instanceName; } const Linux_DnsMastersOfSlaveZoneInstanceName& Linux_DnsMastersOfSlaveZoneRepositoryInstance::getInstanceName() const{ if(!isSet.instanceName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "InstanceName not set in Linux_DnsMastersOfSlaveZone instance"); return m_instanceName; } void Linux_DnsMastersOfSlaveZoneRepositoryInstance::setInstanceName( const Linux_DnsMastersOfSlaveZoneInstanceName& val){ m_instanceName = val; isSet.instanceName=1; } //set isSet attributes to FALSE void Linux_DnsMastersOfSlaveZoneRepositoryInstance::init(){ isSet.instanceName=0; }; //copies another instance properties in this void Linux_DnsMastersOfSlaveZoneRepositoryInstance::init (const Linux_DnsMastersOfSlaveZoneRepositoryInstance& original){ init(); if(original.isInstanceNameSet()){ setInstanceName(original.getInstanceName()); } } //reset the instance data void Linux_DnsMastersOfSlaveZoneRepositoryInstance::reset(){ }; //********************************************************* //Linux_DnsMastersOfSlaveZoneRepositoryInstanceEnumerationElement //********************************************************* Linux_DnsMastersOfSlaveZoneRepositoryInstanceEnumerationElement:: Linux_DnsMastersOfSlaveZoneRepositoryInstanceEnumerationElement(){ m_elementP=0; m_nextP=0; }; Linux_DnsMastersOfSlaveZoneRepositoryInstanceEnumerationElement:: ~Linux_DnsMastersOfSlaveZoneRepositoryInstanceEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //Linux_DnsMastersOfSlaveZoneRepositoryInstanceNameEnumeration //********************************************************* Linux_DnsMastersOfSlaveZoneRepositoryInstanceEnumeration:: Linux_DnsMastersOfSlaveZoneRepositoryInstanceEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; Linux_DnsMastersOfSlaveZoneRepositoryInstanceEnumeration:: Linux_DnsMastersOfSlaveZoneRepositoryInstanceEnumeration( const Linux_DnsMastersOfSlaveZoneRepositoryInstanceEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; Linux_DnsMastersOfSlaveZoneRepositoryInstanceEnumeration:: ~Linux_DnsMastersOfSlaveZoneRepositoryInstanceEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void Linux_DnsMastersOfSlaveZoneRepositoryInstanceEnumeration::reset(){ currentElementP=firstElementP; }; bool Linux_DnsMastersOfSlaveZoneRepositoryInstanceEnumeration::hasNext() const{ return (currentElementP!=0); }; int Linux_DnsMastersOfSlaveZoneRepositoryInstanceEnumeration::getSize() const{ int size=0; Linux_DnsMastersOfSlaveZoneRepositoryInstanceEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const Linux_DnsMastersOfSlaveZoneRepositoryInstance& Linux_DnsMastersOfSlaveZoneRepositoryInstanceEnumeration::getElement(int pos) const{ Linux_DnsMastersOfSlaveZoneRepositoryInstanceEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const Linux_DnsMastersOfSlaveZoneRepositoryInstance& Linux_DnsMastersOfSlaveZoneRepositoryInstanceEnumeration::getNext() { Linux_DnsMastersOfSlaveZoneRepositoryInstanceEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void Linux_DnsMastersOfSlaveZoneRepositoryInstanceEnumeration::addElement (const Linux_DnsMastersOfSlaveZoneRepositoryInstance& elementP){ if(firstElementP==0){ firstElementP=new Linux_DnsMastersOfSlaveZoneRepositoryInstanceEnumerationElement(); firstElementP->m_elementP=new Linux_DnsMastersOfSlaveZoneRepositoryInstance(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new Linux_DnsMastersOfSlaveZoneRepositoryInstanceEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new Linux_DnsMastersOfSlaveZoneRepositoryInstance(elementP); } }; } --- NEW FILE: Linux_DnsMastersOfSlaveZoneResourceAccess.h --- /** * Linux_DnsMastersOfSlaveZoneResourceAccess.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_DnsMastersOfSlaveZoneResourceAccess_h #define Linux_DnsMastersOfSlaveZoneResourceAccess_h #include "Linux_DnsMastersOfSlaveZoneInstanceName.h" #include "Linux_DnsMastersOfSlaveZoneManualInstance.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiDateTime.h" #include "CmpiBroker.h" #include "Linux_DnsSlaveZoneInstance.h" #include "Linux_DnsIPAddressInstance.h" #include "Linux_DnsSlaveZoneExternal.h" #include "Linux_DnsIPAddressExternal.h" #include "Linux_DnsMastersOfSlaveZoneDefaultImplementation.h" #include <string> #include <list> #include "dnssupport.h" #include "defaultvalues.h" #include "DnsArray.h" #include "DnsValueMap.h" namespace genProvider { class Linux_DnsMastersOfSlaveZoneResourceAccess: public Linux_DnsMastersOfSlaveZoneDefaultImplementation { public: /*Linux_DnsMastersOfSlaveZoneResourceAccess();*/ virtual ~Linux_DnsMastersOfSlaveZoneResourceAccess() ; /* intrinsic methods */ /*virtual void enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsMastersOfSlaveZoneInstanceNameEnumeration& instnames);*/ /*virtual void enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsMastersOfSlaveZoneManualInstanceEnumeration& instances);*/ /*virtual Linux_DnsMastersOfSlaveZoneManualInstance getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsMastersOfSlaveZoneInstanceName&);*/ /*virtual void setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsMastersOfSlaveZoneManualInstance&);*/ /*virtual void createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMastersOfSlaveZoneManualInstance&);*/ /*virtual void deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMastersOfSlaveZoneInstanceName&);*/ /* Association Interface */ virtual void referencesElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsIPAddressInstanceName& sourceInst, Linux_DnsMastersOfSlaveZoneManualInstanceEnumeration& instances); virtual void referencesSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsSlaveZoneInstanceName& sourceInst, Linux_DnsMastersOfSlaveZoneManualInstanceEnumeration& instances); virtual void associatorsElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsIPAddressInstanceName& sourceInst, Linux_DnsSlaveZoneInstanceEnumeration& instances); virtual void associatorsSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsSlaveZoneInstanceName& sourceInst, Linux_DnsIPAddressInstanceEnumeration& instances); /* extrinsic methods */ }; } #endif --- NEW FILE: Linux_DnsMastersOfSlaveZoneRepositoryExternal.h --- /** * Linux_DnsMastersOfSlaveZoneRepositoryExternal.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_DnsMastersOfSlaveZoneRepositoryExternal_h #define Linux_DnsMastersOfSlaveZoneRepositoryExternal_h #include "Linux_DnsMastersOfSlaveZoneInstanceName.h" #include "Linux_DnsMastersOfSlaveZoneRepositoryInstance.h" #include "CmpiBroker.h" namespace genProvider { class Linux_DnsMastersOfSlaveZoneRepositoryExternal { public: Linux_DnsMastersOfSlaveZoneRepositoryExternal( const CmpiBroker& brkr, const CmpiContext& ctx); virtual ~Linux_DnsMastersOfSlaveZoneRepositoryExternal(); virtual void enumInstanceNames( Linux_DnsMastersOfSlaveZoneInstanceNameEnumeration&); virtual void enumInstances( const char* *properties, Linux_DnsMastersOfSlaveZoneRepositoryInstanceEnumeration&); virtual Linux_DnsMastersOfSlaveZoneRepositoryInstance getInstance( const char* *properties, const Linux_DnsMastersOfSlaveZoneInstanceName&); virtual void setInstance( const char* *properties, const Linux_DnsMastersOfSlaveZoneRepositoryInstance&); virtual void createInstance( const Linux_DnsMastersOfSlaveZoneRepositoryInstance&); virtual void deleteInstance( const Linux_DnsMastersOfSlaveZoneInstanceName&); private: CmpiBroker broker; CmpiContext context; const static char *nsp; }; } #endif --- NEW FILE: Linux_DnsMastersOfSlaveZoneRepositoryExternal.cpp --- /** * Linux_DnsMastersOfSlaveZoneRepositoryExternal.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_DnsMastersOfSlaveZoneRepositoryExternal.h" namespace genProvider{ Linux_DnsMastersOfSlaveZoneRepositoryExternal::Linux_DnsMastersOfSlaveZoneRepositoryExternal( const CmpiBroker& brkr, const CmpiContext& ctx ) : broker(brkr), context(ctx) {}; const char * Linux_DnsMastersOfSlaveZoneRepositoryExternal:: nsp="IBMShadow/cimv2"; Linux_DnsMastersOfSlaveZoneRepositoryExternal:: ~Linux_DnsMastersOfSlaveZoneRepositoryExternal(){}; void Linux_DnsMastersOfSlaveZoneRepositoryExternal::enumInstanceNames( Linux_DnsMastersOfSlaveZoneInstanceNameEnumeration& instnames) { CmpiObjectPath op(nsp,"Linux_DnsMastersOfSlaveZone"); CmpiEnumeration en=broker.enumInstanceNames(context,op); while(en.hasNext()) { CmpiObjectPath opi = en.getNext(); Linux_DnsMastersOfSlaveZoneInstanceName iname(opi); instnames.addElement(iname); } }; void Linux_DnsMastersOfSlaveZoneRepositoryExternal::enumInstances( const char* *properties, Linux_DnsMastersOfSlaveZoneRepositoryInstanceEnumeration& instances) { CmpiObjectPath op(nsp,"Linux_DnsMastersOfSlaveZone"); CmpiEnumeration en=broker.enumInstances(context,op,properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); Linux_DnsMastersOfSlaveZoneRepositoryInstance instance(inst,nsp); instances.addElement(instance); } }; Linux_DnsMastersOfSlaveZoneRepositoryInstance Linux_DnsMastersOfSlaveZoneRepositoryExternal::getInstance( const char* *properties, const Linux_DnsMastersOfSlaveZoneInstanceName& instanceName) { CmpiObjectPath op=instanceName.getObjectPath(); op.setNameSpace(nsp); CmpiInstance inst=broker.getInstance(context,op,properties); return Linux_DnsMastersOfSlaveZoneRepositoryInstance(inst,nsp); } void Linux_DnsMastersOfSlaveZoneRepositoryExternal::setInstance( const char* *properties, const Linux_DnsMastersOfSlaveZoneRepositoryInstance& instance){ //make a copy of the given instance and set it to the right nameSpace Linux_DnsMastersOfSlaveZoneInstanceName instanceName(instance.getInstanceName()); instanceName.setNamespace(nsp,1); Linux_DnsMastersOfSlaveZoneRepositoryInstance copiedInstance(instance); copiedInstance.setInstanceName(instanceName); CmpiObjectPath op=instanceName.getObjectPath(); CmpiInstance inst=copiedInstance.getCmpiInstance(); broker.setInstance(context,op,inst,properties); } void Linux_DnsMastersOfSlaveZoneRepositoryExternal::createInstance( const Linux_DnsMastersOfSlaveZoneRepositoryInstance& instance){ //make a copy of the given instance and set it to the right nameSpace Linux_DnsMastersOfSlaveZoneInstanceName instanceName(instance.getInstanceName()); instanceName.setNamespace(nsp,1); Linux_DnsMastersOfSlaveZoneRepositoryInstance copiedInstance(instance); copiedInstance.setInstanceName(instanceName); CmpiObjectPath op=instanceName.getObjectPath(); CmpiInstance inst=copiedInstance.getCmpiInstance(); broker.createInstance(context,op,inst); } void Linux_DnsMastersOfSlaveZoneRepositoryExternal::deleteInstance( const Linux_DnsMastersOfSlaveZoneInstanceName& instanceName){ CmpiObjectPath op=instanceName.getObjectPath(); op.setNameSpace(nsp); broker.deleteInstance(context,op); } } --- NEW FILE: Linux_DnsMastersOfSlaveZoneDefaultImplementation.cpp --- /** * Linux_DnsMastersOfSlaveZoneDefaultImplementation.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... [truncated message content] |
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] |
Update of /cvsroot/sblim/cmpi-dns/provider/Linux_DnsHintZone In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20455/provider/Linux_DnsHintZone Added Files: makefile Linux_DnsHintZoneManualInstance.cpp Linux_DnsHintZoneInstance.h Linux_DnsHintZoneRepositoryInstance.h Linux_DnsHintZoneFactory.h Linux_DnsHintZoneDefaultImplementation.cpp Linux_DnsHintZoneRepositoryExternal.h Linux_DnsHintZoneResourceAccess.cpp CmpiLinux_DnsHintZoneProvider.cpp setting.provider Linux_DnsHintZoneRepositoryExternal.cpp Linux_DnsHintZoneInstance.cpp Linux_DnsHintZoneInterface.h Linux_DnsHintZoneInstanceName.cpp CmpiLinux_DnsHintZoneProvider.h Linux_DnsHintZoneManualInstance.h Linux_DnsHintZoneExternal.h Linux_DnsHintZoneDefaultImplementation.h Linux_DnsHintZoneInstanceName.h Linux_DnsHintZoneFactory.cpp Linux_DnsHintZoneFakeFactory.cpp Linux_DnsHintZoneResourceAccess.h Linux_DnsHintZoneExternal.cpp Linux_DnsHintZoneRepositoryInstance.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_DnsHintZoneExternal.h --- /** * Linux_DnsHintZoneExternal.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_DnsHintZoneExternal_h #define Linux_DnsHintZoneExternal_h #include "Linux_DnsHintZoneInstance.h" #include "CmpiBroker.h" namespace genProvider { class Linux_DnsHintZoneExternal { public: Linux_DnsHintZoneExternal( const CmpiBroker& brkr, const CmpiContext& ctx); virtual ~Linux_DnsHintZoneExternal(); virtual void enumInstanceNames( const char *nsp, Linux_DnsHintZoneInstanceNameEnumeration&); virtual void enumInstances( const char *nsp, const char* *properties, Linux_DnsHintZoneInstanceEnumeration&); virtual Linux_DnsHintZoneInstance getInstance( const char* *properties, const Linux_DnsHintZoneInstanceName&); virtual void setInstance( const char* *properties, const Linux_DnsHintZoneInstance&); virtual void createInstance( const Linux_DnsHintZoneInstance&); virtual void deleteInstance( const Linux_DnsHintZoneInstanceName&); private: CmpiBroker broker; CmpiContext context; }; } #endif --- NEW FILE: Linux_DnsHintZoneInstance.cpp --- /** * Linux_DnsHintZoneInstance.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_DnsHintZoneInstance.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //Linux_DnsHintZoneInstance //********************************************************* //empty constructor Linux_DnsHintZoneInstance:: Linux_DnsHintZoneInstance(){ init(); }; //copy constructor Linux_DnsHintZoneInstance:: Linux_DnsHintZoneInstance (const Linux_DnsHintZoneInstance& original){ init(original); }; //constructor using CmpiInstance Linux_DnsHintZoneInstance:: Linux_DnsHintZoneInstance (const CmpiInstance& inst, const char* instanceNamespace){ CmpiData cmpiData; init(); CmpiObjectPath cop=inst.getObjectPath(); cop.setNameSpace(instanceNamespace); setInstanceName(Linux_DnsHintZoneInstanceName(cop)); cmpiData = inst.getProperty("Caption"); if(!cmpiData.isNullValue()){ CmpiString Caption = cmpiData; setCaption(Caption.charPtr()); } cmpiData = inst.getProperty("Description"); if(!cmpiData.isNullValue()){ CmpiString Description = cmpiData; setDescription(Description.charPtr()); } cmpiData = inst.getProperty("ElementName"); if(!cmpiData.isNullValue()){ CmpiString ElementName = cmpiData; setElementName(ElementName.charPtr()); } cmpiData = inst.getProperty("Enabled"); if(!cmpiData.isNullValue()){ CMPIBoolean Enabled = cmpiData; setEnabled(Enabled); } cmpiData = inst.getProperty("ResourceRecordFile"); if(!cmpiData.isNullValue()){ CmpiString ResourceRecordFile = cmpiData; setResourceRecordFile(ResourceRecordFile.charPtr()); } cmpiData = inst.getProperty("SettingID"); if(!cmpiData.isNullValue()){ CmpiString SettingID = cmpiData; setSettingID(SettingID.charPtr()); } cmpiData = inst.getProperty("Type"); if(!cmpiData.isNullValue()){ CMPIUint16 Type = cmpiData; setType(Type); } } //Destructor Linux_DnsHintZoneInstance:: ~Linux_DnsHintZoneInstance(){ reset(); }; //copy operator Linux_DnsHintZoneInstance& Linux_DnsHintZoneInstance::operator= (const Linux_DnsHintZoneInstance& original){ init(original); return *this; }; //converts to CmpiInstance CmpiInstance Linux_DnsHintZoneInstance:: getCmpiInstance(const char** properties) const{ CmpiObjectPath objectPath=getInstanceName().getObjectPath(); CmpiInstance cmpiInstance(objectPath); getInstanceName().fillKeys(cmpiInstance); if (properties) { cmpiInstance.setPropertyFilter(properties,0); } if(isSet.Caption){ cmpiInstance.setProperty("Caption",CmpiData(m_Caption)); } if(isSet.Description){ cmpiInstance.setProperty("Description",CmpiData(m_Description)); } if(isSet.ElementName){ cmpiInstance.setProperty("ElementName",CmpiData(m_ElementName)); } if(isSet.Enabled){ cmpiInstance.setProperty("Enabled",CmpiBooleanData(m_Enabled)); } if(isSet.ResourceRecordFile){ cmpiInstance.setProperty("ResourceRecordFile",CmpiData(m_ResourceRecordFile)); } if(isSet.SettingID){ cmpiInstance.setProperty("SettingID",CmpiData(m_SettingID)); } if(isSet.Type){ cmpiInstance.setProperty("Type",CmpiData(m_Type)); } return cmpiInstance; } //InstanceName related methods unsigned int Linux_DnsHintZoneInstance:: isInstanceNameSet() const{ return isSet.instanceName; } const Linux_DnsHintZoneInstanceName& Linux_DnsHintZoneInstance::getInstanceName() const{ if(!isSet.instanceName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "InstanceName not set in Linux_DnsHintZone instance"); return m_instanceName; } void Linux_DnsHintZoneInstance::setInstanceName( const Linux_DnsHintZoneInstanceName& val){ m_instanceName = val; isSet.instanceName=1; } //Caption related methods unsigned int Linux_DnsHintZoneInstance::isCaptionSet() const{ return isSet.Caption; } void Linux_DnsHintZoneInstance:: setCaption(const char* val, int makeCopy){ if (isSet.Caption) { delete []m_Caption; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_Caption = tmpval; } else { m_Caption = val; } isSet.Caption=1; } const char* Linux_DnsHintZoneInstance:: getCaption() const{ if(!isSet.Caption) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Caption not set"); return m_Caption; } //Description related methods unsigned int Linux_DnsHintZoneInstance::isDescriptionSet() const{ return isSet.Description; } void Linux_DnsHintZoneInstance:: setDescription(const char* val, int makeCopy){ if (isSet.Description) { delete []m_Description; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_Description = tmpval; } else { m_Description = val; } isSet.Description=1; } const char* Linux_DnsHintZoneInstance:: getDescription() const{ if(!isSet.Description) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Description not set"); return m_Description; } //ElementName related methods unsigned int Linux_DnsHintZoneInstance::isElementNameSet() const{ return isSet.ElementName; } void Linux_DnsHintZoneInstance:: setElementName(const char* val, int makeCopy){ if (isSet.ElementName) { delete []m_ElementName; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_ElementName = tmpval; } else { m_ElementName = val; } isSet.ElementName=1; } const char* Linux_DnsHintZoneInstance:: getElementName() const{ if(!isSet.ElementName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "ElementName not set"); return m_ElementName; } //Enabled related methods unsigned int Linux_DnsHintZoneInstance::isEnabledSet() const{ return isSet.Enabled; } void Linux_DnsHintZoneInstance:: setEnabled(const CMPIBoolean val){ m_Enabled = val; isSet.Enabled=1; } const CMPIBoolean Linux_DnsHintZoneInstance:: getEnabled() const{ if(!isSet.Enabled) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Enabled not set"); return m_Enabled; } //ResourceRecordFile related methods unsigned int Linux_DnsHintZoneInstance::isResourceRecordFileSet() const{ return isSet.ResourceRecordFile; } void Linux_DnsHintZoneInstance:: setResourceRecordFile(const char* val, int makeCopy){ if (isSet.ResourceRecordFile) { delete []m_ResourceRecordFile; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_ResourceRecordFile = tmpval; } else { m_ResourceRecordFile = val; } isSet.ResourceRecordFile=1; } const char* Linux_DnsHintZoneInstance:: getResourceRecordFile() const{ if(!isSet.ResourceRecordFile) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "ResourceRecordFile not set"); return m_ResourceRecordFile; } //SettingID related methods unsigned int Linux_DnsHintZoneInstance::isSettingIDSet() const{ return isSet.SettingID; } void Linux_DnsHintZoneInstance:: setSettingID(const char* val, int makeCopy){ if (isSet.SettingID) { delete []m_SettingID; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_SettingID = tmpval; } else { m_SettingID = val; } isSet.SettingID=1; } const char* Linux_DnsHintZoneInstance:: getSettingID() const{ if(!isSet.SettingID) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "SettingID not set"); return m_SettingID; } //Type related methods unsigned int Linux_DnsHintZoneInstance::isTypeSet() const{ return isSet.Type; } void Linux_DnsHintZoneInstance:: setType(const CMPIUint16 val){ m_Type = val; isSet.Type=1; } const CMPIUint16 Linux_DnsHintZoneInstance:: getType() const{ if(!isSet.Type) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Type not set"); return m_Type; } //set isSet attributes to FALSE void Linux_DnsHintZoneInstance::init(){ isSet.instanceName=0; isSet.Caption=0; isSet.Description=0; isSet.ElementName=0; isSet.Enabled=0; isSet.ResourceRecordFile=0; isSet.SettingID=0; isSet.Type=0; }; //copies another instance properties in this void Linux_DnsHintZoneInstance::init (const Linux_DnsHintZoneInstance& original){ init(); if(original.isInstanceNameSet()){ setInstanceName(original.getInstanceName()); } if(original.isCaptionSet()){ const char* CaptionOriginal=original.getCaption(); setCaption(CaptionOriginal, 1); } if(original.isDescriptionSet()){ const char* DescriptionOriginal=original.getDescription(); setDescription(DescriptionOriginal, 1); } if(original.isElementNameSet()){ const char* ElementNameOriginal=original.getElementName(); setElementName(ElementNameOriginal, 1); } if(original.isEnabledSet()){ const CMPIBoolean EnabledOriginal=original.getEnabled(); setEnabled(EnabledOriginal); } if(original.isResourceRecordFileSet()){ const char* ResourceRecordFileOriginal=original.getResourceRecordFile(); setResourceRecordFile(ResourceRecordFileOriginal, 1); } if(original.isSettingIDSet()){ const char* SettingIDOriginal=original.getSettingID(); setSettingID(SettingIDOriginal, 1); } if(original.isTypeSet()){ const CMPIUint16 TypeOriginal=original.getType(); setType(TypeOriginal); } } //reset the instance data void Linux_DnsHintZoneInstance::reset(){ if (isSet.Caption) delete(m_Caption); if (isSet.Description) delete(m_Description); if (isSet.ElementName) delete(m_ElementName); if (isSet.ResourceRecordFile) delete(m_ResourceRecordFile); if (isSet.SettingID) delete(m_SettingID); }; //********************************************************* //Linux_DnsHintZoneInstanceEnumerationElement //********************************************************* Linux_DnsHintZoneInstanceEnumerationElement:: Linux_DnsHintZoneInstanceEnumerationElement(){ m_elementP=0; m_nextP=0; }; Linux_DnsHintZoneInstanceEnumerationElement:: ~Linux_DnsHintZoneInstanceEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //Linux_DnsHintZoneInstanceNameEnumeration //********************************************************* Linux_DnsHintZoneInstanceEnumeration:: Linux_DnsHintZoneInstanceEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; Linux_DnsHintZoneInstanceEnumeration:: Linux_DnsHintZoneInstanceEnumeration( const Linux_DnsHintZoneInstanceEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; Linux_DnsHintZoneInstanceEnumeration:: ~Linux_DnsHintZoneInstanceEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void Linux_DnsHintZoneInstanceEnumeration::reset(){ currentElementP=firstElementP; }; bool Linux_DnsHintZoneInstanceEnumeration::hasNext() const{ return (currentElementP!=0); }; int Linux_DnsHintZoneInstanceEnumeration::getSize() const{ int size=0; Linux_DnsHintZoneInstanceEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const Linux_DnsHintZoneInstance& Linux_DnsHintZoneInstanceEnumeration::getElement(int pos) const{ Linux_DnsHintZoneInstanceEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const Linux_DnsHintZoneInstance& Linux_DnsHintZoneInstanceEnumeration::getNext() { Linux_DnsHintZoneInstanceEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void Linux_DnsHintZoneInstanceEnumeration::addElement (const Linux_DnsHintZoneInstance& elementP){ if(firstElementP==0){ firstElementP=new Linux_DnsHintZoneInstanceEnumerationElement(); firstElementP->m_elementP=new Linux_DnsHintZoneInstance(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new Linux_DnsHintZoneInstanceEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new Linux_DnsHintZoneInstance(elementP); } }; } --- NEW FILE: Linux_DnsHintZoneFakeFactory.cpp --- /** * Linux_DnsHintZoneFakeFactory.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_DnsHintZoneFactory.h" using namespace std; namespace genProvider{ Linux_DnsHintZoneInterface* Linux_DnsHintZoneFactory::getImplementation(){ cout<<"ERROR: incomplete support library is being used"<<endl; cout<<" in provider from class Linux_DnsHintZone"<<endl; cout<<" Use the link-install options for the makefile"<<endl; return 0; }; } --- NEW FILE: Linux_DnsHintZoneRepositoryInstance.cpp --- /** * Linux_DnsHintZoneRepositoryInstance.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_DnsHintZoneRepositoryInstance.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //Linux_DnsHintZoneRepositoryInstance //********************************************************* //empty constructor Linux_DnsHintZoneRepositoryInstance:: Linux_DnsHintZoneRepositoryInstance(){ init(); }; //copy constructor Linux_DnsHintZoneRepositoryInstance:: Linux_DnsHintZoneRepositoryInstance (const Linux_DnsHintZoneRepositoryInstance& original){ init(original); }; //constructor using CmpiInstance Linux_DnsHintZoneRepositoryInstance:: Linux_DnsHintZoneRepositoryInstance (const CmpiInstance& inst, const char* instanceNamespace){ CmpiData cmpiData; init(); CmpiObjectPath cop=inst.getObjectPath(); cop.setNameSpace(instanceNamespace); setInstanceName(Linux_DnsHintZoneInstanceName(cop)); } //Destructor Linux_DnsHintZoneRepositoryInstance:: ~Linux_DnsHintZoneRepositoryInstance(){ reset(); }; //copy operator Linux_DnsHintZoneRepositoryInstance& Linux_DnsHintZoneRepositoryInstance::operator= (const Linux_DnsHintZoneRepositoryInstance& original){ init(original); return *this; }; //converts to CmpiInstance CmpiInstance Linux_DnsHintZoneRepositoryInstance:: 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_DnsHintZoneRepositoryInstance:: isInstanceNameSet() const{ return isSet.instanceName; } const Linux_DnsHintZoneInstanceName& Linux_DnsHintZoneRepositoryInstance::getInstanceName() const{ if(!isSet.instanceName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "InstanceName not set in Linux_DnsHintZone instance"); return m_instanceName; } void Linux_DnsHintZoneRepositoryInstance::setInstanceName( const Linux_DnsHintZoneInstanceName& val){ m_instanceName = val; isSet.instanceName=1; } //set isSet attributes to FALSE void Linux_DnsHintZoneRepositoryInstance::init(){ isSet.instanceName=0; }; //copies another instance properties in this void Linux_DnsHintZoneRepositoryInstance::init (const Linux_DnsHintZoneRepositoryInstance& original){ init(); if(original.isInstanceNameSet()){ setInstanceName(original.getInstanceName()); } } //reset the instance data void Linux_DnsHintZoneRepositoryInstance::reset(){ }; //********************************************************* //Linux_DnsHintZoneRepositoryInstanceEnumerationElement //********************************************************* Linux_DnsHintZoneRepositoryInstanceEnumerationElement:: Linux_DnsHintZoneRepositoryInstanceEnumerationElement(){ m_elementP=0; m_nextP=0; }; Linux_DnsHintZoneRepositoryInstanceEnumerationElement:: ~Linux_DnsHintZoneRepositoryInstanceEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //Linux_DnsHintZoneRepositoryInstanceNameEnumeration //********************************************************* Linux_DnsHintZoneRepositoryInstanceEnumeration:: Linux_DnsHintZoneRepositoryInstanceEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; Linux_DnsHintZoneRepositoryInstanceEnumeration:: Linux_DnsHintZoneRepositoryInstanceEnumeration( const Linux_DnsHintZoneRepositoryInstanceEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; Linux_DnsHintZoneRepositoryInstanceEnumeration:: ~Linux_DnsHintZoneRepositoryInstanceEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void Linux_DnsHintZoneRepositoryInstanceEnumeration::reset(){ currentElementP=firstElementP; }; bool Linux_DnsHintZoneRepositoryInstanceEnumeration::hasNext() const{ return (currentElementP!=0); }; int Linux_DnsHintZoneRepositoryInstanceEnumeration::getSize() const{ int size=0; Linux_DnsHintZoneRepositoryInstanceEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const Linux_DnsHintZoneRepositoryInstance& Linux_DnsHintZoneRepositoryInstanceEnumeration::getElement(int pos) const{ Linux_DnsHintZoneRepositoryInstanceEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const Linux_DnsHintZoneRepositoryInstance& Linux_DnsHintZoneRepositoryInstanceEnumeration::getNext() { Linux_DnsHintZoneRepositoryInstanceEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void Linux_DnsHintZoneRepositoryInstanceEnumeration::addElement (const Linux_DnsHintZoneRepositoryInstance& elementP){ if(firstElementP==0){ firstElementP=new Linux_DnsHintZoneRepositoryInstanceEnumerationElement(); firstElementP->m_elementP=new Linux_DnsHintZoneRepositoryInstance(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new Linux_DnsHintZoneRepositoryInstanceEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new Linux_DnsHintZoneRepositoryInstance(elementP); } }; } --- NEW FILE: Linux_DnsHintZoneResourceAccess.cpp --- /** * Linux_DnsHintZoneResourceAccess.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 <string> #include <iostream> using namespace std; #include "Linux_DnsHintZoneResourceAccess.h" namespace genProvider { //------------------------------------------------------------------------------------ // Linux_DnsMasterZoneResourceAccess::setInstanceNameProperties() //------------------------------------------------------------------------------------ void Linux_DnsHintZoneResourceAccess::setInstanceNameProperties(const CmpiContext& ctx, const CmpiBroker& mbp, const char* nsp, DNSZONE * zone, Linux_DnsHintZoneInstanceName& anInstanceName) { cout << "--- setInstanceNameProperties() called" << endl; anInstanceName.setNamespace(nsp); anInstanceName.setName(zone->zoneName); cout << "--- setInstanceNameProperties() exited" << endl; } //------------------------------------------------------------------------------------ // Linux_DnsMasterZoneResourceAccess::setInstanceProperties() //------------------------------------------------------------------------------------ void Linux_DnsHintZoneResourceAccess::setInstanceProperties(const CmpiContext& ctx, const CmpiBroker& mbp, DNSZONE * zone, const Linux_DnsHintZoneInstanceName& anInstanceName, Linux_DnsHintZoneManualInstance& aManualInstance) { cout<<"--- setInstanceProperties() called"<<endl; aManualInstance.setInstanceName(anInstanceName); aManualInstance.setType(DNS_ZONETYPE_HINT); aManualInstance.setResourceRecordFile(zone->zoneFileName); cout << "--- setInstanceProperties() exited" << endl; } //Linux_DnsHintZoneResourceAccess::Linux_DnsHintZoneResourceAccess(); Linux_DnsHintZoneResourceAccess::~Linux_DnsHintZoneResourceAccess() { }; /* intrinsic methods */ void Linux_DnsHintZoneResourceAccess::enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsHintZoneInstanceNameEnumeration& instnames){ cout << "Linux_DnsHintZoneResourceAccess::enumInstanceNames()" << endl; DNSZONE * zones, *all_zones; cout << "--- enumInstanceNames() called" << endl; cout << "---- calling getZones() " << endl; zones = getZones(); //getZonesByType("hint"); all_zones = zones; if (zones) { for (; zones->zoneName != NULL ; zones++) { if ( strcmp(zones->zoneType, "hint") ) continue; Linux_DnsHintZoneInstanceName instanceName; cout << "--- Calling setInstanceNameProperties()" << endl; printf ("Zone Name is %s \n", zones->zoneName); setInstanceNameProperties(ctx, mbp, nsp, zones, instanceName); instnames.addElement(instanceName); cout << "--- Added to enumeration" << endl; } freeZones( all_zones ); cout << "--- enumInstanceNames () exited" << endl; } } void Linux_DnsHintZoneResourceAccess::enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsHintZoneManualInstanceEnumeration& instances){ cout << "Linux_DnsHintZoneResourceAccess::enumInstances()" << endl; cout << "--- enumInstances() called" << endl; DNSZONE * zones = NULL, *all_zones; cout << "---- calling getZones() " << endl; zones = getZones(); //getZonesByType("hint"); all_zones = zones; if (zones) { for (; zones->zoneName != NULL ; zones++) { if ( strcmp(zones->zoneType, "hint") ) continue; Linux_DnsHintZoneManualInstance instance; Linux_DnsHintZoneInstanceName instanceName; cout << "--- Calling setInstanceNameProperties() for zone" << endl; printf (" -----%s \n", zones->zoneName); setInstanceNameProperties(ctx, mbp, nsp, zones, instanceName); cout << "--- Calling setInstanceProperties()" << endl; setInstanceProperties(ctx, mbp, zones, instanceName, instance); instances.addElement(instance); cout << "--- Added to enumeration" << endl; } freeZones( all_zones ); } else { cout << "--- No Zones Found" << endl; } cout << "--- enumInstances() exited" << endl; } Linux_DnsHintZoneManualInstance Linux_DnsHintZoneResourceAccess::getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsHintZoneInstanceName& anInstanceName){ cout << "--- getInstance() called" << endl; DNSZONE * zones, *all_zones; Linux_DnsHintZoneManualInstance instance; cout << "---- calling getZones() " << endl; zones = getZones(); //getZonesByType("hint"); all_zones = zones; if (zones) { for (; zones->zoneName != NULL ; zones++) { if ( strcmp(zones->zoneType, "hint") ) continue; cout << "--- zones->zoneName is " << endl; printf ("%s \n", zones->zoneName); cout << "--- Name of Instance is " << endl; printf ("%s \n", anInstanceName.getName()); if ((strcmp(zones->zoneName, anInstanceName.getName())) == 0) { cout << "--- Calling setInstanceProperties()" << endl; setInstanceProperties(ctx, mbp, zones, anInstanceName, instance); cout << "--- getInstance() exited " << endl; return instance; } } // end for freeZones( all_zones ); } // end if } void Linux_DnsHintZoneResourceAccess::setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsHintZoneManualInstance& newInstance){ cout << "--- setInstance() called" << endl; DNSZONE *zones, *myZone; zones = getZones(); myZone = findZone(zones, newInstance.getInstanceName().getName()); if ( ! myZone ) throw CmpiStatus(CMPI_RC_ERR_NOT_FOUND,"Zone does not exist"); if ( strcmp(myZone->zoneType,"forward") != 0 ) throw CmpiStatus(CMPI_RC_ERR_NOT_FOUND,"Zone does not exist"); if ( newInstance.isResourceRecordFileSet() ) { free(myZone->zoneFileName); myZone->zoneFileName = strdup(newInstance.getResourceRecordFile()); } updateZones(zones); freeZones( zones ); }; void Linux_DnsHintZoneResourceAccess::createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsHintZoneManualInstance& aManualInstance){ cout << "--- createInstance() called" << endl; DNSZONE * newZone = NULL; Linux_DnsHintZoneInstanceName anInstanceName = aManualInstance.getInstanceName(); if (((anInstanceName.getName()) == NULL) || ((anInstanceName.getName()) == "" ) || ((anInstanceName.getName()) =="") ) { // throw exception that invalid key cout << "---- Zonename is invalid" << endl; throw CmpiStatus(CMPI_RC_ERR_INVALID_PARAMETER,"Zonename is invalid"); } DNSZONE * all_zones = getZones(); if ( findZone(all_zones,anInstanceName.getName()) ) { freeZones(all_zones); throw CmpiStatus(CMPI_RC_ERR_INVALID_PARAMETER,"The zone already exist"); } freeZones(all_zones); newZone = (DNSZONE *)calloc(1+1,sizeof(DNSZONE)); if (newZone) { newZone->zoneName = (char *)anInstanceName.getName(); newZone->zoneType = "hint"; cout << "---- newZone->zoneType is "<< newZone->zoneType << endl; if (aManualInstance.isResourceRecordFileSet()) { newZone->zoneFileName = strdup(aManualInstance.getResourceRecordFile()); } else { char * buffer; buffer = (char *)calloc((strlen(newZone->zoneType)+strlen(newZone->zoneName)+2),sizeof(char)); strcat(buffer, newZone->zoneType); strcat(buffer, "/"); strcat(buffer, newZone->zoneName); newZone->zoneFileName = buffer; } newZone->records = NULL; cout << "---- calling addZones() " << endl; DNSZONE * returnedZones = NULL; returnedZones = addZone(newZone, NULL); if (!returnedZones) { cout <<"---- addZone() failed " << endl; cout <<"---- createInstance Zone exited " << endl; throw CmpiStatus(CMPI_RC_ERROR,"addZone() failed"); } freeZones( returnedZones ); cout <<"---- createInstance Zone exited " << endl; } }; void Linux_DnsHintZoneResourceAccess::deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsHintZoneInstanceName& inst){ deleteZone( inst.getName() ); }; /* extrinsic methods */ /* virtual CMPIUint32 Linux_DnsHintZoneResourceAccess::ApplyIncrementalChangeToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsHintZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CMPIBoolean &ContinueOnError, int isContinueOnErrorPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent, char** &CanNotApply, CMPICount &CanNotApplySize) { }; */ /* virtual CMPIUint32 Linux_DnsHintZoneResourceAccess::ApplyIncrementalChangeToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsHintZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent) { }; */ /* virtual CMPIUint32 Linux_DnsHintZoneResourceAccess::ApplyToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsHintZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CMPIBoolean &ContinueOnError, int isContinueOnErrorPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, char** &CanNotApply, CMPICount &CanNotApplySize) { }; */ /* virtual CMPIUint32 Linux_DnsHintZoneResourceAccess::ApplyToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsHintZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent) { }; */ /* virtual CMPIUint32 Linux_DnsHintZoneResourceAccess::VerifyOKToApplyIncrementalChangeToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsHintZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent, char** &CanNotApply, CMPICount &CanNotApplySize) { }; */ /* virtual CMPIUint32 Linux_DnsHintZoneResourceAccess::VerifyOKToApplyIncrementalChangeToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsHintZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent) { }; */ /* virtual CMPIUint32 Linux_DnsHintZoneResourceAccess::VerifyOKToApplyToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsHintZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, char** &CanNotApply, CMPICount &CanNotApplySize) { }; */ /* virtual CMPIUint32 Linux_DnsHintZoneResourceAccess::VerifyOKToApplyToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsHintZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent) { }; */ CMPIUint32 Linux_DnsHintZoneResourceAccess::disable( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsHintZoneInstanceName& inst) { if ( inst.getName() == NULL ) return 3; disableZone( inst.getName() ); }; CMPIUint32 Linux_DnsHintZoneResourceAccess::enable( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsHintZoneInstanceName& inst) { if ( inst.getName() == NULL ) return 3; enableZone( inst.getName() ); }; } --- NEW FILE: CmpiLinux_DnsHintZoneProvider.cpp --- /** * CmpiLinux_DnsHintZoneProvider.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_DnsHintZoneProvider.h" #include "ArrayConverter.h" #include "Linux_DnsHintZoneManualInstance.h" #include "Linux_DnsHintZoneRepositoryInstance.h" #include <iostream> #include <strings.h> using namespace std; namespace genProvider { CmpiLinux_DnsHintZoneProvider:: CmpiLinux_DnsHintZoneProvider ( const CmpiBroker &mbp, const CmpiContext& ctx): CmpiBaseMI(mbp, ctx), CmpiInstanceMI(mbp,ctx), CmpiMethodMI(mbp,ctx), cppBroker(mbp) { interfaceP=Linux_DnsHintZoneFactory::getImplementation(); cout<<"Provider was constructed"<<endl; }; const char * CmpiLinux_DnsHintZoneProvider:: shadowNameSpaceP="IBMShadow/cimv2"; CmpiLinux_DnsHintZoneProvider:: ~CmpiLinux_DnsHintZoneProvider(){ delete interfaceP; }; int CmpiLinux_DnsHintZoneProvider::isUnloadable() const{ return 0; } /* -----------------------------------------------------------------------*/ /* Adding shadow properties */ /* -----------------------------------------------------------------------*/ void CmpiLinux_DnsHintZoneProvider::completeInstance( const Linux_DnsHintZoneInstanceName& instanceName, CmpiInstance& target, const CmpiContext& ctx){ Linux_DnsHintZoneInstanceName 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_DnsHintZoneProvider::copyShadowData ( const CmpiInstance* source, CmpiInstance* target){ }; /* -----------------------------------------------------------------------*/ /* Extracting shadow instance */ /* -----------------------------------------------------------------------*/ CmpiInstance* CmpiLinux_DnsHintZoneProvider:: getShadowInstance (const CmpiInstance& original, const Linux_DnsHintZoneInstanceName& instanceName){ Linux_DnsHintZoneInstanceName 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_DnsHintZoneProvider::removeDanglingShadowInstances ( const Linux_DnsHintZoneInstanceNameEnumeration& dinInsNames){ //TODO: enumerate shadow instance names and remove those not included // in dinInsNames }; /* -----------------------------------------------------------------------*/ /* Provider Factory */ /* -----------------------------------------------------------------------*/ CMProviderBase(CmpiLinux_DnsHintZoneProvider); CMInstanceMIFactory( CmpiLinux_DnsHintZoneProvider, CmpiLinux_DnsHintZoneProvider); CMMethodMIFactory( CmpiLinux_DnsHintZoneProvider, CmpiLinux_DnsHintZoneProvider); /* -----------------------------------------------------------------------*/ /* Instance Provider Interface */ /* -----------------------------------------------------------------------*/ //enumInstanceNames CmpiStatus CmpiLinux_DnsHintZoneProvider::enumInstanceNames ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop){ cout<<"enumerating instanceNames"<<endl; CmpiString nameSpace=cop.getNameSpace(); const char* nameSpaceP=nameSpace.charPtr(); Linux_DnsHintZoneInstanceNameEnumeration enumeration; interfaceP->enumInstanceNames(ctx, cppBroker, nameSpaceP, enumeration); while ( enumeration.hasNext() ){ const Linux_DnsHintZoneInstanceName& 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_DnsHintZoneProvider::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_DnsHintZoneManualInstanceEnumeration enumeration; interfaceP->enumInstances(ctx, cppBroker, nameSpaceP, properties, enumeration); cout<<"enumerated"<<endl; while ( enumeration.hasNext() ){ const Linux_DnsHintZoneManualInstance& instance= enumeration.getNext(); cout<<"enumerating getNext"<<endl; CmpiInstance cmpiInstance=instance.getCmpiInstance(properties); cout<<"transformed"<<endl; //add the static data completeInstance(instance.getInstanceName(),cmpiInstance,ctx); rslt.returnData(cmpiInstance); } rslt.returnDone(); return CmpiStatus(CMPI_RC_OK); }; //getInstance CmpiStatus CmpiLinux_DnsHintZoneProvider::getInstance ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop, const char* *properties){ //covert to instanceName Linux_DnsHintZoneInstanceName instanceName(cop); //get instance for instanceName Linux_DnsHintZoneManualInstance instance; instance=interfaceP->getInstance(ctx, cppBroker, properties, instanceName); //we convert the instance in a cmpiInstance CmpiInstance cmpiInstance=instance.getCmpiInstance(properties); //add the static data completeInstance(instance.getInstanceName(), cmpiInstance, ctx); rslt.returnData(cmpiInstance); rslt.returnDone(); return CmpiStatus(CMPI_RC_OK); }; CmpiStatus CmpiLinux_DnsHintZoneProvider::createInstance ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop,const CmpiInstance& inst){ Linux_DnsHintZoneManualInstance instance ( inst,cop.getNameSpace().charPtr()); //REPOSITORY DATA CmpiInstance* backupShadowInstance=0; CmpiInstance shadowInstance= Linux_DnsHintZoneRepositoryInstance(inst,shadowNameSpaceP) .getCmpiInstance(0); //We keep a backup of the existing data for recovering previous //state if the resource access raise an exception CmpiObjectPath shadowOp=shadowInstance.getObjectPath(); try{ backupShadowInstance=new CmpiInstance( cppBroker.getInstance (ctx, shadowOp,0)); //if the shadow instance exist we delete it cppBroker.deleteInstance(ctx, shadowOp); }catch(CmpiStatus& rc){}; cppBroker.createInstance(ctx, shadowOp,shadowInstance); //RESOURCE ACCESS DATA try{ interfaceP->createInstance(ctx, cppBroker, instance); }catch(CmpiStatus& rc){ //If something went wrong we recover the previous state cppBroker.deleteInstance(ctx, shadowOp); if(backupShadowInstance){ cppBroker.createInstance(ctx, shadowOp,*backupShadowInstance); } } // ---- temp fix ?? for problem: ecute creteInstance does not return op /* const char * nsp="root/cimv2"; CmpiObjectPath op(nsp,"Linux_DnsHintZone"); op.setKey("Name","r1company"); rslt.returnData(op); */ rslt.returnData( instance.getInstanceName().getObjectPath() ); // if(backupShadowInstance) delete(backupShadowInstance); rslt.returnDone(); return CmpiStatus(CMPI_RC_OK); }; CmpiStatus CmpiLinux_DnsHintZoneProvider::setInstance ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop, const CmpiInstance& inst, const char* *properties){ Linux_DnsHintZoneManualInstance instance ( inst,cop.getNameSpace().charPtr()); //REPOSITORY DATA CmpiInstance* backupShadowInstance=0; CmpiInstance shadowInstance= Linux_DnsHintZoneRepositoryInstance(inst,shadowNameSpaceP) .getCmpiInstance(0); //We keep a backup of the existing data for recovering previous //state if the resource access raise an exception CmpiObjectPath shadowOp=shadowInstance.getObjectPath(); try{ backupShadowInstance=new CmpiInstance( cppBroker.getInstance (ctx, shadowOp,0)); }catch(CmpiStatus& rc){ throw rc; }; //if the instance existed before we delete it //(setInstance is buggy in Pegasus) if(backupShadowInstance) cppBroker.setInstance(ctx, shadowOp,shadowInstance,properties); else cppBroker.createInstance(ctx, shadowOp,shadowInstance); //RESOURCE ACCESS DATA try{ interfaceP->setInstance(ctx, cppBroker, properties, instance); }catch(CmpiStatus& rc){ //If something went wrong we recover the previous state cppBroker.deleteInstance(ctx, shadowOp); if(backupShadowInstance){ cppBroker.createInstance(ctx, shadowOp,*backupShadowInstance); } }; if(backupShadowInstance) delete(backupShadowInstance); rslt.returnDone(); return CmpiStatus(CMPI_RC_OK); }; CmpiStatus CmpiLinux_DnsHintZoneProvider::deleteInstance ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop){ Linux_DnsHintZoneInstanceName instanceName= Linux_DnsHintZoneInstanceName(cop); interfaceP->deleteInstance(ctx, cppBroker, instanceName); instanceName.setNamespace(shadowNameSpaceP); CmpiObjectPath op=instanceName.getObjectPath(); try{ //The instance could not have static data cppBroker.deleteInstance(ctx, op); }catch(CmpiStatus& rc){ throw rc; }; rslt.returnDone(); return CmpiStatus(CMPI_RC_OK); }; CmpiStatus CmpiLinux_DnsHintZoneProvider::invokeMethod ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& ref, const char* methodName, const CmpiArgs& in, CmpiArgs& out){ Linux_DnsHintZoneInstanceName instanceName= Linux_DnsHintZoneInstanceName(ref); if (strcasecmp(methodName,"ApplyIncrementalChangeToCollection")==0){ cout<<"executing method ApplyIncrementalChangeToCollection"<<endl; int isCollectionPresent=0; CIM_CollectionOfMSEsInstanceName Collection; try{ CmpiData CollectionCmpiData=in.getArg("Collection"); isCollectionPresent=!CollectionCmpiData.isNullValue(); CmpiObjectPath CollectionCmpi=CollectionCmpiData; Collection=CIM_CollectionOfMSEsInstanceName(CollectionCmpi); }catch(const CmpiStatus& rc){ //parameter not present }; int isTimeToApplyPresent=0; CmpiDateTime TimeToApply; try{ CmpiData TimeToApplyCmpiData=in.getArg("TimeToApply"); isTimeToApplyPresent=!TimeToApplyCmpiData.isNullValue(); TimeToApply=TimeToApplyCmpiData; }catch(const CmpiStatus& rc){ //parameter not present }; int isContinueOnErrorPresent=0; CMPIBoolean ContinueOnError; try{ CmpiData ContinueOnErrorCmpiData=in.getArg("ContinueOnError"); isContinueOnErrorPresent=!ContinueOnErrorCmpiData.isNullValue(); ContinueOnError=ContinueOnErrorCmpiData; }catch(const CmpiStatus& rc){ //parameter not present }; int isMustBeCompletedByPresent=0; CmpiDateTime MustBeCompletedBy; try{ CmpiData MustBeCompletedByCmpiData=in.getArg("MustBeCompletedBy"); isMustBeCompletedByPresent=!MustBeCompletedByCmpiData.isNullValue(); MustBeCompletedBy=MustBeCompletedByCmpiData; }catch(const CmpiStatus& rc){ //parameter not present }; int isPropertiesToApplyPresent=0; char** PropertiesToApply=0; CMPICount PropertiesToApplySize; try{ CmpiData PropertiesToApplyCmpiData=in.getArg("PropertiesToApply"); isPropertiesToApplyPresent=!PropertiesToApplyCmpiData.isNullValue(); CmpiArray PropertiesToApplyCmpi=PropertiesToApplyCmpiData; PropertiesToApplySize=PropertiesToApplyCmpi.size(); ArrayConverter::makeArray(PropertiesToApplyCmpi, &PropertiesToApply, PropertiesToApplySize); }catch(const CmpiStatus& rc){ //parameter not present };char** CanNotApply; CMPICount CanNotApplySize; rslt.returnData(CmpiData(interfaceP->ApplyIncrementalChangeToCollection( ctx, cppBroker, instanceName, Collection, isCollectionPresent, TimeToApply, isTimeToApplyPresent, ContinueOnError, isContinueOnErrorPresent, MustBeCompletedBy, isMustBeCompletedByPresent, (const char**) PropertiesToApply, PropertiesToApplySize, isPropertiesToApplyPresent, CanNotApply, CanNotApplySize))); out.setArg("CanNotApply", CmpiData(ArrayConverter::makeCmpiArray((const char**) CanNotApply, CanNotApplySize))); if(PropertiesToApply) ArrayConverter::destructArray(PropertiesToApply, PropertiesToApplySize); if(CanNotApply) ArrayConverter::destructArray(CanNotApply, CanNotApplySize); cout<<"end of method ApplyIncrementalChangeToCollection"<<endl; }else if (strcasecmp(methodName,"ApplyIncrementalChangeToMSE")==0){ cout<<"executing method ApplyIncrementalChangeToMSE"<<endl; int isMSEPresent=0; CIM_ManagedSystemElementInstanceName MSE; try{ CmpiData MSECmpiData=in.getArg("MSE"); isMSEPresent=!MSECmpiData.isNullValue(); CmpiObjectPath MSECmpi=MSECmpiData; MSE=CIM_ManagedSystemElementInstanceName(MSECmpi); }catch(const CmpiStatus& rc){ //parameter not present }; int isTimeToApplyPresent=0; CmpiDateTime TimeToApply; try{ CmpiData TimeToApplyCmpiData=in.getArg("TimeToApply"); isTimeToApplyPresent=!TimeToApplyCmpiData.isNullValue(); TimeToApply=TimeToApplyCmpiData; }catch(const CmpiStatus& rc){ //parameter not present }; int isMustBeCompletedByPresent=0; CmpiDateTime MustBeCompletedBy; try{ CmpiData MustBeCompletedByCmpiData=in.getArg("MustBeCompletedBy"); isMustBeCompletedByPresent=!MustBeCompletedByCmpiData.isNullValue(); MustBeCompletedBy=MustBeCompletedByCmpiData; }catch(const CmpiStatus& rc){ //parameter not present }; int isPropertiesToApplyPresent=0; char** PropertiesToApply=0; CMPICount PropertiesToApplySize; try{ CmpiData PropertiesToApplyCmpiData=in.getArg("PropertiesToApply"); isPropertiesToApplyPresent=!PropertiesToApplyCmpiData.isNullValue(); CmpiArray PropertiesToApplyCmpi=PropertiesToApplyCmpiData; PropertiesToApplySize=PropertiesToApplyCmpi.size(); ArrayConverter::makeArray(PropertiesToApplyCmpi, &PropertiesToApply, PropertiesToApplySize); }catch(const CmpiStatus& rc){ //parameter not present }; rslt.returnData(CmpiData(interfaceP->ApplyIncrementalChangeToMSE( ctx, cppBroker, instanceName, MSE, isMSEPresent, TimeToApply, isTimeToApplyPresent, MustBeCompletedBy, isMustBeCompletedByPresent, (const char**) PropertiesToApply, PropertiesToApplySize, isPropertiesToApplyPresent))); if(PropertiesToApply) ArrayConverter::destructArray(PropertiesToApply, PropertiesToApplySize); cout<<"end of method ApplyIncrementalChangeToMSE"<<endl; }else if (strcasecmp(methodName,"ApplyToCollection")==0){ cout<<"executing method ApplyToCollection"<<endl; int isCollectionPresent=0; CIM_CollectionOfMSEsInstanceName Collection; try{ CmpiData CollectionCmpiData=in.getArg("Collection"); isCollectionPresent=!CollectionCmpiData.isNullValue(); CmpiObjectPath CollectionCmpi=CollectionCmpiData; Collection=CIM_CollectionOfMSEsInstanceName(CollectionCmpi); }catch(const CmpiStatus& rc){ //parameter not present }; int isTimeToApplyPresent=0; CmpiDateTime TimeToApply; try{ CmpiData TimeToApplyCmpiData=in.getArg("TimeToApply"); isTimeToApplyPresent=!TimeToApplyCmpiData.isNullValue(); TimeToApply=TimeToApplyCmpiData; }catch(const CmpiStatus& rc){ //parameter not present }; int isContinueOnErrorPresent=0; CMPIBoolean ContinueOnError; try{ CmpiData ContinueOnErrorCmpiData=in.getArg("ContinueOnError"); isContinueOnErrorPresent=!ContinueOnErrorCmpiData.isNullValue(); ContinueOnError=ContinueOnErrorCmpiData; }catch(const CmpiStatus& rc){ //parameter not present }; int isMustBeCompletedByPresent=0; CmpiDateTime MustBeCompletedBy; try{ CmpiData MustBeCompletedByCmpiData=in.getArg("MustBeCompletedBy"); isMustBeCompletedByPresent=!MustBeCompletedByCmpiData.isNullValue(); MustBeCompletedBy=MustBeCompletedByCmpiData; }catch(const CmpiStatus& rc){ //parameter not present };char** CanNotApply; CMPICount CanNotApplySize; rslt.returnData(CmpiData(interfaceP->ApplyToCollection( ctx, cppBroker, instanceName, Collection, isCollectionPresent, TimeToApply, isTimeToApplyPresent, ContinueOnError, isContinueOnErrorPresent, MustBeCompletedBy, isMustBeCompletedByPresent, CanNotApply, CanNotApplySize))); out.setArg("CanNotApply", CmpiData(ArrayConverter::makeCmpiArray((const char**) CanNotApply, CanNotApplySize))); if(CanNotApply) ArrayConverter::destructArray(CanNotApply, CanNotApplySize); cout<<"end of method ApplyToCollection"<<endl; }else if (strcasecmp(methodName,"ApplyToMSE")==0){ cout<<"executing method ApplyToMSE"<<endl; int isMSEPresent=0; CIM_ManagedSystemElementInstanceName MSE; try{ CmpiData MSECmpiData=in.getArg("MSE"); isMSEPresent=!MSECmpiData.isNullValue(); CmpiObjectPath MSECmpi=MSECmpiData; MSE=CIM_ManagedSystemElementInstanceName(MSECmpi); }catch(const CmpiStatus& rc... [truncated message content] |
Update of /cvsroot/sblim/cmpi-dns/provider/Linux_DnsZone In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20455/provider/Linux_DnsZone Added Files: CmpiLinux_DnsZoneProvider.cpp Linux_DnsZoneFactory.cpp Linux_DnsZoneInstanceName.cpp Linux_DnsZoneDefaultImplementation.cpp setting.provider Linux_DnsZoneResourceAccess.cpp Linux_DnsZoneRepositoryInstance.h Linux_DnsZoneRepositoryInstance.cpp Linux_DnsZoneManualInstance.h Linux_DnsZoneInterface.h Linux_DnsZoneResourceAccess.h Linux_DnsZoneExternal.h Linux_DnsZoneInstance.h Linux_DnsZoneFactory.h Linux_DnsZoneInstanceName.h makefile Linux_DnsZoneInstance.cpp Linux_DnsZoneManualInstance.cpp CmpiLinux_DnsZoneProvider.h Linux_DnsZoneRepositoryExternal.h Linux_DnsZoneFakeFactory.cpp Linux_DnsZoneDefaultImplementation.h Linux_DnsZoneExternal.cpp Linux_DnsZoneRepositoryExternal.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: Linux_DnsZoneManualInstance.h --- /** * Linux_DnsZoneManualInstance.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_DnsZoneManualInstance_h #define Linux_DnsZoneManualInstance_h #include "cmpidt.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiBooleanData.h" #include "CmpiCharData.h" #include "CmpiDateTime.h" #include "Linux_DnsZoneInstanceName.h" namespace genProvider { class Linux_DnsZoneManualInstance { public: Linux_DnsZoneManualInstance(); Linux_DnsZoneManualInstance (const Linux_DnsZoneManualInstance& original); Linux_DnsZoneManualInstance (const CmpiInstance& inst, const char* instanceNamespace); ~Linux_DnsZoneManualInstance(); Linux_DnsZoneManualInstance& operator= (const Linux_DnsZoneManualInstance& original); CmpiInstance getCmpiInstance(const char** properties=0) const; unsigned int isInstanceNameSet() const; void setInstanceName( const Linux_DnsZoneInstanceName& val); const Linux_DnsZoneInstanceName& getInstanceName() const; unsigned int isContactSet() const; void setContact(const char* val, int makeCopy = 1); const char* getContact() const; unsigned int isResourceRecordFileSet() const; void setResourceRecordFile(const char* val, int makeCopy = 1); const char* getResourceRecordFile() const; unsigned int isTypeSet() const; void setType(const CMPIUint16 val); const CMPIUint16 getType() const; private: void init(); void init(const Linux_DnsZoneManualInstance& original); void reset(); Linux_DnsZoneInstanceName m_instanceName; const char* m_Contact; const char* m_ResourceRecordFile; CMPIUint16 m_Type; struct isSetType{ unsigned int instanceName:1; unsigned int Contact:1; unsigned int ResourceRecordFile:1; unsigned int Type:1; } isSet; }; struct Linux_DnsZoneManualInstanceEnumerationElement{ Linux_DnsZoneManualInstance* m_elementP; Linux_DnsZoneManualInstanceEnumerationElement* m_nextP; Linux_DnsZoneManualInstanceEnumerationElement(); ~Linux_DnsZoneManualInstanceEnumerationElement(); }; class Linux_DnsZoneManualInstanceEnumeration { private: Linux_DnsZoneManualInstanceEnumerationElement* firstElementP; Linux_DnsZoneManualInstanceEnumerationElement* currentElementP; Linux_DnsZoneManualInstanceEnumerationElement* endElementP; public: Linux_DnsZoneManualInstanceEnumeration(); Linux_DnsZoneManualInstanceEnumeration( const Linux_DnsZoneManualInstanceEnumeration& original); ~Linux_DnsZoneManualInstanceEnumeration(); void reset(); bool hasNext() const; const Linux_DnsZoneManualInstance& getNext(); int getSize() const; const Linux_DnsZoneManualInstance& getElement(int pos) const; void addElement(const Linux_DnsZoneManualInstance& elementP); }; } #endif --- NEW FILE: setting.provider --- #Provider configuration #CPPFLAGS.provider #LDFLAGS.provider --- NEW FILE: Linux_DnsZoneExternal.h --- /** * Linux_DnsZoneExternal.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_DnsZoneExternal_h #define Linux_DnsZoneExternal_h #include "Linux_DnsZoneInstance.h" #include "CmpiBroker.h" namespace genProvider { class Linux_DnsZoneExternal { public: Linux_DnsZoneExternal( const CmpiBroker& brkr, const CmpiContext& ctx); virtual ~Linux_DnsZoneExternal(); virtual void enumInstanceNames( const char *nsp, Linux_DnsZoneInstanceNameEnumeration&); virtual void enumInstances( const char *nsp, const char* *properties, Linux_DnsZoneInstanceEnumeration&); virtual Linux_DnsZoneInstance getInstance( const char* *properties, const Linux_DnsZoneInstanceName&); virtual void setInstance( const char* *properties, const Linux_DnsZoneInstance&); virtual void createInstance( const Linux_DnsZoneInstance&); virtual void deleteInstance( const Linux_DnsZoneInstanceName&); private: CmpiBroker broker; CmpiContext context; }; } #endif --- NEW FILE: CmpiLinux_DnsZoneProvider.h --- /** * CmpiLinux_DnsZoneProvider.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_DnsZoneProvider_h #define CmpiLinux_DnsZoneProvider_h #include "CmpiInstanceMI.h" #include "CmpiMethodMI.h" #include "Linux_DnsZoneFactory.h" namespace genProvider{ class CmpiLinux_DnsZoneProvider : public CmpiInstanceMI, public CmpiMethodMI{ private: Linux_DnsZoneInterface* interfaceP; const static char * shadowNameSpaceP; CmpiBroker cppBroker; void completeInstance ( const Linux_DnsZoneInstanceName& intanceNameP, CmpiInstance& target, const CmpiContext& ctx); void copyShadowData ( const CmpiInstance* source, CmpiInstance* target); CmpiInstance* getShadowInstance ( const CmpiInstance& original, const Linux_DnsZoneInstanceName& intanceName); void removeDanglingShadowInstances ( const Linux_DnsZoneInstanceNameEnumeration& dinInsNames); public: CmpiLinux_DnsZoneProvider ( const CmpiBroker &mbp, const CmpiContext& ctx); ~CmpiLinux_DnsZoneProvider (); 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); }; } #endif --- NEW FILE: CmpiLinux_DnsZoneProvider.cpp --- /** * CmpiLinux_DnsZoneProvider.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_DnsZoneProvider.h" #include "ArrayConverter.h" #include "Linux_DnsZoneManualInstance.h" #include "Linux_DnsZoneRepositoryInstance.h" #include <iostream> #include <strings.h> using namespace std; namespace genProvider { CmpiLinux_DnsZoneProvider:: CmpiLinux_DnsZoneProvider ( const CmpiBroker &mbp, const CmpiContext& ctx): CmpiBaseMI(mbp, ctx), CmpiInstanceMI(mbp,ctx), CmpiMethodMI(mbp,ctx), cppBroker(mbp) { interfaceP=Linux_DnsZoneFactory::getImplementation(); cout<<"Provider was constructed"<<endl; }; const char * CmpiLinux_DnsZoneProvider:: shadowNameSpaceP="IBMShadow/cimv2"; CmpiLinux_DnsZoneProvider:: ~CmpiLinux_DnsZoneProvider(){ delete interfaceP; }; int CmpiLinux_DnsZoneProvider::isUnloadable() const{ return 0; } /* -----------------------------------------------------------------------*/ /* Adding shadow properties */ /* -----------------------------------------------------------------------*/ void CmpiLinux_DnsZoneProvider::completeInstance( const Linux_DnsZoneInstanceName& instanceName, CmpiInstance& target, const CmpiContext& ctx){ Linux_DnsZoneInstanceName 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_DnsZoneProvider::copyShadowData ( const CmpiInstance* source, CmpiInstance* target){ }; /* -----------------------------------------------------------------------*/ /* Extracting shadow instance */ /* -----------------------------------------------------------------------*/ CmpiInstance* CmpiLinux_DnsZoneProvider:: getShadowInstance (const CmpiInstance& original, const Linux_DnsZoneInstanceName& instanceName){ Linux_DnsZoneInstanceName 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_DnsZoneProvider::removeDanglingShadowInstances ( const Linux_DnsZoneInstanceNameEnumeration& dinInsNames){ //TODO: enumerate shadow instance names and remove those not included // in dinInsNames }; /* -----------------------------------------------------------------------*/ /* Provider Factory */ /* -----------------------------------------------------------------------*/ CMProviderBase(CmpiLinux_DnsZoneProvider); CMInstanceMIFactory( CmpiLinux_DnsZoneProvider, CmpiLinux_DnsZoneProvider); CMMethodMIFactory( CmpiLinux_DnsZoneProvider, CmpiLinux_DnsZoneProvider); /* -----------------------------------------------------------------------*/ /* Instance Provider Interface */ /* -----------------------------------------------------------------------*/ //enumInstanceNames CmpiStatus CmpiLinux_DnsZoneProvider::enumInstanceNames ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop){ cout<<"enumerating instanceNames"<<endl; CmpiString nameSpace=cop.getNameSpace(); const char* nameSpaceP=nameSpace.charPtr(); Linux_DnsZoneInstanceNameEnumeration enumeration; interfaceP->enumInstanceNames(ctx, cppBroker, nameSpaceP, enumeration); while ( enumeration.hasNext() ){ const Linux_DnsZoneInstanceName& 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_DnsZoneProvider::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_DnsZoneManualInstanceEnumeration enumeration; interfaceP->enumInstances(ctx, cppBroker, nameSpaceP, properties, enumeration); cout<<"enumerated"<<endl; while ( enumeration.hasNext() ){ const Linux_DnsZoneManualInstance& instance= enumeration.getNext(); cout<<"enumerating getNext"<<endl; CmpiInstance cmpiInstance=instance.getCmpiInstance(properties); cout<<"transformed"<<endl; //add the static data completeInstance(instance.getInstanceName(),cmpiInstance,ctx); rslt.returnData(cmpiInstance); } rslt.returnDone(); return CmpiStatus(CMPI_RC_OK); }; //getInstance CmpiStatus CmpiLinux_DnsZoneProvider::getInstance ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop, const char* *properties){ //covert to instanceName Linux_DnsZoneInstanceName instanceName(cop); //get instance for instanceName Linux_DnsZoneManualInstance instance; instance=interfaceP->getInstance(ctx, cppBroker, properties, instanceName); //we convert the instance in a cmpiInstance CmpiInstance cmpiInstance=instance.getCmpiInstance(properties); //add the static data completeInstance(instance.getInstanceName(), cmpiInstance, ctx); rslt.returnData(cmpiInstance); rslt.returnDone(); return CmpiStatus(CMPI_RC_OK); }; CmpiStatus CmpiLinux_DnsZoneProvider::createInstance ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop,const CmpiInstance& inst){ Linux_DnsZoneManualInstance instance ( inst,cop.getNameSpace().charPtr()); //REPOSITORY DATA CmpiInstance* backupShadowInstance=0; CmpiInstance shadowInstance= Linux_DnsZoneRepositoryInstance(inst,shadowNameSpaceP) .getCmpiInstance(0); //We keep a backup of the existing data for recovering previous //state if the resource access raise an exception CmpiObjectPath shadowOp=shadowInstance.getObjectPath(); try{ backupShadowInstance=new CmpiInstance( cppBroker.getInstance (ctx, shadowOp,0)); //if the shadow instance exist we delete it cppBroker.deleteInstance(ctx, shadowOp); }catch(CmpiStatus& rc){}; cppBroker.createInstance(ctx, shadowOp,shadowInstance); //RESOURCE ACCESS DATA try{ interfaceP->createInstance(ctx, cppBroker, instance); }catch(CmpiStatus& rc){ //If something went wrong we recover the previous state cppBroker.deleteInstance(ctx, shadowOp); if(backupShadowInstance){ cppBroker.createInstance(ctx, shadowOp,*backupShadowInstance); } } if(backupShadowInstance) delete(backupShadowInstance); rslt.returnData( instance.getInstanceName().getObjectPath() ); rslt.returnDone(); return CmpiStatus(CMPI_RC_OK); }; CmpiStatus CmpiLinux_DnsZoneProvider::setInstance ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop, const CmpiInstance& inst, const char* *properties){ Linux_DnsZoneManualInstance instance ( inst,cop.getNameSpace().charPtr()); //REPOSITORY DATA CmpiInstance* backupShadowInstance=0; CmpiInstance shadowInstance= Linux_DnsZoneRepositoryInstance(inst,shadowNameSpaceP) .getCmpiInstance(0); //We keep a backup of the existing data for recovering previous //state if the resource access raise an exception CmpiObjectPath shadowOp=shadowInstance.getObjectPath(); try{ backupShadowInstance=new CmpiInstance( cppBroker.getInstance (ctx, shadowOp,0)); }catch(CmpiStatus& rc){}; //if the instance existed before we delete it //(setInstance is buggy in Pegasus) if(backupShadowInstance) cppBroker.setInstance(ctx, shadowOp,shadowInstance,properties); else cppBroker.createInstance(ctx, shadowOp,shadowInstance); //RESOURCE ACCESS DATA try{ interfaceP->setInstance(ctx, cppBroker, properties, instance); }catch(CmpiStatus& rc){ //If something went wrong we recover the previous state cppBroker.deleteInstance(ctx, shadowOp); if(backupShadowInstance){ cppBroker.createInstance(ctx, shadowOp,*backupShadowInstance); } }; if(backupShadowInstance) delete(backupShadowInstance); rslt.returnDone(); return CmpiStatus(CMPI_RC_OK); }; CmpiStatus CmpiLinux_DnsZoneProvider::deleteInstance ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop){ Linux_DnsZoneInstanceName instanceName= Linux_DnsZoneInstanceName(cop); interfaceP->deleteInstance(ctx, cppBroker, instanceName); instanceName.setNamespace(shadowNameSpaceP); CmpiObjectPath op=instanceName.getObjectPath(); try{ //The instance could not have static data cppBroker.deleteInstance(ctx, op); }catch(CmpiStatus& rc){}; rslt.returnDone(); return CmpiStatus(CMPI_RC_OK); }; CmpiStatus CmpiLinux_DnsZoneProvider::invokeMethod ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& ref, const char* methodName, const CmpiArgs& in, CmpiArgs& out){ Linux_DnsZoneInstanceName instanceName= Linux_DnsZoneInstanceName(ref); if (strcasecmp(methodName,"ApplyIncrementalChangeToCollection")==0){ cout<<"executing method ApplyIncrementalChangeToCollection"<<endl; int isCollectionPresent=0; CIM_CollectionOfMSEsInstanceName Collection; try{ CmpiData CollectionCmpiData=in.getArg("Collection"); isCollectionPresent=!CollectionCmpiData.isNullValue(); CmpiObjectPath CollectionCmpi=CollectionCmpiData; Collection=CIM_CollectionOfMSEsInstanceName(CollectionCmpi); }catch(const CmpiStatus& rc){ //parameter not present }; int isTimeToApplyPresent=0; CmpiDateTime TimeToApply; try{ CmpiData TimeToApplyCmpiData=in.getArg("TimeToApply"); isTimeToApplyPresent=!TimeToApplyCmpiData.isNullValue(); TimeToApply=TimeToApplyCmpiData; }catch(const CmpiStatus& rc){ //parameter not present }; int isContinueOnErrorPresent=0; CMPIBoolean ContinueOnError; try{ CmpiData ContinueOnErrorCmpiData=in.getArg("ContinueOnError"); isContinueOnErrorPresent=!ContinueOnErrorCmpiData.isNullValue(); ContinueOnError=ContinueOnErrorCmpiData; }catch(const CmpiStatus& rc){ //parameter not present }; int isMustBeCompletedByPresent=0; CmpiDateTime MustBeCompletedBy; try{ CmpiData MustBeCompletedByCmpiData=in.getArg("MustBeCompletedBy"); isMustBeCompletedByPresent=!MustBeCompletedByCmpiData.isNullValue(); MustBeCompletedBy=MustBeCompletedByCmpiData; }catch(const CmpiStatus& rc){ //parameter not present }; int isPropertiesToApplyPresent=0; char** PropertiesToApply=0; CMPICount PropertiesToApplySize; try{ CmpiData PropertiesToApplyCmpiData=in.getArg("PropertiesToApply"); isPropertiesToApplyPresent=!PropertiesToApplyCmpiData.isNullValue(); CmpiArray PropertiesToApplyCmpi=PropertiesToApplyCmpiData; PropertiesToApplySize=PropertiesToApplyCmpi.size(); ArrayConverter::makeArray(PropertiesToApplyCmpi, &PropertiesToApply, PropertiesToApplySize); }catch(const CmpiStatus& rc){ //parameter not present };char** CanNotApply; CMPICount CanNotApplySize; rslt.returnData(CmpiData(interfaceP->ApplyIncrementalChangeToCollection( ctx, cppBroker, instanceName, Collection, isCollectionPresent, TimeToApply, isTimeToApplyPresent, ContinueOnError, isContinueOnErrorPresent, MustBeCompletedBy, isMustBeCompletedByPresent, (const char**) PropertiesToApply, PropertiesToApplySize, isPropertiesToApplyPresent, CanNotApply, CanNotApplySize))); out.setArg("CanNotApply", CmpiData(ArrayConverter::makeCmpiArray((const char**) CanNotApply, CanNotApplySize))); if(PropertiesToApply) ArrayConverter::destructArray(PropertiesToApply, PropertiesToApplySize); if(CanNotApply) ArrayConverter::destructArray(CanNotApply, CanNotApplySize); cout<<"end of method ApplyIncrementalChangeToCollection"<<endl; }else if (strcasecmp(methodName,"ApplyIncrementalChangeToMSE")==0){ cout<<"executing method ApplyIncrementalChangeToMSE"<<endl; int isMSEPresent=0; CIM_ManagedSystemElementInstanceName MSE; try{ CmpiData MSECmpiData=in.getArg("MSE"); isMSEPresent=!MSECmpiData.isNullValue(); CmpiObjectPath MSECmpi=MSECmpiData; MSE=CIM_ManagedSystemElementInstanceName(MSECmpi); }catch(const CmpiStatus& rc){ //parameter not present }; int isTimeToApplyPresent=0; CmpiDateTime TimeToApply; try{ CmpiData TimeToApplyCmpiData=in.getArg("TimeToApply"); isTimeToApplyPresent=!TimeToApplyCmpiData.isNullValue(); TimeToApply=TimeToApplyCmpiData; }catch(const CmpiStatus& rc){ //parameter not present }; int isMustBeCompletedByPresent=0; CmpiDateTime MustBeCompletedBy; try{ CmpiData MustBeCompletedByCmpiData=in.getArg("MustBeCompletedBy"); isMustBeCompletedByPresent=!MustBeCompletedByCmpiData.isNullValue(); MustBeCompletedBy=MustBeCompletedByCmpiData; }catch(const CmpiStatus& rc){ //parameter not present }; int isPropertiesToApplyPresent=0; char** PropertiesToApply=0; CMPICount PropertiesToApplySize; try{ CmpiData PropertiesToApplyCmpiData=in.getArg("PropertiesToApply"); isPropertiesToApplyPresent=!PropertiesToApplyCmpiData.isNullValue(); CmpiArray PropertiesToApplyCmpi=PropertiesToApplyCmpiData; PropertiesToApplySize=PropertiesToApplyCmpi.size(); ArrayConverter::makeArray(PropertiesToApplyCmpi, &PropertiesToApply, PropertiesToApplySize); }catch(const CmpiStatus& rc){ //parameter not present }; rslt.returnData(CmpiData(interfaceP->ApplyIncrementalChangeToMSE( ctx, cppBroker, instanceName, MSE, isMSEPresent, TimeToApply, isTimeToApplyPresent, MustBeCompletedBy, isMustBeCompletedByPresent, (const char**) PropertiesToApply, PropertiesToApplySize, isPropertiesToApplyPresent))); if(PropertiesToApply) ArrayConverter::destructArray(PropertiesToApply, PropertiesToApplySize); cout<<"end of method ApplyIncrementalChangeToMSE"<<endl; }else if (strcasecmp(methodName,"ApplyToCollection")==0){ cout<<"executing method ApplyToCollection"<<endl; int isCollectionPresent=0; CIM_CollectionOfMSEsInstanceName Collection; try{ CmpiData CollectionCmpiData=in.getArg("Collection"); isCollectionPresent=!CollectionCmpiData.isNullValue(); CmpiObjectPath CollectionCmpi=CollectionCmpiData; Collection=CIM_CollectionOfMSEsInstanceName(CollectionCmpi); }catch(const CmpiStatus& rc){ //parameter not present }; int isTimeToApplyPresent=0; CmpiDateTime TimeToApply; try{ CmpiData TimeToApplyCmpiData=in.getArg("TimeToApply"); isTimeToApplyPresent=!TimeToApplyCmpiData.isNullValue(); TimeToApply=TimeToApplyCmpiData; }catch(const CmpiStatus& rc){ //parameter not present }; int isContinueOnErrorPresent=0; CMPIBoolean ContinueOnError; try{ CmpiData ContinueOnErrorCmpiData=in.getArg("ContinueOnError"); isContinueOnErrorPresent=!ContinueOnErrorCmpiData.isNullValue(); ContinueOnError=ContinueOnErrorCmpiData; }catch(const CmpiStatus& rc){ //parameter not present }; int isMustBeCompletedByPresent=0; CmpiDateTime MustBeCompletedBy; try{ CmpiData MustBeCompletedByCmpiData=in.getArg("MustBeCompletedBy"); isMustBeCompletedByPresent=!MustBeCompletedByCmpiData.isNullValue(); MustBeCompletedBy=MustBeCompletedByCmpiData; }catch(const CmpiStatus& rc){ //parameter not present };char** CanNotApply; CMPICount CanNotApplySize; rslt.returnData(CmpiData(interfaceP->ApplyToCollection( ctx, cppBroker, instanceName, Collection, isCollectionPresent, TimeToApply, isTimeToApplyPresent, ContinueOnError, isContinueOnErrorPresent, MustBeCompletedBy, isMustBeCompletedByPresent, CanNotApply, CanNotApplySize))); out.setArg("CanNotApply", CmpiData(ArrayConverter::makeCmpiArray((const char**) CanNotApply, CanNotApplySize))); if(CanNotApply) ArrayConverter::destructArray(CanNotApply, CanNotApplySize); cout<<"end of method ApplyToCollection"<<endl; }else if (strcasecmp(methodName,"ApplyToMSE")==0){ cout<<"executing method ApplyToMSE"<<endl; int isMSEPresent=0; CIM_ManagedSystemElementInstanceName MSE; try{ CmpiData MSECmpiData=in.getArg("MSE"); isMSEPresent=!MSECmpiData.isNullValue(); CmpiObjectPath MSECmpi=MSECmpiData; MSE=CIM_ManagedSystemElementInstanceName(MSECmpi); }catch(const CmpiStatus& rc){ //parameter not present }; int isTimeToApplyPresent=0; CmpiDateTime TimeToApply; try{ CmpiData TimeToApplyCmpiData=in.getArg("TimeToApply"); isTimeToApplyPresent=!TimeToApplyCmpiData.isNullValue(); TimeToApply=TimeToApplyCmpiData; }catch(const CmpiStatus& rc){ //parameter not present }; int isMustBeCompletedByPresent=0; CmpiDateTime MustBeCompletedBy; try{ CmpiData MustBeCompletedByCmpiData=in.getArg("MustBeCompletedBy"); isMustBeCompletedByPresent=!MustBeCompletedByCmpiData.isNullValue(); MustBeCompletedBy=MustBeCompletedByCmpiData; }catch(const CmpiStatus& rc){ //parameter not present }; rslt.returnData(CmpiData(interfaceP->ApplyToMSE( ctx, cppBroker, instanceName, MSE, isMSEPresent, TimeToApply, isTimeToApplyPresent, MustBeCompletedBy, isMustBeCompletedByPresent))); cout<<"end of method ApplyToMSE"<<endl; }else if (strcasecmp(methodName,"VerifyOKToApplyIncrementalChangeToCollection")==0){ cout<<"executing method VerifyOKToApplyIncrementalChangeToCollection"<<endl; int isCollectionPresent=0; CIM_CollectionOfMSEsInstanceName Collection; try{ CmpiData CollectionCmpiData=in.getArg("Collection"); isCollectionPresent=!CollectionCmpiData.isNullValue(); CmpiObjectPath CollectionCmpi=CollectionCmpiData; Collection=CIM_CollectionOfMSEsInstanceName(CollectionCmpi); }catch(const CmpiStatus& rc){ //parameter not present }; int isTimeToApplyPresent=0; CmpiDateTime TimeToApply; try{ CmpiData TimeToApplyCmpiData=in.getArg("TimeToApply"); isTimeToApplyPresent=!TimeToApplyCmpiData.isNullValue(); TimeToApply=TimeToApplyCmpiData; }catch(const CmpiStatus& rc){ //parameter not present }; int isMustBeCompletedByPresent=0; CmpiDateTime MustBeCompletedBy; try{ CmpiData MustBeCompletedByCmpiData=in.getArg("MustBeCompletedBy"); isMustBeCompletedByPresent=!MustBeCompletedByCmpiData.isNullValue(); MustBeCompletedBy=MustBeCompletedByCmpiData; }catch(const CmpiStatus& rc){ //parameter not present }; int isPropertiesToApplyPresent=0; char** PropertiesToApply=0; CMPICount PropertiesToApplySize; try{ CmpiData PropertiesToApplyCmpiData=in.getArg("PropertiesToApply"); isPropertiesToApplyPresent=!PropertiesToApplyCmpiData.isNullValue(); CmpiArray PropertiesToApplyCmpi=PropertiesToApplyCmpiData; PropertiesToApplySize=PropertiesToApplyCmpi.size(); ArrayConverter::makeArray(PropertiesToApplyCmpi, &PropertiesToApply, PropertiesToApplySize); }catch(const CmpiStatus& rc){ //parameter not present };char** CanNotApply; CMPICount CanNotApplySize; rslt.returnData(CmpiData(interfaceP->VerifyOKToApplyIncrementalChangeToCollection( ctx, cppBroker, instanceName, Collection, isCollectionPresent, TimeToApply, isTimeToApplyPresent, MustBeCompletedBy, isMustBeCompletedByPresent, (const char**) PropertiesToApply, PropertiesToApplySize, isPropertiesToApplyPresent, CanNotApply, CanNotApplySize))); out.setArg("CanNotApply", CmpiData(ArrayConverter::makeCmpiArray((const char**) CanNotApply, CanNotApplySize))); if(PropertiesToApply) ArrayConverter::destructArray(PropertiesToApply, PropertiesToApplySize); if(CanNotApply) ArrayConverter::destructArray(CanNotApply, CanNotApplySize); cout<<"end of method VerifyOKToApplyIncrementalChangeToCollection"<<endl; }else if (strcasecmp(methodName,"VerifyOKToApplyIncrementalChangeToMSE")==0){ cout<<"executing method VerifyOKToApplyIncrementalChangeToMSE"<<endl; int isMSEPresent=0; CIM_ManagedSystemElementInstanceName MSE; try{ CmpiData MSECmpiData=in.getArg("MSE"); isMSEPresent=!MSECmpiData.isNullValue(); CmpiObjectPath MSECmpi=MSECmpiData; MSE=CIM_ManagedSystemElementInstanceName(MSECmpi); }catch(const CmpiStatus& rc){ //parameter not present }; int isTimeToApplyPresent=0; CmpiDateTime TimeToApply; try{ CmpiData TimeToApplyCmpiData=in.getArg("TimeToApply"); isTimeToApplyPresent=!TimeToApplyCmpiData.isNullValue(); TimeToApply=TimeToApplyCmpiData; }catch(const CmpiStatus& rc){ //parameter not present }; int isMustBeCompletedByPresent=0; CmpiDateTime MustBeCompletedBy; try{ CmpiData MustBeCompletedByCmpiData=in.getArg("MustBeCompletedBy"); isMustBeCompletedByPresent=!MustBeCompletedByCmpiData.isNullValue(); MustBeCompletedBy=MustBeCompletedByCmpiData; }catch(const CmpiStatus& rc){ //parameter not present }; int isPropertiesToApplyPresent=0; char** PropertiesToApply=0; CMPICount PropertiesToApplySize; try{ CmpiData PropertiesToApplyCmpiData=in.getArg("PropertiesToApply"); isPropertiesToApplyPresent=!PropertiesToApplyCmpiData.isNullValue(); CmpiArray PropertiesToApplyCmpi=PropertiesToApplyCmpiData; PropertiesToApplySize=PropertiesToApplyCmpi.size(); ArrayConverter::makeArray(PropertiesToApplyCmpi, &PropertiesToApply, PropertiesToApplySize); }catch(const CmpiStatus& rc){ //parameter not present }; rslt.returnData(CmpiData(interfaceP->VerifyOKToApplyIncrementalChangeToMSE( ctx, cppBroker, instanceName, MSE, isMSEPresent, TimeToApply, isTimeToApplyPresent, MustBeCompletedBy, isMustBeCompletedByPresent, (const char**) PropertiesToApply, PropertiesToApplySize, isPropertiesToApplyPresent))); if(PropertiesToApply) ArrayConverter::destructArray(PropertiesToApply, PropertiesToApplySize); cout<<"end of method VerifyOKToApplyIncrementalChangeToMSE"<<endl; }else if (strcasecmp(methodName,"VerifyOKToApplyToCollection")==0){ cout<<"executing method VerifyOKToApplyToCollection"<<endl; int isCollectionPresent=0; CIM_CollectionOfMSEsInstanceName Collection; try{ CmpiData CollectionCmpiData=in.getArg("Collection"); isCollectionPresent=!CollectionCmpiData.isNullValue(); CmpiObjectPath CollectionCmpi=CollectionCmpiData; Collection=CIM_CollectionOfMSEsInstanceName(CollectionCmpi); }catch(const CmpiStatus& rc){ //parameter not present }; int isTimeToApplyPresent=0; CmpiDateTime TimeToApply; try{ CmpiData TimeToApplyCmpiData=in.getArg("TimeToApply"); isTimeToApplyPresent=!TimeToApplyCmpiData.isNullValue(); TimeToApply=TimeToApplyCmpiData; }catch(const CmpiStatus& rc){ //parameter not present }; int isMustBeCompletedByPresent=0; CmpiDateTime MustBeCompletedBy; try{ CmpiData MustBeCompletedByCmpiData=in.getArg("MustBeCompletedBy"); isMustBeCompletedByPresent=!MustBeCompletedByCmpiData.isNullValue(); MustBeCompletedBy=MustBeCompletedByCmpiData; }catch(const CmpiStatus& rc){ //parameter not present };char** CanNotApply; CMPICount CanNotApplySize; rslt.returnData(CmpiData(interfaceP->VerifyOKToApplyToCollection( ctx, cppBroker, instanceName, Collection, isCollectionPresent, TimeToApply, isTimeToApplyPresent, MustBeCompletedBy, isMustBeCompletedByPresent, CanNotApply, CanNotApplySize))); out.setArg("CanNotApply", CmpiData(ArrayConverter::makeCmpiArray((const char**) CanNotApply, CanNotApplySize))); if(CanNotApply) ArrayConverter::destructArray(CanNotApply, CanNotApplySize); cout<<"end of method VerifyOKToApplyToCollection"<<endl; }else if (strcasecmp(methodName,"VerifyOKToApplyToMSE")==0){ cout<<"executing method VerifyOKToApplyToMSE"<<endl; int isMSEPresent=0; CIM_ManagedSystemElementInstanceName MSE; try{ CmpiData MSECmpiData=in.getArg("MSE"); isMSEPresent=!MSECmpiData.isNullValue(); CmpiObjectPath MSECmpi=MSECmpiData; MSE=CIM_ManagedSystemElementInstanceName(MSECmpi); }catch(const CmpiStatus& rc){ //parameter not present }; int isTimeToApplyPresent=0; CmpiDateTime TimeToApply; try{ CmpiData TimeToApplyCmpiData=in.getArg("TimeToApply"); isTimeToApplyPresent=!TimeToApplyCmpiData.isNullValue(); TimeToApply=TimeToApplyCmpiData; }catch(const CmpiStatus& rc){ //parameter not present }; int isMustBeCompletedByPresent=0; CmpiDateTime MustBeCompletedBy; try{ CmpiData MustBeCompletedByCmpiData=in.getArg("MustBeCompletedBy"); isMustBeCompletedByPresent=!MustBeCompletedByCmpiData.isNullValue(); MustBeCompletedBy=MustBeCompletedByCmpiData; }catch(const CmpiStatus& rc){ //parameter not present }; rslt.returnData(CmpiData(interfaceP->VerifyOKToApplyToMSE( ctx, cppBroker, instanceName, MSE, isMSEPresent, TimeToApply, isTimeToApplyPresent, MustBeCompletedBy, isMustBeCompletedByPresent))); cout<<"end of method VerifyOKToApplyToMSE"<<endl; }else { rslt.returnDone(); return CmpiErrorFormater::getErrorException( CmpiErrorFormater::METHOD_NOT_FOUND, "Method not available"); } rslt.returnDone(); return CmpiStatus(CMPI_RC_OK); }; } --- NEW FILE: makefile --- include ../setting.cmpi include setting.provider CPPFLAGS=$(CPPFLAGS.provider) -I. -I$(CIMOMINC) -I$(COMMONINC) -I$(CIMOMINC)/cpp -I../CIM_CollectionOfMSEs -I../CIM_ManagedSystemElement -D_COMPILE_UNIX -DCMPI_STANDALONE CXXFLAGS=-Wall -g -fPIC -fno-implicit-templates LDFLAGS=-L. -L$(COMMONLIB) -L$(COMMONLIB_OUT) -shared -lCIM_CollectionOfMSEsSupport -lCIM_ManagedSystemElementSupport -lcmpiCppImpl -lIBM_ProviderTooling OBJECTS=Linux_DnsZoneInstanceName.o \ Linux_DnsZoneInstance.o \ Linux_DnsZoneExternal.o \ Linux_DnsZoneRepositoryInstance.o \ Linux_DnsZoneRepositoryExternal.o \ Linux_DnsZoneManualInstance.o \ Linux_DnsZoneDefaultImplementation.o FAKEFACTORY= Linux_DnsZoneFakeFactory.o NORMALFACTORY= Linux_DnsZoneFactory.o RESOURCEOBJECT= Linux_DnsZoneResourceAccess.o PROVIDEROBJECT=CmpiLinux_DnsZoneProvider.o all: testfiles preinstall install buildall: clean all #------------------------------------------------------------------------------# compile: $(OBJECTS) $(FAKEFACTORY) $(NORMALFACTORY) $(RESOURCEOBJECT) $(PROVIDEROBJECT) #------------------------------------------------------------------------------# prelink: $(OBJECTS) $(FAKEFACTORY) $(LINK.cpp) -o libLinux_DnsZoneSupport.so $^ link: deleteFakeLib \ libLinux_DnsZoneSupport.so \ libLinux_DnsZone.so libLinux_DnsZoneSupport.so: LDFLAGS+=$(LDFLAGS.provider) libLinux_DnsZoneSupport.so: $(OBJECTS) $(NORMALFACTORY) $(RESOURCEOBJECT) $(PROVIDEROBJECT) $(LINK.cpp) -o $@ $^ libLinux_DnsZone.so: LDFLAGS+=-lLinux_DnsZoneSupport libLinux_DnsZone.so: $(PROVIDEROBJECT) $(LINK.cpp) -o $@ $^ deleteFakeLib: $(RM) *.so #------------------------------------------------------------------------------# preinstall: prelink install libLinux_DnsZoneSupport.so $(COMMONLIB_OUT) #------------------------------------------------------------------------------# install: link install libLinux_DnsZoneSupport.so $(COMMONLIB_OUT) install libLinux_DnsZone.so $(CIMOMLIB_OUT) # install -m 644 Linux_DnsZone*.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_DnsZone*.h \ $(RM) $(COMMONLIB)/libLinux_DnsZoneSupport.so \ $(RM) $(CIMOMLIB)/libLinux_DnsZone.so --- NEW FILE: Linux_DnsZoneInstanceName.h --- /** * Linux_DnsZoneInstanceName.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_DnsZoneInstanceName_h #define Linux_DnsZoneInstanceName_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" namespace genProvider { class Linux_DnsZoneInstanceName { public: Linux_DnsZoneInstanceName(); Linux_DnsZoneInstanceName (const Linux_DnsZoneInstanceName& original); Linux_DnsZoneInstanceName (const CmpiObjectPath& path); ~Linux_DnsZoneInstanceName(); Linux_DnsZoneInstanceName& operator= (const Linux_DnsZoneInstanceName& 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 isNameSet() const; void setName(const char* val, int makeCopy = 1); const char* getName() const; private: void init(); void init(const Linux_DnsZoneInstanceName& original); void reset(); const char* m_CIMClassNameP; const char* m_namespace; const char* m_Name; struct isSetType{ unsigned int m_namespace:1; unsigned int Name:1; } isSet; }; struct Linux_DnsZoneInstanceNameEnumerationElement{ Linux_DnsZoneInstanceName* m_elementP; Linux_DnsZoneInstanceNameEnumerationElement* m_nextP; Linux_DnsZoneInstanceNameEnumerationElement(); ~Linux_DnsZoneInstanceNameEnumerationElement(); }; class Linux_DnsZoneInstanceNameEnumeration { private: Linux_DnsZoneInstanceNameEnumerationElement* firstElementP; Linux_DnsZoneInstanceNameEnumerationElement* currentElementP; Linux_DnsZoneInstanceNameEnumerationElement* endElementP; public: Linux_DnsZoneInstanceNameEnumeration(); Linux_DnsZoneInstanceNameEnumeration(const CmpiArray& arr); Linux_DnsZoneInstanceNameEnumeration( const Linux_DnsZoneInstanceNameEnumeration& original); ~Linux_DnsZoneInstanceNameEnumeration(); void reset(); bool hasNext() const; const Linux_DnsZoneInstanceName& getNext(); int getSize() const; const Linux_DnsZoneInstanceName& getElement(int pos) const; //no copy of the element is done void addElement(const Linux_DnsZoneInstanceName& elementP); operator CmpiArray() const; }; } #endif --- NEW FILE: Linux_DnsZoneRepositoryInstance.h --- /** * Linux_DnsZoneRepositoryInstance.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_DnsZoneRepositoryInstance_h #define Linux_DnsZoneRepositoryInstance_h #include "cmpidt.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiBooleanData.h" #include "CmpiCharData.h" #include "CmpiDateTime.h" #include "Linux_DnsZoneInstanceName.h" namespace genProvider { class Linux_DnsZoneRepositoryInstance { public: Linux_DnsZoneRepositoryInstance(); Linux_DnsZoneRepositoryInstance (const Linux_DnsZoneRepositoryInstance& original); Linux_DnsZoneRepositoryInstance (const CmpiInstance& inst, const char* instanceNamespace); ~Linux_DnsZoneRepositoryInstance(); Linux_DnsZoneRepositoryInstance& operator= (const Linux_DnsZoneRepositoryInstance& original); CmpiInstance getCmpiInstance(const char** properties=0) const; unsigned int isInstanceNameSet() const; void setInstanceName( const Linux_DnsZoneInstanceName& val); const Linux_DnsZoneInstanceName& getInstanceName() const; private: void init(); void init(const Linux_DnsZoneRepositoryInstance& original); void reset(); Linux_DnsZoneInstanceName m_instanceName; struct isSetType{ unsigned int instanceName:1; } isSet; }; struct Linux_DnsZoneRepositoryInstanceEnumerationElement{ Linux_DnsZoneRepositoryInstance* m_elementP; Linux_DnsZoneRepositoryInstanceEnumerationElement* m_nextP; Linux_DnsZoneRepositoryInstanceEnumerationElement(); ~Linux_DnsZoneRepositoryInstanceEnumerationElement(); }; class Linux_DnsZoneRepositoryInstanceEnumeration { private: Linux_DnsZoneRepositoryInstanceEnumerationElement* firstElementP; Linux_DnsZoneRepositoryInstanceEnumerationElement* currentElementP; Linux_DnsZoneRepositoryInstanceEnumerationElement* endElementP; public: Linux_DnsZoneRepositoryInstanceEnumeration(); Linux_DnsZoneRepositoryInstanceEnumeration( const Linux_DnsZoneRepositoryInstanceEnumeration& original); ~Linux_DnsZoneRepositoryInstanceEnumeration(); void reset(); bool hasNext() const; const Linux_DnsZoneRepositoryInstance& getNext(); int getSize() const; const Linux_DnsZoneRepositoryInstance& getElement(int pos) const; void addElement(const Linux_DnsZoneRepositoryInstance& elementP); }; } #endif --- NEW FILE: Linux_DnsZoneInstance.cpp --- /** * Linux_DnsZoneInstance.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_DnsZoneInstance.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //Linux_DnsZoneInstance //********************************************************* //empty constructor Linux_DnsZoneInstance:: Linux_DnsZoneInstance(){ init(); }; //copy constructor Linux_DnsZoneInstance:: Linux_DnsZoneInstance (const Linux_DnsZoneInstance& original){ init(original); }; //constructor using CmpiInstance Linux_DnsZoneInstance:: Linux_DnsZoneInstance (const CmpiInstance& inst, const char* instanceNamespace){ CmpiData cmpiData; init(); CmpiObjectPath cop=inst.getObjectPath(); cop.setNameSpace(instanceNamespace); setInstanceName(Linux_DnsZoneInstanceName(cop)); cmpiData = inst.getProperty("Caption"); if(!cmpiData.isNullValue()){ CmpiString Caption = cmpiData; setCaption(Caption.charPtr()); } cmpiData = inst.getProperty("Contact"); if(!cmpiData.isNullValue()){ CmpiString Contact = cmpiData; setContact(Contact.charPtr()); } cmpiData = inst.getProperty("Description"); if(!cmpiData.isNullValue()){ CmpiString Description = cmpiData; setDescription(Description.charPtr()); } cmpiData = inst.getProperty("ElementName"); if(!cmpiData.isNullValue()){ CmpiString ElementName = cmpiData; setElementName(ElementName.charPtr()); } cmpiData = inst.getProperty("ResourceRecordFile"); if(!cmpiData.isNullValue()){ CmpiString ResourceRecordFile = cmpiData; setResourceRecordFile(ResourceRecordFile.charPtr()); } cmpiData = inst.getProperty("SettingID"); if(!cmpiData.isNullValue()){ CmpiString SettingID = cmpiData; setSettingID(SettingID.charPtr()); } cmpiData = inst.getProperty("Type"); if(!cmpiData.isNullValue()){ CMPIUint16 Type = cmpiData; setType(Type); } } //Destructor Linux_DnsZoneInstance:: ~Linux_DnsZoneInstance(){ reset(); }; //copy operator Linux_DnsZoneInstance& Linux_DnsZoneInstance::operator= (const Linux_DnsZoneInstance& original){ init(original); return *this; }; //converts to CmpiInstance CmpiInstance Linux_DnsZoneInstance:: getCmpiInstance(const char** properties) const{ CmpiObjectPath objectPath=getInstanceName().getObjectPath(); CmpiInstance cmpiInstance(objectPath); getInstanceName().fillKeys(cmpiInstance); if (properties) { cmpiInstance.setPropertyFilter(properties,0); } if(isSet.Caption){ cmpiInstance.setProperty("Caption",CmpiData(m_Caption)); } if(isSet.Contact){ cmpiInstance.setProperty("Contact",CmpiData(m_Contact)); } if(isSet.Description){ cmpiInstance.setProperty("Description",CmpiData(m_Description)); } if(isSet.ElementName){ cmpiInstance.setProperty("ElementName",CmpiData(m_ElementName)); } if(isSet.ResourceRecordFile){ cmpiInstance.setProperty("ResourceRecordFile",CmpiData(m_ResourceRecordFile)); } if(isSet.SettingID){ cmpiInstance.setProperty("SettingID",CmpiData(m_SettingID)); } if(isSet.Type){ cmpiInstance.setProperty("Type",CmpiData(m_Type)); } return cmpiInstance; } //InstanceName related methods unsigned int Linux_DnsZoneInstance:: isInstanceNameSet() const{ return isSet.instanceName; } const Linux_DnsZoneInstanceName& Linux_DnsZoneInstance::getInstanceName() const{ if(!isSet.instanceName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "InstanceName not set in Linux_DnsZone instance"); return m_instanceName; } void Linux_DnsZoneInstance::setInstanceName( const Linux_DnsZoneInstanceName& val){ m_instanceName = val; isSet.instanceName=1; } //Caption related methods unsigned int Linux_DnsZoneInstance::isCaptionSet() const{ return isSet.Caption; } void Linux_DnsZoneInstance:: setCaption(const char* val, int makeCopy){ if (isSet.Caption) { delete []m_Caption; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_Caption = tmpval; } else { m_Caption = val; } isSet.Caption=1; } const char* Linux_DnsZoneInstance:: getCaption() const{ if(!isSet.Caption) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Caption not set"); return m_Caption; } //Contact related methods unsigned int Linux_DnsZoneInstance::isContactSet() const{ return isSet.Contact; } void Linux_DnsZoneInstance:: setContact(const char* val, int makeCopy){ if (isSet.Contact) { delete []m_Contact; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_Contact = tmpval; } else { m_Contact = val; } isSet.Contact=1; } const char* Linux_DnsZoneInstance:: getContact() const{ if(!isSet.Contact) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Contact not set"); return m_Contact; } //Description related methods unsigned int Linux_DnsZoneInstance::isDescriptionSet() const{ return isSet.Description; } void Linux_DnsZoneInstance:: setDescription(const char* val, int makeCopy){ if (isSet.Description) { delete []m_Description; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_Description = tmpval; } else { m_Description = val; } isSet.Description=1; } const char* Linux_DnsZoneInstance:: getDescription() const{ if(!isSet.Description) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Description not set"); return m_Description; } //ElementName related methods unsigned int Linux_DnsZoneInstance::isElementNameSet() const{ return isSet.ElementName; } void Linux_DnsZoneInstance:: setElementName(const char* val, int makeCopy){ if (isSet.ElementName) { delete []m_ElementName; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_ElementName = tmpval; } else { m_ElementName = val; } isSet.ElementName=1; } const char* Linux_DnsZoneInstance:: getElementName() const{ if(!isSet.ElementName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "ElementName not set"); return m_ElementName; } //ResourceRecordFile related methods unsigned int Linux_DnsZoneInstance::isResourceRecordFileSet() const{ return isSet.ResourceRecordFile; } void Linux_DnsZoneInstance:: setResourceRecordFile(const char* val, int makeCopy){ if (isSet.ResourceRecordFile) { delete []m_ResourceRecordFile; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_ResourceRecordFile = tmpval; } else { m_ResourceRecordFile = val; } isSet.ResourceRecordFile=1; } const char* Linux_DnsZoneInstance:: getResourceRecordFile() const{ if(!isSet.ResourceRecordFile) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "ResourceRecordFile not set"); return m_ResourceRecordFile; } //SettingID related methods unsigned int Linux_DnsZoneInstance::isSettingIDSet() const{ return isSet.SettingID; } void Linux_DnsZoneInstance:: setSettingID(const char* val, int makeCopy){ if (isSet.SettingID) { delete []m_SettingID; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_SettingID = tmpval; } else { m_SettingID = val; } isSet.SettingID=1; } const char* Linux_DnsZoneInstance:: getSettingID() const{ if(!isSet.SettingID) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "SettingID not set"); return m_SettingID; } //Type related methods unsigned int Linux_DnsZoneInstance::isTypeSet() const{ return isSet.Type; } void Linux_DnsZoneInstance:: setType(const CMPIUint16 val){ m_Type = val; isSet.Type=1; } const CMPIUint16 Linux_DnsZoneInstance:: getType() const{ if(!isSet.Type) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Type not set"); return m_Type; } //set isSet attributes to FALSE void Linux_DnsZoneInstance::init(){ isSet.instanceName=0; isSet.Caption=0; isSet.Contact=0; isSet.Description=0; isSet.ElementName=0; isSet.ResourceRecordFile=0; isSet.SettingID=0; isSet.Type=0; }; //copies another instance properties in this void Linux_DnsZoneInstance::init (const Linux_DnsZoneInstance& original){ init(); if(original.isInstanceNameSet()){ setInstanceName(original.getInstanceName()); } if(original.isCaptionSet()){ const char* CaptionOriginal=original.getCaption(); setCaption(CaptionOriginal, 1); } if(original.isContactSet()){ const char* ContactOriginal=original.getContact(); setContact(ContactOriginal, 1); } if(original.isDescriptionSet()){ const char* DescriptionOriginal=original.getDescription(); setDescription(DescriptionOriginal, 1); } if(original.isElementNameSet()){ const char* ElementNameOriginal=original.getElementName(); setElementName(ElementNameOriginal, 1); } if(original.isResourceRecordFileSet()){ const char* ResourceRecordFileOriginal=original.getResourceRecordFile(); setResourceRecordFile(ResourceRecordFileOriginal, 1); } if(original.isSettingIDSet()){ const char* SettingIDOriginal=original.getSettingID(); setSettingID(SettingIDOriginal, 1); } if(original.isTypeSet()){ const CMPIUint16 TypeOriginal=original.getType(); setType(TypeOriginal); } } //reset the instance data void Linux_DnsZoneInstance::reset(){ if (isSet.Caption) delete(m_Caption); if (isSet.Contact) delete(m_Contact); if (isSet.Description) delete(m_Description); if (isSet.ElementName) delete(m_ElementName); if (isSet.ResourceRecordFile) delete(m_ResourceRecordFile); if (isSet.SettingID) delete(m_SettingID); }; //********************************************************* //Linux_DnsZoneInstanceEnumerationElement //********************************************************* Linux_DnsZoneInstanceEnumerationElement:: Linux_DnsZoneInstanceEnumerationElement(){ m_elementP=0; m_nextP=0; }; Linux_DnsZoneInstanceEnumerationElement:: ~Linux_DnsZoneInstanceEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //Linux_DnsZoneInstanceNameEnumeration //********************************************************* Linux_DnsZoneInstanceEnum... [truncated message content] |
Update of /cvsroot/sblim/cmpi-dns/provider/Linux_DnsQueryACLForService In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20455/provider/Linux_DnsQueryACLForService Added Files: Linux_DnsQueryACLForServiceInstanceName.h Linux_DnsQueryACLForServiceDefaultImplementation.h Linux_DnsQueryACLForServiceInterface.h Linux_DnsQueryACLForServiceFakeFactory.cpp Linux_DnsQueryACLForServiceResourceAccess.h Linux_DnsQueryACLForServiceRepositoryInstance.cpp Linux_DnsQueryACLForServiceManualInstance.cpp Linux_DnsQueryACLForServiceRepositoryExternal.h Linux_DnsQueryACLForServiceInstanceName.cpp Linux_DnsQueryACLForServiceManualInstance.h Linux_DnsQueryACLForServiceDefaultImplementation.cpp CmpiLinux_DnsQueryACLForServiceProvider.cpp Linux_DnsQueryACLForServiceInstance.h Linux_DnsQueryACLForServiceExternal.cpp Linux_DnsQueryACLForServiceFactory.cpp CmpiLinux_DnsQueryACLForServiceProvider.h setting.provider makefile Linux_DnsQueryACLForServiceInstance.cpp Linux_DnsQueryACLForServiceExternal.h Linux_DnsQueryACLForServiceRepositoryExternal.cpp Linux_DnsQueryACLForServiceFactory.h Linux_DnsQueryACLForServiceResourceAccess.cpp Linux_DnsQueryACLForServiceRepositoryInstance.h Log Message: WBEM-SMT DNS provider component. First initial upload. This module includes: - CIM model for DNS - CMPI provider for DNS - Resource Access layer for DNS --- NEW FILE: setting.provider --- #Provider configuration #CPPFLAGS.provider LDFLAGS.provider=-ldnssupport --- NEW FILE: Linux_DnsQueryACLForServiceResourceAccess.cpp --- /** * Linux_DnsQueryACLForServiceResourceAccess.cpp * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * author: Murillo Bernardes <ber...@br...> * * Contributors: * */ #include "Linux_DnsQueryACLForServiceResourceAccess.h" #define DNS_ATTR_STR "allow-query" namespace genProvider { //Linux_DnsQueryACLForServiceResourceAccess::Linux_DnsQueryACLForServiceResourceAccess(); Linux_DnsQueryACLForServiceResourceAccess::~Linux_DnsQueryACLForServiceResourceAccess() { }; /* intrinsic methods */ void Linux_DnsQueryACLForServiceResourceAccess::enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsQueryACLForServiceInstanceNameEnumeration& instnames){ BINDOPTS *sopts = ReadOptions(); char *myoptvalue = getOption(sopts,DNS_ATTR_STR); if ( ! myoptvalue ) return; DnsArray list = DnsArray(myoptvalue); DnsArrayConstIterator iter; for ( iter = list.begin(); iter != list.end(); ++iter) { Linux_DnsQueryACLForServiceInstanceName Inst; Linux_DnsAddressMatchListInstanceName addrList; Linux_DnsServiceInstanceName serviceInstanceName; Inst.setNamespace( nsp ); addrList.setNamespace( nsp ); serviceInstanceName.setNamespace( nsp ); serviceInstanceName.setName( DEFAULT_SERVICE_NAME ); serviceInstanceName.setSystemCreationClassName( DEFAULT_SYSTEM_CREATION_CLASS_NAME ); serviceInstanceName.setSystemName( DEFAULT_SYSTEM_NAME ); serviceInstanceName.setCreationClassName( DEFAULT_CREATION_CLASS_NAME ); addrList.setName( (*iter).c_str() ); addrList.setServiceName( DEFAULT_SERVICE_NAME ); Inst.setSetting( addrList ); Inst.setElement( serviceInstanceName ); instnames.addElement(Inst); } freeOptions( sopts ); } void Linux_DnsQueryACLForServiceResourceAccess::enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsQueryACLForServiceManualInstanceEnumeration& instances){ BINDOPTS *sopts = ReadOptions(); char *myoptvalue = getOption(sopts,DNS_ATTR_STR); if ( ! myoptvalue ) return; DnsArray list = DnsArray( myoptvalue ); DnsArrayConstIterator iter; for ( iter = list.begin(); iter != list.end(); ++iter) { Linux_DnsQueryACLForServiceInstanceName Inst; Linux_DnsAddressMatchListInstanceName addrList; Linux_DnsServiceInstanceName serviceInstanceName; Inst.setNamespace( nsp ); addrList.setNamespace( nsp ); serviceInstanceName.setNamespace( nsp ); serviceInstanceName.setName( DEFAULT_SERVICE_NAME ); serviceInstanceName.setSystemCreationClassName( DEFAULT_SYSTEM_CREATION_CLASS_NAME ); serviceInstanceName.setSystemName( DEFAULT_SYSTEM_NAME ); serviceInstanceName.setCreationClassName( DEFAULT_CREATION_CLASS_NAME ); addrList.setName( (*iter).c_str() ); addrList.setServiceName( DEFAULT_SERVICE_NAME, 1 ); Inst.setSetting( addrList ); Inst.setElement( serviceInstanceName ); Linux_DnsQueryACLForServiceManualInstance manualInst; manualInst.setInstanceName( Inst ); instances.addElement(manualInst); } freeOptions( sopts ); }; Linux_DnsQueryACLForServiceManualInstance Linux_DnsQueryACLForServiceResourceAccess::getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsQueryACLForServiceInstanceName& instanceName){ Linux_DnsQueryACLForServiceManualInstance instance; Linux_DnsQueryACLForServiceManualInstance manualInst; manualInst.setInstanceName( instanceName ); return manualInst; } /* void Linux_DnsQueryACLForServiceResourceAccess::setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsQueryACLForServiceManualInstance&){};*/ void Linux_DnsQueryACLForServiceResourceAccess::createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsQueryACLForServiceManualInstance& anInstance){ BINDOPTS* sopts = ReadOptions(); char *myoptvalue = getOption(sopts,DNS_ATTR_STR); DnsArray list; if (myoptvalue) list.populate(myoptvalue); list.add( string(anInstance.getInstanceName().getSetting().getName()) ); setOption(sopts, DNS_ATTR_STR, list.toString().c_str()); freeOptions( sopts ); }; void Linux_DnsQueryACLForServiceResourceAccess::deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsQueryACLForServiceInstanceName& anInstanceName){ BINDOPTS* sopts = ReadOptions(); char *myoptvalue = getOption(sopts,DNS_ATTR_STR); DnsArray list; if (myoptvalue) list.populate(myoptvalue); list.remove( string(anInstanceName.getSetting().getName()) ); setOption(sopts, DNS_ATTR_STR, list.toString().c_str()); freeOptions( sopts ); }; /* Association Interface */ void Linux_DnsQueryACLForServiceResourceAccess::referencesElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsQueryACLForServiceManualInstanceEnumeration& instEnum) { BINDOPTS *sopts = ReadOptions(); char *myoptvalue = getOption(sopts,DNS_ATTR_STR); if ( ! myoptvalue ) return; DnsArray list = DnsArray(myoptvalue); DnsArrayConstIterator iter; for ( iter = list.begin(); iter != list.end(); ++iter) { if ( strcmp( (*iter).c_str(), sourceInst.getName()) ) continue; Linux_DnsServiceInstanceName serviceInstanceName; serviceInstanceName.setNamespace( nsp ); serviceInstanceName.setName( DEFAULT_SERVICE_NAME ); serviceInstanceName.setSystemCreationClassName( DEFAULT_SYSTEM_CREATION_CLASS_NAME ); serviceInstanceName.setSystemName( DEFAULT_SYSTEM_NAME ); serviceInstanceName.setCreationClassName( DEFAULT_CREATION_CLASS_NAME ); Linux_DnsQueryACLForServiceManualInstance inst; Linux_DnsQueryACLForServiceInstanceName instName; instName.setNamespace( nsp ); instName.setElement( serviceInstanceName ); instName.setSetting( sourceInst ); inst.setInstanceName( instName ); instEnum.addElement(inst); } }; void Linux_DnsQueryACLForServiceResourceAccess::referencesSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsQueryACLForServiceManualInstanceEnumeration& instEnum) { BINDOPTS *sopts = ReadOptions(); char *myoptvalue = getOption(sopts,DNS_ATTR_STR); if ( ! myoptvalue ) return; DnsArray list = DnsArray(myoptvalue); DnsArrayConstIterator iter; for ( iter = list.begin(); iter != list.end(); ++iter) { Linux_DnsQueryACLForServiceInstanceName Inst; Linux_DnsAddressMatchListInstanceName addrList; Linux_DnsServiceInstanceName serviceInstanceName; Inst.setNamespace( nsp ); addrList.setNamespace( nsp ); serviceInstanceName.setNamespace( nsp ); serviceInstanceName.setName( DEFAULT_SERVICE_NAME ); serviceInstanceName.setSystemCreationClassName( DEFAULT_SYSTEM_CREATION_CLASS_NAME ); serviceInstanceName.setSystemName( DEFAULT_SYSTEM_NAME ); serviceInstanceName.setCreationClassName( DEFAULT_CREATION_CLASS_NAME ); addrList.setName( (*iter).c_str() ); addrList.setServiceName( DEFAULT_SERVICE_NAME ); Inst.setNamespace( nsp ); Inst.setSetting( addrList ); Inst.setElement( serviceInstanceName ); Linux_DnsQueryACLForServiceManualInstance manualInst; manualInst.setInstanceName( Inst ); instEnum.addElement(manualInst); } freeOptions( sopts ); }; void Linux_DnsQueryACLForServiceResourceAccess::associatorsElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsServiceInstanceEnumeration& instEnum) { BINDOPTS *sopts = ReadOptions(); char *myoptvalue = getOption(sopts,DNS_ATTR_STR); if ( ! myoptvalue ) return; DnsArray list = DnsArray(myoptvalue); DnsArrayConstIterator iter; for ( iter = list.begin(); iter != list.end(); ++iter) { if ( strcmp( (*iter).c_str(), sourceInst.getName() )) continue; Linux_DnsServiceInstance inst; Linux_DnsServiceInstanceName instanceName; instanceName.setNamespace( nsp ); instanceName.setName( DEFAULT_SERVICE_NAME ); instanceName.setSystemCreationClassName( DEFAULT_SYSTEM_CREATION_CLASS_NAME ); instanceName.setSystemName( DEFAULT_SYSTEM_NAME ); instanceName.setCreationClassName( DEFAULT_CREATION_CLASS_NAME ); inst.setInstanceName(instanceName); instEnum.addElement(inst); } }; void Linux_DnsQueryACLForServiceResourceAccess::associatorsSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceEnumeration& instEnum) { ACL *list_acl = ReadACL(); BINDOPTS *sopts = ReadOptions(); char *myoptvalue = getOption(sopts,DNS_ATTR_STR); if ( ! myoptvalue ) return; DnsArray list = DnsArray(myoptvalue); DnsArrayConstIterator iter; for ( iter = list.begin(); iter != list.end(); ++iter) { Linux_DnsAddressMatchListInstance addrInst; Linux_DnsAddressMatchListInstanceName addrInstName; addrInstName.setNamespace( nsp ); addrInstName.setName( (*iter).c_str() ); addrInstName.setServiceName( DEFAULT_SERVICE_NAME ); addrInst.setInstanceName( addrInstName ); char *aclValue = getACL(list_acl, (*iter).c_str()); if ( ! aclValue ) continue; DnsArray aclArray = DnsArray( aclValue ); addrInst.setAddressList( aclArray.toArray(), aclArray.size() ); addrInst.setAddressListType( DNS_AMLTYPE_AML ); instEnum.addElement(addrInst); } freeOptions( sopts ); freeACL( list_acl ); }; /* extrinsic methods */ } --- NEW FILE: Linux_DnsQueryACLForServiceRepositoryExternal.cpp --- /** * Linux_DnsQueryACLForServiceRepositoryExternal.cpp * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * author: Murillo Bernardes <ber...@br...> * * Contributors: * */ #include "Linux_DnsQueryACLForServiceRepositoryExternal.h" namespace genProvider{ Linux_DnsQueryACLForServiceRepositoryExternal::Linux_DnsQueryACLForServiceRepositoryExternal( const CmpiBroker& brkr, const CmpiContext& ctx ) : broker(brkr), context(ctx) {}; const char * Linux_DnsQueryACLForServiceRepositoryExternal:: nsp="IBMShadow/cimv2"; Linux_DnsQueryACLForServiceRepositoryExternal:: ~Linux_DnsQueryACLForServiceRepositoryExternal(){}; void Linux_DnsQueryACLForServiceRepositoryExternal::enumInstanceNames( Linux_DnsQueryACLForServiceInstanceNameEnumeration& instnames) { CmpiObjectPath op(nsp,"Linux_DnsQueryACLForService"); CmpiEnumeration en=broker.enumInstanceNames(context,op); while(en.hasNext()) { CmpiObjectPath opi = en.getNext(); Linux_DnsQueryACLForServiceInstanceName iname(opi); instnames.addElement(iname); } }; void Linux_DnsQueryACLForServiceRepositoryExternal::enumInstances( const char* *properties, Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration& instances) { CmpiObjectPath op(nsp,"Linux_DnsQueryACLForService"); CmpiEnumeration en=broker.enumInstances(context,op,properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); Linux_DnsQueryACLForServiceRepositoryInstance instance(inst,nsp); instances.addElement(instance); } }; Linux_DnsQueryACLForServiceRepositoryInstance Linux_DnsQueryACLForServiceRepositoryExternal::getInstance( const char* *properties, const Linux_DnsQueryACLForServiceInstanceName& instanceName) { CmpiObjectPath op=instanceName.getObjectPath(); op.setNameSpace(nsp); CmpiInstance inst=broker.getInstance(context,op,properties); return Linux_DnsQueryACLForServiceRepositoryInstance(inst,nsp); } void Linux_DnsQueryACLForServiceRepositoryExternal::setInstance( const char* *properties, const Linux_DnsQueryACLForServiceRepositoryInstance& instance){ //make a copy of the given instance and set it to the right nameSpace Linux_DnsQueryACLForServiceInstanceName instanceName(instance.getInstanceName()); instanceName.setNamespace(nsp,1); Linux_DnsQueryACLForServiceRepositoryInstance copiedInstance(instance); copiedInstance.setInstanceName(instanceName); CmpiObjectPath op=instanceName.getObjectPath(); CmpiInstance inst=copiedInstance.getCmpiInstance(); broker.setInstance(context,op,inst,properties); } void Linux_DnsQueryACLForServiceRepositoryExternal::createInstance( const Linux_DnsQueryACLForServiceRepositoryInstance& instance){ //make a copy of the given instance and set it to the right nameSpace Linux_DnsQueryACLForServiceInstanceName instanceName(instance.getInstanceName()); instanceName.setNamespace(nsp,1); Linux_DnsQueryACLForServiceRepositoryInstance copiedInstance(instance); copiedInstance.setInstanceName(instanceName); CmpiObjectPath op=instanceName.getObjectPath(); CmpiInstance inst=copiedInstance.getCmpiInstance(); broker.createInstance(context,op,inst); } void Linux_DnsQueryACLForServiceRepositoryExternal::deleteInstance( const Linux_DnsQueryACLForServiceInstanceName& instanceName){ CmpiObjectPath op=instanceName.getObjectPath(); op.setNameSpace(nsp); broker.deleteInstance(context,op); } } --- NEW FILE: Linux_DnsQueryACLForServiceRepositoryInstance.cpp --- /** * Linux_DnsQueryACLForServiceRepositoryInstance.cpp * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * author: Murillo Bernardes <ber...@br...> * * Contributors: * */ #include "Linux_DnsQueryACLForServiceRepositoryInstance.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //Linux_DnsQueryACLForServiceRepositoryInstance //********************************************************* //empty constructor Linux_DnsQueryACLForServiceRepositoryInstance:: Linux_DnsQueryACLForServiceRepositoryInstance(){ init(); }; //copy constructor Linux_DnsQueryACLForServiceRepositoryInstance:: Linux_DnsQueryACLForServiceRepositoryInstance (const Linux_DnsQueryACLForServiceRepositoryInstance& original){ init(original); }; //constructor using CmpiInstance Linux_DnsQueryACLForServiceRepositoryInstance:: Linux_DnsQueryACLForServiceRepositoryInstance (const CmpiInstance& inst, const char* instanceNamespace){ CmpiData cmpiData; init(); CmpiObjectPath cop=inst.getObjectPath(); cop.setNameSpace(instanceNamespace); setInstanceName(Linux_DnsQueryACLForServiceInstanceName(cop)); } //Destructor Linux_DnsQueryACLForServiceRepositoryInstance:: ~Linux_DnsQueryACLForServiceRepositoryInstance(){ reset(); }; //copy operator Linux_DnsQueryACLForServiceRepositoryInstance& Linux_DnsQueryACLForServiceRepositoryInstance::operator= (const Linux_DnsQueryACLForServiceRepositoryInstance& original){ init(original); return *this; }; //converts to CmpiInstance CmpiInstance Linux_DnsQueryACLForServiceRepositoryInstance:: getCmpiInstance(const char** properties) const{ CmpiObjectPath objectPath=getInstanceName().getObjectPath(); CmpiInstance cmpiInstance(objectPath); getInstanceName().fillKeys(cmpiInstance); if (properties) { cmpiInstance.setPropertyFilter(properties,0); } return cmpiInstance; } //InstanceName related methods unsigned int Linux_DnsQueryACLForServiceRepositoryInstance:: isInstanceNameSet() const{ return isSet.instanceName; } const Linux_DnsQueryACLForServiceInstanceName& Linux_DnsQueryACLForServiceRepositoryInstance::getInstanceName() const{ if(!isSet.instanceName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "InstanceName not set in Linux_DnsQueryACLForService instance"); return m_instanceName; } void Linux_DnsQueryACLForServiceRepositoryInstance::setInstanceName( const Linux_DnsQueryACLForServiceInstanceName& val){ m_instanceName = val; isSet.instanceName=1; } //set isSet attributes to FALSE void Linux_DnsQueryACLForServiceRepositoryInstance::init(){ isSet.instanceName=0; }; //copies another instance properties in this void Linux_DnsQueryACLForServiceRepositoryInstance::init (const Linux_DnsQueryACLForServiceRepositoryInstance& original){ init(); if(original.isInstanceNameSet()){ setInstanceName(original.getInstanceName()); } } //reset the instance data void Linux_DnsQueryACLForServiceRepositoryInstance::reset(){ }; //********************************************************* //Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement //********************************************************* Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement:: Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement(){ m_elementP=0; m_nextP=0; }; Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement:: ~Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //Linux_DnsQueryACLForServiceRepositoryInstanceNameEnumeration //********************************************************* Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration:: Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration:: Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration( const Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration:: ~Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration::reset(){ currentElementP=firstElementP; }; bool Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration::hasNext() const{ return (currentElementP!=0); }; int Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration::getSize() const{ int size=0; Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const Linux_DnsQueryACLForServiceRepositoryInstance& Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration::getElement(int pos) const{ Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const Linux_DnsQueryACLForServiceRepositoryInstance& Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration::getNext() { Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration::addElement (const Linux_DnsQueryACLForServiceRepositoryInstance& elementP){ if(firstElementP==0){ firstElementP=new Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement(); firstElementP->m_elementP=new Linux_DnsQueryACLForServiceRepositoryInstance(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new Linux_DnsQueryACLForServiceRepositoryInstance(elementP); } }; } --- NEW FILE: Linux_DnsQueryACLForServiceDefaultImplementation.cpp --- /** * Linux_DnsQueryACLForServiceDefaultImplementation.cpp * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * author: Murillo Bernardes <ber...@br...> * * Contributors: * */ #include "Linux_DnsQueryACLForServiceDefaultImplementation.h" #include <iostream> using namespace std; namespace genProvider { /* intrinsic methods */ void Linux_DnsQueryACLForServiceDefaultImplementation::enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsQueryACLForServiceInstanceNameEnumeration& instnames){ cout<<"enumInstances not supported for Linux_DnsQueryACLForService"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "enumInstances not implemented for Linux_DnsQueryACLForService"); } void Linux_DnsQueryACLForServiceDefaultImplementation::enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsQueryACLForServiceManualInstanceEnumeration& instances){ cout<<"Using default enumInstances implementation for Linux_DnsQueryACLForService"<<endl; cout<<"LetŽs get the instanceNames"<<endl; Linux_DnsQueryACLForServiceInstanceNameEnumeration namesEnumeration; enumInstanceNames(ctx, mbp,nsp,namesEnumeration); cout<<"Getting each instance"<<endl; while(namesEnumeration.hasNext()){ Linux_DnsQueryACLForServiceInstanceName name= namesEnumeration.getNext(); cout<<"Getting an instance for instanceName"<<endl; Linux_DnsQueryACLForServiceManualInstance instance= getInstance(ctx, mbp, properties, name); cout<<"adding instance to enum"<<endl; instances.addElement(instance); cout<<"Added!"<<endl; }; } Linux_DnsQueryACLForServiceManualInstance Linux_DnsQueryACLForServiceDefaultImplementation::getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsQueryACLForServiceInstanceName&){ cout<<"getInstance not supported for Linux_DnsQueryACLForService"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "getInstance not implemented for Linux_DnsQueryACLForService"); } void Linux_DnsQueryACLForServiceDefaultImplementation::setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsQueryACLForServiceManualInstance&){ cout<<"setInstance not supported for Linux_DnsQueryACLForService"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "setInstance not implemented for Linux_DnsQueryACLForService"); } void Linux_DnsQueryACLForServiceDefaultImplementation:: createInstance(const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsQueryACLForServiceManualInstance&){ cout<<"createInstance not supported for Linux_DnsQueryACLForService"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "createInstance not implemented for Linux_DnsQueryACLForService"); } void Linux_DnsQueryACLForServiceDefaultImplementation:: deleteInstance(const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsQueryACLForServiceInstanceName&){ cout<<"deleteInstance not supported for Linux_DnsQueryACLForService"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "deleteInstance not implemented for Linux_DnsQueryACLForService"); } /* Association Interface */ void Linux_DnsQueryACLForServiceDefaultImplementation:: referencesElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsQueryACLForServiceManualInstanceEnumeration& instances){ throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "getElementReferences between Linux_DnsService and Linux_DnsAddressMatchList not implemented for Linux_DnsQueryACLForService"); } void Linux_DnsQueryACLForServiceDefaultImplementation:: referencesSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsQueryACLForServiceManualInstanceEnumeration& instances){ throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "getSettingReferences between Linux_DnsService and Linux_DnsAddressMatchList not implemented for Linux_DnsQueryACLForService"); } void Linux_DnsQueryACLForServiceDefaultImplementation:: associatorsElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsServiceInstanceEnumeration& instances){ std::cout<<"Linux_DnsQueryACLForService : associatorsLinux_DnsService() ... returns one instance"<<std::endl; Linux_DnsQueryACLForServiceManualInstanceEnumeration enumeration; referencesElement(ctx, mbp, sourceInst.getNamespace(), properties, sourceInst, enumeration); Linux_DnsServiceExternal external(mbp, ctx); while(enumeration.hasNext()) { const Linux_DnsQueryACLForServiceManualInstance instance = enumeration.getNext(); const Linux_DnsQueryACLForServiceInstanceName instanceName = instance.getInstanceName(); const Linux_DnsServiceInstanceName Element = instanceName.getElement(); Linux_DnsServiceInstance inst = external.getInstance(properties,Element); instances.addElement(inst); } } void Linux_DnsQueryACLForServiceDefaultImplementation:: associatorsSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceEnumeration& instances){ std::cout<<"Linux_DnsQueryACLForService : associatorsLinux_DnsAddressMatchList() ... returns one instance"<<std::endl; Linux_DnsQueryACLForServiceManualInstanceEnumeration enumeration; referencesSetting(ctx, mbp, sourceInst.getNamespace(), properties, sourceInst, enumeration); Linux_DnsAddressMatchListExternal external(mbp, ctx); while(enumeration.hasNext()) { const Linux_DnsQueryACLForServiceManualInstance instance = enumeration.getNext(); const Linux_DnsQueryACLForServiceInstanceName instanceName = instance.getInstanceName(); const Linux_DnsAddressMatchListInstanceName Setting = instanceName.getSetting(); Linux_DnsAddressMatchListInstance inst = external.getInstance(properties,Setting); instances.addElement(inst); } } /* extrinsic methods */ } --- NEW FILE: Linux_DnsQueryACLForServiceRepositoryInstance.h --- /** * Linux_DnsQueryACLForServiceRepositoryInstance.h * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * author: Murillo Bernardes <ber...@br...> * * Contributors: * */ #ifndef Linux_DnsQueryACLForServiceRepositoryInstance_h #define Linux_DnsQueryACLForServiceRepositoryInstance_h #include "cmpidt.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiBooleanData.h" #include "CmpiCharData.h" #include "CmpiDateTime.h" #include "Linux_DnsQueryACLForServiceInstanceName.h" namespace genProvider { class Linux_DnsQueryACLForServiceRepositoryInstance { public: Linux_DnsQueryACLForServiceRepositoryInstance(); Linux_DnsQueryACLForServiceRepositoryInstance (const Linux_DnsQueryACLForServiceRepositoryInstance& original); Linux_DnsQueryACLForServiceRepositoryInstance (const CmpiInstance& inst, const char* instanceNamespace); ~Linux_DnsQueryACLForServiceRepositoryInstance(); Linux_DnsQueryACLForServiceRepositoryInstance& operator= (const Linux_DnsQueryACLForServiceRepositoryInstance& original); CmpiInstance getCmpiInstance(const char** properties=0) const; unsigned int isInstanceNameSet() const; void setInstanceName( const Linux_DnsQueryACLForServiceInstanceName& val); const Linux_DnsQueryACLForServiceInstanceName& getInstanceName() const; private: void init(); void init(const Linux_DnsQueryACLForServiceRepositoryInstance& original); void reset(); Linux_DnsQueryACLForServiceInstanceName m_instanceName; struct isSetType{ unsigned int instanceName:1; } isSet; }; struct Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement{ Linux_DnsQueryACLForServiceRepositoryInstance* m_elementP; Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement* m_nextP; Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement(); ~Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement(); }; class Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration { private: Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement* firstElementP; Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement* currentElementP; Linux_DnsQueryACLForServiceRepositoryInstanceEnumerationElement* endElementP; public: Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration(); Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration( const Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration& original); ~Linux_DnsQueryACLForServiceRepositoryInstanceEnumeration(); void reset(); bool hasNext() const; const Linux_DnsQueryACLForServiceRepositoryInstance& getNext(); int getSize() const; const Linux_DnsQueryACLForServiceRepositoryInstance& getElement(int pos) const; void addElement(const Linux_DnsQueryACLForServiceRepositoryInstance& elementP); }; } #endif --- NEW FILE: Linux_DnsQueryACLForServiceDefaultImplementation.h --- /** * Linux_DnsQueryACLForServiceDefaultImplementation.h * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * author: Murillo Bernardes <ber...@br...> * * Contributors: * */ #ifndef Linux_DnsQueryACLForServiceDefaultImplementation_h #define Linux_DnsQueryACLForServiceDefaultImplementation_h #include "Linux_DnsQueryACLForServiceInstanceName.h" #include "Linux_DnsQueryACLForServiceManualInstance.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiDateTime.h" #include "CmpiBroker.h" #include "Linux_DnsServiceInstance.h" #include "Linux_DnsAddressMatchListInstance.h" #include "Linux_DnsServiceExternal.h" #include "Linux_DnsAddressMatchListExternal.h" #include "Linux_DnsQueryACLForServiceInterface.h" namespace genProvider { class Linux_DnsQueryACLForServiceDefaultImplementation: public Linux_DnsQueryACLForServiceInterface { public: virtual ~Linux_DnsQueryACLForServiceDefaultImplementation() { }; /* intrinsic methods */ virtual void enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsQueryACLForServiceInstanceNameEnumeration& instnames); virtual void enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsQueryACLForServiceManualInstanceEnumeration& instances); virtual Linux_DnsQueryACLForServiceManualInstance getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsQueryACLForServiceInstanceName&); virtual void setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsQueryACLForServiceManualInstance&); virtual void createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsQueryACLForServiceManualInstance&); virtual void deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsQueryACLForServiceInstanceName&); /* Association Interface */ virtual void referencesElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsQueryACLForServiceManualInstanceEnumeration& instances); virtual void referencesSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsQueryACLForServiceManualInstanceEnumeration& instances); virtual void associatorsElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsServiceInstanceEnumeration& instances); virtual void associatorsSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceEnumeration& instances); /* extrinsic methods */ }; } #endif --- NEW FILE: Linux_DnsQueryACLForServiceManualInstance.cpp --- /** * Linux_DnsQueryACLForServiceManualInstance.cpp * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * author: Murillo Bernardes <ber...@br...> * * Contributors: * */ #include "Linux_DnsQueryACLForServiceManualInstance.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //Linux_DnsQueryACLForServiceManualInstance //********************************************************* //empty constructor Linux_DnsQueryACLForServiceManualInstance:: Linux_DnsQueryACLForServiceManualInstance(){ init(); }; //copy constructor Linux_DnsQueryACLForServiceManualInstance:: Linux_DnsQueryACLForServiceManualInstance (const Linux_DnsQueryACLForServiceManualInstance& original){ init(original); }; //constructor using CmpiInstance Linux_DnsQueryACLForServiceManualInstance:: Linux_DnsQueryACLForServiceManualInstance (const CmpiInstance& inst, const char* instanceNamespace){ CmpiData cmpiData; init(); CmpiObjectPath cop=inst.getObjectPath(); cop.setNameSpace(instanceNamespace); setInstanceName(Linux_DnsQueryACLForServiceInstanceName(cop)); } //Destructor Linux_DnsQueryACLForServiceManualInstance:: ~Linux_DnsQueryACLForServiceManualInstance(){ reset(); }; //copy operator Linux_DnsQueryACLForServiceManualInstance& Linux_DnsQueryACLForServiceManualInstance::operator= (const Linux_DnsQueryACLForServiceManualInstance& original){ init(original); return *this; }; //converts to CmpiInstance CmpiInstance Linux_DnsQueryACLForServiceManualInstance:: getCmpiInstance(const char** properties) const{ CmpiObjectPath objectPath=getInstanceName().getObjectPath(); CmpiInstance cmpiInstance(objectPath); getInstanceName().fillKeys(cmpiInstance); if (properties) { cmpiInstance.setPropertyFilter(properties,0); } return cmpiInstance; } //InstanceName related methods unsigned int Linux_DnsQueryACLForServiceManualInstance:: isInstanceNameSet() const{ return isSet.instanceName; } const Linux_DnsQueryACLForServiceInstanceName& Linux_DnsQueryACLForServiceManualInstance::getInstanceName() const{ if(!isSet.instanceName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "InstanceName not set in Linux_DnsQueryACLForService instance"); return m_instanceName; } void Linux_DnsQueryACLForServiceManualInstance::setInstanceName( const Linux_DnsQueryACLForServiceInstanceName& val){ m_instanceName = val; isSet.instanceName=1; } //set isSet attributes to FALSE void Linux_DnsQueryACLForServiceManualInstance::init(){ isSet.instanceName=0; }; //copies another instance properties in this void Linux_DnsQueryACLForServiceManualInstance::init (const Linux_DnsQueryACLForServiceManualInstance& original){ init(); if(original.isInstanceNameSet()){ setInstanceName(original.getInstanceName()); } } //reset the instance data void Linux_DnsQueryACLForServiceManualInstance::reset(){ }; //********************************************************* //Linux_DnsQueryACLForServiceManualInstanceEnumerationElement //********************************************************* Linux_DnsQueryACLForServiceManualInstanceEnumerationElement:: Linux_DnsQueryACLForServiceManualInstanceEnumerationElement(){ m_elementP=0; m_nextP=0; }; Linux_DnsQueryACLForServiceManualInstanceEnumerationElement:: ~Linux_DnsQueryACLForServiceManualInstanceEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //Linux_DnsQueryACLForServiceManualInstanceNameEnumeration //********************************************************* Linux_DnsQueryACLForServiceManualInstanceEnumeration:: Linux_DnsQueryACLForServiceManualInstanceEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; Linux_DnsQueryACLForServiceManualInstanceEnumeration:: Linux_DnsQueryACLForServiceManualInstanceEnumeration( const Linux_DnsQueryACLForServiceManualInstanceEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; Linux_DnsQueryACLForServiceManualInstanceEnumeration:: ~Linux_DnsQueryACLForServiceManualInstanceEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void Linux_DnsQueryACLForServiceManualInstanceEnumeration::reset(){ currentElementP=firstElementP; }; bool Linux_DnsQueryACLForServiceManualInstanceEnumeration::hasNext() const{ return (currentElementP!=0); }; int Linux_DnsQueryACLForServiceManualInstanceEnumeration::getSize() const{ int size=0; Linux_DnsQueryACLForServiceManualInstanceEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const Linux_DnsQueryACLForServiceManualInstance& Linux_DnsQueryACLForServiceManualInstanceEnumeration::getElement(int pos) const{ Linux_DnsQueryACLForServiceManualInstanceEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const Linux_DnsQueryACLForServiceManualInstance& Linux_DnsQueryACLForServiceManualInstanceEnumeration::getNext() { Linux_DnsQueryACLForServiceManualInstanceEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void Linux_DnsQueryACLForServiceManualInstanceEnumeration::addElement (const Linux_DnsQueryACLForServiceManualInstance& elementP){ if(firstElementP==0){ firstElementP=new Linux_DnsQueryACLForServiceManualInstanceEnumerationElement(); firstElementP->m_elementP=new Linux_DnsQueryACLForServiceManualInstance(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new Linux_DnsQueryACLForServiceManualInstanceEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new Linux_DnsQueryACLForServiceManualInstance(elementP); } }; } --- NEW FILE: Linux_DnsQueryACLForServiceInstance.h --- /** * Linux_DnsQueryACLForServiceInstance.h * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * author: Murillo Bernardes <ber...@br...> * * Contributors: * */ #ifndef Linux_DnsQueryACLForServiceInstance_h #define Linux_DnsQueryACLForServiceInstance_h #include "cmpidt.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiBooleanData.h" #include "CmpiCharData.h" #include "CmpiDateTime.h" #include "Linux_DnsQueryACLForServiceInstanceName.h" namespace genProvider { class Linux_DnsQueryACLForServiceInstance { public: Linux_DnsQueryACLForServiceInstance(); Linux_DnsQueryACLForServiceInstance (const Linux_DnsQueryACLForServiceInstance& original); Linux_DnsQueryACLForServiceInstance (const CmpiInstance& inst, const char* instanceNamespace); ~Linux_DnsQueryACLForServiceInstance(); Linux_DnsQueryACLForServiceInstance& operator= (const Linux_DnsQueryACLForServiceInstance& original); CmpiInstance getCmpiInstance(const char** properties=0) const; unsigned int isInstanceNameSet() const; void setInstanceName( const Linux_DnsQueryACLForServiceInstanceName& val); const Linux_DnsQueryACLForServiceInstanceName& getInstanceName() const; private: void init(); void init(const Linux_DnsQueryACLForServiceInstance& original); void reset(); Linux_DnsQueryACLForServiceInstanceName m_instanceName; struct isSetType{ unsigned int instanceName:1; } isSet; }; struct Linux_DnsQueryACLForServiceInstanceEnumerationElement{ Linux_DnsQueryACLForServiceInstance* m_elementP; Linux_DnsQueryACLForServiceInstanceEnumerationElement* m_nextP; Linux_DnsQueryACLForServiceInstanceEnumerationElement(); ~Linux_DnsQueryACLForServiceInstanceEnumerationElement(); }; class Linux_DnsQueryACLForServiceInstanceEnumeration { private: Linux_DnsQueryACLForServiceInstanceEnumerationElement* firstElementP; Linux_DnsQueryACLForServiceInstanceEnumerationElement* currentElementP; Linux_DnsQueryACLForServiceInstanceEnumerationElement* endElementP; public: Linux_DnsQueryACLForServiceInstanceEnumeration(); Linux_DnsQueryACLForServiceInstanceEnumeration( const Linux_DnsQueryACLForServiceInstanceEnumeration& original); ~Linux_DnsQueryACLForServiceInstanceEnumeration(); void reset(); bool hasNext() const; const Linux_DnsQueryACLForServiceInstance& getNext(); int getSize() const; const Linux_DnsQueryACLForServiceInstance& getElement(int pos) const; void addElement(const Linux_DnsQueryACLForServiceInstance& elementP); }; } #endif --- NEW FILE: makefile --- include ../setting.cmpi include setting.provider CPPFLAGS=$(CPPFLAGS.provider) -I. -I$(CIMOMINC) -I$(COMMONINC) -I$(CIMOMINC)/cpp -I../CIM_CollectionOfMSEs -I../Linux_DnsService -I../Linux_DnsAddressMatchList -I../CIM_ConcreteJob -I../CIM_ManagedSystemElement -D_COMPILE_UNIX -DCMPI_STANDALONE CXXFLAGS=-Wall -g -fPIC -fno-implicit-templates LDFLAGS=-L. -L$(COMMONLIB) -L$(COMMONLIB_OUT) -shared -lLinux_DnsServiceSupport -lLinux_DnsAddressMatchListSupport -lcmpiCppImpl -lIBM_ProviderTooling OBJECTS=Linux_DnsQueryACLForServiceInstanceName.o \ Linux_DnsQueryACLForServiceInstance.o \ Linux_DnsQueryACLForServiceExternal.o \ Linux_DnsQueryACLForServiceRepositoryInstance.o \ Linux_DnsQueryACLForServiceRepositoryExternal.o \ Linux_DnsQueryACLForServiceManualInstance.o \ Linux_DnsQueryACLForServiceDefaultImplementation.o FAKEFACTORY= Linux_DnsQueryACLForServiceFakeFactory.o NORMALFACTORY= Linux_DnsQueryACLForServiceFactory.o RESOURCEOBJECT= Linux_DnsQueryACLForServiceResourceAccess.o PROVIDEROBJECT=CmpiLinux_DnsQueryACLForServiceProvider.o all: testfiles preinstall install buildall: clean all #------------------------------------------------------------------------------# compile: $(OBJECTS) $(FAKEFACTORY) $(NORMALFACTORY) $(RESOURCEOBJECT) $(PROVIDEROBJECT) #------------------------------------------------------------------------------# prelink: $(OBJECTS) $(FAKEFACTORY) $(LINK.cpp) -o libLinux_DnsQueryACLForServiceSupport.so $^ link: deleteFakeLib \ libLinux_DnsQueryACLForServiceSupport.so \ libLinux_DnsQueryACLForService.so libLinux_DnsQueryACLForServiceSupport.so: LDFLAGS+=$(LDFLAGS.provider) libLinux_DnsQueryACLForServiceSupport.so: $(OBJECTS) $(NORMALFACTORY) $(RESOURCEOBJECT) $(PROVIDEROBJECT) $(LINK.cpp) -o $@ $^ libLinux_DnsQueryACLForService.so: LDFLAGS+=-lLinux_DnsQueryACLForServiceSupport libLinux_DnsQueryACLForService.so: $(PROVIDEROBJECT) $(LINK.cpp) -o $@ $^ deleteFakeLib: $(RM) *.so #------------------------------------------------------------------------------# preinstall: prelink install libLinux_DnsQueryACLForServiceSupport.so $(COMMONLIB_OUT) #------------------------------------------------------------------------------# install: link install libLinux_DnsQueryACLForServiceSupport.so $(COMMONLIB_OUT) install libLinux_DnsQueryACLForService.so $(CIMOMLIB_OUT) # install -m 644 Linux_DnsQueryACLForService*.h $(COMMONINC) $(MAKE) -C mof -f $(MOFMAKEFILE) install #------------------------------------------------------------------------------# testfiles: @[ -d $(CIMOMLIB) ] || ( echo directory $(CIMOMLIB) does not exist && false) @[ -d $(CIMOMINC) ] || ( echo directory $(CIMOMINC) does not exist - please create manually && false) @[ -d $(CIMOMMOF) ] || ( echo directory $(CIMOMMOF) does not exist - please create manually && false) @[ -d $(COMMONINC) ] || ( echo directory $(COMMONINC) does not exist - please create manually && false) @[ -d $(COMMONLIB) ] || ( echo directory $(COMMONLIB) does not exist - please create manually && false) #------------------------------------------------------------------------------# clean: $(RM) *.so *.o *~ #------------------------------------------------------------------------------# uninstall: $(MAKE) -C mof -f $(MOFMAKEFILE) uninstall; # $(RM) $(COMMONINC)/Linux_DnsQueryACLForService*.h \ $(RM) $(COMMONLIB)/libLinux_DnsQueryACLForServiceSupport.so \ $(RM) $(CIMOMLIB)/libLinux_DnsQueryACLForService.so --- NEW FILE: Linux_DnsQueryACLForServiceInstanceName.h --- /** * Linux_DnsQueryACLForServiceInstanceName.h * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * author: Murillo Bernardes <ber...@br...> * * Contributors: * */ #ifndef Linux_DnsQueryACLForServiceInstanceName_h #define Linux_DnsQueryACLForServiceInstanceName_h #include "cmpidt.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiBooleanData.h" #include "CmpiCharData.h" #include "CmpiDateTime.h" #include "ArrayConverter.h" #include "CmpiErrorFormater.h" #include "Linux_DnsServiceInstanceName.h" #include "Linux_DnsAddressMatchListInstanceName.h" namespace genProvider { class Linux_DnsQueryACLForServiceInstanceName { public: Linux_DnsQueryACLForServiceInstanceName(); Linux_DnsQueryACLForServiceInstanceName (const Linux_DnsQueryACLForServiceInstanceName& original); Linux_DnsQueryACLForServiceInstanceName (const CmpiObjectPath& path); ~Linux_DnsQueryACLForServiceInstanceName(); Linux_DnsQueryACLForServiceInstanceName& operator= (const Linux_DnsQueryACLForServiceInstanceName& original); CmpiObjectPath getObjectPath() const; void fillKeys(CmpiInstance& cmpiInstance) const; unsigned int isNameSpaceSet() const; void setNamespace(const char * val, int makeCopy = 1); const char * getNamespace() const; unsigned int isElementSet() const; void setElement(const Linux_DnsServiceInstanceName& val); const Linux_DnsServiceInstanceName& getElement() const; unsigned int isSettingSet() const; void setSetting(const Linux_DnsAddressMatchListInstanceName& val); const Linux_DnsAddressMatchListInstanceName& getSetting() const; private: void init(); void init(const Linux_DnsQueryACLForServiceInstanceName& original); void reset(); const char* m_CIMClassNameP; const char* m_namespace; Linux_DnsServiceInstanceName m_Element; Linux_DnsAddressMatchListInstanceName m_Setting; struct isSetType{ unsigned int m_namespace:1; unsigned int Element:1; unsigned int Setting:1; } isSet; }; struct Linux_DnsQueryACLForServiceInstanceNameEnumerationElement{ Linux_DnsQueryACLForServiceInstanceName* m_elementP; Linux_DnsQueryACLForServiceInstanceNameEnumerationElement* m_nextP; Linux_DnsQueryACLForServiceInstanceNameEnumerationElement(); ~Linux_DnsQueryACLForServiceInstanceNameEnumerationElement(); }; class Linux_DnsQueryACLForServiceInstanceNameEnumeration { private: Linux_DnsQueryACLForServiceInstanceNameEnumerationElement* firstElementP; Linux_DnsQueryACLForServiceInstanceNameEnumerationElement* currentElementP; Linux_DnsQueryACLForServiceInstanceNameEnumerationElement* endElementP; public: Linux_DnsQueryACLForServiceInstanceNameEnumeration(); Linux_DnsQueryACLForServiceInstanceNameEnumeration(const CmpiArray& arr); Linux_DnsQueryACLForServiceInstanceNameEnumeration( const Linux_DnsQueryACLForServiceInstanceNameEnumeration& original); ~Linux_DnsQueryACLForServiceInstanceNameEnumeration(); void reset(); bool hasNext() const; const Linux_DnsQueryACLForServiceInstanceName& getNext(); int getSize() const; const Linux_DnsQueryACLForServiceInstanceName& getElement(int pos) const; //no copy of the element is done void addElement(const Linux_DnsQueryACLForServiceInstanceName& elementP); operator CmpiArray() const; }; } #endif --- NEW FILE: Linux_DnsQueryACLForServiceInterface.h --- /** * Linux_DnsQueryACLForServiceInterface.h * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * author: Murillo Bernardes <ber...@br...> * * Contributors: * */ #ifndef Linux_DnsQueryACLForServiceInterface_h #define Linux_DnsQueryACLForServiceInterface_h #include "Linux_DnsQueryACLForServiceInstanceName.h" #include "Linux_DnsQueryACLForServiceManualInstance.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiDateTime.h" #include "CmpiBroker.h" #include "Linux_DnsServiceInstance.h" #include "Linux_DnsAddressMatchListInstance.h" #include "Linux_DnsServiceExternal.h" #include "Linux_DnsAddressMatchListExternal.h" namespace genProvider { class Linux_DnsQueryACLForServiceInterface { public: virtual ~Linux_DnsQueryACLForServiceInterface() { }; /* intrinsic methods */ virtual void enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsQueryACLForServiceInstanceNameEnumeration& instnames) = 0; virtual void enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsQueryACLForServiceManualInstanceEnumeration& instances) = 0; virtual Linux_DnsQueryACLForServiceManualInstance getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsQueryACLForServiceInstanceName&) = 0; virtual void setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsQueryACLForServiceManualInstance&) = 0; virtual void createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsQueryACLForServiceManualInstance&) = 0; virtual void deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsQueryACLForServiceInstanceName&) = 0; /* Association Interface */ virtual void referencesElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsQueryACLForServiceManualInstanceEnumeration& instances) = 0; virtual void referencesSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsQueryACLForServiceManualInstanceEnumeration& instances) = 0; virtual void associatorsElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsServiceInstanceEnumeration& instances) = 0; virtual void associatorsSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceEnumeration& instances) = 0; /* extrinsic methods */ }; } #endif --- NEW FILE: Linux_DnsQueryACLForServiceFactory.h --- /** * Linux_DnsQueryACLForServiceFactory.h * * (C) Copyright IBM Corp. 2005 * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT. * * You can obtain a current copy of the Common Public License from * http://www.opensource.org/licenses/cpl1.0.php * * author: Murillo Bernardes <ber...@br...> * * Contributors: * */ #ifndef Linux_DnsQueryACLForServiceFactory_h #define Linux_DnsQueryACLForServiceFactory_h #include "Linux_DnsQueryACLForServiceInterface.h" namespace genProvider{ class Linux_DnsQueryACLForServiceFactory{ public: Linux_DnsQueryACLForServiceFactory(){}; ~Linux_DnsQueryACLForServiceFactory(){}; static Linux_DnsQueryACLForServiceInterface* getImplementation(); }; } #endif --- NEW FILE: CmpiLinux_DnsQueryACLForServiceProvider.cpp --- /** * CmpiLinux_DnsQueryACL... [truncated message content] |
Update of /cvsroot/sblim/cmpi-dns/provider/Linux_DnsSetting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20455/provider/Linux_DnsSetting Added Files: Linux_DnsSettingExternal.cpp Linux_DnsSettingDefaultImplementation.cpp Linux_DnsSettingManualInstance.cpp Linux_DnsSettingFactory.h Linux_DnsSettingResourceAccess.cpp Linux_DnsSettingRepositoryInstance.h Linux_DnsSettingInstance.h Linux_DnsSettingInterface.h Linux_DnsSettingManualInstance.h Linux_DnsSettingInstanceName.h Linux_DnsSettingInstanceName.cpp Linux_DnsSettingRepositoryInstance.cpp Linux_DnsSettingDefaultImplementation.h setting.provider Linux_DnsSettingRepositoryExternal.h Linux_DnsSettingExternal.h Linux_DnsSettingRepositoryExternal.cpp CmpiLinux_DnsSettingProvider.cpp makefile Linux_DnsSettingInstance.cpp Linux_DnsSettingResourceAccess.h CmpiLinux_DnsSettingProvider.h Linux_DnsSettingFakeFactory.cpp Linux_DnsSettingFactory.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_DnsSettingManualInstance.h --- /** * Linux_DnsSettingManualInstance.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_DnsSettingManualInstance_h #define Linux_DnsSettingManualInstance_h #include "cmpidt.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiBooleanData.h" #include "CmpiCharData.h" #include "CmpiDateTime.h" #include "Linux_DnsSettingInstanceName.h" namespace genProvider { class Linux_DnsSettingManualInstance { public: Linux_DnsSettingManualInstance(); Linux_DnsSettingManualInstance (const Linux_DnsSettingManualInstance& original); Linux_DnsSettingManualInstance (const CmpiInstance& inst, const char* instanceNamespace); ~Linux_DnsSettingManualInstance(); Linux_DnsSettingManualInstance& operator= (const Linux_DnsSettingManualInstance& original); CmpiInstance getCmpiInstance(const char** properties=0) const; unsigned int isInstanceNameSet() const; void setInstanceName( const Linux_DnsSettingInstanceName& val); const Linux_DnsSettingInstanceName& getInstanceName() const; unsigned int isConfigurationDirectorySet() const; void setConfigurationDirectory(const char* val, int makeCopy = 1); const char* getConfigurationDirectory() const; unsigned int isForwardSet() const; void setForward(const CMPIUint16 val); const CMPIUint16 getForward() const; unsigned int isForwardersSet() const; void setForwarders(const char** val, unsigned const int size, int makeCopy = 1); const char** getForwarders(unsigned int& size) const; unsigned int isPortNumberSet() const; void setPortNumber(const CMPIUint32 val); const CMPIUint32 getPortNumber() const; unsigned int isTSIGSet() const; void setTSIG(const CMPIUint16 val); const CMPIUint16 getTSIG() const; unsigned int isTTLSet() const; void setTTL(const CMPIUint32 val); const CMPIUint32 getTTL() const; unsigned int isXferFormatSet() const; void setXferFormat(const CMPIUint16 val); const CMPIUint16 getXferFormat() const; private: void init(); void init(const Linux_DnsSettingManualInstance& original); void reset(); Linux_DnsSettingInstanceName m_instanceName; const char* m_ConfigurationDirectory; CMPIUint16 m_Forward; const char** m_Forwarders; unsigned int ForwardersArraySize; CMPIUint32 m_PortNumber; CMPIUint16 m_TSIG; CMPIUint32 m_TTL; CMPIUint16 m_XferFormat; struct isSetType{ unsigned int instanceName:1; unsigned int ConfigurationDirectory:1; unsigned int Forward:1; unsigned int Forwarders:1; unsigned int PortNumber:1; unsigned int TSIG:1; unsigned int TTL:1; unsigned int XferFormat:1; } isSet; }; struct Linux_DnsSettingManualInstanceEnumerationElement{ Linux_DnsSettingManualInstance* m_elementP; Linux_DnsSettingManualInstanceEnumerationElement* m_nextP; Linux_DnsSettingManualInstanceEnumerationElement(); ~Linux_DnsSettingManualInstanceEnumerationElement(); }; class Linux_DnsSettingManualInstanceEnumeration { private: Linux_DnsSettingManualInstanceEnumerationElement* firstElementP; Linux_DnsSettingManualInstanceEnumerationElement* currentElementP; Linux_DnsSettingManualInstanceEnumerationElement* endElementP; public: Linux_DnsSettingManualInstanceEnumeration(); Linux_DnsSettingManualInstanceEnumeration( const Linux_DnsSettingManualInstanceEnumeration& original); ~Linux_DnsSettingManualInstanceEnumeration(); void reset(); bool hasNext() const; const Linux_DnsSettingManualInstance& getNext(); int getSize() const; const Linux_DnsSettingManualInstance& getElement(int pos) const; void addElement(const Linux_DnsSettingManualInstance& elementP); }; } #endif --- NEW FILE: Linux_DnsSettingInstanceName.h --- /** * Linux_DnsSettingInstanceName.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_DnsSettingInstanceName_h #define Linux_DnsSettingInstanceName_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" namespace genProvider { class Linux_DnsSettingInstanceName { public: Linux_DnsSettingInstanceName(); Linux_DnsSettingInstanceName (const Linux_DnsSettingInstanceName& original); Linux_DnsSettingInstanceName (const CmpiObjectPath& path); ~Linux_DnsSettingInstanceName(); Linux_DnsSettingInstanceName& operator= (const Linux_DnsSettingInstanceName& 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 isNameSet() const; void setName(const char* val, int makeCopy = 1); const char* getName() const; private: void init(); void init(const Linux_DnsSettingInstanceName& original); void reset(); const char* m_CIMClassNameP; const char* m_namespace; const char* m_Name; struct isSetType{ unsigned int m_namespace:1; unsigned int Name:1; } isSet; }; struct Linux_DnsSettingInstanceNameEnumerationElement{ Linux_DnsSettingInstanceName* m_elementP; Linux_DnsSettingInstanceNameEnumerationElement* m_nextP; Linux_DnsSettingInstanceNameEnumerationElement(); ~Linux_DnsSettingInstanceNameEnumerationElement(); }; class Linux_DnsSettingInstanceNameEnumeration { private: Linux_DnsSettingInstanceNameEnumerationElement* firstElementP; Linux_DnsSettingInstanceNameEnumerationElement* currentElementP; Linux_DnsSettingInstanceNameEnumerationElement* endElementP; public: Linux_DnsSettingInstanceNameEnumeration(); Linux_DnsSettingInstanceNameEnumeration(const CmpiArray& arr); Linux_DnsSettingInstanceNameEnumeration( const Linux_DnsSettingInstanceNameEnumeration& original); ~Linux_DnsSettingInstanceNameEnumeration(); void reset(); bool hasNext() const; const Linux_DnsSettingInstanceName& getNext(); int getSize() const; const Linux_DnsSettingInstanceName& getElement(int pos) const; //no copy of the element is done void addElement(const Linux_DnsSettingInstanceName& elementP); operator CmpiArray() const; }; } #endif --- NEW FILE: Linux_DnsSettingExternal.h --- /** * Linux_DnsSettingExternal.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_DnsSettingExternal_h #define Linux_DnsSettingExternal_h #include "Linux_DnsSettingInstance.h" #include "CmpiBroker.h" namespace genProvider { class Linux_DnsSettingExternal { public: Linux_DnsSettingExternal( const CmpiBroker& brkr, const CmpiContext& ctx); virtual ~Linux_DnsSettingExternal(); virtual void enumInstanceNames( const char *nsp, Linux_DnsSettingInstanceNameEnumeration&); virtual void enumInstances( const char *nsp, const char* *properties, Linux_DnsSettingInstanceEnumeration&); virtual Linux_DnsSettingInstance getInstance( const char* *properties, const Linux_DnsSettingInstanceName&); virtual void setInstance( const char* *properties, const Linux_DnsSettingInstance&); virtual void createInstance( const Linux_DnsSettingInstance&); virtual void deleteInstance( const Linux_DnsSettingInstanceName&); private: CmpiBroker broker; CmpiContext context; }; } #endif --- NEW FILE: Linux_DnsSettingExternal.cpp --- /** * Linux_DnsSettingExternal.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_DnsSettingExternal.h" namespace genProvider{ Linux_DnsSettingExternal::Linux_DnsSettingExternal( const CmpiBroker& brkr, const CmpiContext& ctx ) : broker(brkr), context(ctx) {}; Linux_DnsSettingExternal:: ~Linux_DnsSettingExternal(){}; void Linux_DnsSettingExternal::enumInstanceNames( const char *nsp, Linux_DnsSettingInstanceNameEnumeration& instnames) { CmpiObjectPath op(nsp,"Linux_DnsSetting"); CmpiEnumeration en=broker.enumInstanceNames(context,op); while(en.hasNext()) { CmpiObjectPath opi = en.getNext(); Linux_DnsSettingInstanceName iname(opi); instnames.addElement(iname); } }; void Linux_DnsSettingExternal::enumInstances( const char *nsp, const char* *properties, Linux_DnsSettingInstanceEnumeration& instances) { CmpiObjectPath op(nsp,"Linux_DnsSetting"); CmpiEnumeration en=broker.enumInstances(context,op,properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); Linux_DnsSettingInstance instance(inst,nsp); instances.addElement(instance); } }; Linux_DnsSettingInstance Linux_DnsSettingExternal::getInstance( const char* *properties, const Linux_DnsSettingInstanceName& instanceName) { CmpiObjectPath op=instanceName.getObjectPath(); CmpiInstance inst=broker.getInstance(context,op,properties); return Linux_DnsSettingInstance(inst,instanceName.getNamespace()); } void Linux_DnsSettingExternal::setInstance( const char* *properties, const Linux_DnsSettingInstance& instance){ CmpiObjectPath op=instance.getInstanceName().getObjectPath(); CmpiInstance inst=instance.getCmpiInstance(); broker.setInstance(context,op,inst,properties); } void Linux_DnsSettingExternal::createInstance( const Linux_DnsSettingInstance& instance){ CmpiObjectPath op=instance.getInstanceName().getObjectPath(); CmpiInstance inst=instance.getCmpiInstance(); broker.createInstance(context,op,inst); } void Linux_DnsSettingExternal::deleteInstance( const Linux_DnsSettingInstanceName& instanceName){ CmpiObjectPath op=instanceName.getObjectPath(); broker.deleteInstance(context,op); } } --- NEW FILE: Linux_DnsSettingRepositoryInstance.h --- /** * Linux_DnsSettingRepositoryInstance.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_DnsSettingRepositoryInstance_h #define Linux_DnsSettingRepositoryInstance_h #include "cmpidt.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiBooleanData.h" #include "CmpiCharData.h" #include "CmpiDateTime.h" #include "Linux_DnsSettingInstanceName.h" namespace genProvider { class Linux_DnsSettingRepositoryInstance { public: Linux_DnsSettingRepositoryInstance(); Linux_DnsSettingRepositoryInstance (const Linux_DnsSettingRepositoryInstance& original); Linux_DnsSettingRepositoryInstance (const CmpiInstance& inst, const char* instanceNamespace); ~Linux_DnsSettingRepositoryInstance(); Linux_DnsSettingRepositoryInstance& operator= (const Linux_DnsSettingRepositoryInstance& original); CmpiInstance getCmpiInstance(const char** properties=0) const; unsigned int isInstanceNameSet() const; void setInstanceName( const Linux_DnsSettingInstanceName& val); const Linux_DnsSettingInstanceName& getInstanceName() const; private: void init(); void init(const Linux_DnsSettingRepositoryInstance& original); void reset(); Linux_DnsSettingInstanceName m_instanceName; struct isSetType{ unsigned int instanceName:1; } isSet; }; struct Linux_DnsSettingRepositoryInstanceEnumerationElement{ Linux_DnsSettingRepositoryInstance* m_elementP; Linux_DnsSettingRepositoryInstanceEnumerationElement* m_nextP; Linux_DnsSettingRepositoryInstanceEnumerationElement(); ~Linux_DnsSettingRepositoryInstanceEnumerationElement(); }; class Linux_DnsSettingRepositoryInstanceEnumeration { private: Linux_DnsSettingRepositoryInstanceEnumerationElement* firstElementP; Linux_DnsSettingRepositoryInstanceEnumerationElement* currentElementP; Linux_DnsSettingRepositoryInstanceEnumerationElement* endElementP; public: Linux_DnsSettingRepositoryInstanceEnumeration(); Linux_DnsSettingRepositoryInstanceEnumeration( const Linux_DnsSettingRepositoryInstanceEnumeration& original); ~Linux_DnsSettingRepositoryInstanceEnumeration(); void reset(); bool hasNext() const; const Linux_DnsSettingRepositoryInstance& getNext(); int getSize() const; const Linux_DnsSettingRepositoryInstance& getElement(int pos) const; void addElement(const Linux_DnsSettingRepositoryInstance& elementP); }; } #endif --- NEW FILE: makefile --- include ../setting.cmpi include setting.provider CPPFLAGS=$(CPPFLAGS.provider) -I. -I$(CIMOMINC) -I$(COMMONINC) -I$(CIMOMINC)/cpp -I../CIM_CollectionOfMSEs -I../CIM_ManagedSystemElement -D_COMPILE_UNIX -DCMPI_STANDALONE CXXFLAGS=-Wall -g -fPIC -fno-implicit-templates LDFLAGS=-L. -L$(COMMONLIB) -L$(COMMONLIB_OUT) -shared -lCIM_CollectionOfMSEsSupport -lCIM_ManagedSystemElementSupport -lcmpiCppImpl -lIBM_ProviderTooling OBJECTS=Linux_DnsSettingInstanceName.o \ Linux_DnsSettingInstance.o \ Linux_DnsSettingExternal.o \ Linux_DnsSettingRepositoryInstance.o \ Linux_DnsSettingRepositoryExternal.o \ Linux_DnsSettingManualInstance.o \ Linux_DnsSettingDefaultImplementation.o FAKEFACTORY= Linux_DnsSettingFakeFactory.o NORMALFACTORY= Linux_DnsSettingFactory.o RESOURCEOBJECT= Linux_DnsSettingResourceAccess.o PROVIDEROBJECT=CmpiLinux_DnsSettingProvider.o all: testfiles preinstall install buildall: clean all #------------------------------------------------------------------------------# compile: $(OBJECTS) $(FAKEFACTORY) $(NORMALFACTORY) $(RESOURCEOBJECT) $(PROVIDEROBJECT) #------------------------------------------------------------------------------# prelink: $(OBJECTS) $(FAKEFACTORY) $(LINK.cpp) -o libLinux_DnsSettingSupport.so $^ link: deleteFakeLib \ libLinux_DnsSettingSupport.so \ libLinux_DnsSetting.so libLinux_DnsSettingSupport.so: LDFLAGS+=$(LDFLAGS.provider) libLinux_DnsSettingSupport.so: $(OBJECTS) $(NORMALFACTORY) $(RESOURCEOBJECT) $(PROVIDEROBJECT) $(LINK.cpp) -o $@ $^ libLinux_DnsSetting.so: LDFLAGS+=-lLinux_DnsSettingSupport libLinux_DnsSetting.so: $(PROVIDEROBJECT) $(LINK.cpp) -o $@ $^ deleteFakeLib: $(RM) *.so #------------------------------------------------------------------------------# preinstall: prelink install libLinux_DnsSettingSupport.so $(COMMONLIB_OUT) #------------------------------------------------------------------------------# install: link install libLinux_DnsSettingSupport.so $(COMMONLIB_OUT) install libLinux_DnsSetting.so $(CIMOMLIB_OUT) # install -m 644 Linux_DnsSetting*.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_DnsSetting*.h \ $(RM) $(COMMONLIB)/libLinux_DnsSettingSupport.so \ $(RM) $(CIMOMLIB)/libLinux_DnsSetting.so --- NEW FILE: Linux_DnsSettingDefaultImplementation.h --- /** * Linux_DnsSettingDefaultImplementation.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_DnsSettingDefaultImplementation_h #define Linux_DnsSettingDefaultImplementation_h #include "Linux_DnsSettingInstanceName.h" #include "Linux_DnsSettingManualInstance.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiDateTime.h" #include "CmpiBroker.h" #include "CIM_CollectionOfMSEsInstanceName.h" #include "CIM_ManagedSystemElementInstanceName.h" #include "Linux_DnsSettingInterface.h" namespace genProvider { class Linux_DnsSettingDefaultImplementation: public Linux_DnsSettingInterface { public: virtual ~Linux_DnsSettingDefaultImplementation() { }; /* intrinsic methods */ virtual void enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsSettingInstanceNameEnumeration& instnames); virtual void enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsSettingManualInstanceEnumeration& instances); virtual Linux_DnsSettingManualInstance getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsSettingInstanceName&); virtual void setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsSettingManualInstance&); virtual void createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingManualInstance&); virtual void deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&); /* extrinsic methods */ virtual CMPIUint32 ApplyIncrementalChangeToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CMPIBoolean &ContinueOnError, int isContinueOnErrorPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent, char** &CanNotApply, CMPICount &CanNotApplySize); virtual CMPIUint32 ApplyIncrementalChangeToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent); virtual CMPIUint32 ApplyToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CMPIBoolean &ContinueOnError, int isContinueOnErrorPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, char** &CanNotApply, CMPICount &CanNotApplySize); virtual CMPIUint32 ApplyToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent); virtual CMPIUint32 VerifyOKToApplyIncrementalChangeToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent, char** &CanNotApply, CMPICount &CanNotApplySize); virtual CMPIUint32 VerifyOKToApplyIncrementalChangeToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent); virtual CMPIUint32 VerifyOKToApplyToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, char** &CanNotApply, CMPICount &CanNotApplySize); virtual CMPIUint32 VerifyOKToApplyToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent); }; } #endif --- NEW FILE: Linux_DnsSettingInstanceName.cpp --- /** * Linux_DnsSettingInstanceName.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_DnsSettingInstanceName.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //Linux_DnsSettingInstanceName //********************************************************* //empty constructor Linux_DnsSettingInstanceName:: Linux_DnsSettingInstanceName(){ init(); }; //copy constructor Linux_DnsSettingInstanceName:: Linux_DnsSettingInstanceName (const Linux_DnsSettingInstanceName& original){ init(original); }; //contructor using CmpiObjectPath Linux_DnsSettingInstanceName:: Linux_DnsSettingInstanceName (const CmpiObjectPath& path){ init(); m_CIMClassNameP=path.getClassName().charPtr(); CmpiString namespaceOP; namespaceOP=path.getNameSpace(); setNamespace(namespaceOP.charPtr(),1); CmpiString Name = path.getKey("Name"); setName(Name.charPtr()); } //destructor Linux_DnsSettingInstanceName:: ~Linux_DnsSettingInstanceName(){ reset(); }; //copy operator Linux_DnsSettingInstanceName& Linux_DnsSettingInstanceName::operator= (const Linux_DnsSettingInstanceName& original){ init(original); return *this; } //returns the related CmpiObjectPath CmpiObjectPath Linux_DnsSettingInstanceName:: getObjectPath() const{ CmpiObjectPath objectPath(m_namespace, m_CIMClassNameP); objectPath.setKey("Name",CmpiData(m_Name)); return objectPath; } //adds the related CmpiObjectPath to an existing cmpiInstance void Linux_DnsSettingInstanceName::fillKeys(CmpiInstance& cmpiInstance) const{ if(isSet.Name){ cmpiInstance.setProperty("Name",CmpiData(m_Name)); } } //NameSpace related methods unsigned int Linux_DnsSettingInstanceName:: isNameSpaceSet() const{ return isSet.m_namespace; } const char * Linux_DnsSettingInstanceName:: getNamespace() const { if(!isSet.m_namespace) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "NameSpace not set in Linux_DnsSetting instanceName"); return m_namespace; } void Linux_DnsSettingInstanceName:: 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; } //Name related methods unsigned int Linux_DnsSettingInstanceName::isNameSet() const{ return isSet.Name; } void Linux_DnsSettingInstanceName:: setName(const char* val, int makeCopy){ if (isSet.Name) { delete []m_Name; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_Name = tmpval; } else { m_Name = val; } isSet.Name=1; } const char* Linux_DnsSettingInstanceName:: getName() const{ if(!isSet.Name) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Name not set"); return m_Name; } //set isSet variables to FALSE void Linux_DnsSettingInstanceName::init(){ m_CIMClassNameP="Linux_DnsSetting"; isSet.m_namespace=0; isSet.Name=0; } //copies another instance properties in this void Linux_DnsSettingInstanceName::init (const Linux_DnsSettingInstanceName& original){ init(); m_CIMClassNameP=original.m_CIMClassNameP; if(original.isNameSpaceSet()){ setNamespace(original.getNamespace(),1); } if(original.isNameSet()){ const char* NameOriginal=original.getName(); setName(NameOriginal, 1); } } //reset the instanceName data void Linux_DnsSettingInstanceName::reset(){ if (isSet.m_namespace) delete(m_namespace); if (isSet.Name) delete(m_Name); }; //********************************************************* //Linux_DnsSettingInstanceNameEnumerationElement //********************************************************* Linux_DnsSettingInstanceNameEnumerationElement:: Linux_DnsSettingInstanceNameEnumerationElement(){ m_elementP=0; m_nextP=0; }; Linux_DnsSettingInstanceNameEnumerationElement:: ~Linux_DnsSettingInstanceNameEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //Linux_DnsSettingInstanceNameEnumeration //********************************************************* Linux_DnsSettingInstanceNameEnumeration:: Linux_DnsSettingInstanceNameEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; Linux_DnsSettingInstanceNameEnumeration:: Linux_DnsSettingInstanceNameEnumeration(const CmpiArray& arr){ firstElementP=0; currentElementP=0; endElementP=0; int size = arr.size(); for (int i=0; i < size; i++) { addElement(Linux_DnsSettingInstanceName(arr[i])); } } Linux_DnsSettingInstanceNameEnumeration:: Linux_DnsSettingInstanceNameEnumeration( const Linux_DnsSettingInstanceNameEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; Linux_DnsSettingInstanceNameEnumeration:: ~Linux_DnsSettingInstanceNameEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void Linux_DnsSettingInstanceNameEnumeration::reset(){ currentElementP=firstElementP; }; bool Linux_DnsSettingInstanceNameEnumeration::hasNext() const{ return (currentElementP!=0); }; int Linux_DnsSettingInstanceNameEnumeration::getSize() const{ int size=0; Linux_DnsSettingInstanceNameEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const Linux_DnsSettingInstanceName& Linux_DnsSettingInstanceNameEnumeration::getElement(int pos) const{ Linux_DnsSettingInstanceNameEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const Linux_DnsSettingInstanceName& Linux_DnsSettingInstanceNameEnumeration::getNext() { Linux_DnsSettingInstanceNameEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void Linux_DnsSettingInstanceNameEnumeration::addElement (const Linux_DnsSettingInstanceName& elementP){ if(firstElementP==0){ firstElementP=new Linux_DnsSettingInstanceNameEnumerationElement(); firstElementP->m_elementP=new Linux_DnsSettingInstanceName(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new Linux_DnsSettingInstanceNameEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new Linux_DnsSettingInstanceName(elementP); } }; Linux_DnsSettingInstanceNameEnumeration::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_DnsSettingDefaultImplementation.cpp --- /** * Linux_DnsSettingDefaultImplementation.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_DnsSettingDefaultImplementation.h" #include <iostream> using namespace std; namespace genProvider { /* intrinsic methods */ void Linux_DnsSettingDefaultImplementation::enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsSettingInstanceNameEnumeration& instnames){ cout<<"enumInstances not supported for Linux_DnsSetting"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "enumInstances not implemented for Linux_DnsSetting"); } void Linux_DnsSettingDefaultImplementation::enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsSettingManualInstanceEnumeration& instances){ cout<<"Using default enumInstances implementation for Linux_DnsSetting"<<endl; cout<<"LetŽs get the instanceNames"<<endl; Linux_DnsSettingInstanceNameEnumeration namesEnumeration; enumInstanceNames(ctx, mbp,nsp,namesEnumeration); cout<<"Getting each instance"<<endl; while(namesEnumeration.hasNext()){ Linux_DnsSettingInstanceName name= namesEnumeration.getNext(); cout<<"Getting an instance for instanceName"<<endl; Linux_DnsSettingManualInstance instance= getInstance(ctx, mbp, properties, name); cout<<"adding instance to enum"<<endl; instances.addElement(instance); cout<<"Added!"<<endl; }; } Linux_DnsSettingManualInstance Linux_DnsSettingDefaultImplementation::getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsSettingInstanceName&){ cout<<"getInstance not supported for Linux_DnsSetting"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "getInstance not implemented for Linux_DnsSetting"); } void Linux_DnsSettingDefaultImplementation::setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsSettingManualInstance&){ cout<<"setInstance not supported for Linux_DnsSetting"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "setInstance not implemented for Linux_DnsSetting"); } void Linux_DnsSettingDefaultImplementation:: createInstance(const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingManualInstance&){ cout<<"createInstance not supported for Linux_DnsSetting"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "createInstance not implemented for Linux_DnsSetting"); } void Linux_DnsSettingDefaultImplementation:: deleteInstance(const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&){ cout<<"deleteInstance not supported for Linux_DnsSetting"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "deleteInstance not implemented for Linux_DnsSetting"); } /* extrinsic methods */ CMPIUint32 Linux_DnsSettingDefaultImplementation::ApplyIncrementalChangeToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CMPIBoolean &ContinueOnError, int isContinueOnErrorPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent, char** &CanNotApply, CMPICount &CanNotApplySize){ cout<<"ApplyIncrementalChangeToCollection() not supported in Linux_DnsSetting"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "ApplyIncrementalChangeToCollection() not implemented in Linux_DnsSetting"); }; CMPIUint32 Linux_DnsSettingDefaultImplementation::ApplyIncrementalChangeToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent){ cout<<"ApplyIncrementalChangeToMSE() not supported in Linux_DnsSetting"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "ApplyIncrementalChangeToMSE() not implemented in Linux_DnsSetting"); }; CMPIUint32 Linux_DnsSettingDefaultImplementation::ApplyToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CMPIBoolean &ContinueOnError, int isContinueOnErrorPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, char** &CanNotApply, CMPICount &CanNotApplySize){ cout<<"ApplyToCollection() not supported in Linux_DnsSetting"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "ApplyToCollection() not implemented in Linux_DnsSetting"); }; CMPIUint32 Linux_DnsSettingDefaultImplementation::ApplyToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent){ cout<<"ApplyToMSE() not supported in Linux_DnsSetting"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "ApplyToMSE() not implemented in Linux_DnsSetting"); }; CMPIUint32 Linux_DnsSettingDefaultImplementation::VerifyOKToApplyIncrementalChangeToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent, char** &CanNotApply, CMPICount &CanNotApplySize){ cout<<"VerifyOKToApplyIncrementalChangeToCollection() not supported in Linux_DnsSetting"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "VerifyOKToApplyIncrementalChangeToCollection() not implemented in Linux_DnsSetting"); }; CMPIUint32 Linux_DnsSettingDefaultImplementation::VerifyOKToApplyIncrementalChangeToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent){ cout<<"VerifyOKToApplyIncrementalChangeToMSE() not supported in Linux_DnsSetting"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "VerifyOKToApplyIncrementalChangeToMSE() not implemented in Linux_DnsSetting"); }; CMPIUint32 Linux_DnsSettingDefaultImplementation::VerifyOKToApplyToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, char** &CanNotApply, CMPICount &CanNotApplySize){ cout<<"VerifyOKToApplyToCollection() not supported in Linux_DnsSetting"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "VerifyOKToApplyToCollection() not implemented in Linux_DnsSetting"); }; CMPIUint32 Linux_DnsSettingDefaultImplementation::VerifyOKToApplyToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent){ cout<<"VerifyOKToApplyToMSE() not supported in Linux_DnsSetting"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "VerifyOKToApplyToMSE() not implemented in Linux_DnsSetting"); }; } --- NEW FILE: Linux_DnsSettingRepositoryExternal.h --- /** * Linux_DnsSettingRepositoryExternal.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_DnsSettingRepositoryExternal_h #define Linux_DnsSettingRepositoryExternal_h #include "Linux_DnsSettingInstanceName.h" #include "Linux_DnsSettingRepositoryInstance.h" #include "CmpiBroker.h" namespace genProvider { class Linux_DnsSettingRepositoryExternal { public: Linux_DnsSettingRepositoryExternal( const CmpiBroker& brkr, const CmpiContext& ctx); virtual ~Linux_DnsSettingRepositoryExternal(); virtual void enumInstanceNames( Linux_DnsSettingInstanceNameEnumeration&); virtual void enumInstances( const char* *properties, Linux_DnsSettingRepositoryInstanceEnumeration&); virtual Linux_DnsSettingRepositoryInstance getInstance( const char* *properties, const Linux_DnsSettingInstanceName&); virtual void setInstance( const char* *properties, const Linux_DnsSettingRepositoryInstance&); virtual void createInstance( const Linux_DnsSettingRepositoryInstance&); virtual void deleteInstance( const Linux_DnsSettingInstanceName&); private: CmpiBroker broker; CmpiContext context; const static char *nsp; }; } #endif --- NEW FILE: Linux_DnsSettingResourceAccess.cpp --- /** * Linux_DnsSettingResourceAccess.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> using namespace std; #include "Linux_DnsSettingResourceAccess.h" #include "defaultvalues.h" namespace genProvider { //Linux_DnsSettingResourceAccess::Linux_DnsSettingResourceAccess(); Linux_DnsSettingResourceAccess::~Linux_DnsSettingResourceAccess() { }; /* intrinsic methods */ void Linux_DnsSettingResourceAccess::enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsSettingInstanceNameEnumeration& instnames){ Linux_DnsSettingInstanceName instanceName; instanceName.setNamespace(nsp); instanceName.setName(DEFAULT_SERVICE_NAME); instnames.addElement(instanceName); } void Linux_DnsSettingResourceAccess::enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsSettingManualInstanceEnumeration& instances){ Linux_DnsSettingManualInstance aManualInstance; Linux_DnsSettingInstanceName instanceName; instanceName.setNamespace(nsp); instanceName.setName(DEFAULT_SERVICE_NAME); aManualInstance.setInstanceName(instanceName); BINDOPTS *bopts = ReadOptions(); char *forward = getOption(bopts,"forward"); if ( forward ) { if ( strcmp( forward, "first" ) ) aManualInstance.setForward( DNS_FORWARD_FIRST ); if ( strcmp( forward, "only" ) ) aManualInstance.setForward( DNS_FORWARD_ONLY ); free( forward ); } char* forwarders = getOption( bopts, "forwarders" ); if ( forwarders ) { DnsArray da = DnsArray( forwarders ); aManualInstance.setForwarders( da.toArray(), da.size() ); free( forwarders ); } char *directory = getOption(bopts,"directory"); if ( directory ) { aManualInstance.setConfigurationDirectory( directory ); free( directory ); } char *port = getOption(bopts,"port"); if ( port ) { aManualInstance.setPortNumber( atoi( port ) ); free( port ); } char *tsig = getOption(bopts,"TSIG"); if ( tsig ) { aManualInstance.setTSIG( atoi( tsig ) ); free( tsig ); } char *ttl = getOption(bopts,"TTL"); if ( ttl ) { aManualInstance.setTTL( atoi( ttl ) ); free( ttl ); } instances.addElement(aManualInstance); }; Linux_DnsSettingManualInstance Linux_DnsSettingResourceAccess::getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsSettingInstanceName& instance){ Linux_DnsSettingManualInstance aManualInstance; aManualInstance.setInstanceName(instance); BINDOPTS *bopts = ReadOptions(); char *directory = getOption(bopts,"directory"); if ( directory != NULL ) { aManualInstance.setConfigurationDirectory( directory ); free( directory ); } char *forward = getOption(bopts,"forward"); if ( forward ) { if ( strcmp( forward, "first" ) ) aManualInstance.setForward( DNS_FORWARD_FIRST ); if ( strcmp( forward, "only" ) ) aManualInstance.setForward( DNS_FORWARD_ONLY ); free( forward ); } char* forwarders = getOption( bopts, "forwarders" ); if ( forwarders ) { DnsArray da = DnsArray( forwarders ); aManualInstance.setForwarders( da.toArray(), da.size() ); free( forwarders ); } char *port = getOption(bopts,"port"); if ( port != NULL ) { aManualInstance.setPortNumber( atoi( port ) ); free( port ); } char *tsig = getOption(bopts,"TSIG"); if ( tsig != NULL ) { aManualInstance.setTSIG( atoi( tsig ) ); free( tsig ); } char *ttl = getOption(bopts,"TTL"); if ( ttl != NULL ) { aManualInstance.setTTL( atoi( ttl ) ); free( ttl ); } return aManualInstance; } void Linux_DnsSettingResourceAccess::setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsSettingManualInstance& newInstance){ BINDOPTS *bopt = ReadOptions(); if ( newInstance.isConfigurationDirectorySet() ) setOption(bopt, "directory", newInstance.getConfigurationDirectory() ); if ( newInstance.isForwardSet() ) { if ( newInstance.getForward() == DNS_FORWARD_ONLY ) setOption(bopt, "forward", strdup( "only" ) ); if ( newInstance.getForward() == DNS_FORWARD_FIRST ) setOption(bopt, "forward", strdup( "first" ) ); } unsigned int size = 0; if ( newInstance.isForwardersSet() ) { const char **forwardersList = newInstance.getForwarders( size ); DnsArray value_list; for (unsigned int i = 0; i < size; i++) if (! value_list.isPresent( string( forwardersList[i]) ) ) value_list.add( forwardersList[i] ); setOption( bopt, "forwarders", strdup ( value_list.toString().c_str() ) ); } if ( newInstance.isPortNumberSet() ) { char *port = (char *) malloc(6*sizeof(char)); sprintf( port, "%lu", newInstance.getPortNumber() ); setOption(bopt, "port", port ); free(port); } if ( newInstance.isTSIGSet() ) { char *tsig = (char *) malloc(6*sizeof(char)); sprintf( tsig, "%d", newInstance.getTSIG() ); setOption(bopt, "TSIG", tsig ); free(tsig); } if ( newInstance.isTTLSet() ) { char *ttl = (char *) malloc(20*sizeof(char)); sprintf( ttl, "%lu", newInstance.getTTL() ); setOption(bopt, "TTL", ttl ); free(ttl); } }; /* void Linux_DnsSettingResourceAccess::createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingManualInstance&){}; */ /* void Linux_DnsSettingResourceAccess::deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&){}; */ /* extrinsic methods */ /* virtual CMPIUint32 Linux_DnsSettingResourceAccess::ApplyIncrementalChangeToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CMPIBoolean &ContinueOnError, int isContinueOnErrorPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent, char** &CanNotApply, CMPICount &CanNotApplySize) { }; */ /* virtual CMPIUint32 Linux_DnsSettingResourceAccess::ApplyIncrementalChangeToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent) { }; */ /* virtual CMPIUint32 Linux_DnsSettingResourceAccess::ApplyToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CMPIBoolean &ContinueOnError, int isContinueOnErrorPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, char** &CanNotApply, CMPICount &CanNotApplySize) { }; */ /* virtual CMPIUint32 Linux_DnsSettingResourceAccess::ApplyToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent) { }; */ /* virtual CMPIUint32 Linux_DnsSettingResourceAccess::VerifyOKToApplyIncrementalChangeToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent, char** &CanNotApply, CMPICount &CanNotApplySize) { }; */ /* virtual CMPIUint32 Linux_DnsSettingResourceAccess::VerifyOKToApplyIncrementalChangeToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent) { }; */ /* virtual CMPIUint32 Linux_DnsSettingResourceAccess::VerifyOKToApplyToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, char** &CanNotApply, CMPICount &CanNotApplySize) { }; */ /* virtual CMPIUint32 Linux_DnsSettingResourceAccess::VerifyOKToApplyToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsSettingInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent) { }; */ } --- NEW FILE: CmpiLinux_DnsSettingProvider.h --- /** * CmpiLinux_DnsSettingProvider.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_DnsSettingProvider_h #define CmpiLinux_DnsSettingProvider_h #include "CmpiInstanceMI.h" #include "CmpiMethodMI.h" #include "Linux_DnsSettingFactory.h" namespace genProvider{ class CmpiLinux_DnsSettingProvider : public CmpiInstanceMI, public CmpiMethodMI{ private: Linux_DnsSettingInterface* interfaceP; const static char * shadowNameSpaceP; CmpiBroker cppBroker; void completeInstance ( const Linux_DnsSettingInstanceName& intanceNameP, CmpiInstance& target, const CmpiContext& ctx); void copyShadowData ( const CmpiInstance* source, CmpiInstance* target); CmpiInstance* getShadowInstance ( const CmpiInstance& original, const Linux_DnsSettingInstanceName& intanceName); void removeDanglingShadowInstances ( const Linux_DnsSettingInstanceNameEnumeration& dinInsNames); public: CmpiLinux_DnsSettingProvider ( const CmpiBroker &mbp, const CmpiContext& ctx); ~CmpiLinux_DnsSettingProvider (); 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); }; } #endif --- NEW FILE: Linux_DnsSettingManualInstance.cpp --- /** * Linux_DnsSettingManualInstance.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_DnsSettingManualInstance.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <stri... [truncated message content] |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:58:52
|
Update of /cvsroot/sblim/cmpi-dns/provider/Linux_DnsAllowUpdateACLForZone/mof In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20455/provider/Linux_DnsAllowUpdateACLForZone/mof Added Files: makefile.pegasus Linux_DnsAllowUpdateACLForZoneRegister.mof Linux_DnsAllowUpdateACLForZone.mof makefile.standalone Linux_DnsAllowUpdateACLForZoneRepository.mof 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: Linux_DnsAllowUpdateACLForZoneRegister.mof --- // =================================================================== // Linux_DnsAllowUpdateACLForZone // =================================================================== instance of PG_ProviderModule { Name = "Linux_DnsAllowUpdateACLForZoneProviderModule"; //The library name on disk Location = "Linux_DnsAllowUpdateACLForZone"; Vendor = "SBLIM"; Version = "2.0.0"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { //The provider module as defined in PG_ProviderModule ProviderModuleName = "Linux_DnsAllowUpdateACLForZoneProviderModule"; // The provider name as referenced in the code Name = "CmpiLinux_DnsAllowUpdateACLForZoneProvider"; }; instance of PG_ProviderCapabilities { //The provider module as defined in PG_ProviderModule ProviderModuleName = "Linux_DnsAllowUpdateACLForZoneProviderModule"; //The provider name as defined in PG_Provider ProviderName = "CmpiLinux_DnsAllowUpdateACLForZoneProvider"; CapabilityID = "1"; //Name of the CIM class as defined in the mof ClassName = "Linux_DnsAllowUpdateACLForZone"; Namespaces = {"root/cimv2"}; ProviderType = {2, 3}; // Instance Association SupportedProperties = NULL; // All properties SupportedMethods = NULL; // All methods }; --- NEW FILE: Linux_DnsAllowUpdateACLForZoneRepository.mof --- // =================================================================== // This file was created using ECUTE. // Version 2.0 Beta-1 // by exporting package Linux_DnsAllowUpdateACLForZoneRepository // from model // on 5/18/2005 // Origin of package: Manually created // =================================================================== // =================================================================== // Linux_DnsAllowUpdateACLForZone // =================================================================== class Linux_DnsAllowUpdateACLForZone { [Key] Linux_DnsZone REF Element; [Key] Linux_DnsAddressMatchList REF Setting; }; // =================================================================== // end of file // =================================================================== --- NEW FILE: Linux_DnsAllowUpdateACLForZone.mof --- // =================================================================== // This file was created using ECUTE. // Version 2.0 Beta-1 // by exporting package Linux_DnsAllowUpdateACLForZone // from model // on 5/18/2005 // Origin of package: Manually created // =================================================================== // =================================================================== // Linux_DnsAllowUpdateACLForZone // =================================================================== [Association, Description ( "Association pointing to Address Match Lists, hosting the list of" " elements that are allowed to support the request type: allow" "-update."), IBM_HasInstances, IBM_HasProvider] class Linux_DnsAllowUpdateACLForZone : Linux_DnsManagedSystemElementForSetting { [Key, Override ("Element"), Description ( "The scoping DNS Zone.")] Linux_DnsZone REF Element; [Key, Override ("Setting")] Linux_DnsAddressMatchList REF Setting; }; // =================================================================== // end of file // =================================================================== --- NEW FILE: makefile.standalone --- # Makefile for Linux_DnsAllowUpdateACLForZone # (Standalone flavor) include ../../setting.cmpi install: install -m 644 Linux_DnsAllowUpdateACLForZone*.mof $(CIMOMMOF) uninstall: $(RM) $(CIMOMMOF)/Linux_DnsAllowUpdateACLForZone*.mof --- NEW FILE: makefile.pegasus --- # Makefile for Linux_DnsAllowUpdateACLForZone # (Pegasus flavor) include ../../setting.cmpi install: cimmofl -I. -aE -nroot/cimv2 Linux_DnsAllowUpdateACLForZone.mof if [ -f Linux_DnsAllowUpdateACLForZoneRepository.mof ]; then \ cimmofl -I. -nIBMShadow/cimv2 Linux_DnsAllowUpdateACLForZoneRepository.mof; \ fi if [ -f Linux_DnsAllowUpdateACLForZoneRegister.mof ]; then \ cimmofl -I. -nroot/PG_InterOp Linux_DnsAllowUpdateACLForZoneRegister.mof; \ fi uninstall: |
Update of /cvsroot/sblim/cmpi-dns/provider/Linux_DnsMasterZone In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20455/provider/Linux_DnsMasterZone Added Files: Linux_DnsMasterZoneRepositoryExternal.cpp setting.provider Linux_DnsMasterZoneInstanceName.h Linux_DnsMasterZoneRepositoryInstance.h makefile Linux_DnsMasterZoneDefaultImplementation.h Linux_DnsMasterZoneInstanceName.cpp Linux_DnsMasterZoneInstance.cpp Linux_DnsMasterZoneInstance.h Linux_DnsMasterZoneExternal.cpp Linux_DnsMasterZoneFactory.h Linux_DnsMasterZoneResourceAccess.cpp Linux_DnsMasterZoneDefaultImplementation.cpp Linux_DnsMasterZoneManualInstance.cpp Linux_DnsMasterZoneFactory.cpp CmpiLinux_DnsMasterZoneProvider.h Linux_DnsMasterZoneResourceAccess.h Linux_DnsMasterZoneManualInstance.h CmpiLinux_DnsMasterZoneProvider.cpp Linux_DnsMasterZoneFakeFactory.cpp Linux_DnsMasterZoneRepositoryExternal.h Linux_DnsMasterZoneInterface.h Linux_DnsMasterZoneExternal.h Linux_DnsMasterZoneRepositoryInstance.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_DnsMasterZoneInstance.cpp --- /** * Linux_DnsMasterZoneInstance.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_DnsMasterZoneInstance.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //Linux_DnsMasterZoneInstance //********************************************************* //empty constructor Linux_DnsMasterZoneInstance:: Linux_DnsMasterZoneInstance(){ init(); }; //copy constructor Linux_DnsMasterZoneInstance:: Linux_DnsMasterZoneInstance (const Linux_DnsMasterZoneInstance& original){ init(original); }; //constructor using CmpiInstance Linux_DnsMasterZoneInstance:: Linux_DnsMasterZoneInstance (const CmpiInstance& inst, const char* instanceNamespace){ CmpiData cmpiData; init(); CmpiObjectPath cop=inst.getObjectPath(); cop.setNameSpace(instanceNamespace); setInstanceName(Linux_DnsMasterZoneInstanceName(cop)); cmpiData = inst.getProperty("Caption"); if(!cmpiData.isNullValue()){ CmpiString Caption = cmpiData; setCaption(Caption.charPtr()); } cmpiData = inst.getProperty("Contact"); if(!cmpiData.isNullValue()){ CmpiString Contact = cmpiData; setContact(Contact.charPtr()); } cmpiData = inst.getProperty("Description"); if(!cmpiData.isNullValue()){ CmpiString Description = cmpiData; setDescription(Description.charPtr()); } cmpiData = inst.getProperty("ElementName"); if(!cmpiData.isNullValue()){ CmpiString ElementName = cmpiData; setElementName(ElementName.charPtr()); } cmpiData = inst.getProperty("Expire"); if(!cmpiData.isNullValue()){ CMPIUint32 Expire = cmpiData; setExpire(Expire); } cmpiData = inst.getProperty("Forward"); if(!cmpiData.isNullValue()){ CMPIUint16 Forward = cmpiData; setForward(Forward); } cmpiData = inst.getProperty("Forwarders"); if(!cmpiData.isNullValue()){ CmpiArray Forwarders = cmpiData; unsigned int ForwardersSize; const char** ForwardersArray; ArrayConverter::makeArray(Forwarders, (char***)&ForwardersArray, ForwardersSize); setForwarders(ForwardersArray, ForwardersSize, 0); } cmpiData = inst.getProperty("NegativeCachingTTL"); if(!cmpiData.isNullValue()){ CMPIUint32 NegativeCachingTTL = cmpiData; setNegativeCachingTTL(NegativeCachingTTL); } cmpiData = inst.getProperty("Refresh"); if(!cmpiData.isNullValue()){ CMPIUint32 Refresh = cmpiData; setRefresh(Refresh); } cmpiData = inst.getProperty("ResourceRecordFile"); if(!cmpiData.isNullValue()){ CmpiString ResourceRecordFile = cmpiData; setResourceRecordFile(ResourceRecordFile.charPtr()); } cmpiData = inst.getProperty("Retry"); if(!cmpiData.isNullValue()){ CMPIUint32 Retry = cmpiData; setRetry(Retry); } cmpiData = inst.getProperty("SerialNumber"); if(!cmpiData.isNullValue()){ CmpiString SerialNumber = cmpiData; setSerialNumber(SerialNumber.charPtr()); } cmpiData = inst.getProperty("Server"); if(!cmpiData.isNullValue()){ CmpiString Server = cmpiData; setServer(Server.charPtr()); } cmpiData = inst.getProperty("SettingID"); if(!cmpiData.isNullValue()){ CmpiString SettingID = cmpiData; setSettingID(SettingID.charPtr()); } cmpiData = inst.getProperty("Type"); if(!cmpiData.isNullValue()){ CMPIUint16 Type = cmpiData; setType(Type); } } //Destructor Linux_DnsMasterZoneInstance:: ~Linux_DnsMasterZoneInstance(){ reset(); }; //copy operator Linux_DnsMasterZoneInstance& Linux_DnsMasterZoneInstance::operator= (const Linux_DnsMasterZoneInstance& original){ init(original); return *this; }; //converts to CmpiInstance CmpiInstance Linux_DnsMasterZoneInstance:: getCmpiInstance(const char** properties) const{ CmpiObjectPath objectPath=getInstanceName().getObjectPath(); CmpiInstance cmpiInstance(objectPath); getInstanceName().fillKeys(cmpiInstance); if (properties) { cmpiInstance.setPropertyFilter(properties,0); } if(isSet.Caption){ cmpiInstance.setProperty("Caption",CmpiData(m_Caption)); } if(isSet.Contact){ cmpiInstance.setProperty("Contact",CmpiData(m_Contact)); } if(isSet.Description){ cmpiInstance.setProperty("Description",CmpiData(m_Description)); } if(isSet.ElementName){ cmpiInstance.setProperty("ElementName",CmpiData(m_ElementName)); } if(isSet.Expire){ cmpiInstance.setProperty("Expire",CmpiData(m_Expire)); } if(isSet.Forward){ cmpiInstance.setProperty("Forward",CmpiData(m_Forward)); } if(isSet.Forwarders){ unsigned int ForwardersSize; const char** arrayForwarders=getForwarders(ForwardersSize); CmpiArray arrayCmpiForwarders=CmpiArray(ForwardersSize,CMPI_chars); for(unsigned int i=0;i<ForwardersSize;i++) arrayCmpiForwarders[i]=CmpiData(arrayForwarders[i]); cmpiInstance.setProperty("Forwarders",CmpiData(arrayCmpiForwarders)); } if(isSet.NegativeCachingTTL){ cmpiInstance.setProperty("NegativeCachingTTL",CmpiData(m_NegativeCachingTTL)); } if(isSet.Refresh){ cmpiInstance.setProperty("Refresh",CmpiData(m_Refresh)); } if(isSet.ResourceRecordFile){ cmpiInstance.setProperty("ResourceRecordFile",CmpiData(m_ResourceRecordFile)); } if(isSet.Retry){ cmpiInstance.setProperty("Retry",CmpiData(m_Retry)); } if(isSet.SerialNumber){ cmpiInstance.setProperty("SerialNumber",CmpiData(m_SerialNumber)); } if(isSet.Server){ cmpiInstance.setProperty("Server",CmpiData(m_Server)); } if(isSet.SettingID){ cmpiInstance.setProperty("SettingID",CmpiData(m_SettingID)); } if(isSet.Type){ cmpiInstance.setProperty("Type",CmpiData(m_Type)); } return cmpiInstance; } //InstanceName related methods unsigned int Linux_DnsMasterZoneInstance:: isInstanceNameSet() const{ return isSet.instanceName; } const Linux_DnsMasterZoneInstanceName& Linux_DnsMasterZoneInstance::getInstanceName() const{ if(!isSet.instanceName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "InstanceName not set in Linux_DnsMasterZone instance"); return m_instanceName; } void Linux_DnsMasterZoneInstance::setInstanceName( const Linux_DnsMasterZoneInstanceName& val){ m_instanceName = val; isSet.instanceName=1; } //Caption related methods unsigned int Linux_DnsMasterZoneInstance::isCaptionSet() const{ return isSet.Caption; } void Linux_DnsMasterZoneInstance:: setCaption(const char* val, int makeCopy){ if (isSet.Caption) { delete []m_Caption; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_Caption = tmpval; } else { m_Caption = val; } isSet.Caption=1; } const char* Linux_DnsMasterZoneInstance:: getCaption() const{ if(!isSet.Caption) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Caption not set"); return m_Caption; } //Contact related methods unsigned int Linux_DnsMasterZoneInstance::isContactSet() const{ return isSet.Contact; } void Linux_DnsMasterZoneInstance:: setContact(const char* val, int makeCopy){ if (isSet.Contact) { delete []m_Contact; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_Contact = tmpval; } else { m_Contact = val; } isSet.Contact=1; } const char* Linux_DnsMasterZoneInstance:: getContact() const{ if(!isSet.Contact) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Contact not set"); return m_Contact; } //Description related methods unsigned int Linux_DnsMasterZoneInstance::isDescriptionSet() const{ return isSet.Description; } void Linux_DnsMasterZoneInstance:: setDescription(const char* val, int makeCopy){ if (isSet.Description) { delete []m_Description; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_Description = tmpval; } else { m_Description = val; } isSet.Description=1; } const char* Linux_DnsMasterZoneInstance:: getDescription() const{ if(!isSet.Description) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Description not set"); return m_Description; } //ElementName related methods unsigned int Linux_DnsMasterZoneInstance::isElementNameSet() const{ return isSet.ElementName; } void Linux_DnsMasterZoneInstance:: setElementName(const char* val, int makeCopy){ if (isSet.ElementName) { delete []m_ElementName; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_ElementName = tmpval; } else { m_ElementName = val; } isSet.ElementName=1; } const char* Linux_DnsMasterZoneInstance:: getElementName() const{ if(!isSet.ElementName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "ElementName not set"); return m_ElementName; } //Expire related methods unsigned int Linux_DnsMasterZoneInstance::isExpireSet() const{ return isSet.Expire; } void Linux_DnsMasterZoneInstance:: setExpire(const CMPIUint32 val){ m_Expire = val; isSet.Expire=1; } const CMPIUint32 Linux_DnsMasterZoneInstance:: getExpire() const{ if(!isSet.Expire) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Expire not set"); return m_Expire; } //Forward related methods unsigned int Linux_DnsMasterZoneInstance::isForwardSet() const{ return isSet.Forward; } void Linux_DnsMasterZoneInstance:: setForward(const CMPIUint16 val){ m_Forward = val; isSet.Forward=1; } const CMPIUint16 Linux_DnsMasterZoneInstance:: getForward() const{ if(!isSet.Forward) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Forward not set"); return m_Forward; } //Forwarders related methods unsigned int Linux_DnsMasterZoneInstance::isForwardersSet() const{ return isSet.Forwarders; } void Linux_DnsMasterZoneInstance:: setForwarders(const char** val, const unsigned int size, int makeCopy){ ForwardersArraySize=size; if (isSet.Forwarders) { delete m_Forwarders; } if (makeCopy&&val) { m_Forwarders = new const char*[size]; for(unsigned int i=0;i<size;i++){ char* aString = new char[strlen(val[i])+1]; strcpy(aString,val[i]); m_Forwarders[i]=aString; } } else { m_Forwarders = val; } isSet.Forwarders=1; } const char** Linux_DnsMasterZoneInstance:: getForwarders(unsigned int& size) const{ if(!isSet.Forwarders) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Forwarders not set"); size=ForwardersArraySize; return m_Forwarders; } //NegativeCachingTTL related methods unsigned int Linux_DnsMasterZoneInstance::isNegativeCachingTTLSet() const{ return isSet.NegativeCachingTTL; } void Linux_DnsMasterZoneInstance:: setNegativeCachingTTL(const CMPIUint32 val){ m_NegativeCachingTTL = val; isSet.NegativeCachingTTL=1; } const CMPIUint32 Linux_DnsMasterZoneInstance:: getNegativeCachingTTL() const{ if(!isSet.NegativeCachingTTL) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "NegativeCachingTTL not set"); return m_NegativeCachingTTL; } //Refresh related methods unsigned int Linux_DnsMasterZoneInstance::isRefreshSet() const{ return isSet.Refresh; } void Linux_DnsMasterZoneInstance:: setRefresh(const CMPIUint32 val){ m_Refresh = val; isSet.Refresh=1; } const CMPIUint32 Linux_DnsMasterZoneInstance:: getRefresh() const{ if(!isSet.Refresh) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Refresh not set"); return m_Refresh; } //ResourceRecordFile related methods unsigned int Linux_DnsMasterZoneInstance::isResourceRecordFileSet() const{ return isSet.ResourceRecordFile; } void Linux_DnsMasterZoneInstance:: setResourceRecordFile(const char* val, int makeCopy){ if (isSet.ResourceRecordFile) { delete []m_ResourceRecordFile; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_ResourceRecordFile = tmpval; } else { m_ResourceRecordFile = val; } isSet.ResourceRecordFile=1; } const char* Linux_DnsMasterZoneInstance:: getResourceRecordFile() const{ if(!isSet.ResourceRecordFile) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "ResourceRecordFile not set"); return m_ResourceRecordFile; } //Retry related methods unsigned int Linux_DnsMasterZoneInstance::isRetrySet() const{ return isSet.Retry; } void Linux_DnsMasterZoneInstance:: setRetry(const CMPIUint32 val){ m_Retry = val; isSet.Retry=1; } const CMPIUint32 Linux_DnsMasterZoneInstance:: getRetry() const{ if(!isSet.Retry) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Retry not set"); return m_Retry; } //SerialNumber related methods unsigned int Linux_DnsMasterZoneInstance::isSerialNumberSet() const{ return isSet.SerialNumber; } void Linux_DnsMasterZoneInstance:: setSerialNumber(const char* val, int makeCopy){ if (isSet.SerialNumber) { delete []m_SerialNumber; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_SerialNumber = tmpval; } else { m_SerialNumber = val; } isSet.SerialNumber=1; } const char* Linux_DnsMasterZoneInstance:: getSerialNumber() const{ if(!isSet.SerialNumber) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "SerialNumber not set"); return m_SerialNumber; } //Server related methods unsigned int Linux_DnsMasterZoneInstance::isServerSet() const{ return isSet.Server; } void Linux_DnsMasterZoneInstance:: setServer(const char* val, int makeCopy){ if (isSet.Server) { delete []m_Server; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_Server = tmpval; } else { m_Server = val; } isSet.Server=1; } const char* Linux_DnsMasterZoneInstance:: getServer() const{ if(!isSet.Server) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Server not set"); return m_Server; } //SettingID related methods unsigned int Linux_DnsMasterZoneInstance::isSettingIDSet() const{ return isSet.SettingID; } void Linux_DnsMasterZoneInstance:: setSettingID(const char* val, int makeCopy){ if (isSet.SettingID) { delete []m_SettingID; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_SettingID = tmpval; } else { m_SettingID = val; } isSet.SettingID=1; } const char* Linux_DnsMasterZoneInstance:: getSettingID() const{ if(!isSet.SettingID) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "SettingID not set"); return m_SettingID; } //Type related methods unsigned int Linux_DnsMasterZoneInstance::isTypeSet() const{ return isSet.Type; } void Linux_DnsMasterZoneInstance:: setType(const CMPIUint16 val){ m_Type = val; isSet.Type=1; } const CMPIUint16 Linux_DnsMasterZoneInstance:: getType() const{ if(!isSet.Type) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Type not set"); return m_Type; } //set isSet attributes to FALSE void Linux_DnsMasterZoneInstance::init(){ isSet.instanceName=0; isSet.Caption=0; isSet.Contact=0; isSet.Description=0; isSet.ElementName=0; isSet.Expire=0; isSet.Forward=0; isSet.Forwarders=0; ForwardersArraySize=0; isSet.NegativeCachingTTL=0; isSet.Refresh=0; isSet.ResourceRecordFile=0; isSet.Retry=0; isSet.SerialNumber=0; isSet.Server=0; isSet.SettingID=0; isSet.Type=0; }; //copies another instance properties in this void Linux_DnsMasterZoneInstance::init (const Linux_DnsMasterZoneInstance& original){ init(); if(original.isInstanceNameSet()){ setInstanceName(original.getInstanceName()); } if(original.isCaptionSet()){ const char* CaptionOriginal=original.getCaption(); setCaption(CaptionOriginal, 1); } if(original.isContactSet()){ const char* ContactOriginal=original.getContact(); setContact(ContactOriginal, 1); } if(original.isDescriptionSet()){ const char* DescriptionOriginal=original.getDescription(); setDescription(DescriptionOriginal, 1); } if(original.isElementNameSet()){ const char* ElementNameOriginal=original.getElementName(); setElementName(ElementNameOriginal, 1); } if(original.isExpireSet()){ const CMPIUint32 ExpireOriginal=original.getExpire(); setExpire(ExpireOriginal); } if(original.isForwardSet()){ const CMPIUint16 ForwardOriginal=original.getForward(); setForward(ForwardOriginal); } if(original.isForwardersSet()){ unsigned int sizeForwarders; const char** ForwardersOriginal=original.getForwarders(sizeForwarders); setForwarders(ForwardersOriginal, sizeForwarders, 1); } if(original.isNegativeCachingTTLSet()){ const CMPIUint32 NegativeCachingTTLOriginal=original.getNegativeCachingTTL(); setNegativeCachingTTL(NegativeCachingTTLOriginal); } if(original.isRefreshSet()){ const CMPIUint32 RefreshOriginal=original.getRefresh(); setRefresh(RefreshOriginal); } if(original.isResourceRecordFileSet()){ const char* ResourceRecordFileOriginal=original.getResourceRecordFile(); setResourceRecordFile(ResourceRecordFileOriginal, 1); } if(original.isRetrySet()){ const CMPIUint32 RetryOriginal=original.getRetry(); setRetry(RetryOriginal); } if(original.isSerialNumberSet()){ const char* SerialNumberOriginal=original.getSerialNumber(); setSerialNumber(SerialNumberOriginal, 1); } if(original.isServerSet()){ const char* ServerOriginal=original.getServer(); setServer(ServerOriginal, 1); } if(original.isSettingIDSet()){ const char* SettingIDOriginal=original.getSettingID(); setSettingID(SettingIDOriginal, 1); } if(original.isTypeSet()){ const CMPIUint16 TypeOriginal=original.getType(); setType(TypeOriginal); } } //reset the instance data void Linux_DnsMasterZoneInstance::reset(){ if (isSet.Caption) delete(m_Caption); if (isSet.Contact) delete(m_Contact); if (isSet.Description) delete(m_Description); if (isSet.ElementName) delete(m_ElementName); if (isSet.Forwarders){ ArrayConverter::destructArray((char**)(char**)m_Forwarders,ForwardersArraySize); } if (isSet.ResourceRecordFile) delete(m_ResourceRecordFile); if (isSet.SerialNumber) delete(m_SerialNumber); if (isSet.Server) delete(m_Server); if (isSet.SettingID) delete(m_SettingID); }; //********************************************************* //Linux_DnsMasterZoneInstanceEnumerationElement //********************************************************* Linux_DnsMasterZoneInstanceEnumerationElement:: Linux_DnsMasterZoneInstanceEnumerationElement(){ m_elementP=0; m_nextP=0; }; Linux_DnsMasterZoneInstanceEnumerationElement:: ~Linux_DnsMasterZoneInstanceEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //Linux_DnsMasterZoneInstanceNameEnumeration //********************************************************* Linux_DnsMasterZoneInstanceEnumeration:: Linux_DnsMasterZoneInstanceEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; Linux_DnsMasterZoneInstanceEnumeration:: Linux_DnsMasterZoneInstanceEnumeration( const Linux_DnsMasterZoneInstanceEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; Linux_DnsMasterZoneInstanceEnumeration:: ~Linux_DnsMasterZoneInstanceEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void Linux_DnsMasterZoneInstanceEnumeration::reset(){ currentElementP=firstElementP; }; bool Linux_DnsMasterZoneInstanceEnumeration::hasNext() const{ return (currentElementP!=0); }; int Linux_DnsMasterZoneInstanceEnumeration::getSize() const{ int size=0; Linux_DnsMasterZoneInstanceEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const Linux_DnsMasterZoneInstance& Linux_DnsMasterZoneInstanceEnumeration::getElement(int pos) const{ Linux_DnsMasterZoneInstanceEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const Linux_DnsMasterZoneInstance& Linux_DnsMasterZoneInstanceEnumeration::getNext() { Linux_DnsMasterZoneInstanceEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void Linux_DnsMasterZoneInstanceEnumeration::addElement (const Linux_DnsMasterZoneInstance& elementP){ if(firstElementP==0){ firstElementP=new Linux_DnsMasterZoneInstanceEnumerationElement(); firstElementP->m_elementP=new Linux_DnsMasterZoneInstance(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new Linux_DnsMasterZoneInstanceEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new Linux_DnsMasterZoneInstance(elementP); } }; } --- NEW FILE: Linux_DnsMasterZoneResourceAccess.cpp --- /** * Linux_DnsMasterZoneResourceAccess.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: Tony Gargya <ga...@de...> * Murillo Bernardes <ber...@br...> * * Contributors: * */ #include <string> #include <iostream> using namespace std; #include "Linux_DnsMasterZoneResourceAccess.h" namespace genProvider { //------------------------------------------------------------------------------------ // Linux_DnsMasterZoneResourceAccess::setInstanceNameProperties() //------------------------------------------------------------------------------------ void Linux_DnsMasterZoneResourceAccess::setInstanceNameProperties(const CmpiContext& ctx, const CmpiBroker& mbp, const char* nsp, DNSZONE * zone, Linux_DnsMasterZoneInstanceName& anInstanceName) { cout << "--- setInstanceNameProperties() called" << endl; anInstanceName.setNamespace(nsp); anInstanceName.setName(zone->zoneName); cout << "--- setInstanceNameProperties() exited" << endl; } //------------------------------------------------------------------------------------ // Linux_DnsMasterZoneResourceAccess::setInstanceProperties() //------------------------------------------------------------------------------------ void Linux_DnsMasterZoneResourceAccess::setInstanceProperties(const CmpiContext& ctx, const CmpiBroker& mbp, DNSZONE * zone, const Linux_DnsMasterZoneInstanceName& anInstanceName, Linux_DnsMasterZoneManualInstance& aManualInstance) { cout<<"--- setInstanceProperties() called"<<endl; //ZONEOPTS* zoneOpts; ZONEOPTS * forward = findOptsInZone( zone, "forward" ); if ( forward ) { if ( strcmp( forward->value, "first" ) ) aManualInstance.setForward( DNS_FORWARD_FIRST ); if ( strcmp( forward->value, "only" ) ) aManualInstance.setForward( DNS_FORWARD_ONLY ); } ZONEOPTS * forwarders = findOptsInZone( zone, "forwarders" ); DnsArray da; if ( forwarders && forwarders->value ) { da.populate( forwarders->value ); aManualInstance.setForwarders( da.toArray(), da.size() ); } aManualInstance.setInstanceName(anInstanceName); aManualInstance.setType(DNS_ZONETYPE_MASTER); aManualInstance.setResourceRecordFile(zone->zoneFileName); aManualInstance.setContact(zone->soaContact); char *val = (char *) malloc( 12*sizeof(char) ); sprintf(val,"%lld", zone->soaSerialNumber ); aManualInstance.setSerialNumber( val ); free(val); aManualInstance.setRefresh( zone->soaRefresh ); aManualInstance.setRetry( zone->soaRetry ); aManualInstance.setExpire( zone->soaExpire ); aManualInstance.setServer( zone->soaServer ); aManualInstance.setNegativeCachingTTL( zone->soaNegativCachingTTL ); cout << "--- setInstanceProperties() exited" << endl; } //Linux_DnsMasterZoneResourceAccess::Linux_DnsMasterZoneResourceAccess(); Linux_DnsMasterZoneResourceAccess::~Linux_DnsMasterZoneResourceAccess() { }; /* intrinsic methods */ void Linux_DnsMasterZoneResourceAccess::enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsMasterZoneInstanceNameEnumeration& instnames) { DNSZONE * zones, *all_zones; cout << "--- enumInstanceNames() called" << endl; cout << "---- calling getZones() " << endl; zones = getZones(); //getZonesByType("master"); all_zones = zones; if (zones) { for (; zones->zoneName != NULL ; zones++) { if ( strcmp(zones->zoneType, "master") ) continue; //Linux_DnsZoneManualInstance instance; Linux_DnsMasterZoneInstanceName instanceName; cout << "--- Calling setInstanceNameProperties()" << endl; printf ("Zone Name is %s \n", zones->zoneName); setInstanceNameProperties(ctx, mbp, nsp, zones, instanceName); instnames.addElement(instanceName); cout << "--- Added to enumeration" << endl; } freeZones( all_zones ); cout << "--- enumInstanceNames () exited" << endl; } } void Linux_DnsMasterZoneResourceAccess::enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsMasterZoneManualInstanceEnumeration& instances) { cout << "Linux_DnsMasterZoneResourceAccess::enumInstances()" << endl; cout << "--- enumInstances() called" << endl; DNSZONE * zones = NULL, *all_zones; cout << "---- calling getZones() " << endl; zones = getZones(); //getZonesByType("master"); all_zones = zones; if (zones) { for (; zones->zoneName != NULL ; zones++) { if ( strcmp(zones->zoneType, "master") ) continue; Linux_DnsMasterZoneManualInstance instance; Linux_DnsMasterZoneInstanceName instanceName; cout << "--- Calling setInstanceNameProperties() for zone" << endl; printf (" -----%s \n", zones->zoneName); setInstanceNameProperties(ctx, mbp, nsp, zones, instanceName); cout << "--- Calling setInstanceProperties()" << endl; setInstanceProperties(ctx, mbp, zones, instanceName, instance); instances.addElement(instance); cout << "--- Added to enumeration" << endl; } freeZones( all_zones ); } else { cout << "--- No Zones Found" << endl; } cout << "--- enumInstances() exited" << endl; }; Linux_DnsMasterZoneManualInstance Linux_DnsMasterZoneResourceAccess::getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsMasterZoneInstanceName& anInstanceName){ cout << "--- getInstance() called" << endl; DNSZONE *zones, *myZone; Linux_DnsMasterZoneManualInstance instance; cout << "---- calling getZones() " << endl; zones = getZones(); myZone = findZone(zones,anInstanceName.getName()); if ( ! myZone ) throw CmpiStatus(CMPI_RC_ERR_NOT_FOUND,"Zone does not exist"); setInstanceProperties(ctx, mbp, myZone, anInstanceName, instance); cout << "--- getInstance() exited " << endl; freeZones( zones ); return instance; } void Linux_DnsMasterZoneResourceAccess::setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsMasterZoneManualInstance& newInstance){ cout << "Linux_DnsMasterZoneResourceAccess::setInstance()" << endl; cout << "--- setInstance() called" << endl; DNSZONE *zones, *myZone; zones = getZones(); myZone = findZone(zones, newInstance.getInstanceName().getName()); if ( ! myZone ) throw CmpiStatus(CMPI_RC_ERR_NOT_FOUND,"Zone does not exist"); if ( strcmp(myZone->zoneType,"master") != 0 ) throw CmpiStatus(CMPI_RC_ERR_NOT_FOUND,"Zone does not exist"); if ( newInstance.isResourceRecordFileSet() ) { free(myZone->zoneFileName); myZone->zoneFileName = strdup(newInstance.getResourceRecordFile()); } if (newInstance.isContactSet()) { free(myZone->soaContact); myZone->soaContact = strdup( newInstance.getContact() ); } if ( newInstance.isForwardSet() ) { ZONEOPTS *zopts = findOptsInZone( myZone, "forward" ); if ( zopts ) { free( zopts->value ); if ( newInstance.getForward() == DNS_FORWARD_ONLY ) zopts->value = strdup( "only" ); if ( newInstance.getForward() == DNS_FORWARD_FIRST ) zopts->value = strdup( "first" ); } else { if ( newInstance.getForward() == DNS_FORWARD_ONLY ) addOptsToZone( myZone, "forward", "only" ); if ( newInstance.getForward() == DNS_FORWARD_FIRST ) addOptsToZone( myZone, "forward", "first" ); } } unsigned int size = 0; if ( newInstance.isForwardersSet() ) { ZONEOPTS *zopts = findOptsInZone( myZone, "forwarders" ); const char **forwardersList = newInstance.getForwarders( size ); DnsArray value_list; for (unsigned int i = 0; i < size; i++) if (! value_list.isPresent( string( forwardersList[i]) ) ) value_list.add( forwardersList[i] ); if ( zopts ) { free( zopts->value ); zopts->value = strdup ( value_list.toString().c_str() ); } else addOptsToZone( myZone,"forwarders", strdup( value_list.toString().c_str() ) ); } // SerialNumber if (newInstance.isSerialNumberSet()) myZone->soaSerialNumber = atoi(newInstance.getSerialNumber()); // Refresh if (newInstance.isRefreshSet()) myZone->soaRefresh = newInstance.getRefresh(); // Retry if (newInstance.isRetrySet()) myZone->soaRetry = newInstance.getRetry(); // Expire if (newInstance.isExpireSet()) myZone->soaExpire = newInstance.getExpire(); // NegativeCachingTTL if (newInstance.isNegativeCachingTTLSet()) myZone->soaNegativCachingTTL = newInstance.getNegativeCachingTTL(); if (newInstance.isServerSet()) myZone->soaServer = strdup( newInstance.getServer() ); updateZones(zones); freeZones( zones ); cout << "--- setInstance() exited " << endl; }; void Linux_DnsMasterZoneResourceAccess::createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneManualInstance& aManualInstance) { cout << "--- createInstance() called" << endl; DNSZONE * newZone = NULL; Linux_DnsMasterZoneInstanceName anInstanceName = aManualInstance.getInstanceName(); if (((anInstanceName.getName()) == NULL) || ((anInstanceName.getName()) == "" ) || ((anInstanceName.getName()) == " " ) ) { // throw exception that invalid key cout << "---- Zonename is invalid" << endl; throw CmpiStatus(CMPI_RC_ERR_INVALID_PARAMETER,"Zonename is invalid"); } DNSZONE * all_zones = getZones(); if ( findZone(all_zones,anInstanceName.getName()) ) { freeZones(all_zones); throw CmpiStatus(CMPI_RC_ERR_INVALID_PARAMETER,"The zone already exist"); } freeZones(all_zones); newZone = (DNSZONE *)calloc(1+1,sizeof(DNSZONE)); if (newZone) { // Take in value specified only at Dialog ??// newZone->zoneName = (char *)anInstanceName.getName(); newZone->zoneType = "master"; cout << "---- newZone->zoneType is "<< newZone->zoneType << endl; if (aManualInstance.isResourceRecordFileSet()) { newZone->zoneFileName = strdup(aManualInstance.getResourceRecordFile()); } else { char * buffer; buffer = (char *)calloc((strlen(newZone->zoneType)+strlen(newZone->zoneName)+2),sizeof(char)); strcat(buffer, newZone->zoneType); strcat(buffer, "/"); strcat(buffer, newZone->zoneName); newZone->zoneFileName = buffer; } printf("---- zoneFileName is %s \n", newZone->zoneFileName); // Contact if (aManualInstance.isContactSet()) newZone->soaContact = (char *)aManualInstance.getContact(); else newZone->soaContact = "root"; // if not at dialog then use following default required values (dnssupport.h) for a Zone // may need to get them from default section in Service // SerialNumber if (aManualInstance.isSerialNumberSet()) newZone->soaSerialNumber = atoi(aManualInstance.getSerialNumber()); else newZone->soaSerialNumber = 2005040000; // Refresh if (aManualInstance.isRefreshSet()) newZone->soaRefresh = aManualInstance.getRefresh(); else newZone->soaRefresh = 60*60; // Retry if (aManualInstance.isRetrySet()) newZone->soaRetry = aManualInstance.getRetry(); else newZone->soaRetry = 3*60*60; // Expire if (aManualInstance.isExpireSet()) newZone->soaExpire = aManualInstance.getExpire(); else newZone->soaExpire = 2*60*60; if ( aManualInstance.isForwardSet() ) { if ( aManualInstance.getForward() == DNS_FORWARD_ONLY ) addOptsToZone( newZone, "forward", "only" ); if ( aManualInstance.getForward() == DNS_FORWARD_FIRST ) addOptsToZone( newZone, "forward", "first" ); } unsigned int size = 0; if ( aManualInstance.isForwardersSet() ) { const char **forwardersList = aManualInstance.getForwarders( size ); DnsArray value_list; for (unsigned int i = 0; i < size; i++) if (! value_list.isPresent( string( forwardersList[i]) ) ) value_list.add( forwardersList[i] ); addOptsToZone( newZone,"forwarders", strdup( value_list.toString().c_str() ) ); } // NegativeCachingTTL if (aManualInstance.isNegativeCachingTTLSet()) newZone->soaNegativCachingTTL = aManualInstance.getNegativeCachingTTL(); else newZone->soaNegativCachingTTL = 0; if (aManualInstance.isServerSet()) newZone->soaServer = strdup( aManualInstance.getServer() ); else newZone->soaServer = "@"; newZone->records = NULL; cout << "---- calling addZones() " << endl; DNSZONE * returnedZones = NULL; returnedZones = addZone(newZone, NULL); if (!returnedZones) { cout <<"---- addZone() failed " << endl; cout <<"---- createInstance Zone exited " << endl; throw CmpiStatus(CMPI_RC_ERROR,"addZone() failed"); } freeZones( returnedZones ); cout <<"---- createInstance Zone exited " << endl; } } void Linux_DnsMasterZoneResourceAccess::deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName& inst){ deleteZone( inst.getName() ); }; /* extrinsic methods */ /* virtual CMPIUint32 Linux_DnsMasterZoneResourceAccess::ApplyIncrementalChangeToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CMPIBoolean &ContinueOnError, int isContinueOnErrorPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent, char** &CanNotApply, CMPICount &CanNotApplySize) { }; */ /* virtual CMPIUint32 Linux_DnsMasterZoneResourceAccess::ApplyIncrementalChangeToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent) { }; */ /* virtual CMPIUint32 Linux_DnsMasterZoneResourceAccess::ApplyToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CMPIBoolean &ContinueOnError, int isContinueOnErrorPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, char** &CanNotApply, CMPICount &CanNotApplySize) { }; */ /* virtual CMPIUint32 Linux_DnsMasterZoneResourceAccess::ApplyToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent) { }; */ /* virtual CMPIUint32 Linux_DnsMasterZoneResourceAccess::VerifyOKToApplyIncrementalChangeToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent, char** &CanNotApply, CMPICount &CanNotApplySize) { }; */ /* virtual CMPIUint32 Linux_DnsMasterZoneResourceAccess::VerifyOKToApplyIncrementalChangeToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent) { }; */ /* virtual CMPIUint32 Linux_DnsMasterZoneResourceAccess::VerifyOKToApplyToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, char** &CanNotApply, CMPICount &CanNotApplySize) { }; */ /* virtual CMPIUint32 Linux_DnsMasterZoneResourceAccess::VerifyOKToApplyToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent) { }; */ CMPIUint32 Linux_DnsMasterZoneResourceAccess::disable( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName& inst) { if ( inst.getName() == NULL ) return 3; return disableZone(inst.getName()); }; CMPIUint32 Linux_DnsMasterZoneResourceAccess::enable( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName& inst) { if ( inst.getName() == NULL ) return 3; return enableZone(inst.getName()); }; } --- NEW FILE: Linux_DnsMasterZoneExternal.cpp --- /** * Linux_DnsMasterZoneExternal.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_DnsMasterZoneExternal.h" namespace genProvider{ Linux_DnsMasterZoneExternal::Linux_DnsMasterZoneExternal( const CmpiBroker& brkr, const CmpiContext& ctx ) : broker(brkr), context(ctx) {}; Linux_DnsMasterZoneExternal:: ~Linux_DnsMasterZoneExternal(){}; void Linux_DnsMasterZoneExternal::enumInstanceNames( const char *nsp, Linux_DnsMasterZoneInstanceNameEnumeration& instnames) { CmpiObjectPath op(nsp,"Linux_DnsMasterZone"); CmpiEnumeration en=broker.enumInstanceNames(context,op); while(en.hasNext()) { CmpiObjectPath opi = en.getNext(); Linux_DnsMasterZoneInstanceName iname(opi); instnames.addElement(iname); } }; void Linux_DnsMasterZoneExternal::enumInstances( const char *nsp, const char* *properties, Linux_DnsMasterZoneInstanceEnumeration& instances) { CmpiObjectPath op(nsp,"Linux_DnsMasterZone"); CmpiEnumeration en=broker.enumInstances(context,op,properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); Linux_DnsMasterZoneInstance instance(inst,nsp); instances.addElement(instance); } }; Linux_DnsMasterZoneInstance Linux_DnsMasterZoneExternal::getInstance( const char* *properties, const Linux_DnsMasterZoneInstanceName& instanceName) { CmpiObjectPath op=instanceName.getObjectPath(); CmpiInstance inst=broker.getInstance(context,op,properties); return Linux_DnsMasterZoneInstance(inst,instanceName.getNamespace()); } void Linux_DnsMasterZoneExternal::setInstance( const char* *properties, const Linux_DnsMasterZoneInstance& instance){ CmpiObjectPath op=instance.getInstanceName().getObjectPath(); CmpiInstance inst=instance.getCmpiInstance(); broker.setInstance(context,op,inst,properties); } void Linux_DnsMasterZoneExternal::createInstance( const Linux_DnsMasterZoneInstance& instance){ CmpiObjectPath op=instance.getInstanceName().getObjectPath(); CmpiInstance inst=instance.getCmpiInstance(); broker.createInstance(context,op,inst); } void Linux_DnsMasterZoneExternal::deleteInstance( const Linux_DnsMasterZoneInstanceName& instanceName){ CmpiObjectPath op=instanceName.getObjectPath(); broker.deleteInstance(context,op); } } --- NEW FILE: Linux_DnsMasterZoneResourceAccess.h --- /** * Linux_DnsMasterZoneResourceAccess.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_DnsMasterZoneResourceAccess_h #define Linux_DnsMasterZoneResourceAccess_h #include "Linux_DnsMasterZoneInstanceName.h" #include "Linux_DnsMasterZoneManualInstance.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiDateTime.h" #include "CmpiBroker.h" #include "CIM_CollectionOfMSEsInstanceName.h" #include "CIM_ManagedSystemElementInstanceName.h" #include "Linux_DnsMasterZoneDefaultImplementation.h" #include <string> #include <list> #include "dnssupport.h" #include "DnsValueMap.h" #include "DnsArray.h" namespace genProvider { class Linux_DnsMasterZoneResourceAccess: public Linux_DnsMasterZoneDefaultImplementation { private: virtual void setInstanceProperties( const CmpiContext& ctx, const CmpiBroker &mbp, DNSZONE * zone, const Linux_DnsMasterZoneInstanceName& anInstanceName, Linux_DnsMasterZoneManualInstance& aManualInstance); virtual void setInstanceNameProperties( const CmpiContext& ctx, const CmpiBroker& mbp, const char *nsp, DNSZONE * zone, Linux_DnsMasterZoneInstanceName& anInstanceName); public: /*Linux_DnsMasterZoneResourceAccess();*/ virtual ~Linux_DnsMasterZoneResourceAccess() ; /* intrinsic methods */ virtual void enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsMasterZoneInstanceNameEnumeration& instnames); virtual void enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsMasterZoneManualInstanceEnumeration& instances); virtual Linux_DnsMasterZoneManualInstance getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsMasterZoneInstanceName&); virtual void setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsMasterZoneManualInstance&); virtual void createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneManualInstance&); virtual void deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName&); /* extrinsic methods */ /*virtual CMPIUint32 ApplyIncrementalChangeToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CMPIBoolean &ContinueOnError, int isContinueOnErrorPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent, char** &CanNotApply, CMPICount &CanNotApplySize);*/ /*virtual CMPIUint32 ApplyIncrementalChangeToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent);*/ /*virtual CMPIUint32 ApplyToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CMPIBoolean &ContinueOnError, int isContinueOnErrorPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, char** &CanNotApply, CMPICount &CanNotApplySize);*/ /*virtual CMPIUint32 ApplyToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent);*/ /*virtual CMPIUint32 VerifyOKToApplyIncrementalChangeToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent, char** &CanNotApply, CMPICount &CanNotApplySize);*/ /*virtual CMPIUint32 VerifyOKToApplyIncrementalChangeToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent);*/ /*virtual CMPIUint32 VerifyOKToApplyToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, char** &CanNotApply, CMPICount &CanNotApplySize);*/ /*virtual CMPIUint32 VerifyOKToApplyToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent);*/ virtual CMPIUint32 disable( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName&); virtual CMPIUint32 enable( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName&); }; } #endif --- NEW FILE: Linux_DnsMasterZoneInterface.h --- /** * Linux_DnsMasterZoneInterface.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_DnsMasterZoneInterface_h #define Linux_DnsMasterZoneInterface_h #include "Linux_DnsMasterZoneInstanceName.h" #include "Linux_DnsMasterZoneManualInstance.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiDateTime.h" #include "CmpiBroker.h" #include "CIM_CollectionOfMSEsInstanceName.h" #include "CIM_ManagedSystemElementInstanceName.h" namespace genProvider { class Linux_DnsMasterZoneInterface { public: virtual ~Linux_DnsMasterZoneInterface() { }; /* intrinsic methods */ virtual void enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsMasterZoneInstanceNameEnumeration& instnames) = 0; virtual void enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsMasterZoneManualInstanceEnumeration& instances) = 0; virtual Linux_DnsMasterZoneManualInstance getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsMasterZoneInstanceName&) = 0; virtual void setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsMasterZoneManualInstance&) = 0; virtual void createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneManualInstance&) = 0; virtual void deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName&) = 0; /* extrinsic methods */ virtual CMPIUint32 ApplyIncrementalChangeToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CMPIBoolean &ContinueOnError, int isContinueOnErrorPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent, char** &CanNotApply, CMPICount &CanNotApplySize) = 0; virtual CMPIUint32 ApplyIncrementalChangeToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent) = 0; virtual CMPIUint32 ApplyToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CMPIBoolean &ContinueOnError, int isContinueOnErrorPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, char** &CanNotApply, CMPICount &CanNotApplySize) = 0; virtual CMPIUint32 ApplyToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent) = 0; virtual CMPIUint32 VerifyOKToApplyIncrementalChangeToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsMasterZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const C... [truncated message content] |
Update of /cvsroot/sblim/cmpi-dns/provider/Linux_DnsForwardZone In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20455/provider/Linux_DnsForwardZone Added Files: CmpiLinux_DnsForwardZoneProvider.h Linux_DnsForwardZoneInstanceName.h Linux_DnsForwardZoneFactory.cpp Linux_DnsForwardZoneInstanceName.cpp Linux_DnsForwardZoneFakeFactory.cpp Linux_DnsForwardZoneManualInstance.h Linux_DnsForwardZoneRepositoryInstance.cpp Linux_DnsForwardZoneDefaultImplementation.h Linux_DnsForwardZoneRepositoryExternal.cpp Linux_DnsForwardZoneInstance.h Linux_DnsForwardZoneExternal.h Linux_DnsForwardZoneResourceAccess.h Linux_DnsForwardZoneDefaultImplementation.cpp Linux_DnsForwardZoneManualInstance.cpp makefile Linux_DnsForwardZoneResourceAccess.cpp Linux_DnsForwardZoneExternal.cpp Linux_DnsForwardZoneInterface.h Linux_DnsForwardZoneRepositoryExternal.h CmpiLinux_DnsForwardZoneProvider.cpp Linux_DnsForwardZoneInstance.cpp Linux_DnsForwardZoneRepositoryInstance.h setting.provider Linux_DnsForwardZoneFactory.h Log Message: WBEM-SMT DNS provider component. First initial upload. This module includes: - CIM model for DNS - CMPI provider for DNS - Resource Access layer for DNS --- NEW FILE: Linux_DnsForwardZoneFakeFactory.cpp --- /** * Linux_DnsForwardZoneFakeFactory.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_DnsForwardZoneFactory.h" using namespace std; namespace genProvider{ Linux_DnsForwardZoneInterface* Linux_DnsForwardZoneFactory::getImplementation(){ cout<<"ERROR: incomplete support library is being used"<<endl; cout<<" in provider from class Linux_DnsForwardZone"<<endl; cout<<" Use the link-install options for the makefile"<<endl; return 0; }; } --- NEW FILE: setting.provider --- #Provider configuration #CPPFLAGS.provider LDFLAGS.provider=-ldnssupport --- NEW FILE: Linux_DnsForwardZoneDefaultImplementation.h --- /** * Linux_DnsForwardZoneDefaultImplementation.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_DnsForwardZoneDefaultImplementation_h #define Linux_DnsForwardZoneDefaultImplementation_h #include "Linux_DnsForwardZoneInstanceName.h" #include "Linux_DnsForwardZoneManualInstance.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiDateTime.h" #include "CmpiBroker.h" #include "CIM_CollectionOfMSEsInstanceName.h" #include "CIM_ManagedSystemElementInstanceName.h" #include "Linux_DnsForwardZoneInterface.h" namespace genProvider { class Linux_DnsForwardZoneDefaultImplementation: public Linux_DnsForwardZoneInterface { public: virtual ~Linux_DnsForwardZoneDefaultImplementation() { }; /* intrinsic methods */ virtual void enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsForwardZoneInstanceNameEnumeration& instnames); virtual void enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsForwardZoneManualInstanceEnumeration& instances); virtual Linux_DnsForwardZoneManualInstance getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsForwardZoneInstanceName&); virtual void setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsForwardZoneManualInstance&); virtual void createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneManualInstance&); virtual void deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&); /* extrinsic methods */ virtual CMPIUint32 ApplyIncrementalChangeToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CMPIBoolean &ContinueOnError, int isContinueOnErrorPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent, char** &CanNotApply, CMPICount &CanNotApplySize); virtual CMPIUint32 ApplyIncrementalChangeToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent); virtual CMPIUint32 ApplyToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CMPIBoolean &ContinueOnError, int isContinueOnErrorPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, char** &CanNotApply, CMPICount &CanNotApplySize); virtual CMPIUint32 ApplyToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent); virtual CMPIUint32 VerifyOKToApplyIncrementalChangeToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent, char** &CanNotApply, CMPICount &CanNotApplySize); virtual CMPIUint32 VerifyOKToApplyIncrementalChangeToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent); virtual CMPIUint32 VerifyOKToApplyToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, char** &CanNotApply, CMPICount &CanNotApplySize); virtual CMPIUint32 VerifyOKToApplyToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent); }; } #endif --- NEW FILE: Linux_DnsForwardZoneResourceAccess.cpp --- /** * Linux_DnsForwardZoneResourceAccess.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 <string> #include <iostream> using namespace std; #include "Linux_DnsForwardZoneResourceAccess.h" namespace genProvider { //------------------------------------------------------------------------------------ // Linux_DnsForwardZoneResourceAccess::setInstanceNameProperties() //------------------------------------------------------------------------------------ void Linux_DnsForwardZoneResourceAccess::setInstanceNameProperties(const CmpiContext& ctx, const CmpiBroker& mbp, const char* nsp, DNSZONE * zone, Linux_DnsForwardZoneInstanceName& anInstanceName) { cout << "--- setInstanceNameProperties() called" << endl; anInstanceName.setNamespace(nsp); anInstanceName.setName(zone->zoneName); cout << "--- setInstanceNameProperties() exited" << endl; } //------------------------------------------------------------------------------------ // Linux_DnsForwardZoneResourceAccess::setInstanceProperties() //------------------------------------------------------------------------------------ void Linux_DnsForwardZoneResourceAccess::setInstanceProperties(const CmpiContext& ctx, const CmpiBroker& mbp, DNSZONE * zone, const Linux_DnsForwardZoneInstanceName& anInstanceName, Linux_DnsForwardZoneManualInstance& aManualInstance) { cout<<"--- setInstanceProperties() called"<<endl; aManualInstance.setInstanceName(anInstanceName); aManualInstance.setType(DNS_ZONETYPE_FORWARD); // aManualInstance.setResourceRecordFile(zone->zoneFileName); ZONEOPTS * forward = findOptsInZone( zone, "forward" ); if ( forward ) { if ( strcmp( forward->value, "first" ) ) aManualInstance.setForward( DNS_FORWARD_FIRST ); if ( strcmp( forward->value, "only" ) ) aManualInstance.setForward( DNS_FORWARD_ONLY ); } ZONEOPTS * forwarders = findOptsInZone( zone, "forwarders" ); DnsArray da; if ( forwarders && forwarders->value ) { da.populate( forwarders->value ); aManualInstance.setForwarders( da.toArray(), da.size() ); } } //Linux_DnsForwardZoneResourceAccess::Linux_DnsForwardZoneResourceAccess(); Linux_DnsForwardZoneResourceAccess::~Linux_DnsForwardZoneResourceAccess() { }; /* intrinsic methods */ void Linux_DnsForwardZoneResourceAccess::enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsForwardZoneInstanceNameEnumeration& instnames){ DNSZONE * zones, *all_zones; cout << "--- enumInstanceNames() called" << endl; cout << "---- calling getZones() " << endl; zones = getZones(); //getZonesByType("forward"); all_zones = zones; if (zones) { for (; zones->zoneName; zones++) { if ( strcmp(zones->zoneType, "forward") ) continue; Linux_DnsForwardZoneInstanceName instanceName; cout << "--- Calling setInstanceNameProperties()" << endl; printf ("Zone Name is %s \n", zones->zoneName); setInstanceNameProperties(ctx, mbp, nsp, zones, instanceName); instnames.addElement(instanceName); cout << "--- Added to enumeration" << endl; } freeZones( all_zones ); cout << "--- enumInstanceNames () exited" << endl; } } void Linux_DnsForwardZoneResourceAccess::enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsForwardZoneManualInstanceEnumeration& instances){ cout << "--- enumInstances() called" << endl; DNSZONE * zones = NULL, *all_zones; cout << "---- calling getZones() " << endl; zones = getZones(); //getZonesByType("forward"); all_zones = zones; if (zones) { for (; zones->zoneName != NULL ; zones++) { if ( strcmp(zones->zoneType, "forward") ) continue; Linux_DnsForwardZoneManualInstance instance; Linux_DnsForwardZoneInstanceName instanceName; cout << "--- Calling setInstanceNameProperties() for zone" << endl; printf (" -----%s \n", zones->zoneName); setInstanceNameProperties(ctx, mbp, nsp, zones, instanceName); cout << "--- Calling setInstanceProperties()" << endl; setInstanceProperties(ctx, mbp, zones, instanceName, instance); instances.addElement(instance); cout << "--- Added to enumeration" << endl; } freeZones( all_zones ); } else { cout << "--- No Zones Found" << endl; } cout << "--- enumInstances() exited" << endl; }; Linux_DnsForwardZoneManualInstance Linux_DnsForwardZoneResourceAccess::getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsForwardZoneInstanceName& anInstanceName){ cout << "--- getInstance() called" << endl; DNSZONE *zones, *myZone; Linux_DnsForwardZoneManualInstance instance; cout << "---- calling getZones() " << endl; zones = getZones(); //getZonesByType("forward"); myZone = findZone(zones,anInstanceName.getName()); setInstanceProperties(ctx, mbp, myZone, anInstanceName, instance); cout << "--- getInstance() exited " << endl; freeZones( zones ); return instance; } void Linux_DnsForwardZoneResourceAccess::setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsForwardZoneManualInstance& newInstance){ cout << "--- setInstance() called" << endl; DNSZONE *zones, *myZone; zones = getZones(); myZone = findZone(zones, newInstance.getInstanceName().getName()); if ( ! myZone ) throw CmpiStatus(CMPI_RC_ERR_NOT_FOUND,"Zone does not exist"); if ( strcmp(myZone->zoneType,"forward") != 0 ) throw CmpiStatus(CMPI_RC_ERR_NOT_FOUND,"Zone does not exist"); if ( newInstance.isForwardSet() ) { ZONEOPTS *zopts = findOptsInZone( myZone, "forward" ); if ( zopts ) { free( zopts->value ); if ( newInstance.getForward() == DNS_FORWARD_ONLY ) zopts->value = strdup( "only" ); if ( newInstance.getForward() == DNS_FORWARD_FIRST ) zopts->value = strdup( "first" ); } else { if ( newInstance.getForward() == DNS_FORWARD_ONLY ) addOptsToZone( myZone, "forward", "only" ); if ( newInstance.getForward() == DNS_FORWARD_FIRST ) addOptsToZone( myZone, "forward", "first" ); } } unsigned int size = 0; if ( newInstance.isForwardersSet() ) { ZONEOPTS *zopts = findOptsInZone( myZone, "forwarders" ); const char **forwardersList = newInstance.getForwarders( size ); DnsArray value_list; for (unsigned int i = 0; i < size; i++) if (! value_list.isPresent( string( forwardersList[i]) ) ) value_list.add( forwardersList[i] ); if ( zopts ) { free( zopts->value ); zopts->value = strdup ( value_list.toString().c_str() ); } else addOptsToZone( myZone,"forwarders", strdup( value_list.toString().c_str() ) ); } // option 'file' is not allowed in 'forward' zone if ( newInstance.isResourceRecordFileSet() ) { free(myZone->zoneFileName); myZone->zoneFileName = strdup(newInstance.getResourceRecordFile()); } updateZones( zones ); freeZones( zones ); }; void Linux_DnsForwardZoneResourceAccess::createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneManualInstance& aManualInstance){ cout << "--- createInstance() called" << endl; DNSZONE * newZone = NULL; Linux_DnsForwardZoneInstanceName anInstanceName = aManualInstance.getInstanceName(); if (((anInstanceName.getName()) == NULL) || ((anInstanceName.getName()) == "" ) || ((anInstanceName.getName()) =="") ) { // throw exception that invalid key cout << "---- Zonename is invalid" << endl; throw CmpiStatus(CMPI_RC_ERR_INVALID_PARAMETER,"Zonename is invalid"); } DNSZONE * all_zones = getZones(); if ( findZone(all_zones,anInstanceName.getName()) ) { freeZones(all_zones); throw CmpiStatus(CMPI_RC_ERR_INVALID_PARAMETER,"The zone already exist"); } freeZones(all_zones); newZone = (DNSZONE *)calloc(1+1,sizeof(DNSZONE)); if (newZone) { newZone->zoneName = (char *)anInstanceName.getName(); newZone->zoneType = "forward"; if ( aManualInstance.isForwardSet() ) { if ( aManualInstance.getForward() == DNS_FORWARD_ONLY ) addOptsToZone( newZone, "forward", "only" ); if ( aManualInstance.getForward() == DNS_FORWARD_FIRST ) addOptsToZone( newZone, "forward", "first" ); } unsigned int size = 0; if ( aManualInstance.isForwardersSet() ) { const char **forwardersList = aManualInstance.getForwarders( size ); DnsArray value_list; for (unsigned int i = 0; i < size; i++) if (! value_list.isPresent( string( forwardersList[i]) ) ) value_list.add( forwardersList[i] ); addOptsToZone( newZone,"forwarders", strdup( value_list.toString().c_str() ) ); } cout << "---- newZone->zoneType is "<< newZone->zoneType << endl; //option 'file' is not allowed in 'forward' zone if (aManualInstance.isResourceRecordFileSet()) { newZone->zoneFileName = strdup(aManualInstance.getResourceRecordFile()); } else { char * buffer; buffer = (char *)calloc((strlen(newZone->zoneType)+strlen(newZone->zoneName)+2),sizeof(char)); strcat(buffer, newZone->zoneType); strcat(buffer, "/"); strcat(buffer, newZone->zoneName); newZone->zoneFileName = buffer; } newZone->records = NULL; cout << "---- calling addZones() " << endl; DNSZONE * returnedZones = NULL; returnedZones = addZone(newZone, NULL); if (!returnedZones) { cout <<"---- addZone() failed " << endl; cout <<"---- createInstance Zone exited " << endl; throw CmpiStatus(CMPI_RC_ERROR,"addZone() failed"); } freeZones( returnedZones ); cout <<"---- createInstance Zone exited " << endl; } }; void Linux_DnsForwardZoneResourceAccess::deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName& inst){ deleteZone( inst.getName() ); }; /* extrinsic methods */ /* virtual CMPIUint32 Linux_DnsForwardZoneResourceAccess::ApplyIncrementalChangeToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CMPIBoolean &ContinueOnError, int isContinueOnErrorPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent, char** &CanNotApply, CMPICount &CanNotApplySize) { }; */ /* virtual CMPIUint32 Linux_DnsForwardZoneResourceAccess::ApplyIncrementalChangeToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent) { }; */ /* virtual CMPIUint32 Linux_DnsForwardZoneResourceAccess::ApplyToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CMPIBoolean &ContinueOnError, int isContinueOnErrorPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, char** &CanNotApply, CMPICount &CanNotApplySize) { }; */ /* virtual CMPIUint32 Linux_DnsForwardZoneResourceAccess::ApplyToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent) { }; */ /* virtual CMPIUint32 Linux_DnsForwardZoneResourceAccess::VerifyOKToApplyIncrementalChangeToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent, char** &CanNotApply, CMPICount &CanNotApplySize) { }; */ /* virtual CMPIUint32 Linux_DnsForwardZoneResourceAccess::VerifyOKToApplyIncrementalChangeToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, const char** PropertiesToApply, const CMPICount PropertiesToApplySize, int isPropertiesToApplyPresent) { }; */ /* virtual CMPIUint32 Linux_DnsForwardZoneResourceAccess::VerifyOKToApplyToCollection( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_CollectionOfMSEsInstanceName &Collection, int isCollectionPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent, char** &CanNotApply, CMPICount &CanNotApplySize) { }; */ /* virtual CMPIUint32 Linux_DnsForwardZoneResourceAccess::VerifyOKToApplyToMSE( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName&, const CIM_ManagedSystemElementInstanceName &MSE, int isMSEPresent, const CmpiDateTime &TimeToApply, int isTimeToApplyPresent, const CmpiDateTime &MustBeCompletedBy, int isMustBeCompletedByPresent) { }; */ CMPIUint32 Linux_DnsForwardZoneResourceAccess::disable( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName& inst) { if ( inst.getName() == NULL ) return 3; disableZone( inst.getName() ); }; CMPIUint32 Linux_DnsForwardZoneResourceAccess::enable( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsForwardZoneInstanceName& inst) { if ( inst.getName() == NULL ) return 3; enableZone( inst.getName() ); }; } --- NEW FILE: Linux_DnsForwardZoneExternal.cpp --- /** * Linux_DnsForwardZoneExternal.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_DnsForwardZoneExternal.h" namespace genProvider{ Linux_DnsForwardZoneExternal::Linux_DnsForwardZoneExternal( const CmpiBroker& brkr, const CmpiContext& ctx ) : broker(brkr), context(ctx) {}; Linux_DnsForwardZoneExternal:: ~Linux_DnsForwardZoneExternal(){}; void Linux_DnsForwardZoneExternal::enumInstanceNames( const char *nsp, Linux_DnsForwardZoneInstanceNameEnumeration& instnames) { CmpiObjectPath op(nsp,"Linux_DnsForwardZone"); CmpiEnumeration en=broker.enumInstanceNames(context,op); while(en.hasNext()) { CmpiObjectPath opi = en.getNext(); Linux_DnsForwardZoneInstanceName iname(opi); instnames.addElement(iname); } }; void Linux_DnsForwardZoneExternal::enumInstances( const char *nsp, const char* *properties, Linux_DnsForwardZoneInstanceEnumeration& instances) { CmpiObjectPath op(nsp,"Linux_DnsForwardZone"); CmpiEnumeration en=broker.enumInstances(context,op,properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); Linux_DnsForwardZoneInstance instance(inst,nsp); instances.addElement(instance); } }; Linux_DnsForwardZoneInstance Linux_DnsForwardZoneExternal::getInstance( const char* *properties, const Linux_DnsForwardZoneInstanceName& instanceName) { CmpiObjectPath op=instanceName.getObjectPath(); CmpiInstance inst=broker.getInstance(context,op,properties); return Linux_DnsForwardZoneInstance(inst,instanceName.getNamespace()); } void Linux_DnsForwardZoneExternal::setInstance( const char* *properties, const Linux_DnsForwardZoneInstance& instance){ CmpiObjectPath op=instance.getInstanceName().getObjectPath(); CmpiInstance inst=instance.getCmpiInstance(); broker.setInstance(context,op,inst,properties); } void Linux_DnsForwardZoneExternal::createInstance( const Linux_DnsForwardZoneInstance& instance){ CmpiObjectPath op=instance.getInstanceName().getObjectPath(); CmpiInstance inst=instance.getCmpiInstance(); broker.createInstance(context,op,inst); } void Linux_DnsForwardZoneExternal::deleteInstance( const Linux_DnsForwardZoneInstanceName& instanceName){ CmpiObjectPath op=instanceName.getObjectPath(); broker.deleteInstance(context,op); } } --- NEW FILE: makefile --- include ../setting.cmpi include setting.provider CPPFLAGS=$(CPPFLAGS.provider) -I. -I$(CIMOMINC) -I$(COMMONINC) -I$(CIMOMINC)/cpp -I../CIM_CollectionOfMSEs -I../CIM_ManagedSystemElement -D_COMPILE_UNIX -DCMPI_STANDALONE CXXFLAGS=-Wall -g -fPIC -fno-implicit-templates LDFLAGS=-L. -L$(COMMONLIB) -L$(COMMONLIB_OUT) -shared -lCIM_CollectionOfMSEsSupport -lCIM_ManagedSystemElementSupport -lcmpiCppImpl -lIBM_ProviderTooling OBJECTS=Linux_DnsForwardZoneInstanceName.o \ Linux_DnsForwardZoneInstance.o \ Linux_DnsForwardZoneExternal.o \ Linux_DnsForwardZoneRepositoryInstance.o \ Linux_DnsForwardZoneRepositoryExternal.o \ Linux_DnsForwardZoneManualInstance.o \ Linux_DnsForwardZoneDefaultImplementation.o FAKEFACTORY= Linux_DnsForwardZoneFakeFactory.o NORMALFACTORY= Linux_DnsForwardZoneFactory.o RESOURCEOBJECT= Linux_DnsForwardZoneResourceAccess.o PROVIDEROBJECT=CmpiLinux_DnsForwardZoneProvider.o all: testfiles preinstall install buildall: clean all #------------------------------------------------------------------------------# compile: $(OBJECTS) $(FAKEFACTORY) $(NORMALFACTORY) $(RESOURCEOBJECT) $(PROVIDEROBJECT) #------------------------------------------------------------------------------# prelink: $(OBJECTS) $(FAKEFACTORY) $(LINK.cpp) -o libLinux_DnsForwardZoneSupport.so $^ link: deleteFakeLib \ libLinux_DnsForwardZoneSupport.so \ libLinux_DnsForwardZone.so libLinux_DnsForwardZoneSupport.so: LDFLAGS+=$(LDFLAGS.provider) libLinux_DnsForwardZoneSupport.so: $(OBJECTS) $(NORMALFACTORY) $(RESOURCEOBJECT) $(PROVIDEROBJECT) $(LINK.cpp) -o $@ $^ libLinux_DnsForwardZone.so: LDFLAGS+=-lLinux_DnsForwardZoneSupport libLinux_DnsForwardZone.so: $(PROVIDEROBJECT) $(LINK.cpp) -o $@ $^ deleteFakeLib: $(RM) *.so #------------------------------------------------------------------------------# preinstall: prelink install libLinux_DnsForwardZoneSupport.so $(COMMONLIB_OUT) #------------------------------------------------------------------------------# install: link install libLinux_DnsForwardZoneSupport.so $(COMMONLIB_OUT) install libLinux_DnsForwardZone.so $(CIMOMLIB_OUT) # install -m 644 Linux_DnsForwardZone*.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_DnsForwardZone*.h \ $(RM) $(COMMONLIB)/libLinux_DnsForwardZoneSupport.so \ $(RM) $(CIMOMLIB)/libLinux_DnsForwardZone.so --- NEW FILE: Linux_DnsForwardZoneExternal.h --- /** * Linux_DnsForwardZoneExternal.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_DnsForwardZoneExternal_h #define Linux_DnsForwardZoneExternal_h #include "Linux_DnsForwardZoneInstance.h" #include "CmpiBroker.h" namespace genProvider { class Linux_DnsForwardZoneExternal { public: Linux_DnsForwardZoneExternal( const CmpiBroker& brkr, const CmpiContext& ctx); virtual ~Linux_DnsForwardZoneExternal(); virtual void enumInstanceNames( const char *nsp, Linux_DnsForwardZoneInstanceNameEnumeration&); virtual void enumInstances( const char *nsp, const char* *properties, Linux_DnsForwardZoneInstanceEnumeration&); virtual Linux_DnsForwardZoneInstance getInstance( const char* *properties, const Linux_DnsForwardZoneInstanceName&); virtual void setInstance( const char* *properties, const Linux_DnsForwardZoneInstance&); virtual void createInstance( const Linux_DnsForwardZoneInstance&); virtual void deleteInstance( const Linux_DnsForwardZoneInstanceName&); private: CmpiBroker broker; CmpiContext context; }; } #endif --- NEW FILE: Linux_DnsForwardZoneFactory.cpp --- /** * Linux_DnsForwardZoneFactory.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_DnsForwardZoneFactory.h" #include "Linux_DnsForwardZoneResourceAccess.h" namespace genProvider{ Linux_DnsForwardZoneInterface* Linux_DnsForwardZoneFactory::getImplementation(){ return (new Linux_DnsForwardZoneResourceAccess()); }; } --- NEW FILE: Linux_DnsForwardZoneManualInstance.h --- /** * Linux_DnsForwardZoneManualInstance.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_DnsForwardZoneManualInstance_h #define Linux_DnsForwardZoneManualInstance_h #include "cmpidt.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiBooleanData.h" #include "CmpiCharData.h" #include "CmpiDateTime.h" #include "Linux_DnsForwardZoneInstanceName.h" namespace genProvider { class Linux_DnsForwardZoneManualInstance { public: Linux_DnsForwardZoneManualInstance(); Linux_DnsForwardZoneManualInstance (const Linux_DnsForwardZoneManualInstance& original); Linux_DnsForwardZoneManualInstance (const CmpiInstance& inst, const char* instanceNamespace); ~Linux_DnsForwardZoneManualInstance(); Linux_DnsForwardZoneManualInstance& operator= (const Linux_DnsForwardZoneManualInstance& original); CmpiInstance getCmpiInstance(const char** properties=0) const; unsigned int isInstanceNameSet() const; void setInstanceName( const Linux_DnsForwardZoneInstanceName& val); const Linux_DnsForwardZoneInstanceName& getInstanceName() const; unsigned int isForwardSet() const; void setForward(const CMPIUint16 val); const CMPIUint16 getForward() const; unsigned int isForwardersSet() const; void setForwarders(const char** val, unsigned const int size, int makeCopy = 1); const char** getForwarders(unsigned int& size) const; unsigned int isResourceRecordFileSet() const; void setResourceRecordFile(const char* val, int makeCopy = 1); const char* getResourceRecordFile() const; unsigned int isTypeSet() const; void setType(const CMPIUint16 val); const CMPIUint16 getType() const; private: void init(); void init(const Linux_DnsForwardZoneManualInstance& original); void reset(); Linux_DnsForwardZoneInstanceName m_instanceName; CMPIUint16 m_Forward; const char** m_Forwarders; unsigned int ForwardersArraySize; const char* m_ResourceRecordFile; CMPIUint16 m_Type; struct isSetType{ unsigned int instanceName:1; unsigned int Forward:1; unsigned int Forwarders:1; unsigned int ResourceRecordFile:1; unsigned int Type:1; } isSet; }; struct Linux_DnsForwardZoneManualInstanceEnumerationElement{ Linux_DnsForwardZoneManualInstance* m_elementP; Linux_DnsForwardZoneManualInstanceEnumerationElement* m_nextP; Linux_DnsForwardZoneManualInstanceEnumerationElement(); ~Linux_DnsForwardZoneManualInstanceEnumerationElement(); }; class Linux_DnsForwardZoneManualInstanceEnumeration { private: Linux_DnsForwardZoneManualInstanceEnumerationElement* firstElementP; Linux_DnsForwardZoneManualInstanceEnumerationElement* currentElementP; Linux_DnsForwardZoneManualInstanceEnumerationElement* endElementP; public: Linux_DnsForwardZoneManualInstanceEnumeration(); Linux_DnsForwardZoneManualInstanceEnumeration( const Linux_DnsForwardZoneManualInstanceEnumeration& original); ~Linux_DnsForwardZoneManualInstanceEnumeration(); void reset(); bool hasNext() const; const Linux_DnsForwardZoneManualInstance& getNext(); int getSize() const; const Linux_DnsForwardZoneManualInstance& getElement(int pos) const; void addElement(const Linux_DnsForwardZoneManualInstance& elementP); }; } #endif --- NEW FILE: Linux_DnsForwardZoneInstance.cpp --- /** * Linux_DnsForwardZoneInstance.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_DnsForwardZoneInstance.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //Linux_DnsForwardZoneInstance //********************************************************* //empty constructor Linux_DnsForwardZoneInstance:: Linux_DnsForwardZoneInstance(){ init(); }; //copy constructor Linux_DnsForwardZoneInstance:: Linux_DnsForwardZoneInstance (const Linux_DnsForwardZoneInstance& original){ init(original); }; //constructor using CmpiInstance Linux_DnsForwardZoneInstance:: Linux_DnsForwardZoneInstance (const CmpiInstance& inst, const char* instanceNamespace){ CmpiData cmpiData; init(); CmpiObjectPath cop=inst.getObjectPath(); cop.setNameSpace(instanceNamespace); setInstanceName(Linux_DnsForwardZoneInstanceName(cop)); cmpiData = inst.getProperty("Caption"); if(!cmpiData.isNullValue()){ CmpiString Caption = cmpiData; setCaption(Caption.charPtr()); } cmpiData = inst.getProperty("Description"); if(!cmpiData.isNullValue()){ CmpiString Description = cmpiData; setDescription(Description.charPtr()); } cmpiData = inst.getProperty("ElementName"); if(!cmpiData.isNullValue()){ CmpiString ElementName = cmpiData; setElementName(ElementName.charPtr()); } cmpiData = inst.getProperty("Forward"); if(!cmpiData.isNullValue()){ CMPIUint16 Forward = cmpiData; setForward(Forward); } cmpiData = inst.getProperty("Forwarders"); if(!cmpiData.isNullValue()){ CmpiArray Forwarders = cmpiData; unsigned int ForwardersSize; const char** ForwardersArray; ArrayConverter::makeArray(Forwarders, (char***)&ForwardersArray, ForwardersSize); setForwarders(ForwardersArray, ForwardersSize, 0); } cmpiData = inst.getProperty("ResourceRecordFile"); if(!cmpiData.isNullValue()){ CmpiString ResourceRecordFile = cmpiData; setResourceRecordFile(ResourceRecordFile.charPtr()); } cmpiData = inst.getProperty("SettingID"); if(!cmpiData.isNullValue()){ CmpiString SettingID = cmpiData; setSettingID(SettingID.charPtr()); } cmpiData = inst.getProperty("Type"); if(!cmpiData.isNullValue()){ CMPIUint16 Type = cmpiData; setType(Type); } } //Destructor Linux_DnsForwardZoneInstance:: ~Linux_DnsForwardZoneInstance(){ reset(); }; //copy operator Linux_DnsForwardZoneInstance& Linux_DnsForwardZoneInstance::operator= (const Linux_DnsForwardZoneInstance& original){ init(original); return *this; }; //converts to CmpiInstance CmpiInstance Linux_DnsForwardZoneInstance:: getCmpiInstance(const char** properties) const{ CmpiObjectPath objectPath=getInstanceName().getObjectPath(); CmpiInstance cmpiInstance(objectPath); getInstanceName().fillKeys(cmpiInstance); if (properties) { cmpiInstance.setPropertyFilter(properties,0); } if(isSet.Caption){ cmpiInstance.setProperty("Caption",CmpiData(m_Caption)); } if(isSet.Description){ cmpiInstance.setProperty("Description",CmpiData(m_Description)); } if(isSet.ElementName){ cmpiInstance.setProperty("ElementName",CmpiData(m_ElementName)); } if(isSet.Forward){ cmpiInstance.setProperty("Forward",CmpiData(m_Forward)); } if(isSet.Forwarders){ unsigned int ForwardersSize; const char** arrayForwarders=getForwarders(ForwardersSize); CmpiArray arrayCmpiForwarders=CmpiArray(ForwardersSize,CMPI_chars); for(unsigned int i=0;i<ForwardersSize;i++) arrayCmpiForwarders[i]=CmpiData(arrayForwarders[i]); cmpiInstance.setProperty("Forwarders",CmpiData(arrayCmpiForwarders)); } if(isSet.ResourceRecordFile){ cmpiInstance.setProperty("ResourceRecordFile",CmpiData(m_ResourceRecordFile)); } if(isSet.SettingID){ cmpiInstance.setProperty("SettingID",CmpiData(m_SettingID)); } if(isSet.Type){ cmpiInstance.setProperty("Type",CmpiData(m_Type)); } return cmpiInstance; } //InstanceName related methods unsigned int Linux_DnsForwardZoneInstance:: isInstanceNameSet() const{ return isSet.instanceName; } const Linux_DnsForwardZoneInstanceName& Linux_DnsForwardZoneInstance::getInstanceName() const{ if(!isSet.instanceName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "InstanceName not set in Linux_DnsForwardZone instance"); return m_instanceName; } void Linux_DnsForwardZoneInstance::setInstanceName( const Linux_DnsForwardZoneInstanceName& val){ m_instanceName = val; isSet.instanceName=1; } //Caption related methods unsigned int Linux_DnsForwardZoneInstance::isCaptionSet() const{ return isSet.Caption; } void Linux_DnsForwardZoneInstance:: setCaption(const char* val, int makeCopy){ if (isSet.Caption) { delete []m_Caption; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_Caption = tmpval; } else { m_Caption = val; } isSet.Caption=1; } const char* Linux_DnsForwardZoneInstance:: getCaption() const{ if(!isSet.Caption) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Caption not set"); return m_Caption; } //Description related methods unsigned int Linux_DnsForwardZoneInstance::isDescriptionSet() const{ return isSet.Description; } void Linux_DnsForwardZoneInstance:: setDescription(const char* val, int makeCopy){ if (isSet.Description) { delete []m_Description; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_Description = tmpval; } else { m_Description = val; } isSet.Description=1; } const char* Linux_DnsForwardZoneInstance:: getDescription() const{ if(!isSet.Description) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Description not set"); return m_Description; } //ElementName related methods unsigned int Linux_DnsForwardZoneInstance::isElementNameSet() const{ return isSet.ElementName; } void Linux_DnsForwardZoneInstance:: setElementName(const char* val, int makeCopy){ if (isSet.ElementName) { delete []m_ElementName; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_ElementName = tmpval; } else { m_ElementName = val; } isSet.ElementName=1; } const char* Linux_DnsForwardZoneInstance:: getElementName() const{ if(!isSet.ElementName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "ElementName not set"); return m_ElementName; } //Forward related methods unsigned int Linux_DnsForwardZoneInstance::isForwardSet() const{ return isSet.Forward; } void Linux_DnsForwardZoneInstance:: setForward(const CMPIUint16 val){ m_Forward = val; isSet.Forward=1; } const CMPIUint16 Linux_DnsForwardZoneInstance:: getForward() const{ if(!isSet.Forward) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Forward not set"); return m_Forward; } //Forwarders related methods unsigned int Linux_DnsForwardZoneInstance::isForwardersSet() const{ return isSet.Forwarders; } void Linux_DnsForwardZoneInstance:: setForwarders(const char** val, const unsigned int size, int makeCopy){ ForwardersArraySize=size; if (isSet.Forwarders) { delete m_Forwarders; } if (makeCopy&&val) { m_Forwarders = new const char*[size]; for(unsigned int i=0;i<size;i++){ char* aString = new char[strlen(val[i])+1]; strcpy(aString,val[i]); m_Forwarders[i]=aString; } } else { m_Forwarders = val; } isSet.Forwarders=1; } const char** Linux_DnsForwardZoneInstance:: getForwarders(unsigned int& size) const{ if(!isSet.Forwarders) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Forwarders not set"); size=ForwardersArraySize; return m_Forwarders; } //ResourceRecordFile related methods unsigned int Linux_DnsForwardZoneInstance::isResourceRecordFileSet() const{ return isSet.ResourceRecordFile; } void Linux_DnsForwardZoneInstance:: setResourceRecordFile(const char* val, int makeCopy){ if (isSet.ResourceRecordFile) { delete []m_ResourceRecordFile; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_ResourceRecordFile = tmpval; } else { m_ResourceRecordFile = val; } isSet.ResourceRecordFile=1; } const char* Linux_DnsForwardZoneInstance:: getResourceRecordFile() const{ if(!isSet.ResourceRecordFile) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "ResourceRecordFile not set"); return m_ResourceRecordFile; } //SettingID related methods unsigned int Linux_DnsForwardZoneInstance::isSettingIDSet() const{ return isSet.SettingID; } void Linux_DnsForwardZoneInstance:: setSettingID(const char* val, int makeCopy){ if (isSet.SettingID) { delete []m_SettingID; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_SettingID = tmpval; } else { m_SettingID = val; } isSet.SettingID=1; } const char* Linux_DnsForwardZoneInstance:: getSettingID() const{ if(!isSet.SettingID) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "SettingID not set"); return m_SettingID; } //Type related methods unsigned int Linux_DnsForwardZoneInstance::isTypeSet() const{ return isSet.Type; } void Linux_DnsForwardZoneInstance:: setType(const CMPIUint16 val){ m_Type = val; isSet.Type=1; } const CMPIUint16 Linux_DnsForwardZoneInstance:: getType() const{ if(!isSet.Type) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Type not set"); return m_Type; } //set isSet attributes to FALSE void Linux_DnsForwardZoneInstance::init(){ isSet.instanceName=0; isSet.Caption=0; isSet.Description=0; isSet.ElementName=0; isSet.Forward=0; isSet.Forwarders=0; ForwardersArraySize=0; isSet.ResourceRecordFile=0; isSet.SettingID=0; isSet.Type=0; }; //copies another instance properties in this void Linux_DnsForwardZoneInstance::init (const Linux_DnsForwardZoneInstance& original){ init(); if(original.isInstanceNameSet()){ setInstanceName(original.getInstanceName()); } if(original.isCaptionSet()){ const char* CaptionOriginal=original.getCaption(); setCaption(CaptionOriginal, 1); } if(original.isDescriptionSet()){ const char* DescriptionOriginal=original.getDescription(); setDescription(DescriptionOriginal, 1); } if(original.isElementNameSet()){ const char* ElementNameOriginal=original.getElementName(); setElementName(ElementNameOriginal, 1); } if(original.isForwardSet()){ const CMPIUint16 ForwardOriginal=original.getForward(); setForward(ForwardOriginal); } if(original.isForwardersSet()){ unsigned int sizeForwarders; const char** ForwardersOriginal=original.getForwarders(sizeForwarders); setForwarders(ForwardersOriginal, sizeForwarders, 1); } if(original.isResourceRecordFileSet()){ const char* ResourceRecordFileOriginal=original.getResourceRecordFile(); setResourceRecordFile(ResourceRecordFileOriginal, 1); } if(original.isSettingIDSet()){ const char* SettingIDOriginal=original.getSettingID(); setSettingID(SettingIDOriginal, 1); } if(original.isTypeSet()){ const CMPIUint16 TypeOriginal=original.getType(); setType(TypeOriginal); } } //reset the instance data void Linux_DnsForwardZoneInstance::reset(){ if (isSet.Caption) delete(m_Caption); if (isSet.Description) delete(m_Description); if (isSet.ElementName) delete(m_ElementName); if (isSet.Forwarders){ ArrayConverter::destructArray((char**)(char**)m_Forwarders,ForwardersArraySize); } if (isSet.ResourceRecordFile) delete(m_ResourceRecordFile); if (isSet.SettingID) delete(m_SettingID); }; //********************************************************* //Linux_DnsForwardZoneInstanceEnumerationElement //********************************************************* Linux_DnsForwardZoneInstanceEnumerationElement:: Linux_DnsForwardZoneInstanceEnumerationElement(){ m_elementP=0; m_nextP=0; }; Linux_DnsForwardZoneInstanceEnumerationElement:: ~Linux_DnsForwardZoneInstanceEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //Linux_DnsForwardZoneInstanceNameEnumeration //********************************************************* Linux_DnsForwardZoneInstanceEnumeration:: Linux_DnsForwardZoneInstanceEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; Linux_DnsForwardZoneInstanceEnumeration:: Linux_DnsForwardZoneInstanceEnumeration( const Linux_DnsForwardZoneInstanceEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; Linux_DnsForwardZoneInstanceEnumeration:: ~Linux_DnsForwardZoneInstanceEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void Linux_DnsForwardZoneInstanceEnumeration::reset(){ currentElementP=firstElementP; }; bool Linux_DnsForwardZoneInstanceEnumeration::hasNext() const{ return (currentElementP!=0); }; int Linux_DnsForwardZoneInstanceEnumeration::getSize() const{ int size=0; Linux_DnsForwardZoneInstanceEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const Linux_DnsForwardZoneInstance& Linux_DnsForwardZoneInstanceEnumeration::getElement(int pos) const{ Linux_DnsForwardZoneInstanceEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const Linux_DnsForwardZoneInstance& Linux_DnsForwardZoneInstanceEnumeration::getNext() { Linux_DnsForwardZoneInstanceEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void Linux_DnsForwardZoneInstanceEnumeration::addElement (const Linux_DnsForwardZoneInstance& elementP){ if(firstElementP==0){ firstElementP=new Linux_DnsForwardZoneInstanceEnumerationElement(); firstElementP->m_elementP=new Linux_DnsForwardZoneInstance(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new Linux_DnsForwardZoneInstanceEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new Linux_DnsForwardZoneInstance(elementP); } }; } --- NEW FILE: CmpiLinux_DnsForwardZoneProvider.cpp --- /** * CmpiLinux_DnsForwardZoneProvider.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_DnsForwardZoneProvider.h" #include "ArrayConverter.h" #include "Linux_DnsForwardZoneManualInstance.h" #include "Linux_DnsForwardZoneRepositoryInstance.h" #include <iostream> #include <strings.h> using namespace std; namespace genProvider { CmpiLinux_DnsForwardZoneProvider:: CmpiLinux_DnsForwardZoneProvider ( const CmpiBroker &mbp, const CmpiContext& ctx): CmpiBaseMI(mbp, ctx), CmpiInstanceMI(mbp,ctx), CmpiMethodMI(mbp,ctx), cppBroker(mbp) { interfaceP=Linux_DnsForwardZoneFactory::getImplementation(); cout<<"Provider was constructed"<<endl; }; const char * CmpiLinux_DnsForwardZoneProvider:: shadowNameSpaceP="IBMShadow/cimv2"; CmpiLinux_DnsForwardZoneProvider:: ~CmpiLinux_DnsForwardZoneProvider(){ delete interfaceP; }; int CmpiLinux_DnsForwardZoneProvider::isUnloadable() const{ return 0; } /* -----------------------------------------------------------------------*/ /* Adding shadow properties */ /* -----------------------------------------------------------------------*/ void CmpiLinux_DnsForwardZoneProvider::completeInstance( const Linux_DnsForwardZoneInstanceName& instanceName, CmpiInstance& target, const CmpiContext& ctx){ Linux_DnsForwardZoneInstanceName 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_DnsForwardZoneProvider::copyShadowData ( const CmpiInstance* source, CmpiInstance* target){ }; /* -----------------------------------------------------------------------*/ /* Extracting shadow instance */ /* -----------------------------------------------------------------------*/ CmpiInstance* CmpiLinux_DnsForwardZoneProvider:: getShadowInstance (const CmpiInstance& original, const Linux_DnsForwardZoneInstanceName& instanceName){ Linux_DnsForwardZoneInstanceName 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_DnsForwardZoneProvider::removeDanglingShadowInstances ( const Linux_DnsForwardZoneInstanceNameEnumeration& dinInsNames){ //TODO: enumerate shadow instance names and remove those not included // in dinInsNames }; /* -----------------------------------------------------------------------*/ /* Provider Factory */ /* -----------------------------------------------------------------------*/ CMProviderBase(CmpiLinux_DnsForwardZoneProvider); CMInstanceMIFactory( CmpiLinux_DnsForwardZoneProvider, CmpiLinux_DnsForwardZoneProvider); CMMethodMIFactory( CmpiLinux_DnsForwardZoneProvider, CmpiLinux_DnsForwardZoneProvider); /* -----------------------------------------------------------------------*/ /* Instance Provider... [truncated message content] |
Update of /cvsroot/sblim/cmpi-dns/provider/Linux_DnsManagedSystemElementForSetting In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20455/provider/Linux_DnsManagedSystemElementForSetting Added Files: Linux_DnsManagedSystemElementForSettingDefaultImplementation.h Linux_DnsManagedSystemElementForSettingExternal.h Linux_DnsManagedSystemElementForSettingRepositoryExternal.cpp Linux_DnsManagedSystemElementForSettingInstance.cpp Linux_DnsManagedSystemElementForSettingResourceAccess.h Linux_DnsManagedSystemElementForSettingFakeFactory.cpp Linux_DnsManagedSystemElementForSettingManualInstance.h Linux_DnsManagedSystemElementForSettingFactory.cpp Linux_DnsManagedSystemElementForSettingRepositoryInstance.cpp Linux_DnsManagedSystemElementForSettingRepositoryExternal.h Linux_DnsManagedSystemElementForSettingManualInstance.cpp Linux_DnsManagedSystemElementForSettingRepositoryInstance.h makefile Linux_DnsManagedSystemElementForSettingResourceAccess.cpp CmpiLinux_DnsManagedSystemElementForSettingProvider.h Linux_DnsManagedSystemElementForSettingInstanceName.h Linux_DnsManagedSystemElementForSettingInstanceName.cpp Linux_DnsManagedSystemElementForSettingDefaultImplementation.cpp Linux_DnsManagedSystemElementForSettingInterface.h Linux_DnsManagedSystemElementForSettingExternal.cpp setting.provider Linux_DnsManagedSystemElementForSettingFactory.h CmpiLinux_DnsManagedSystemElementForSettingProvider.cpp Linux_DnsManagedSystemElementForSettingInstance.h Log Message: WBEM-SMT DNS provider component. First initial upload. This module includes: - CIM model for DNS - CMPI provider for DNS - Resource Access layer for DNS --- NEW FILE: setting.provider --- #Provider configuration #CPPFLAGS.provider #LDFLAGS.provider --- NEW FILE: Linux_DnsManagedSystemElementForSettingResourceAccess.cpp --- /** * Linux_DnsManagedSystemElementForSettingResourceAccess.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_DnsManagedSystemElementForSettingResourceAccess.h" namespace genProvider { //Linux_DnsManagedSystemElementForSettingResourceAccess::Linux_DnsManagedSystemElementForSettingResourceAccess(); Linux_DnsManagedSystemElementForSettingResourceAccess::~Linux_DnsManagedSystemElementForSettingResourceAccess() { }; /* intrinsic methods */ /* void Linux_DnsManagedSystemElementForSettingResourceAccess::enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsManagedSystemElementForSettingInstanceNameEnumeration& instnames){ int numInstanceNames=1; for(int i=0;i<numInstanceNames;i++){ //place here the code retrieving your instanceName Linux_DnsManagedSystemElementForSettingInstanceName instanceName; } } */ /* void Linux_DnsManagedSystemElementForSettingResourceAccess::enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsManagedSystemElementForSettingManualInstanceEnumeration& instances){}; */ /* Linux_DnsManagedSystemElementForSettingManualInstance Linux_DnsManagedSystemElementForSettingResourceAccess::getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsManagedSystemElementForSettingInstanceName&){ Linux_DnsManagedSystemElementForSettingManualInstance instance; } */ /* void Linux_DnsManagedSystemElementForSettingResourceAccess::setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsManagedSystemElementForSettingManualInstance&){}; */ /* void Linux_DnsManagedSystemElementForSettingResourceAccess::createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsManagedSystemElementForSettingManualInstance&){}; */ /* void Linux_DnsManagedSystemElementForSettingResourceAccess::deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsManagedSystemElementForSettingInstanceName&){}; */ /* Association Interface */ void Linux_DnsManagedSystemElementForSettingResourceAccess::referencesElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsManagedSystemElementForSettingManualInstanceEnumeration& instEnum) { /* cout << "Linux_DnsManagedSystemElementForSettingResourceAcces::referencesElement()" << endl; DNSZONE *zones = getZones(); DNSZONE *zones_ptr = zones; if ( ! zones) throw CmpiStatus(CMPI_RC_ERR_INVALID_PARAMETER,"The indicated Zone does not exist"); for (; zones->zoneName ; zones++) { ZONEOPTS *zopts = zones->zoneOpts; while (zopts && zopts->key) { if ( strcmp(zopts->key, DNS_ALLOW_NOTIFY_STR) && strcmp(zopts->key, DNS_ALLOW_QUERY_STR) && strcmp(zopts->key, DNS_ALLOW_TRANSFER_STR) && strcmp(zopts->key, DNS_ALLOW_UPDATE_STR ) ) 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_DnsManagedSystemElementForSettingInstanceName AuInstName; Linux_DnsManagedSystemElementForSettingManualInstance AuInst; 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.setElement( zoneInstName ); AuInstName.setSetting( sourceInst ); AuInst.setInstanceName( AuInstName ); instEnum.addElement( AuInst ); } zopts++; } } freeZones( zones_ptr ); */ }; void Linux_DnsManagedSystemElementForSettingResourceAccess::referencesSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsZoneInstanceName& sourceInst, Linux_DnsManagedSystemElementForSettingManualInstanceEnumeration& instEnum) { }; void Linux_DnsManagedSystemElementForSettingResourceAccess::associatorsElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsZoneInstanceEnumeration&) { }; void Linux_DnsManagedSystemElementForSettingResourceAccess::associatorsSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsZoneInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceEnumeration&) { }; /* extrinsic methods */ } --- NEW FILE: Linux_DnsManagedSystemElementForSettingInstance.cpp --- /** * Linux_DnsManagedSystemElementForSettingInstance.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_DnsManagedSystemElementForSettingInstance.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //Linux_DnsManagedSystemElementForSettingInstance //********************************************************* //empty constructor Linux_DnsManagedSystemElementForSettingInstance:: Linux_DnsManagedSystemElementForSettingInstance(){ init(); }; //copy constructor Linux_DnsManagedSystemElementForSettingInstance:: Linux_DnsManagedSystemElementForSettingInstance (const Linux_DnsManagedSystemElementForSettingInstance& original){ init(original); }; //constructor using CmpiInstance Linux_DnsManagedSystemElementForSettingInstance:: Linux_DnsManagedSystemElementForSettingInstance (const CmpiInstance& inst, const char* instanceNamespace){ CmpiData cmpiData; init(); CmpiObjectPath cop=inst.getObjectPath(); cop.setNameSpace(instanceNamespace); setInstanceName(Linux_DnsManagedSystemElementForSettingInstanceName(cop)); } //Destructor Linux_DnsManagedSystemElementForSettingInstance:: ~Linux_DnsManagedSystemElementForSettingInstance(){ reset(); }; //copy operator Linux_DnsManagedSystemElementForSettingInstance& Linux_DnsManagedSystemElementForSettingInstance::operator= (const Linux_DnsManagedSystemElementForSettingInstance& original){ init(original); return *this; }; //converts to CmpiInstance CmpiInstance Linux_DnsManagedSystemElementForSettingInstance:: 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_DnsManagedSystemElementForSettingInstance:: isInstanceNameSet() const{ return isSet.instanceName; } const Linux_DnsManagedSystemElementForSettingInstanceName& Linux_DnsManagedSystemElementForSettingInstance::getInstanceName() const{ if(!isSet.instanceName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "InstanceName not set in Linux_DnsManagedSystemElementForSetting instance"); return m_instanceName; } void Linux_DnsManagedSystemElementForSettingInstance::setInstanceName( const Linux_DnsManagedSystemElementForSettingInstanceName& val){ m_instanceName = val; isSet.instanceName=1; } //set isSet attributes to FALSE void Linux_DnsManagedSystemElementForSettingInstance::init(){ isSet.instanceName=0; }; //copies another instance properties in this void Linux_DnsManagedSystemElementForSettingInstance::init (const Linux_DnsManagedSystemElementForSettingInstance& original){ init(); if(original.isInstanceNameSet()){ setInstanceName(original.getInstanceName()); } } //reset the instance data void Linux_DnsManagedSystemElementForSettingInstance::reset(){ }; //********************************************************* //Linux_DnsManagedSystemElementForSettingInstanceEnumerationElement //********************************************************* Linux_DnsManagedSystemElementForSettingInstanceEnumerationElement:: Linux_DnsManagedSystemElementForSettingInstanceEnumerationElement(){ m_elementP=0; m_nextP=0; }; Linux_DnsManagedSystemElementForSettingInstanceEnumerationElement:: ~Linux_DnsManagedSystemElementForSettingInstanceEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //Linux_DnsManagedSystemElementForSettingInstanceNameEnumeration //********************************************************* Linux_DnsManagedSystemElementForSettingInstanceEnumeration:: Linux_DnsManagedSystemElementForSettingInstanceEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; Linux_DnsManagedSystemElementForSettingInstanceEnumeration:: Linux_DnsManagedSystemElementForSettingInstanceEnumeration( const Linux_DnsManagedSystemElementForSettingInstanceEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; Linux_DnsManagedSystemElementForSettingInstanceEnumeration:: ~Linux_DnsManagedSystemElementForSettingInstanceEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void Linux_DnsManagedSystemElementForSettingInstanceEnumeration::reset(){ currentElementP=firstElementP; }; bool Linux_DnsManagedSystemElementForSettingInstanceEnumeration::hasNext() const{ return (currentElementP!=0); }; int Linux_DnsManagedSystemElementForSettingInstanceEnumeration::getSize() const{ int size=0; Linux_DnsManagedSystemElementForSettingInstanceEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const Linux_DnsManagedSystemElementForSettingInstance& Linux_DnsManagedSystemElementForSettingInstanceEnumeration::getElement(int pos) const{ Linux_DnsManagedSystemElementForSettingInstanceEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const Linux_DnsManagedSystemElementForSettingInstance& Linux_DnsManagedSystemElementForSettingInstanceEnumeration::getNext() { Linux_DnsManagedSystemElementForSettingInstanceEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void Linux_DnsManagedSystemElementForSettingInstanceEnumeration::addElement (const Linux_DnsManagedSystemElementForSettingInstance& elementP){ if(firstElementP==0){ firstElementP=new Linux_DnsManagedSystemElementForSettingInstanceEnumerationElement(); firstElementP->m_elementP=new Linux_DnsManagedSystemElementForSettingInstance(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new Linux_DnsManagedSystemElementForSettingInstanceEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new Linux_DnsManagedSystemElementForSettingInstance(elementP); } }; } --- NEW FILE: Linux_DnsManagedSystemElementForSettingInstance.h --- /** * Linux_DnsManagedSystemElementForSettingInstance.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_DnsManagedSystemElementForSettingInstance_h #define Linux_DnsManagedSystemElementForSettingInstance_h #include "cmpidt.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiBooleanData.h" #include "CmpiCharData.h" #include "CmpiDateTime.h" #include "Linux_DnsManagedSystemElementForSettingInstanceName.h" namespace genProvider { class Linux_DnsManagedSystemElementForSettingInstance { public: Linux_DnsManagedSystemElementForSettingInstance(); Linux_DnsManagedSystemElementForSettingInstance (const Linux_DnsManagedSystemElementForSettingInstance& original); Linux_DnsManagedSystemElementForSettingInstance (const CmpiInstance& inst, const char* instanceNamespace); ~Linux_DnsManagedSystemElementForSettingInstance(); Linux_DnsManagedSystemElementForSettingInstance& operator= (const Linux_DnsManagedSystemElementForSettingInstance& original); CmpiInstance getCmpiInstance(const char** properties=0) const; unsigned int isInstanceNameSet() const; void setInstanceName( const Linux_DnsManagedSystemElementForSettingInstanceName& val); const Linux_DnsManagedSystemElementForSettingInstanceName& getInstanceName() const; private: void init(); void init(const Linux_DnsManagedSystemElementForSettingInstance& original); void reset(); Linux_DnsManagedSystemElementForSettingInstanceName m_instanceName; struct isSetType{ unsigned int instanceName:1; } isSet; }; struct Linux_DnsManagedSystemElementForSettingInstanceEnumerationElement{ Linux_DnsManagedSystemElementForSettingInstance* m_elementP; Linux_DnsManagedSystemElementForSettingInstanceEnumerationElement* m_nextP; Linux_DnsManagedSystemElementForSettingInstanceEnumerationElement(); ~Linux_DnsManagedSystemElementForSettingInstanceEnumerationElement(); }; class Linux_DnsManagedSystemElementForSettingInstanceEnumeration { private: Linux_DnsManagedSystemElementForSettingInstanceEnumerationElement* firstElementP; Linux_DnsManagedSystemElementForSettingInstanceEnumerationElement* currentElementP; Linux_DnsManagedSystemElementForSettingInstanceEnumerationElement* endElementP; public: Linux_DnsManagedSystemElementForSettingInstanceEnumeration(); Linux_DnsManagedSystemElementForSettingInstanceEnumeration( const Linux_DnsManagedSystemElementForSettingInstanceEnumeration& original); ~Linux_DnsManagedSystemElementForSettingInstanceEnumeration(); void reset(); bool hasNext() const; const Linux_DnsManagedSystemElementForSettingInstance& getNext(); int getSize() const; const Linux_DnsManagedSystemElementForSettingInstance& getElement(int pos) const; void addElement(const Linux_DnsManagedSystemElementForSettingInstance& elementP); }; } #endif --- NEW FILE: Linux_DnsManagedSystemElementForSettingExternal.cpp --- /** * Linux_DnsManagedSystemElementForSettingExternal.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_DnsManagedSystemElementForSettingExternal.h" namespace genProvider{ Linux_DnsManagedSystemElementForSettingExternal::Linux_DnsManagedSystemElementForSettingExternal( const CmpiBroker& brkr, const CmpiContext& ctx ) : broker(brkr), context(ctx) {}; Linux_DnsManagedSystemElementForSettingExternal:: ~Linux_DnsManagedSystemElementForSettingExternal(){}; void Linux_DnsManagedSystemElementForSettingExternal::enumInstanceNames( const char *nsp, Linux_DnsManagedSystemElementForSettingInstanceNameEnumeration& instnames) { CmpiObjectPath op(nsp,"Linux_DnsManagedSystemElementForSetting"); CmpiEnumeration en=broker.enumInstanceNames(context,op); while(en.hasNext()) { CmpiObjectPath opi = en.getNext(); Linux_DnsManagedSystemElementForSettingInstanceName iname(opi); instnames.addElement(iname); } }; void Linux_DnsManagedSystemElementForSettingExternal::enumInstances( const char *nsp, const char* *properties, Linux_DnsManagedSystemElementForSettingInstanceEnumeration& instances) { CmpiObjectPath op(nsp,"Linux_DnsManagedSystemElementForSetting"); CmpiEnumeration en=broker.enumInstances(context,op,properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); Linux_DnsManagedSystemElementForSettingInstance instance(inst,nsp); instances.addElement(instance); } }; Linux_DnsManagedSystemElementForSettingInstance Linux_DnsManagedSystemElementForSettingExternal::getInstance( const char* *properties, const Linux_DnsManagedSystemElementForSettingInstanceName& instanceName) { CmpiObjectPath op=instanceName.getObjectPath(); CmpiInstance inst=broker.getInstance(context,op,properties); return Linux_DnsManagedSystemElementForSettingInstance(inst,instanceName.getNamespace()); } void Linux_DnsManagedSystemElementForSettingExternal::setInstance( const char* *properties, const Linux_DnsManagedSystemElementForSettingInstance& instance){ CmpiObjectPath op=instance.getInstanceName().getObjectPath(); CmpiInstance inst=instance.getCmpiInstance(); broker.setInstance(context,op,inst,properties); } void Linux_DnsManagedSystemElementForSettingExternal::createInstance( const Linux_DnsManagedSystemElementForSettingInstance& instance){ CmpiObjectPath op=instance.getInstanceName().getObjectPath(); CmpiInstance inst=instance.getCmpiInstance(); broker.createInstance(context,op,inst); } void Linux_DnsManagedSystemElementForSettingExternal::deleteInstance( const Linux_DnsManagedSystemElementForSettingInstanceName& instanceName){ CmpiObjectPath op=instanceName.getObjectPath(); broker.deleteInstance(context,op); } //Reference calls void Linux_DnsManagedSystemElementForSettingExternal:: referencesElement( const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsManagedSystemElementForSettingInstanceEnumeration& instances){ CmpiObjectPath op=sourceInst.getObjectPath(); CmpiEnumeration en=broker.references (context, op, "Linux_DnsAddressMatchList", "Element", properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); Linux_DnsManagedSystemElementForSettingInstance instance(inst,nsp); instances.addElement(instance); } } void Linux_DnsManagedSystemElementForSettingExternal:: referenceNamesElement( const char *nsp, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsManagedSystemElementForSettingInstanceNameEnumeration& instanceNames){ CmpiObjectPath op=sourceInst.getObjectPath(); CmpiEnumeration en=broker.referenceNames (context, op, "Linux_DnsAddressMatchList", "Element"); while(en.hasNext()) { CmpiObjectPath instName = en.getNext(); Linux_DnsManagedSystemElementForSettingInstanceName instanceName(instName); instanceNames.addElement(instanceName); } } void Linux_DnsManagedSystemElementForSettingExternal:: referencesSetting( const char *nsp, const char** properties, const Linux_DnsZoneInstanceName& sourceInst, Linux_DnsManagedSystemElementForSettingInstanceEnumeration& instances){ CmpiObjectPath op=sourceInst.getObjectPath(); CmpiEnumeration en=broker.references (context, op, "Linux_DnsZone", "Setting", properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); Linux_DnsManagedSystemElementForSettingInstance instance(inst,nsp); instances.addElement(instance); } } void Linux_DnsManagedSystemElementForSettingExternal:: referenceNamesSetting( const char *nsp, const Linux_DnsZoneInstanceName& sourceInst, Linux_DnsManagedSystemElementForSettingInstanceNameEnumeration& instanceNames){ CmpiObjectPath op=sourceInst.getObjectPath(); CmpiEnumeration en=broker.referenceNames (context, op, "Linux_DnsZone", "Setting"); while(en.hasNext()) { CmpiObjectPath instName = en.getNext(); Linux_DnsManagedSystemElementForSettingInstanceName instanceName(instName); instanceNames.addElement(instanceName); } } //Associator calls void Linux_DnsManagedSystemElementForSettingExternal:: associatorsElement( const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsZoneInstanceEnumeration& instances){ CmpiObjectPath op=sourceInst.getObjectPath(); CmpiEnumeration en=broker.associators (context,op,0,0,0,0,properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); Linux_DnsZoneInstance instance(inst,nsp); instances.addElement(instance); } } void Linux_DnsManagedSystemElementForSettingExternal:: associatorNamesElement( const char *nsp, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsZoneInstanceNameEnumeration& instanceNames){ CmpiObjectPath op=sourceInst.getObjectPath(); CmpiEnumeration en=broker.associatorNames (context,op,0,0,0,0); while(en.hasNext()) { CmpiObjectPath instName = en.getNext(); Linux_DnsZoneInstanceName instanceName(instName); instanceNames.addElement(instanceName); } } void Linux_DnsManagedSystemElementForSettingExternal:: associatorsSetting( const char *nsp, const char** properties, const Linux_DnsZoneInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceEnumeration& instances){ CmpiObjectPath op=sourceInst.getObjectPath(); CmpiEnumeration en=broker.associators (context,op,0,0,0,0,properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); Linux_DnsAddressMatchListInstance instance(inst,nsp); instances.addElement(instance); } } void Linux_DnsManagedSystemElementForSettingExternal:: associatorNamesSetting( const char *nsp, const Linux_DnsZoneInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceNameEnumeration& instanceNames){ CmpiObjectPath op=sourceInst.getObjectPath(); CmpiEnumeration en=broker.associatorNames (context,op,0,0,0,0); while(en.hasNext()) { CmpiObjectPath instName = en.getNext(); Linux_DnsAddressMatchListInstanceName instanceName(instName); instanceNames.addElement(instanceName); } } } --- NEW FILE: Linux_DnsManagedSystemElementForSettingRepositoryExternal.cpp --- /** * Linux_DnsManagedSystemElementForSettingRepositoryExternal.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_DnsManagedSystemElementForSettingRepositoryExternal.h" namespace genProvider{ Linux_DnsManagedSystemElementForSettingRepositoryExternal::Linux_DnsManagedSystemElementForSettingRepositoryExternal( const CmpiBroker& brkr, const CmpiContext& ctx ) : broker(brkr), context(ctx) {}; const char * Linux_DnsManagedSystemElementForSettingRepositoryExternal:: nsp="IBMShadow/cimv2"; Linux_DnsManagedSystemElementForSettingRepositoryExternal:: ~Linux_DnsManagedSystemElementForSettingRepositoryExternal(){}; void Linux_DnsManagedSystemElementForSettingRepositoryExternal::enumInstanceNames( Linux_DnsManagedSystemElementForSettingInstanceNameEnumeration& instnames) { CmpiObjectPath op(nsp,"Linux_DnsManagedSystemElementForSetting"); CmpiEnumeration en=broker.enumInstanceNames(context,op); while(en.hasNext()) { CmpiObjectPath opi = en.getNext(); Linux_DnsManagedSystemElementForSettingInstanceName iname(opi); instnames.addElement(iname); } }; void Linux_DnsManagedSystemElementForSettingRepositoryExternal::enumInstances( const char* *properties, Linux_DnsManagedSystemElementForSettingRepositoryInstanceEnumeration& instances) { CmpiObjectPath op(nsp,"Linux_DnsManagedSystemElementForSetting"); CmpiEnumeration en=broker.enumInstances(context,op,properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); Linux_DnsManagedSystemElementForSettingRepositoryInstance instance(inst,nsp); instances.addElement(instance); } }; Linux_DnsManagedSystemElementForSettingRepositoryInstance Linux_DnsManagedSystemElementForSettingRepositoryExternal::getInstance( const char* *properties, const Linux_DnsManagedSystemElementForSettingInstanceName& instanceName) { CmpiObjectPath op=instanceName.getObjectPath(); op.setNameSpace(nsp); CmpiInstance inst=broker.getInstance(context,op,properties); return Linux_DnsManagedSystemElementForSettingRepositoryInstance(inst,nsp); } void Linux_DnsManagedSystemElementForSettingRepositoryExternal::setInstance( const char* *properties, const Linux_DnsManagedSystemElementForSettingRepositoryInstance& instance){ //make a copy of the given instance and set it to the right nameSpace Linux_DnsManagedSystemElementForSettingInstanceName instanceName(instance.getInstanceName()); instanceName.setNamespace(nsp,1); Linux_DnsManagedSystemElementForSettingRepositoryInstance copiedInstance(instance); copiedInstance.setInstanceName(instanceName); CmpiObjectPath op=instanceName.getObjectPath(); CmpiInstance inst=copiedInstance.getCmpiInstance(); broker.setInstance(context,op,inst,properties); } void Linux_DnsManagedSystemElementForSettingRepositoryExternal::createInstance( const Linux_DnsManagedSystemElementForSettingRepositoryInstance& instance){ //make a copy of the given instance and set it to the right nameSpace Linux_DnsManagedSystemElementForSettingInstanceName instanceName(instance.getInstanceName()); instanceName.setNamespace(nsp,1); Linux_DnsManagedSystemElementForSettingRepositoryInstance copiedInstance(instance); copiedInstance.setInstanceName(instanceName); CmpiObjectPath op=instanceName.getObjectPath(); CmpiInstance inst=copiedInstance.getCmpiInstance(); broker.createInstance(context,op,inst); } void Linux_DnsManagedSystemElementForSettingRepositoryExternal::deleteInstance( const Linux_DnsManagedSystemElementForSettingInstanceName& instanceName){ CmpiObjectPath op=instanceName.getObjectPath(); op.setNameSpace(nsp); broker.deleteInstance(context,op); } } --- NEW FILE: Linux_DnsManagedSystemElementForSettingDefaultImplementation.h --- /** * Linux_DnsManagedSystemElementForSettingDefaultImplementation.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_DnsManagedSystemElementForSettingDefaultImplementation_h #define Linux_DnsManagedSystemElementForSettingDefaultImplementation_h #include "Linux_DnsManagedSystemElementForSettingInstanceName.h" #include "Linux_DnsManagedSystemElementForSettingManualInstance.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiDateTime.h" #include "CmpiBroker.h" #include "Linux_DnsZoneInstance.h" #include "Linux_DnsAddressMatchListInstance.h" #include "Linux_DnsZoneExternal.h" #include "Linux_DnsAddressMatchListExternal.h" #include "Linux_DnsManagedSystemElementForSettingInterface.h" namespace genProvider { class Linux_DnsManagedSystemElementForSettingDefaultImplementation: public Linux_DnsManagedSystemElementForSettingInterface { public: virtual ~Linux_DnsManagedSystemElementForSettingDefaultImplementation() { }; /* intrinsic methods */ virtual void enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsManagedSystemElementForSettingInstanceNameEnumeration& instnames); virtual void enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsManagedSystemElementForSettingManualInstanceEnumeration& instances); virtual Linux_DnsManagedSystemElementForSettingManualInstance getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsManagedSystemElementForSettingInstanceName&); virtual void setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsManagedSystemElementForSettingManualInstance&); virtual void createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsManagedSystemElementForSettingManualInstance&); virtual void deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsManagedSystemElementForSettingInstanceName&); /* Association Interface */ virtual void referencesElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsManagedSystemElementForSettingManualInstanceEnumeration& instances); virtual void referencesSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsZoneInstanceName& sourceInst, Linux_DnsManagedSystemElementForSettingManualInstanceEnumeration& instances); virtual void associatorsElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsZoneInstanceEnumeration& instances); virtual void associatorsSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsZoneInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceEnumeration& instances); /* extrinsic methods */ }; } #endif --- NEW FILE: Linux_DnsManagedSystemElementForSettingFactory.h --- /** * Linux_DnsManagedSystemElementForSettingFactory.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_DnsManagedSystemElementForSettingFactory_h #define Linux_DnsManagedSystemElementForSettingFactory_h #include "Linux_DnsManagedSystemElementForSettingInterface.h" namespace genProvider{ class Linux_DnsManagedSystemElementForSettingFactory{ public: Linux_DnsManagedSystemElementForSettingFactory(){}; ~Linux_DnsManagedSystemElementForSettingFactory(){}; static Linux_DnsManagedSystemElementForSettingInterface* getImplementation(); }; } #endif --- NEW FILE: Linux_DnsManagedSystemElementForSettingRepositoryInstance.h --- /** * Linux_DnsManagedSystemElementForSettingRepositoryInstance.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_DnsManagedSystemElementForSettingRepositoryInstance_h #define Linux_DnsManagedSystemElementForSettingRepositoryInstance_h #include "cmpidt.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiBooleanData.h" #include "CmpiCharData.h" #include "CmpiDateTime.h" #include "Linux_DnsManagedSystemElementForSettingInstanceName.h" namespace genProvider { class Linux_DnsManagedSystemElementForSettingRepositoryInstance { public: Linux_DnsManagedSystemElementForSettingRepositoryInstance(); Linux_DnsManagedSystemElementForSettingRepositoryInstance (const Linux_DnsManagedSystemElementForSettingRepositoryInstance& original); Linux_DnsManagedSystemElementForSettingRepositoryInstance (const CmpiInstance& inst, const char* instanceNamespace); ~Linux_DnsManagedSystemElementForSettingRepositoryInstance(); Linux_DnsManagedSystemElementForSettingRepositoryInstance& operator= (const Linux_DnsManagedSystemElementForSettingRepositoryInstance& original); CmpiInstance getCmpiInstance(const char** properties=0) const; unsigned int isInstanceNameSet() const; void setInstanceName( const Linux_DnsManagedSystemElementForSettingInstanceName& val); const Linux_DnsManagedSystemElementForSettingInstanceName& getInstanceName() const; private: void init(); void init(const Linux_DnsManagedSystemElementForSettingRepositoryInstance& original); void reset(); Linux_DnsManagedSystemElementForSettingInstanceName m_instanceName; struct isSetType{ unsigned int instanceName:1; } isSet; }; struct Linux_DnsManagedSystemElementForSettingRepositoryInstanceEnumerationElement{ Linux_DnsManagedSystemElementForSettingRepositoryInstance* m_elementP; Linux_DnsManagedSystemElementForSettingRepositoryInstanceEnumerationElement* m_nextP; Linux_DnsManagedSystemElementForSettingRepositoryInstanceEnumerationElement(); ~Linux_DnsManagedSystemElementForSettingRepositoryInstanceEnumerationElement(); }; class Linux_DnsManagedSystemElementForSettingRepositoryInstanceEnumeration { private: Linux_DnsManagedSystemElementForSettingRepositoryInstanceEnumerationElement* firstElementP; Linux_DnsManagedSystemElementForSettingRepositoryInstanceEnumerationElement* currentElementP; Linux_DnsManagedSystemElementForSettingRepositoryInstanceEnumerationElement* endElementP; public: Linux_DnsManagedSystemElementForSettingRepositoryInstanceEnumeration(); Linux_DnsManagedSystemElementForSettingRepositoryInstanceEnumeration( const Linux_DnsManagedSystemElementForSettingRepositoryInstanceEnumeration& original); ~Linux_DnsManagedSystemElementForSettingRepositoryInstanceEnumeration(); void reset(); bool hasNext() const; const Linux_DnsManagedSystemElementForSettingRepositoryInstance& getNext(); int getSize() const; const Linux_DnsManagedSystemElementForSettingRepositoryInstance& getElement(int pos) const; void addElement(const Linux_DnsManagedSystemElementForSettingRepositoryInstance& elementP); }; } #endif --- NEW FILE: Linux_DnsManagedSystemElementForSettingExternal.h --- /** * Linux_DnsManagedSystemElementForSettingExternal.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_DnsManagedSystemElementForSettingExternal_h #define Linux_DnsManagedSystemElementForSettingExternal_h #include "Linux_DnsManagedSystemElementForSettingInstance.h" #include "Linux_DnsZoneInstance.h" #include "Linux_DnsAddressMatchListInstance.h" #include "CmpiBroker.h" namespace genProvider { class Linux_DnsManagedSystemElementForSettingExternal { public: Linux_DnsManagedSystemElementForSettingExternal( const CmpiBroker& brkr, const CmpiContext& ctx); virtual ~Linux_DnsManagedSystemElementForSettingExternal(); virtual void enumInstanceNames( const char *nsp, Linux_DnsManagedSystemElementForSettingInstanceNameEnumeration&); virtual void enumInstances( const char *nsp, const char* *properties, Linux_DnsManagedSystemElementForSettingInstanceEnumeration&); virtual Linux_DnsManagedSystemElementForSettingInstance getInstance( const char* *properties, const Linux_DnsManagedSystemElementForSettingInstanceName&); virtual void setInstance( const char* *properties, const Linux_DnsManagedSystemElementForSettingInstance&); virtual void createInstance( const Linux_DnsManagedSystemElementForSettingInstance&); virtual void deleteInstance( const Linux_DnsManagedSystemElementForSettingInstanceName&); //association calls void referencesElement( const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsManagedSystemElementForSettingInstanceEnumeration& instances); void referenceNamesElement( const char *nsp, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsManagedSystemElementForSettingInstanceNameEnumeration& instanceNames); void referencesSetting( const char *nsp, const char** properties, const Linux_DnsZoneInstanceName& sourceInst, Linux_DnsManagedSystemElementForSettingInstanceEnumeration& instances); void referenceNamesSetting( const char *nsp, const Linux_DnsZoneInstanceName& sourceInst, Linux_DnsManagedSystemElementForSettingInstanceNameEnumeration& instanceNames); void associatorsElement( const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsZoneInstanceEnumeration& instances); void associatorNamesElement( const char *nsp, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsZoneInstanceNameEnumeration& instanceNames); void associatorsSetting( const char *nsp, const char** properties, const Linux_DnsZoneInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceEnumeration& instances); void associatorNamesSetting( const char *nsp, const Linux_DnsZoneInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceNameEnumeration& instanceNames); private: CmpiBroker broker; CmpiContext context; }; } #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_DnsManagedSystemElementForSettingInstanceName.o \ Linux_DnsManagedSystemElementForSettingInstance.o \ Linux_DnsManagedSystemElementForSettingExternal.o \ Linux_DnsManagedSystemElementForSettingRepositoryInstance.o \ Linux_DnsManagedSystemElementForSettingRepositoryExternal.o \ Linux_DnsManagedSystemElementForSettingManualInstance.o \ Linux_DnsManagedSystemElementForSettingDefaultImplementation.o FAKEFACTORY= Linux_DnsManagedSystemElementForSettingFakeFactory.o NORMALFACTORY= Linux_DnsManagedSystemElementForSettingFactory.o RESOURCEOBJECT= Linux_DnsManagedSystemElementForSettingResourceAccess.o PROVIDEROBJECT=CmpiLinux_DnsManagedSystemElementForSettingProvider.o all: testfiles preinstall install buildall: clean all #------------------------------------------------------------------------------# compile: $(OBJECTS) $(FAKEFACTORY) $(NORMALFACTORY) $(RESOURCEOBJECT) $(PROVIDEROBJECT) #------------------------------------------------------------------------------# prelink: $(OBJECTS) $(FAKEFACTORY) $(LINK.cpp) -o libLinux_DnsManagedSystemElementForSettingSupport.so $^ link: deleteFakeLib \ libLinux_DnsManagedSystemElementForSettingSupport.so \ libLinux_DnsManagedSystemElementForSetting.so libLinux_DnsManagedSystemElementForSettingSupport.so: LDFLAGS+=$(LDFLAGS.provider) libLinux_DnsManagedSystemElementForSettingSupport.so: $(OBJECTS) $(NORMALFACTORY) $(RESOURCEOBJECT) $(PROVIDEROBJECT) $(LINK.cpp) -o $@ $^ libLinux_DnsManagedSystemElementForSetting.so: LDFLAGS+=-lLinux_DnsManagedSystemElementForSettingSupport libLinux_DnsManagedSystemElementForSetting.so: $(PROVIDEROBJECT) $(LINK.cpp) -o $@ $^ deleteFakeLib: $(RM) *.so #------------------------------------------------------------------------------# preinstall: prelink install libLinux_DnsManagedSystemElementForSettingSupport.so $(COMMONLIB_OUT) #------------------------------------------------------------------------------# install: link install libLinux_DnsManagedSystemElementForSettingSupport.so $(COMMONLIB_OUT) install libLinux_DnsManagedSystemElementForSetting.so $(CIMOMLIB_OUT) # install -m 644 Linux_DnsManagedSystemElementForSetting*.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_DnsManagedSystemElementForSetting*.h \ $(RM) $(COMMONLIB)/libLinux_DnsManagedSystemElementForSettingSupport.so \ $(RM) $(CIMOMLIB)/libLinux_DnsManagedSystemElementForSetting.so --- NEW FILE: Linux_DnsManagedSystemElementForSettingFactory.cpp --- /** * Linux_DnsManagedSystemElementForSettingFactory.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_DnsManagedSystemElementForSettingFactory.h" #include "Linux_DnsManagedSystemElementForSettingResourceAccess.h" namespace genProvider{ Linux_DnsManagedSystemElementForSettingInterface* Linux_DnsManagedSystemElementForSettingFactory::getImplementation(){ return (new Linux_DnsManagedSystemElementForSettingResourceAccess()); }; } --- NEW FILE: Linux_DnsManagedSystemElementForSettingInstanceName.h --- /** * Linux_DnsManagedSystemElementForSettingInstanceName.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_DnsManagedSystemElementForSettingInstanceName_h #define Linux_DnsManagedSystemElementForSettingInstanceName_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_DnsManagedSystemElementForSettingInstanceName { public: Linux_DnsManagedSystemElementForSettingInstanceName(); Linux_DnsManagedSystemElementForSettingInstanceName (const Linux_DnsManagedSystemElementForSettingInstanceName& original); Linux_DnsManagedSystemElementForSettingInstanceName (const CmpiObjectPath& path); ~Linux_DnsManagedSystemElementForSettingInstanceName(); Linux_DnsManagedSystemElementForSettingInstanceName& operator= (const Linux_DnsManagedSystemElementForSettingInstanceName& 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_DnsManagedSystemElementForSettingInstanceName& 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_DnsManagedSystemElementForSettingInstanceNameEnumerationElement{ Linux_DnsManagedSystemElementForSettingInstanceName* m_elementP; Linux_DnsManagedSystemElementForSettingInstanceNameEnumerationElement* m_nextP; Linux_DnsManagedSystemElementForSettingInstanceNameEnumerationElement(); ~Linux_DnsManagedSystemElementForSettingInstanceNameEnumerationElement(); }; class Linux_DnsManagedSystemElementForSettingInstanceNameEnumeration { private: Linux_DnsManagedSystemElementForSettingInstanceNameEnumerationElement* firstElementP; Linux_DnsManagedSystemElementForSettingInstanceNameEnumerationElement* currentElementP; Linux_DnsManagedSystemElementForSettingInstanceNameEnumerationElement* endElementP; public: Linux_DnsManagedSystemElementForSettingInstanceNameEnumeration(); Linux_DnsManagedSystemElementForSettingInstanceNameEnumeration(const CmpiArray& arr); Linux_DnsManagedSystemElementForSettingInstanceNameEnumeration( const Linux_DnsManagedSystemElementForSettingInstanceNameEnumeration& original); ~Linux_DnsManagedSystemElementForSettingInstanceNameEnumeration(); void reset(); bool hasNext() const; const Linux_DnsManagedSystemElementForSettingInstanceName& getNext(); int getSize() const; const Linux_DnsManagedSystemElementForSettingInstanceName& getElement(int pos) const; //no copy of the element is done void addElement(const Linux_DnsManagedSystemElementForSettingInstanceName& elementP); operator CmpiArray() const; }; } #endif --- NEW FILE: Linux_DnsManagedSystemElementForSettingDefaultImplementation.cpp --- /** * Linux_DnsManagedSystemElementForSettingDefaultImplementation.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_DnsManagedSystemElementForSettingDefaultImplementation.h" #include <iostream> using namespace std; namespace genProvider { /* intrinsic methods */ void Linux_DnsManagedSystemElementForSettingDefaultImplementation::enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsManagedSystemElementForSettingInstanceNameEnumeration& instnames){ cout<<"enumInstances not supported for Linux_DnsManagedSystemElementForSetting"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "enumInstances not implemented for Linux_DnsManagedSystemElementForSetting"); } void Linux_DnsManagedSystemElementForSettingDefaultImplementation::enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsManagedSystemElementForSettingManualInstanceEnumeration& instances){ cout<<"Using default enumInstances implementation for Linux_DnsManagedSystemElementForSetting"<<endl; cout<<"LetŽs get the instanceNames"<<endl; Linux_DnsManagedSystemElementForSettingInstanceNameEnumeration namesEnumeration; enumInstanceNames(ctx, mbp,nsp,namesEnumeration); cout<<"Getting each instance"<<endl; while(namesEnumeration.hasNext()){ Linux_DnsManagedSystemElementForSettingInstanceName name= namesEnumeration.getNext(); cout<<"Getting an instance for instanceName"<<endl; Linux_DnsManagedSystemElementForSettingManualInstance instance= getInstance(ctx, mbp, properties, name); cout<<"adding instance to enum"<<endl; instances.addElement(instance); cout<<"Added!"<<endl; }; } Linux_DnsManagedSystemElementForSettingManualInstance Linux_DnsManagedSystemElementForSettingDefaultImplementation::getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsManagedSystemElementForSettingInstanceName&){ cout<<"getInstance not supported for Linux_DnsManagedSystemElementForSetting"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "getInstance not implemented for Linux_DnsManagedSystemElementForSetting"); } void Linux_DnsManagedSystemElementForSettingDefaultImplementation::setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsManagedSystemElementForSettingManualInstance&){ cout<<"setInstance not supported for Linux_DnsManagedSystemElementForSetting"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "setInstance not implemented for Linux_DnsManagedSystemElementForSetting"); } void Linux_DnsManagedSystemElementForSettingDefaultImplementation:: createInstance(const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsManagedSystemElementForSettingManualInstance&){ cout<<"createInstance not supported for Linux_DnsManagedSystemElementForSetting"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "createInstance not implemented for Linux_DnsManagedSystemElementForSetting"); } void Linux_DnsManagedSystemElementForSettingDefaultImplementation:: deleteInstance(const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsManagedSystemElementForSettingInstanceName&){ cout<<"deleteInstance not supported for Linux_DnsManagedSystemElementForSetting"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "deleteInstance not implemented for Linux_DnsManagedSystemElementForSetting"); } /* Association Interface */ void Linux_DnsManagedSystemElementForSettingDefaultImplementation:: referencesElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsManagedSystemElementForSettingManualInstanceEnumeration& instances){ throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "getElementReferences between Linux_DnsZone and Linux_DnsAddressMatchList not implemented for Linux_DnsManagedSystemElementForSetting"); } void Linux_DnsManagedSystemElementForSettingDefaultImplementation:: referencesSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsZoneInstanceName& sourceInst, Linux_DnsManagedSystemElementForSettingManualInstanceEnumeration& instances){ throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "getSettingReferences between Linux_DnsZone and Linux_DnsAddressMatchList not implemented for Linux_DnsManagedSystemElementForSetting"); } void Linux_DnsManagedSystemElementForSettingDefaultImplementation:: associatorsElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsZoneInstanceEnumeration& instances){ std::cout<<"Linux_DnsManagedSystemElementForSetting : associatorsLinux_DnsZone() ... returns one instance"<<std::endl; Linux_DnsManagedSystemElementForSettingManualInstanceEnumeration enumeration; referencesElement(ctx, mbp, sourceInst.getNamespace(), properties, sourceInst, enumeration); Linux_DnsZoneExternal external(mbp, ctx); while(enumeration.hasNext()) { const Linux_DnsManagedSystemElementForSettingManualInstance instance = enumeration.getNext(); const Linux_DnsManagedSystemElementForSettingInstanceName instanceName = instance.getInstanceName(); const Linux_DnsZoneInstanceName Element = instanceName.getElement(); Linux_DnsZoneInstance inst = external.getInstance(properties,Element); instances.addElement(inst); } } void Linux_DnsManagedSystemElementForSettingDefaultI... [truncated message content] |
Update of /cvsroot/sblim/cmpi-dns/provider/Linux_DnsServiceConfiguration In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20455/provider/Linux_DnsServiceConfiguration Added Files: Linux_DnsServiceConfigurationInterface.h CmpiLinux_DnsServiceConfigurationProvider.cpp Linux_DnsServiceConfigurationManualInstance.h Linux_DnsServiceConfigurationInstance.h Linux_DnsServiceConfigurationInstance.cpp Linux_DnsServiceConfigurationRepositoryExternal.cpp Linux_DnsServiceConfigurationExternal.cpp Linux_DnsServiceConfigurationRepositoryInstance.h Linux_DnsServiceConfigurationResourceAccess.h Linux_DnsServiceConfigurationRepositoryExternal.h Linux_DnsServiceConfigurationManualInstance.cpp Linux_DnsServiceConfigurationDefaultImplementation.cpp Linux_DnsServiceConfigurationFactory.h Linux_DnsServiceConfigurationDefaultImplementation.h Linux_DnsServiceConfigurationInstanceName.cpp CmpiLinux_DnsServiceConfigurationProvider.h makefile Linux_DnsServiceConfigurationExternal.h Linux_DnsServiceConfigurationResourceAccess.cpp Linux_DnsServiceConfigurationRepositoryInstance.cpp Linux_DnsServiceConfigurationInstanceName.h setting.provider Linux_DnsServiceConfigurationFakeFactory.cpp Linux_DnsServiceConfigurationFactory.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: Linux_DnsServiceConfigurationRepositoryInstance.cpp --- /** * Linux_DnsServiceConfigurationRepositoryInstance.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_DnsServiceConfigurationRepositoryInstance.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //Linux_DnsServiceConfigurationRepositoryInstance //********************************************************* //empty constructor Linux_DnsServiceConfigurationRepositoryInstance:: Linux_DnsServiceConfigurationRepositoryInstance(){ init(); }; //copy constructor Linux_DnsServiceConfigurationRepositoryInstance:: Linux_DnsServiceConfigurationRepositoryInstance (const Linux_DnsServiceConfigurationRepositoryInstance& original){ init(original); }; //constructor using CmpiInstance Linux_DnsServiceConfigurationRepositoryInstance:: Linux_DnsServiceConfigurationRepositoryInstance (const CmpiInstance& inst, const char* instanceNamespace){ CmpiData cmpiData; init(); CmpiObjectPath cop=inst.getObjectPath(); cop.setNameSpace(instanceNamespace); setInstanceName(Linux_DnsServiceConfigurationInstanceName(cop)); } //Destructor Linux_DnsServiceConfigurationRepositoryInstance:: ~Linux_DnsServiceConfigurationRepositoryInstance(){ reset(); }; //copy operator Linux_DnsServiceConfigurationRepositoryInstance& Linux_DnsServiceConfigurationRepositoryInstance::operator= (const Linux_DnsServiceConfigurationRepositoryInstance& original){ init(original); return *this; }; //converts to CmpiInstance CmpiInstance Linux_DnsServiceConfigurationRepositoryInstance:: 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_DnsServiceConfigurationRepositoryInstance:: isInstanceNameSet() const{ return isSet.instanceName; } const Linux_DnsServiceConfigurationInstanceName& Linux_DnsServiceConfigurationRepositoryInstance::getInstanceName() const{ if(!isSet.instanceName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "InstanceName not set in Linux_DnsServiceConfiguration instance"); return m_instanceName; } void Linux_DnsServiceConfigurationRepositoryInstance::setInstanceName( const Linux_DnsServiceConfigurationInstanceName& val){ m_instanceName = val; isSet.instanceName=1; } //set isSet attributes to FALSE void Linux_DnsServiceConfigurationRepositoryInstance::init(){ isSet.instanceName=0; }; //copies another instance properties in this void Linux_DnsServiceConfigurationRepositoryInstance::init (const Linux_DnsServiceConfigurationRepositoryInstance& original){ init(); if(original.isInstanceNameSet()){ setInstanceName(original.getInstanceName()); } } //reset the instance data void Linux_DnsServiceConfigurationRepositoryInstance::reset(){ }; //********************************************************* //Linux_DnsServiceConfigurationRepositoryInstanceEnumerationElement //********************************************************* Linux_DnsServiceConfigurationRepositoryInstanceEnumerationElement:: Linux_DnsServiceConfigurationRepositoryInstanceEnumerationElement(){ m_elementP=0; m_nextP=0; }; Linux_DnsServiceConfigurationRepositoryInstanceEnumerationElement:: ~Linux_DnsServiceConfigurationRepositoryInstanceEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //Linux_DnsServiceConfigurationRepositoryInstanceNameEnumeration //********************************************************* Linux_DnsServiceConfigurationRepositoryInstanceEnumeration:: Linux_DnsServiceConfigurationRepositoryInstanceEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; Linux_DnsServiceConfigurationRepositoryInstanceEnumeration:: Linux_DnsServiceConfigurationRepositoryInstanceEnumeration( const Linux_DnsServiceConfigurationRepositoryInstanceEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; Linux_DnsServiceConfigurationRepositoryInstanceEnumeration:: ~Linux_DnsServiceConfigurationRepositoryInstanceEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void Linux_DnsServiceConfigurationRepositoryInstanceEnumeration::reset(){ currentElementP=firstElementP; }; bool Linux_DnsServiceConfigurationRepositoryInstanceEnumeration::hasNext() const{ return (currentElementP!=0); }; int Linux_DnsServiceConfigurationRepositoryInstanceEnumeration::getSize() const{ int size=0; Linux_DnsServiceConfigurationRepositoryInstanceEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const Linux_DnsServiceConfigurationRepositoryInstance& Linux_DnsServiceConfigurationRepositoryInstanceEnumeration::getElement(int pos) const{ Linux_DnsServiceConfigurationRepositoryInstanceEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const Linux_DnsServiceConfigurationRepositoryInstance& Linux_DnsServiceConfigurationRepositoryInstanceEnumeration::getNext() { Linux_DnsServiceConfigurationRepositoryInstanceEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void Linux_DnsServiceConfigurationRepositoryInstanceEnumeration::addElement (const Linux_DnsServiceConfigurationRepositoryInstance& elementP){ if(firstElementP==0){ firstElementP=new Linux_DnsServiceConfigurationRepositoryInstanceEnumerationElement(); firstElementP->m_elementP=new Linux_DnsServiceConfigurationRepositoryInstance(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new Linux_DnsServiceConfigurationRepositoryInstanceEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new Linux_DnsServiceConfigurationRepositoryInstance(elementP); } }; } --- NEW FILE: setting.provider --- #Provider configuration #CPPFLAGS.provider #LDFLAGS.provider --- NEW FILE: Linux_DnsServiceConfigurationRepositoryInstance.h --- /** * Linux_DnsServiceConfigurationRepositoryInstance.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_DnsServiceConfigurationRepositoryInstance_h #define Linux_DnsServiceConfigurationRepositoryInstance_h #include "cmpidt.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiBooleanData.h" #include "CmpiCharData.h" #include "CmpiDateTime.h" #include "Linux_DnsServiceConfigurationInstanceName.h" namespace genProvider { class Linux_DnsServiceConfigurationRepositoryInstance { public: Linux_DnsServiceConfigurationRepositoryInstance(); Linux_DnsServiceConfigurationRepositoryInstance (const Linux_DnsServiceConfigurationRepositoryInstance& original); Linux_DnsServiceConfigurationRepositoryInstance (const CmpiInstance& inst, const char* instanceNamespace); ~Linux_DnsServiceConfigurationRepositoryInstance(); Linux_DnsServiceConfigurationRepositoryInstance& operator= (const Linux_DnsServiceConfigurationRepositoryInstance& original); CmpiInstance getCmpiInstance(const char** properties=0) const; unsigned int isInstanceNameSet() const; void setInstanceName( const Linux_DnsServiceConfigurationInstanceName& val); const Linux_DnsServiceConfigurationInstanceName& getInstanceName() const; private: void init(); void init(const Linux_DnsServiceConfigurationRepositoryInstance& original); void reset(); Linux_DnsServiceConfigurationInstanceName m_instanceName; struct isSetType{ unsigned int instanceName:1; } isSet; }; struct Linux_DnsServiceConfigurationRepositoryInstanceEnumerationElement{ Linux_DnsServiceConfigurationRepositoryInstance* m_elementP; Linux_DnsServiceConfigurationRepositoryInstanceEnumerationElement* m_nextP; Linux_DnsServiceConfigurationRepositoryInstanceEnumerationElement(); ~Linux_DnsServiceConfigurationRepositoryInstanceEnumerationElement(); }; class Linux_DnsServiceConfigurationRepositoryInstanceEnumeration { private: Linux_DnsServiceConfigurationRepositoryInstanceEnumerationElement* firstElementP; Linux_DnsServiceConfigurationRepositoryInstanceEnumerationElement* currentElementP; Linux_DnsServiceConfigurationRepositoryInstanceEnumerationElement* endElementP; public: Linux_DnsServiceConfigurationRepositoryInstanceEnumeration(); Linux_DnsServiceConfigurationRepositoryInstanceEnumeration( const Linux_DnsServiceConfigurationRepositoryInstanceEnumeration& original); ~Linux_DnsServiceConfigurationRepositoryInstanceEnumeration(); void reset(); bool hasNext() const; const Linux_DnsServiceConfigurationRepositoryInstance& getNext(); int getSize() const; const Linux_DnsServiceConfigurationRepositoryInstance& getElement(int pos) const; void addElement(const Linux_DnsServiceConfigurationRepositoryInstance& elementP); }; } #endif --- NEW FILE: Linux_DnsServiceConfigurationRepositoryExternal.cpp --- /** * Linux_DnsServiceConfigurationRepositoryExternal.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_DnsServiceConfigurationRepositoryExternal.h" namespace genProvider{ Linux_DnsServiceConfigurationRepositoryExternal::Linux_DnsServiceConfigurationRepositoryExternal( const CmpiBroker& brkr, const CmpiContext& ctx ) : broker(brkr), context(ctx) {}; const char * Linux_DnsServiceConfigurationRepositoryExternal:: nsp="IBMShadow/cimv2"; Linux_DnsServiceConfigurationRepositoryExternal:: ~Linux_DnsServiceConfigurationRepositoryExternal(){}; void Linux_DnsServiceConfigurationRepositoryExternal::enumInstanceNames( Linux_DnsServiceConfigurationInstanceNameEnumeration& instnames) { CmpiObjectPath op(nsp,"Linux_DnsServiceConfiguration"); CmpiEnumeration en=broker.enumInstanceNames(context,op); while(en.hasNext()) { CmpiObjectPath opi = en.getNext(); Linux_DnsServiceConfigurationInstanceName iname(opi); instnames.addElement(iname); } }; void Linux_DnsServiceConfigurationRepositoryExternal::enumInstances( const char* *properties, Linux_DnsServiceConfigurationRepositoryInstanceEnumeration& instances) { CmpiObjectPath op(nsp,"Linux_DnsServiceConfiguration"); CmpiEnumeration en=broker.enumInstances(context,op,properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); Linux_DnsServiceConfigurationRepositoryInstance instance(inst,nsp); instances.addElement(instance); } }; Linux_DnsServiceConfigurationRepositoryInstance Linux_DnsServiceConfigurationRepositoryExternal::getInstance( const char* *properties, const Linux_DnsServiceConfigurationInstanceName& instanceName) { CmpiObjectPath op=instanceName.getObjectPath(); op.setNameSpace(nsp); CmpiInstance inst=broker.getInstance(context,op,properties); return Linux_DnsServiceConfigurationRepositoryInstance(inst,nsp); } void Linux_DnsServiceConfigurationRepositoryExternal::setInstance( const char* *properties, const Linux_DnsServiceConfigurationRepositoryInstance& instance){ //make a copy of the given instance and set it to the right nameSpace Linux_DnsServiceConfigurationInstanceName instanceName(instance.getInstanceName()); instanceName.setNamespace(nsp,1); Linux_DnsServiceConfigurationRepositoryInstance copiedInstance(instance); copiedInstance.setInstanceName(instanceName); CmpiObjectPath op=instanceName.getObjectPath(); CmpiInstance inst=copiedInstance.getCmpiInstance(); broker.setInstance(context,op,inst,properties); } void Linux_DnsServiceConfigurationRepositoryExternal::createInstance( const Linux_DnsServiceConfigurationRepositoryInstance& instance){ //make a copy of the given instance and set it to the right nameSpace Linux_DnsServiceConfigurationInstanceName instanceName(instance.getInstanceName()); instanceName.setNamespace(nsp,1); Linux_DnsServiceConfigurationRepositoryInstance copiedInstance(instance); copiedInstance.setInstanceName(instanceName); CmpiObjectPath op=instanceName.getObjectPath(); CmpiInstance inst=copiedInstance.getCmpiInstance(); broker.createInstance(context,op,inst); } void Linux_DnsServiceConfigurationRepositoryExternal::deleteInstance( const Linux_DnsServiceConfigurationInstanceName& instanceName){ CmpiObjectPath op=instanceName.getObjectPath(); op.setNameSpace(nsp); broker.deleteInstance(context,op); } } --- NEW FILE: Linux_DnsServiceConfigurationRepositoryExternal.h --- /** * Linux_DnsServiceConfigurationRepositoryExternal.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_DnsServiceConfigurationRepositoryExternal_h #define Linux_DnsServiceConfigurationRepositoryExternal_h #include "Linux_DnsServiceConfigurationInstanceName.h" #include "Linux_DnsServiceConfigurationRepositoryInstance.h" #include "CmpiBroker.h" namespace genProvider { class Linux_DnsServiceConfigurationRepositoryExternal { public: Linux_DnsServiceConfigurationRepositoryExternal( const CmpiBroker& brkr, const CmpiContext& ctx); virtual ~Linux_DnsServiceConfigurationRepositoryExternal(); virtual void enumInstanceNames( Linux_DnsServiceConfigurationInstanceNameEnumeration&); virtual void enumInstances( const char* *properties, Linux_DnsServiceConfigurationRepositoryInstanceEnumeration&); virtual Linux_DnsServiceConfigurationRepositoryInstance getInstance( const char* *properties, const Linux_DnsServiceConfigurationInstanceName&); virtual void setInstance( const char* *properties, const Linux_DnsServiceConfigurationRepositoryInstance&); virtual void createInstance( const Linux_DnsServiceConfigurationRepositoryInstance&); virtual void deleteInstance( const Linux_DnsServiceConfigurationInstanceName&); private: CmpiBroker broker; CmpiContext context; const static char *nsp; }; } #endif --- NEW FILE: Linux_DnsServiceConfigurationInstanceName.h --- /** * Linux_DnsServiceConfigurationInstanceName.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_DnsServiceConfigurationInstanceName_h #define Linux_DnsServiceConfigurationInstanceName_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_DnsConfigurationInstanceName.h" namespace genProvider { class Linux_DnsServiceConfigurationInstanceName { public: Linux_DnsServiceConfigurationInstanceName(); Linux_DnsServiceConfigurationInstanceName (const Linux_DnsServiceConfigurationInstanceName& original); Linux_DnsServiceConfigurationInstanceName (const CmpiObjectPath& path); ~Linux_DnsServiceConfigurationInstanceName(); Linux_DnsServiceConfigurationInstanceName& operator= (const Linux_DnsServiceConfigurationInstanceName& 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 isConfigurationSet() const; void setConfiguration(const Linux_DnsConfigurationInstanceName& val); const Linux_DnsConfigurationInstanceName& getConfiguration() const; private: void init(); void init(const Linux_DnsServiceConfigurationInstanceName& original); void reset(); const char* m_CIMClassNameP; const char* m_namespace; Linux_DnsServiceInstanceName m_Element; Linux_DnsConfigurationInstanceName m_Configuration; struct isSetType{ unsigned int m_namespace:1; unsigned int Element:1; unsigned int Configuration:1; } isSet; }; struct Linux_DnsServiceConfigurationInstanceNameEnumerationElement{ Linux_DnsServiceConfigurationInstanceName* m_elementP; Linux_DnsServiceConfigurationInstanceNameEnumerationElement* m_nextP; Linux_DnsServiceConfigurationInstanceNameEnumerationElement(); ~Linux_DnsServiceConfigurationInstanceNameEnumerationElement(); }; class Linux_DnsServiceConfigurationInstanceNameEnumeration { private: Linux_DnsServiceConfigurationInstanceNameEnumerationElement* firstElementP; Linux_DnsServiceConfigurationInstanceNameEnumerationElement* currentElementP; Linux_DnsServiceConfigurationInstanceNameEnumerationElement* endElementP; public: Linux_DnsServiceConfigurationInstanceNameEnumeration(); Linux_DnsServiceConfigurationInstanceNameEnumeration(const CmpiArray& arr); Linux_DnsServiceConfigurationInstanceNameEnumeration( const Linux_DnsServiceConfigurationInstanceNameEnumeration& original); ~Linux_DnsServiceConfigurationInstanceNameEnumeration(); void reset(); bool hasNext() const; const Linux_DnsServiceConfigurationInstanceName& getNext(); int getSize() const; const Linux_DnsServiceConfigurationInstanceName& getElement(int pos) const; //no copy of the element is done void addElement(const Linux_DnsServiceConfigurationInstanceName& elementP); operator CmpiArray() const; }; } #endif --- NEW FILE: Linux_DnsServiceConfigurationInstance.h --- /** * Linux_DnsServiceConfigurationInstance.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_DnsServiceConfigurationInstance_h #define Linux_DnsServiceConfigurationInstance_h #include "cmpidt.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiBooleanData.h" #include "CmpiCharData.h" #include "CmpiDateTime.h" #include "Linux_DnsServiceConfigurationInstanceName.h" namespace genProvider { class Linux_DnsServiceConfigurationInstance { public: Linux_DnsServiceConfigurationInstance(); Linux_DnsServiceConfigurationInstance (const Linux_DnsServiceConfigurationInstance& original); Linux_DnsServiceConfigurationInstance (const CmpiInstance& inst, const char* instanceNamespace); ~Linux_DnsServiceConfigurationInstance(); Linux_DnsServiceConfigurationInstance& operator= (const Linux_DnsServiceConfigurationInstance& original); CmpiInstance getCmpiInstance(const char** properties=0) const; unsigned int isInstanceNameSet() const; void setInstanceName( const Linux_DnsServiceConfigurationInstanceName& val); const Linux_DnsServiceConfigurationInstanceName& getInstanceName() const; private: void init(); void init(const Linux_DnsServiceConfigurationInstance& original); void reset(); Linux_DnsServiceConfigurationInstanceName m_instanceName; struct isSetType{ unsigned int instanceName:1; } isSet; }; struct Linux_DnsServiceConfigurationInstanceEnumerationElement{ Linux_DnsServiceConfigurationInstance* m_elementP; Linux_DnsServiceConfigurationInstanceEnumerationElement* m_nextP; Linux_DnsServiceConfigurationInstanceEnumerationElement(); ~Linux_DnsServiceConfigurationInstanceEnumerationElement(); }; class Linux_DnsServiceConfigurationInstanceEnumeration { private: Linux_DnsServiceConfigurationInstanceEnumerationElement* firstElementP; Linux_DnsServiceConfigurationInstanceEnumerationElement* currentElementP; Linux_DnsServiceConfigurationInstanceEnumerationElement* endElementP; public: Linux_DnsServiceConfigurationInstanceEnumeration(); Linux_DnsServiceConfigurationInstanceEnumeration( const Linux_DnsServiceConfigurationInstanceEnumeration& original); ~Linux_DnsServiceConfigurationInstanceEnumeration(); void reset(); bool hasNext() const; const Linux_DnsServiceConfigurationInstance& getNext(); int getSize() const; const Linux_DnsServiceConfigurationInstance& getElement(int pos) const; void addElement(const Linux_DnsServiceConfigurationInstance& elementP); }; } #endif --- NEW FILE: Linux_DnsServiceConfigurationManualInstance.cpp --- /** * Linux_DnsServiceConfigurationManualInstance.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_DnsServiceConfigurationManualInstance.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //Linux_DnsServiceConfigurationManualInstance //********************************************************* //empty constructor Linux_DnsServiceConfigurationManualInstance:: Linux_DnsServiceConfigurationManualInstance(){ init(); }; //copy constructor Linux_DnsServiceConfigurationManualInstance:: Linux_DnsServiceConfigurationManualInstance (const Linux_DnsServiceConfigurationManualInstance& original){ init(original); }; //constructor using CmpiInstance Linux_DnsServiceConfigurationManualInstance:: Linux_DnsServiceConfigurationManualInstance (const CmpiInstance& inst, const char* instanceNamespace){ CmpiData cmpiData; init(); CmpiObjectPath cop=inst.getObjectPath(); cop.setNameSpace(instanceNamespace); setInstanceName(Linux_DnsServiceConfigurationInstanceName(cop)); } //Destructor Linux_DnsServiceConfigurationManualInstance:: ~Linux_DnsServiceConfigurationManualInstance(){ reset(); }; //copy operator Linux_DnsServiceConfigurationManualInstance& Linux_DnsServiceConfigurationManualInstance::operator= (const Linux_DnsServiceConfigurationManualInstance& original){ init(original); return *this; }; //converts to CmpiInstance CmpiInstance Linux_DnsServiceConfigurationManualInstance:: 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_DnsServiceConfigurationManualInstance:: isInstanceNameSet() const{ return isSet.instanceName; } const Linux_DnsServiceConfigurationInstanceName& Linux_DnsServiceConfigurationManualInstance::getInstanceName() const{ if(!isSet.instanceName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "InstanceName not set in Linux_DnsServiceConfiguration instance"); return m_instanceName; } void Linux_DnsServiceConfigurationManualInstance::setInstanceName( const Linux_DnsServiceConfigurationInstanceName& val){ m_instanceName = val; isSet.instanceName=1; } //set isSet attributes to FALSE void Linux_DnsServiceConfigurationManualInstance::init(){ isSet.instanceName=0; }; //copies another instance properties in this void Linux_DnsServiceConfigurationManualInstance::init (const Linux_DnsServiceConfigurationManualInstance& original){ init(); if(original.isInstanceNameSet()){ setInstanceName(original.getInstanceName()); } } //reset the instance data void Linux_DnsServiceConfigurationManualInstance::reset(){ }; //********************************************************* //Linux_DnsServiceConfigurationManualInstanceEnumerationElement //********************************************************* Linux_DnsServiceConfigurationManualInstanceEnumerationElement:: Linux_DnsServiceConfigurationManualInstanceEnumerationElement(){ m_elementP=0; m_nextP=0; }; Linux_DnsServiceConfigurationManualInstanceEnumerationElement:: ~Linux_DnsServiceConfigurationManualInstanceEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //Linux_DnsServiceConfigurationManualInstanceNameEnumeration //********************************************************* Linux_DnsServiceConfigurationManualInstanceEnumeration:: Linux_DnsServiceConfigurationManualInstanceEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; Linux_DnsServiceConfigurationManualInstanceEnumeration:: Linux_DnsServiceConfigurationManualInstanceEnumeration( const Linux_DnsServiceConfigurationManualInstanceEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; Linux_DnsServiceConfigurationManualInstanceEnumeration:: ~Linux_DnsServiceConfigurationManualInstanceEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void Linux_DnsServiceConfigurationManualInstanceEnumeration::reset(){ currentElementP=firstElementP; }; bool Linux_DnsServiceConfigurationManualInstanceEnumeration::hasNext() const{ return (currentElementP!=0); }; int Linux_DnsServiceConfigurationManualInstanceEnumeration::getSize() const{ int size=0; Linux_DnsServiceConfigurationManualInstanceEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const Linux_DnsServiceConfigurationManualInstance& Linux_DnsServiceConfigurationManualInstanceEnumeration::getElement(int pos) const{ Linux_DnsServiceConfigurationManualInstanceEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const Linux_DnsServiceConfigurationManualInstance& Linux_DnsServiceConfigurationManualInstanceEnumeration::getNext() { Linux_DnsServiceConfigurationManualInstanceEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void Linux_DnsServiceConfigurationManualInstanceEnumeration::addElement (const Linux_DnsServiceConfigurationManualInstance& elementP){ if(firstElementP==0){ firstElementP=new Linux_DnsServiceConfigurationManualInstanceEnumerationElement(); firstElementP->m_elementP=new Linux_DnsServiceConfigurationManualInstance(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new Linux_DnsServiceConfigurationManualInstanceEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new Linux_DnsServiceConfigurationManualInstance(elementP); } }; } --- NEW FILE: Linux_DnsServiceConfigurationFactory.h --- /** * Linux_DnsServiceConfigurationFactory.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_DnsServiceConfigurationFactory_h #define Linux_DnsServiceConfigurationFactory_h #include "Linux_DnsServiceConfigurationInterface.h" namespace genProvider{ class Linux_DnsServiceConfigurationFactory{ public: Linux_DnsServiceConfigurationFactory(){}; ~Linux_DnsServiceConfigurationFactory(){}; static Linux_DnsServiceConfigurationInterface* getImplementation(); }; } #endif --- NEW FILE: Linux_DnsServiceConfigurationResourceAccess.cpp --- /** * Linux_DnsServiceConfigurationResourceAccess.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_DnsServiceConfigurationResourceAccess.h" namespace genProvider { //Linux_DnsServiceConfigurationResourceAccess::Linux_DnsServiceConfigurationResourceAccess(); Linux_DnsServiceConfigurationResourceAccess::~Linux_DnsServiceConfigurationResourceAccess() { }; /* intrinsic methods */ /* void Linux_DnsServiceConfigurationResourceAccess::enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsServiceConfigurationInstanceNameEnumeration& instnames){ int numInstanceNames=1; for(int i=0;i<numInstanceNames;i++){ //place here the code retrieving your instanceName Linux_DnsServiceConfigurationInstanceName instanceName; } } */ /* void Linux_DnsServiceConfigurationResourceAccess::enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsServiceConfigurationManualInstanceEnumeration& instances){}; */ /* Linux_DnsServiceConfigurationManualInstance Linux_DnsServiceConfigurationResourceAccess::getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsServiceConfigurationInstanceName&){ Linux_DnsServiceConfigurationManualInstance instance; } */ /* void Linux_DnsServiceConfigurationResourceAccess::setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsServiceConfigurationManualInstance&){}; */ /* void Linux_DnsServiceConfigurationResourceAccess::createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsServiceConfigurationManualInstance&){}; */ /* void Linux_DnsServiceConfigurationResourceAccess::deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsServiceConfigurationInstanceName&){}; */ /* Association Interface */ void Linux_DnsServiceConfigurationResourceAccess::referencesElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsConfigurationInstanceName& sourceInst, Linux_DnsServiceConfigurationManualInstanceEnumeration& instEnum) { 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_DnsServiceConfigurationManualInstance aManualInstance; Linux_DnsServiceConfigurationInstanceName instanceName; instanceName.setNamespace( nsp ); instanceName.setElement( serviceInstanceName ); instanceName.setConfiguration( sourceInst ); aManualInstance.setInstanceName(instanceName); instEnum.addElement(aManualInstance); }; void Linux_DnsServiceConfigurationResourceAccess::referencesConfiguration( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsServiceConfigurationManualInstanceEnumeration& instEnum) { Linux_DnsConfigurationInstanceName confInstanceName; confInstanceName.setNamespace(nsp); confInstanceName.setName(DEFAULT_SERVICE_NAME); Linux_DnsServiceConfigurationManualInstance aManualInstance; Linux_DnsServiceConfigurationInstanceName instanceName; instanceName.setNamespace( nsp ); instanceName.setElement( sourceInst ); instanceName.setConfiguration( confInstanceName ); aManualInstance.setInstanceName(instanceName); instEnum.addElement(aManualInstance); }; void Linux_DnsServiceConfigurationResourceAccess::associatorsElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsConfigurationInstanceName& sourceInst, Linux_DnsServiceInstanceEnumeration& instEnum) { 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_DnsServiceConfigurationResourceAccess::associatorsConfiguration( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsConfigurationInstanceEnumeration& instEnum) { Linux_DnsConfigurationInstanceName instanceName; Linux_DnsConfigurationInstance aManualInstance; instanceName.setNamespace(nsp); instanceName.setName(DEFAULT_SERVICE_NAME); aManualInstance.setInstanceName(instanceName); aManualInstance.setConfigurationFile(DEFAULT_CONFIGURATION_FILE); instEnum.addElement(aManualInstance); }; /* extrinsic methods */ } --- NEW FILE: Linux_DnsServiceConfigurationInstance.cpp --- /** * Linux_DnsServiceConfigurationInstance.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_DnsServiceConfigurationInstance.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //Linux_DnsServiceConfigurationInstance //********************************************************* //empty constructor Linux_DnsServiceConfigurationInstance:: Linux_DnsServiceConfigurationInstance(){ init(); }; //copy constructor Linux_DnsServiceConfigurationInstance:: Linux_DnsServiceConfigurationInstance (const Linux_DnsServiceConfigurationInstance& original){ init(original); }; //constructor using CmpiInstance Linux_DnsServiceConfigurationInstance:: Linux_DnsServiceConfigurationInstance (const CmpiInstance& inst, const char* instanceNamespace){ CmpiData cmpiData; init(); CmpiObjectPath cop=inst.getObjectPath(); cop.setNameSpace(instanceNamespace); setInstanceName(Linux_DnsServiceConfigurationInstanceName(cop)); } //Destructor Linux_DnsServiceConfigurationInstance:: ~Linux_DnsServiceConfigurationInstance(){ reset(); }; //copy operator Linux_DnsServiceConfigurationInstance& Linux_DnsServiceConfigurationInstance::operator= (const Linux_DnsServiceConfigurationInstance& original){ init(original); return *this; }; //converts to CmpiInstance CmpiInstance Linux_DnsServiceConfigurationInstance:: 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_DnsServiceConfigurationInstance:: isInstanceNameSet() const{ return isSet.instanceName; } const Linux_DnsServiceConfigurationInstanceName& Linux_DnsServiceConfigurationInstance::getInstanceName() const{ if(!isSet.instanceName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "InstanceName not set in Linux_DnsServiceConfiguration instance"); return m_instanceName; } void Linux_DnsServiceConfigurationInstance::setInstanceName( const Linux_DnsServiceConfigurationInstanceName& val){ m_instanceName = val; isSet.instanceName=1; } //set isSet attributes to FALSE void Linux_DnsServiceConfigurationInstance::init(){ isSet.instanceName=0; }; //copies another instance properties in this void Linux_DnsServiceConfigurationInstance::init (const Linux_DnsServiceConfigurationInstance& original){ init(); if(original.isInstanceNameSet()){ setInstanceName(original.getInstanceName()); } } //reset the instance data void Linux_DnsServiceConfigurationInstance::reset(){ }; //********************************************************* //Linux_DnsServiceConfigurationInstanceEnumerationElement //********************************************************* Linux_DnsServiceConfigurationInstanceEnumerationElement:: Linux_DnsServiceConfigurationInstanceEnumerationElement(){ m_elementP=0; m_nextP=0; }; Linux_DnsServiceConfigurationInstanceEnumerationElement:: ~Linux_DnsServiceConfigurationInstanceEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //Linux_DnsServiceConfigurationInstanceNameEnumeration //********************************************************* Linux_DnsServiceConfigurationInstanceEnumeration:: Linux_DnsServiceConfigurationInstanceEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; Linux_DnsServiceConfigurationInstanceEnumeration:: Linux_DnsServiceConfigurationInstanceEnumeration( const Linux_DnsServiceConfigurationInstanceEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; Linux_DnsServiceConfigurationInstanceEnumeration:: ~Linux_DnsServiceConfigurationInstanceEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void Linux_DnsServiceConfigurationInstanceEnumeration::reset(){ currentElementP=firstElementP; }; bool Linux_DnsServiceConfigurationInstanceEnumeration::hasNext() const{ return (currentElementP!=0); }; int Linux_DnsServiceConfigurationInstanceEnumeration::getSize() const{ int size=0; Linux_DnsServiceConfigurationInstanceEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const Linux_DnsServiceConfigurationInstance& Linux_DnsServiceConfigurationInstanceEnumeration::getElement(int pos) const{ Linux_DnsServiceConfigurationInstanceEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const Linux_DnsServiceConfigurationInstance& Linux_DnsServiceConfigurationInstanceEnumeration::getNext() { Linux_DnsServiceConfigurationInstanceEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void Linux_DnsServiceConfigurationInstanceEnumeration::addElement (const Linux_DnsServiceConfigurationInstance& elementP){ if(firstElementP==0){ firstElementP=new Linux_DnsServiceConfigurationInstanceEnumerationElement(); firstElementP->m_elementP=new Linux_DnsServiceConfigurationInstance(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new Linux_DnsServiceConfigurationInstanceEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new Linux_DnsServiceConfigurationInstance(elementP); } }; } --- NEW FILE: Linux_DnsServiceConfigurationDefaultImplementation.cpp --- /** * Linux_DnsServiceConfigurationDefaultImplementation.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_DnsServiceConfigurationDefaultImplementation.h" #include <iostream> using namespace std; namespace genProvider { /* intrinsic methods */ void Linux_DnsServiceConfigurationDefaultImplementation::enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsServiceConfigurationInstanceNameEnumeration& instnames){ cout<<"enumInstances not supported for Linux_DnsServiceConfiguration"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "enumInstances not implemented for Linux_DnsServiceConfiguration"); } void Linux_DnsServiceConfigurationDefaultImplementation::enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsServiceConfigurationManualInstanceEnumeration& instances){ cout<<"Using default enumInstances implementation for Linux_DnsServiceConfiguration"<<endl; cout<<"LetŽs get the instanceNames"<<endl; Linux_DnsServiceConfigurationInstanceNameEnumeration namesEnumeration; enumInstanceNames(ctx, mbp,nsp,namesEnumeration); cout<<"Getting each instance"<<endl; while(namesEnumeration.hasNext()){ Linux_DnsServiceConfigurationInstanceName name= namesEnumeration.getNext(); cout<<"Getting an instance for instanceName"<<endl; Linux_DnsServiceConfigurationManualInstance instance= getInstance(ctx, mbp, properties, name); cout<<"adding instance to enum"<<endl; instances.addElement(instance); cout<<"Added!"<<endl; }; } Linux_DnsServiceConfigurationManualInstance Linux_DnsServiceConfigurationDefaultImplementation::getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsServiceConfigurationInstanceName&){ cout<<"getInstance not supported for Linux_DnsServiceConfiguration"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "getInstance not implemented for Linux_DnsServiceConfiguration"); } void Linux_DnsServiceConfigurationDefaultImplementation::setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsServiceConfigurationManualInstance&){ cout<<"setInstance not supported for Linux_DnsServiceConfiguration"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "setInstance not implemented for Linux_DnsServiceConfiguration"); } void Linux_DnsServiceConfigurationDefaultImplementation:: createInstance(const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsServiceConfigurationManualInstance&){ cout<<"createInstance not supported for Linux_DnsServiceConfiguration"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "createInstance not implemented for Linux_DnsServiceConfiguration"); } void Linux_DnsServiceConfigurationDefaultImplementation:: deleteInstance(const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsServiceConfigurationInstanceName&){ cout<<"deleteInstance not supported for Linux_DnsServiceConfiguration"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "deleteInstance not implemented for Linux_DnsServiceConfiguration"); } /* Association Interface */ void Linux_DnsServiceConfigurationDefaultImplementation:: referencesElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsConfigurationInstanceName& sourceInst, Linux_DnsServiceConfigurationManualInstanceEnumeration& instances){ throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "getElementReferences between Linux_DnsService and Linux_DnsConfiguration not implemented for Linux_DnsServiceConfiguration"); } void Linux_DnsServiceConfigurationDefaultImplementation:: referencesConfiguration( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsServiceConfigurationManualInstanceEnumeration& instances){ throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "getConfigurationReferences between Linux_DnsService and Linux_DnsConfiguration not implemented for Linux_DnsServiceConfiguration"); } void Linux_DnsServiceConfigurationDefaultImplementation:: associatorsElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsConfigurationInstanceName& sourceInst, Linux_DnsServiceInstanceEnumeration& instances){ std::cout<<"Linux_DnsServiceConfiguration : associatorsLinux_DnsService() ... returns one instance"<<std::endl; Linux_DnsServiceConfigurationManualInstanceEnumeration enumeration; referencesElement(ctx, mbp, sourceInst.getNamespace(), properties, sourceInst, enumeration); Linux_DnsServiceExternal external(mbp, ctx); while(enumeration.hasNext()) { const Linux_DnsServiceConfigurationManualInstance instance = enumeration.getNext(); const Linux_DnsServiceConfigurationInstanceName instanceName = instance.getInstanceName(); const Linux_DnsServiceInstanceName Element = instanceName.getElement(); Linux_DnsServiceInstance inst = external.getInstance(properties,Element); instances.addElement(inst); } } void Linux_DnsServiceConfigurationDefaultImplementation:: associatorsConfiguration( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsConfigurationInstanceEnumeration& instances){ std::cout<<"Linux_DnsServiceConfiguration : associatorsLinux_DnsConfiguration() ... returns one instance"<<std::endl; Linux_DnsServiceConfigurationManualInstanceEnumeration enumeration; referencesConfiguration(ctx, mbp, sourceInst.getNamespace(), properties, sourceInst, enumeration); Linux_DnsConfigurationExternal external(mbp, ctx); while(enumeration.hasNext()) { const Linux_DnsServiceConfigurationManualInstance instance = enumeration.getNext(); const Linux_DnsServiceConfigurationInstanceName instanceName = instance.getInstanceName(); const Linux_DnsConfigurationInstanceName Configuration = instanceName.getConfiguration(); Linux_DnsConfigurationInstance inst = external.getInstance(properties,Configuration); instances.addElement(inst); } } /* extrinsic methods */ } --- NEW FILE: makefile --- include ../setting.cmpi include setting.provider CPPFLAGS=$(CPPFLAGS.provider) -I. -I$(CIMOMINC) -I$(COMMONINC) -I$(CIMOMINC)/cpp -I../Linux_DnsService -I../CIM_ConcreteJob -I../Linux_DnsConfiguration -D_COMPILE_UNIX -DCMPI_STANDALONE CXXFLAGS=-Wall -g -fPIC -fno-implicit-templates LDFLAGS=-L. -L$(COMMONLIB) -L$(COMMONLIB_OUT) -shared -lLinux_DnsServiceSupport -lLinux_DnsConfigurationSupport -lcmpiCppImpl -lIBM_ProviderTooling OBJECTS=Linux_DnsServiceConfigurationInstanceName.o \ Linux_DnsServiceConfigurationInstance.o \ Linux_DnsServiceConfigurationExternal.o \ Linux_DnsServiceConfigurationRepositoryInstance.o \ Linux_DnsServiceConfigurationRepositoryExternal.o \ Linux_DnsServiceConfigurationManualInstance.o \ Linux_DnsServiceConfigurationDefaultImplementation.o FAKEFACTORY= Linux_DnsServiceConfigurationFakeFactory.o NORMALFACTORY= Linux_DnsServiceConfigurationFactory.o RESOURCEOBJECT= Linux_DnsServiceConfigurationResourceAccess.o PROVIDEROBJECT=CmpiLinux_DnsServiceConfigurationProvider.o all: testfiles preinstall install buildall: clean all #------------------------------------------------------------------------------# compile: $(OBJECTS) $(FAKEFACTORY) $(NORMALFACTORY) $(RESOURCEOBJECT) $(PROVIDEROBJECT) #------------------------------------------------------------------------------# prelink: $(OBJECTS) $(FAKEFACTORY) $(LINK.cpp) -o libLinux_DnsServiceConfigurationSupport.so $^ link: deleteFakeLib \ libLinux_DnsServiceConfigurationSupport.so \ libLinux_DnsServiceConfiguration.so libLinux_DnsServiceConfigurationSupport.so: LDFLAGS+=$(LDFLAGS.provider) libLinux_DnsServiceConfigurationSupport.so: $(OBJECTS) $(NORMALFACTORY) $(RESOURCEOBJECT) $(PROVIDEROBJECT) $(LINK.cpp) -o $@ $^ libLinux_DnsServiceConfiguration.so: LDFLAGS+=-lLinux_DnsServiceConfigurationSupport libLinux_DnsServiceConfiguration.so: $(PROVIDEROBJECT) $(LINK.cpp) -o $@ $^ deleteFakeLib: $(RM) *.so #------------------------------------------------------------------------------# preinstall: prelink install libLinux_DnsServiceConfigurationSupport.so $(COMMONLIB_OUT) #------------------------------------------------------------------------------# install: link install libLinux_DnsServiceConfigurationSupport.so $(COMMONLIB_OUT) install libLinux_DnsServiceConfiguration.so $(CIMOMLIB_OUT) # install -m 644 Linux_DnsServiceConfiguration*.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_DnsServiceConfiguration*.h \ $(RM) $(COMMONLIB)/libLinux_DnsServiceConfigurationSupport.so \ $(RM) $(CIMOMLIB)/libLinux_DnsServiceConfiguration.so --- NEW FILE: Linux_DnsServiceConfigurationInterface.h --- /** * Linux_DnsServiceConfigurationInterface.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_DnsServiceConfigurationInterface_h #define Linux_DnsServiceConfigurationInterface_h #include "Linux_DnsServiceConfigurationInstanceName.h" #include "Linux_DnsServiceConfigurationManualInstance.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiDateTime.h" #include "CmpiBroker.h" #include "Linux_DnsServiceInstance.h" #include "Linux_DnsConfigurationInstance.h" #include "Linux_DnsServiceExternal.h" #include "Linux_DnsConfigurationExternal.h" namespace genProvider { class Linux_DnsServiceConfigurationInterface { public: virtual ~Linux_DnsServiceConfigurationInterface() { }; /* intrinsic methods */ virtual void enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsServiceConfigurationInstanceNameEnumeration& instnames) = 0; virtual void enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsServiceConfigurationManualInstanceEnumeration& instances) = 0; virtual Linux_DnsServiceConfigurationManualInstance getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsServiceConfigurationInstanceName&) = 0; virtual void setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsServiceConfigurationManualInstance&) = 0; virtual void createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsServiceConfigurationManualInstance&) = 0; virtual void deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsServiceConfigura... [truncated message content] |
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] |
Update of /cvsroot/sblim/cmpi-dns/provider/Linux_DnsNotifyACLForService In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20455/provider/Linux_DnsNotifyACLForService Added Files: CmpiLinux_DnsNotifyACLForServiceProvider.cpp Linux_DnsNotifyACLForServiceFactory.h Linux_DnsNotifyACLForServiceManualInstance.cpp Linux_DnsNotifyACLForServiceManualInstance.h setting.provider Linux_DnsNotifyACLForServiceInterface.h Linux_DnsNotifyACLForServiceRepositoryInstance.cpp Linux_DnsNotifyACLForServiceFakeFactory.cpp Linux_DnsNotifyACLForServiceRepositoryExternal.cpp Linux_DnsNotifyACLForServiceInstance.h Linux_DnsNotifyACLForServiceInstance.cpp Linux_DnsNotifyACLForServiceRepositoryExternal.h Linux_DnsNotifyACLForServiceResourceAccess.h Linux_DnsNotifyACLForServiceResourceAccess.cpp Linux_DnsNotifyACLForServiceDefaultImplementation.h Linux_DnsNotifyACLForServiceInstanceName.cpp Linux_DnsNotifyACLForServiceRepositoryInstance.h CmpiLinux_DnsNotifyACLForServiceProvider.h makefile Linux_DnsNotifyACLForServiceInstanceName.h Linux_DnsNotifyACLForServiceDefaultImplementation.cpp Linux_DnsNotifyACLForServiceFactory.cpp Linux_DnsNotifyACLForServiceExternal.h Linux_DnsNotifyACLForServiceExternal.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_DnsNotifyACLForServiceFakeFactory.cpp --- /** * Linux_DnsNotifyACLForServiceFakeFactory.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_DnsNotifyACLForServiceFactory.h" using namespace std; namespace genProvider{ Linux_DnsNotifyACLForServiceInterface* Linux_DnsNotifyACLForServiceFactory::getImplementation(){ cout<<"ERROR: incomplete support library is being used"<<endl; cout<<" in provider from class Linux_DnsNotifyACLForService"<<endl; cout<<" Use the link-install options for the makefile"<<endl; return 0; }; } --- NEW FILE: Linux_DnsNotifyACLForServiceResourceAccess.h --- /** * Linux_DnsNotifyACLForServiceResourceAccess.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_DnsNotifyACLForServiceResourceAccess_h #define Linux_DnsNotifyACLForServiceResourceAccess_h #include "Linux_DnsNotifyACLForServiceInstanceName.h" #include "Linux_DnsNotifyACLForServiceManualInstance.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiDateTime.h" #include "CmpiBroker.h" #include "Linux_DnsServiceInstance.h" #include "Linux_DnsAddressMatchListInstance.h" #include "Linux_DnsServiceExternal.h" #include "Linux_DnsAddressMatchListExternal.h" #include "Linux_DnsNotifyACLForServiceDefaultImplementation.h" #include <string> #include <list> using namespace std; #include "dnssupport.h" #include "defaultvalues.h" #include "DnsArray.h" #include "DnsValueMap.h" namespace genProvider { class Linux_DnsNotifyACLForServiceResourceAccess: public Linux_DnsNotifyACLForServiceDefaultImplementation { public: /*Linux_DnsNotifyACLForServiceResourceAccess(); */ virtual ~Linux_DnsNotifyACLForServiceResourceAccess() ; /* intrinsic methods */ virtual void enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsNotifyACLForServiceInstanceNameEnumeration& instnames); virtual void enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsNotifyACLForServiceManualInstanceEnumeration& instances); virtual Linux_DnsNotifyACLForServiceManualInstance getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsNotifyACLForServiceInstanceName&); /* virtual void setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsNotifyACLForServiceManualInstance&); */ virtual void createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsNotifyACLForServiceManualInstance&); virtual void deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsNotifyACLForServiceInstanceName&); /* Association Interface */ virtual void referencesElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsNotifyACLForServiceManualInstanceEnumeration& instances); virtual void referencesSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsNotifyACLForServiceManualInstanceEnumeration& 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: 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_DnsNotifyACLForServiceInstanceName.o \ Linux_DnsNotifyACLForServiceInstance.o \ Linux_DnsNotifyACLForServiceExternal.o \ Linux_DnsNotifyACLForServiceRepositoryInstance.o \ Linux_DnsNotifyACLForServiceRepositoryExternal.o \ Linux_DnsNotifyACLForServiceManualInstance.o \ Linux_DnsNotifyACLForServiceDefaultImplementation.o FAKEFACTORY= Linux_DnsNotifyACLForServiceFakeFactory.o NORMALFACTORY= Linux_DnsNotifyACLForServiceFactory.o RESOURCEOBJECT= Linux_DnsNotifyACLForServiceResourceAccess.o PROVIDEROBJECT=CmpiLinux_DnsNotifyACLForServiceProvider.o all: testfiles preinstall install buildall: clean all #------------------------------------------------------------------------------# compile: $(OBJECTS) $(FAKEFACTORY) $(NORMALFACTORY) $(RESOURCEOBJECT) $(PROVIDEROBJECT) #------------------------------------------------------------------------------# prelink: $(OBJECTS) $(FAKEFACTORY) $(LINK.cpp) -o libLinux_DnsNotifyACLForServiceSupport.so $^ link: deleteFakeLib \ libLinux_DnsNotifyACLForServiceSupport.so \ libLinux_DnsNotifyACLForService.so libLinux_DnsNotifyACLForServiceSupport.so: LDFLAGS+=$(LDFLAGS.provider) libLinux_DnsNotifyACLForServiceSupport.so: $(OBJECTS) $(NORMALFACTORY) $(RESOURCEOBJECT) $(PROVIDEROBJECT) $(LINK.cpp) -o $@ $^ libLinux_DnsNotifyACLForService.so: LDFLAGS+=-lLinux_DnsNotifyACLForServiceSupport libLinux_DnsNotifyACLForService.so: $(PROVIDEROBJECT) $(LINK.cpp) -o $@ $^ deleteFakeLib: $(RM) *.so #------------------------------------------------------------------------------# preinstall: prelink install libLinux_DnsNotifyACLForServiceSupport.so $(COMMONLIB_OUT) #------------------------------------------------------------------------------# install: link install libLinux_DnsNotifyACLForServiceSupport.so $(COMMONLIB_OUT) install libLinux_DnsNotifyACLForService.so $(CIMOMLIB_OUT) # install -m 644 Linux_DnsNotifyACLForService*.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_DnsNotifyACLForService*.h \ $(RM) $(COMMONLIB)/libLinux_DnsNotifyACLForServiceSupport.so \ $(RM) $(CIMOMLIB)/libLinux_DnsNotifyACLForService.so --- NEW FILE: Linux_DnsNotifyACLForServiceFactory.cpp --- /** * Linux_DnsNotifyACLForServiceFactory.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_DnsNotifyACLForServiceFactory.h" #include "Linux_DnsNotifyACLForServiceResourceAccess.h" namespace genProvider{ Linux_DnsNotifyACLForServiceInterface* Linux_DnsNotifyACLForServiceFactory::getImplementation(){ return (new Linux_DnsNotifyACLForServiceResourceAccess()); }; } --- NEW FILE: Linux_DnsNotifyACLForServiceExternal.cpp --- /** * Linux_DnsNotifyACLForServiceExternal.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_DnsNotifyACLForServiceExternal.h" namespace genProvider{ Linux_DnsNotifyACLForServiceExternal::Linux_DnsNotifyACLForServiceExternal( const CmpiBroker& brkr, const CmpiContext& ctx ) : broker(brkr), context(ctx) {}; Linux_DnsNotifyACLForServiceExternal:: ~Linux_DnsNotifyACLForServiceExternal(){}; void Linux_DnsNotifyACLForServiceExternal::enumInstanceNames( const char *nsp, Linux_DnsNotifyACLForServiceInstanceNameEnumeration& instnames) { CmpiObjectPath op(nsp,"Linux_DnsNotifyACLForService"); CmpiEnumeration en=broker.enumInstanceNames(context,op); while(en.hasNext()) { CmpiObjectPath opi = en.getNext(); Linux_DnsNotifyACLForServiceInstanceName iname(opi); instnames.addElement(iname); } }; void Linux_DnsNotifyACLForServiceExternal::enumInstances( const char *nsp, const char* *properties, Linux_DnsNotifyACLForServiceInstanceEnumeration& instances) { CmpiObjectPath op(nsp,"Linux_DnsNotifyACLForService"); CmpiEnumeration en=broker.enumInstances(context,op,properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); Linux_DnsNotifyACLForServiceInstance instance(inst,nsp); instances.addElement(instance); } }; Linux_DnsNotifyACLForServiceInstance Linux_DnsNotifyACLForServiceExternal::getInstance( const char* *properties, const Linux_DnsNotifyACLForServiceInstanceName& instanceName) { CmpiObjectPath op=instanceName.getObjectPath(); CmpiInstance inst=broker.getInstance(context,op,properties); return Linux_DnsNotifyACLForServiceInstance(inst,instanceName.getNamespace()); } void Linux_DnsNotifyACLForServiceExternal::setInstance( const char* *properties, const Linux_DnsNotifyACLForServiceInstance& instance){ CmpiObjectPath op=instance.getInstanceName().getObjectPath(); CmpiInstance inst=instance.getCmpiInstance(); broker.setInstance(context,op,inst,properties); } void Linux_DnsNotifyACLForServiceExternal::createInstance( const Linux_DnsNotifyACLForServiceInstance& instance){ CmpiObjectPath op=instance.getInstanceName().getObjectPath(); CmpiInstance inst=instance.getCmpiInstance(); broker.createInstance(context,op,inst); } void Linux_DnsNotifyACLForServiceExternal::deleteInstance( const Linux_DnsNotifyACLForServiceInstanceName& instanceName){ CmpiObjectPath op=instanceName.getObjectPath(); broker.deleteInstance(context,op); } //Reference calls void Linux_DnsNotifyACLForServiceExternal:: referencesElement( const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsNotifyACLForServiceInstanceEnumeration& instances){ CmpiObjectPath op=sourceInst.getObjectPath(); CmpiEnumeration en=broker.references (context, op, "Linux_DnsAddressMatchList", "Element", properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); Linux_DnsNotifyACLForServiceInstance instance(inst,nsp); instances.addElement(instance); } } void Linux_DnsNotifyACLForServiceExternal:: referenceNamesElement( const char *nsp, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsNotifyACLForServiceInstanceNameEnumeration& instanceNames){ CmpiObjectPath op=sourceInst.getObjectPath(); CmpiEnumeration en=broker.referenceNames (context, op, "Linux_DnsAddressMatchList", "Element"); while(en.hasNext()) { CmpiObjectPath instName = en.getNext(); Linux_DnsNotifyACLForServiceInstanceName instanceName(instName); instanceNames.addElement(instanceName); } } void Linux_DnsNotifyACLForServiceExternal:: referencesSetting( const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsNotifyACLForServiceInstanceEnumeration& instances){ CmpiObjectPath op=sourceInst.getObjectPath(); CmpiEnumeration en=broker.references (context, op, "Linux_DnsService", "Setting", properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); Linux_DnsNotifyACLForServiceInstance instance(inst,nsp); instances.addElement(instance); } } void Linux_DnsNotifyACLForServiceExternal:: referenceNamesSetting( const char *nsp, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsNotifyACLForServiceInstanceNameEnumeration& instanceNames){ CmpiObjectPath op=sourceInst.getObjectPath(); CmpiEnumeration en=broker.referenceNames (context, op, "Linux_DnsService", "Setting"); while(en.hasNext()) { CmpiObjectPath instName = en.getNext(); Linux_DnsNotifyACLForServiceInstanceName instanceName(instName); instanceNames.addElement(instanceName); } } //Associator calls void Linux_DnsNotifyACLForServiceExternal:: associatorsElement( const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsServiceInstanceEnumeration& instances){ CmpiObjectPath op=sourceInst.getObjectPath(); CmpiEnumeration en=broker.associators (context,op,0,0,0,0,properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); Linux_DnsServiceInstance instance(inst,nsp); instances.addElement(instance); } } void Linux_DnsNotifyACLForServiceExternal:: associatorNamesElement( const char *nsp, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsServiceInstanceNameEnumeration& instanceNames){ CmpiObjectPath op=sourceInst.getObjectPath(); CmpiEnumeration en=broker.associatorNames (context,op,0,0,0,0); while(en.hasNext()) { CmpiObjectPath instName = en.getNext(); Linux_DnsServiceInstanceName instanceName(instName); instanceNames.addElement(instanceName); } } void Linux_DnsNotifyACLForServiceExternal:: associatorsSetting( const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceEnumeration& instances){ CmpiObjectPath op=sourceInst.getObjectPath(); CmpiEnumeration en=broker.associators (context,op,0,0,0,0,properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); Linux_DnsAddressMatchListInstance instance(inst,nsp); instances.addElement(instance); } } void Linux_DnsNotifyACLForServiceExternal:: associatorNamesSetting( const char *nsp, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceNameEnumeration& instanceNames){ CmpiObjectPath op=sourceInst.getObjectPath(); CmpiEnumeration en=broker.associatorNames (context,op,0,0,0,0); while(en.hasNext()) { CmpiObjectPath instName = en.getNext(); Linux_DnsAddressMatchListInstanceName instanceName(instName); instanceNames.addElement(instanceName); } } } --- NEW FILE: Linux_DnsNotifyACLForServiceExternal.h --- /** * Linux_DnsNotifyACLForServiceExternal.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_DnsNotifyACLForServiceExternal_h #define Linux_DnsNotifyACLForServiceExternal_h #include "Linux_DnsNotifyACLForServiceInstance.h" #include "Linux_DnsServiceInstance.h" #include "Linux_DnsAddressMatchListInstance.h" #include "CmpiBroker.h" namespace genProvider { class Linux_DnsNotifyACLForServiceExternal { public: Linux_DnsNotifyACLForServiceExternal( const CmpiBroker& brkr, const CmpiContext& ctx); virtual ~Linux_DnsNotifyACLForServiceExternal(); virtual void enumInstanceNames( const char *nsp, Linux_DnsNotifyACLForServiceInstanceNameEnumeration&); virtual void enumInstances( const char *nsp, const char* *properties, Linux_DnsNotifyACLForServiceInstanceEnumeration&); virtual Linux_DnsNotifyACLForServiceInstance getInstance( const char* *properties, const Linux_DnsNotifyACLForServiceInstanceName&); virtual void setInstance( const char* *properties, const Linux_DnsNotifyACLForServiceInstance&); virtual void createInstance( const Linux_DnsNotifyACLForServiceInstance&); virtual void deleteInstance( const Linux_DnsNotifyACLForServiceInstanceName&); //association calls void referencesElement( const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsNotifyACLForServiceInstanceEnumeration& instances); void referenceNamesElement( const char *nsp, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsNotifyACLForServiceInstanceNameEnumeration& instanceNames); void referencesSetting( const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsNotifyACLForServiceInstanceEnumeration& instances); void referenceNamesSetting( const char *nsp, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsNotifyACLForServiceInstanceNameEnumeration& 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_DnsNotifyACLForServiceDefaultImplementation.cpp --- /** * Linux_DnsNotifyACLForServiceDefaultImplementation.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_DnsNotifyACLForServiceDefaultImplementation.h" #include <iostream> using namespace std; namespace genProvider { /* intrinsic methods */ void Linux_DnsNotifyACLForServiceDefaultImplementation::enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsNotifyACLForServiceInstanceNameEnumeration& instnames){ cout<<"enumInstances not supported for Linux_DnsNotifyACLForService"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "enumInstances not implemented for Linux_DnsNotifyACLForService"); } void Linux_DnsNotifyACLForServiceDefaultImplementation::enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsNotifyACLForServiceManualInstanceEnumeration& instances){ cout<<"Using default enumInstances implementation for Linux_DnsNotifyACLForService"<<endl; cout<<"LetŽs get the instanceNames"<<endl; Linux_DnsNotifyACLForServiceInstanceNameEnumeration namesEnumeration; enumInstanceNames(ctx, mbp,nsp,namesEnumeration); cout<<"Getting each instance"<<endl; while(namesEnumeration.hasNext()){ Linux_DnsNotifyACLForServiceInstanceName name= namesEnumeration.getNext(); cout<<"Getting an instance for instanceName"<<endl; Linux_DnsNotifyACLForServiceManualInstance instance= getInstance(ctx, mbp, properties, name); cout<<"adding instance to enum"<<endl; instances.addElement(instance); cout<<"Added!"<<endl; }; } Linux_DnsNotifyACLForServiceManualInstance Linux_DnsNotifyACLForServiceDefaultImplementation::getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsNotifyACLForServiceInstanceName&){ cout<<"getInstance not supported for Linux_DnsNotifyACLForService"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "getInstance not implemented for Linux_DnsNotifyACLForService"); } void Linux_DnsNotifyACLForServiceDefaultImplementation::setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsNotifyACLForServiceManualInstance&){ cout<<"setInstance not supported for Linux_DnsNotifyACLForService"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "setInstance not implemented for Linux_DnsNotifyACLForService"); } void Linux_DnsNotifyACLForServiceDefaultImplementation:: createInstance(const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsNotifyACLForServiceManualInstance&){ cout<<"createInstance not supported for Linux_DnsNotifyACLForService"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "createInstance not implemented for Linux_DnsNotifyACLForService"); } void Linux_DnsNotifyACLForServiceDefaultImplementation:: deleteInstance(const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsNotifyACLForServiceInstanceName&){ cout<<"deleteInstance not supported for Linux_DnsNotifyACLForService"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "deleteInstance not implemented for Linux_DnsNotifyACLForService"); } /* Association Interface */ void Linux_DnsNotifyACLForServiceDefaultImplementation:: referencesElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsNotifyACLForServiceManualInstanceEnumeration& instances){ throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "getElementReferences between Linux_DnsService and Linux_DnsAddressMatchList not implemented for Linux_DnsNotifyACLForService"); } void Linux_DnsNotifyACLForServiceDefaultImplementation:: referencesSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsNotifyACLForServiceManualInstanceEnumeration& instances){ throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "getSettingReferences between Linux_DnsService and Linux_DnsAddressMatchList not implemented for Linux_DnsNotifyACLForService"); } void Linux_DnsNotifyACLForServiceDefaultImplementation:: associatorsElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsServiceInstanceEnumeration& instances){ std::cout<<"Linux_DnsNotifyACLForService : associatorsLinux_DnsService() ... returns one instance"<<std::endl; Linux_DnsNotifyACLForServiceManualInstanceEnumeration enumeration; referencesElement(ctx, mbp, sourceInst.getNamespace(), properties, sourceInst, enumeration); Linux_DnsServiceExternal external(mbp, ctx); while(enumeration.hasNext()) { const Linux_DnsNotifyACLForServiceManualInstance instance = enumeration.getNext(); const Linux_DnsNotifyACLForServiceInstanceName instanceName = instance.getInstanceName(); const Linux_DnsServiceInstanceName Element = instanceName.getElement(); Linux_DnsServiceInstance inst = external.getInstance(properties,Element); instances.addElement(inst); } } void Linux_DnsNotifyACLForServiceDefaultImplementation:: associatorsSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceEnumeration& instances){ std::cout<<"Linux_DnsNotifyACLForService : associatorsLinux_DnsAddressMatchList() ... returns one instance"<<std::endl; Linux_DnsNotifyACLForServiceManualInstanceEnumeration enumeration; referencesSetting(ctx, mbp, sourceInst.getNamespace(), properties, sourceInst, enumeration); Linux_DnsAddressMatchListExternal external(mbp, ctx); while(enumeration.hasNext()) { const Linux_DnsNotifyACLForServiceManualInstance instance = enumeration.getNext(); const Linux_DnsNotifyACLForServiceInstanceName instanceName = instance.getInstanceName(); const Linux_DnsAddressMatchListInstanceName Setting = instanceName.getSetting(); Linux_DnsAddressMatchListInstance inst = external.getInstance(properties,Setting); instances.addElement(inst); } } /* extrinsic methods */ } --- NEW FILE: Linux_DnsNotifyACLForServiceInstance.cpp --- /** * Linux_DnsNotifyACLForServiceInstance.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_DnsNotifyACLForServiceInstance.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //Linux_DnsNotifyACLForServiceInstance //********************************************************* //empty constructor Linux_DnsNotifyACLForServiceInstance:: Linux_DnsNotifyACLForServiceInstance(){ init(); }; //copy constructor Linux_DnsNotifyACLForServiceInstance:: Linux_DnsNotifyACLForServiceInstance (const Linux_DnsNotifyACLForServiceInstance& original){ init(original); }; //constructor using CmpiInstance Linux_DnsNotifyACLForServiceInstance:: Linux_DnsNotifyACLForServiceInstance (const CmpiInstance& inst, const char* instanceNamespace){ CmpiData cmpiData; init(); CmpiObjectPath cop=inst.getObjectPath(); cop.setNameSpace(instanceNamespace); setInstanceName(Linux_DnsNotifyACLForServiceInstanceName(cop)); } //Destructor Linux_DnsNotifyACLForServiceInstance:: ~Linux_DnsNotifyACLForServiceInstance(){ reset(); }; //copy operator Linux_DnsNotifyACLForServiceInstance& Linux_DnsNotifyACLForServiceInstance::operator= (const Linux_DnsNotifyACLForServiceInstance& original){ init(original); return *this; }; //converts to CmpiInstance CmpiInstance Linux_DnsNotifyACLForServiceInstance:: 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_DnsNotifyACLForServiceInstance:: isInstanceNameSet() const{ return isSet.instanceName; } const Linux_DnsNotifyACLForServiceInstanceName& Linux_DnsNotifyACLForServiceInstance::getInstanceName() const{ if(!isSet.instanceName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "InstanceName not set in Linux_DnsNotifyACLForService instance"); return m_instanceName; } void Linux_DnsNotifyACLForServiceInstance::setInstanceName( const Linux_DnsNotifyACLForServiceInstanceName& val){ m_instanceName = val; isSet.instanceName=1; } //set isSet attributes to FALSE void Linux_DnsNotifyACLForServiceInstance::init(){ isSet.instanceName=0; }; //copies another instance properties in this void Linux_DnsNotifyACLForServiceInstance::init (const Linux_DnsNotifyACLForServiceInstance& original){ init(); if(original.isInstanceNameSet()){ setInstanceName(original.getInstanceName()); } } //reset the instance data void Linux_DnsNotifyACLForServiceInstance::reset(){ }; //********************************************************* //Linux_DnsNotifyACLForServiceInstanceEnumerationElement //********************************************************* Linux_DnsNotifyACLForServiceInstanceEnumerationElement:: Linux_DnsNotifyACLForServiceInstanceEnumerationElement(){ m_elementP=0; m_nextP=0; }; Linux_DnsNotifyACLForServiceInstanceEnumerationElement:: ~Linux_DnsNotifyACLForServiceInstanceEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //Linux_DnsNotifyACLForServiceInstanceNameEnumeration //********************************************************* Linux_DnsNotifyACLForServiceInstanceEnumeration:: Linux_DnsNotifyACLForServiceInstanceEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; Linux_DnsNotifyACLForServiceInstanceEnumeration:: Linux_DnsNotifyACLForServiceInstanceEnumeration( const Linux_DnsNotifyACLForServiceInstanceEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; Linux_DnsNotifyACLForServiceInstanceEnumeration:: ~Linux_DnsNotifyACLForServiceInstanceEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void Linux_DnsNotifyACLForServiceInstanceEnumeration::reset(){ currentElementP=firstElementP; }; bool Linux_DnsNotifyACLForServiceInstanceEnumeration::hasNext() const{ return (currentElementP!=0); }; int Linux_DnsNotifyACLForServiceInstanceEnumeration::getSize() const{ int size=0; Linux_DnsNotifyACLForServiceInstanceEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const Linux_DnsNotifyACLForServiceInstance& Linux_DnsNotifyACLForServiceInstanceEnumeration::getElement(int pos) const{ Linux_DnsNotifyACLForServiceInstanceEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const Linux_DnsNotifyACLForServiceInstance& Linux_DnsNotifyACLForServiceInstanceEnumeration::getNext() { Linux_DnsNotifyACLForServiceInstanceEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void Linux_DnsNotifyACLForServiceInstanceEnumeration::addElement (const Linux_DnsNotifyACLForServiceInstance& elementP){ if(firstElementP==0){ firstElementP=new Linux_DnsNotifyACLForServiceInstanceEnumerationElement(); firstElementP->m_elementP=new Linux_DnsNotifyACLForServiceInstance(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new Linux_DnsNotifyACLForServiceInstanceEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new Linux_DnsNotifyACLForServiceInstance(elementP); } }; } --- NEW FILE: Linux_DnsNotifyACLForServiceRepositoryInstance.cpp --- /** * Linux_DnsNotifyACLForServiceRepositoryInstance.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_DnsNotifyACLForServiceRepositoryInstance.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //Linux_DnsNotifyACLForServiceRepositoryInstance //********************************************************* //empty constructor Linux_DnsNotifyACLForServiceRepositoryInstance:: Linux_DnsNotifyACLForServiceRepositoryInstance(){ init(); }; //copy constructor Linux_DnsNotifyACLForServiceRepositoryInstance:: Linux_DnsNotifyACLForServiceRepositoryInstance (const Linux_DnsNotifyACLForServiceRepositoryInstance& original){ init(original); }; //constructor using CmpiInstance Linux_DnsNotifyACLForServiceRepositoryInstance:: Linux_DnsNotifyACLForServiceRepositoryInstance (const CmpiInstance& inst, const char* instanceNamespace){ CmpiData cmpiData; init(); CmpiObjectPath cop=inst.getObjectPath(); cop.setNameSpace(instanceNamespace); setInstanceName(Linux_DnsNotifyACLForServiceInstanceName(cop)); } //Destructor Linux_DnsNotifyACLForServiceRepositoryInstance:: ~Linux_DnsNotifyACLForServiceRepositoryInstance(){ reset(); }; //copy operator Linux_DnsNotifyACLForServiceRepositoryInstance& Linux_DnsNotifyACLForServiceRepositoryInstance::operator= (const Linux_DnsNotifyACLForServiceRepositoryInstance& original){ init(original); return *this; }; //converts to CmpiInstance CmpiInstance Linux_DnsNotifyACLForServiceRepositoryInstance:: 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_DnsNotifyACLForServiceRepositoryInstance:: isInstanceNameSet() const{ return isSet.instanceName; } const Linux_DnsNotifyACLForServiceInstanceName& Linux_DnsNotifyACLForServiceRepositoryInstance::getInstanceName() const{ if(!isSet.instanceName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "InstanceName not set in Linux_DnsNotifyACLForService instance"); return m_instanceName; } void Linux_DnsNotifyACLForServiceRepositoryInstance::setInstanceName( const Linux_DnsNotifyACLForServiceInstanceName& val){ m_instanceName = val; isSet.instanceName=1; } //set isSet attributes to FALSE void Linux_DnsNotifyACLForServiceRepositoryInstance::init(){ isSet.instanceName=0; }; //copies another instance properties in this void Linux_DnsNotifyACLForServiceRepositoryInstance::init (const Linux_DnsNotifyACLForServiceRepositoryInstance& original){ init(); if(original.isInstanceNameSet()){ setInstanceName(original.getInstanceName()); } } //reset the instance data void Linux_DnsNotifyACLForServiceRepositoryInstance::reset(){ }; //********************************************************* //Linux_DnsNotifyACLForServiceRepositoryInstanceEnumerationElement //********************************************************* Linux_DnsNotifyACLForServiceRepositoryInstanceEnumerationElement:: Linux_DnsNotifyACLForServiceRepositoryInstanceEnumerationElement(){ m_elementP=0; m_nextP=0; }; Linux_DnsNotifyACLForServiceRepositoryInstanceEnumerationElement:: ~Linux_DnsNotifyACLForServiceRepositoryInstanceEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //Linux_DnsNotifyACLForServiceRepositoryInstanceNameEnumeration //********************************************************* Linux_DnsNotifyACLForServiceRepositoryInstanceEnumeration:: Linux_DnsNotifyACLForServiceRepositoryInstanceEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; Linux_DnsNotifyACLForServiceRepositoryInstanceEnumeration:: Linux_DnsNotifyACLForServiceRepositoryInstanceEnumeration( const Linux_DnsNotifyACLForServiceRepositoryInstanceEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; Linux_DnsNotifyACLForServiceRepositoryInstanceEnumeration:: ~Linux_DnsNotifyACLForServiceRepositoryInstanceEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void Linux_DnsNotifyACLForServiceRepositoryInstanceEnumeration::reset(){ currentElementP=firstElementP; }; bool Linux_DnsNotifyACLForServiceRepositoryInstanceEnumeration::hasNext() const{ return (currentElementP!=0); }; int Linux_DnsNotifyACLForServiceRepositoryInstanceEnumeration::getSize() const{ int size=0; Linux_DnsNotifyACLForServiceRepositoryInstanceEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const Linux_DnsNotifyACLForServiceRepositoryInstance& Linux_DnsNotifyACLForServiceRepositoryInstanceEnumeration::getElement(int pos) const{ Linux_DnsNotifyACLForServiceRepositoryInstanceEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const Linux_DnsNotifyACLForServiceRepositoryInstance& Linux_DnsNotifyACLForServiceRepositoryInstanceEnumeration::getNext() { Linux_DnsNotifyACLForServiceRepositoryInstanceEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void Linux_DnsNotifyACLForServiceRepositoryInstanceEnumeration::addElement (const Linux_DnsNotifyACLForServiceRepositoryInstance& elementP){ if(firstElementP==0){ firstElementP=new Linux_DnsNotifyACLForServiceRepositoryInstanceEnumerationElement(); firstElementP->m_elementP=new Linux_DnsNotifyACLForServiceRepositoryInstance(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new Linux_DnsNotifyACLForServiceRepositoryInstanceEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new Linux_DnsNotifyACLForServiceRepositoryInstance(elementP); } }; } --- NEW FILE: Linux_DnsNotifyACLForServiceManualInstance.h --- /** * Linux_DnsNotifyACLForServiceManualInstance.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_DnsNotifyACLForServiceManualInstance_h #define Linux_DnsNotifyACLForServiceManualInstance_h #include "cmpidt.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiBooleanData.h" #include "CmpiCharData.h" #include "CmpiDateTime.h" #include "Linux_DnsNotifyACLForServiceInstanceName.h" namespace genProvider { class Linux_DnsNotifyACLForServiceManualInstance { public: Linux_DnsNotifyACLForServiceManualInstance(); Linux_DnsNotifyACLForServiceManualInstance (const Linux_DnsNotifyACLForServiceManualInstance& original); Linux_DnsNotifyACLForServiceManualInstance (const CmpiInstance& inst, const char* instanceNamespace); ~Linux_DnsNotifyACLForServiceManualInstance(); Linux_DnsNotifyACLForServiceManualInstance& operator= (const Linux_DnsNotifyACLForServiceManualInstance& original); CmpiInstance getCmpiInstance(const char** properties=0) const; unsigned int isInstanceNameSet() const; void setInstanceName( const Linux_DnsNotifyACLForServiceInstanceName& val); const Linux_DnsNotifyACLForServiceInstanceName& getInstanceName() const; private: void init(); void init(const Linux_DnsNotifyACLForServiceManualInstance& original); void reset(); Linux_DnsNotifyACLForServiceInstanceName m_instanceName; struct isSetType{ unsigned int instanceName:1; } isSet; }; struct Linux_DnsNotifyACLForServiceManualInstanceEnumerationElement{ Linux_DnsNotifyACLForServiceManualInstance* m_elementP; Linux_DnsNotifyACLForServiceManualInstanceEnumerationElement* m_nextP; Linux_DnsNotifyACLForServiceManualInstanceEnumerationElement(); ~Linux_DnsNotifyACLForServiceManualInstanceEnumerationElement(); }; class Linux_DnsNotifyACLForServiceManualInstanceEnumeration { private: Linux_DnsNotifyACLForServiceManualInstanceEnumerationElement* firstElementP; Linux_DnsNotifyACLForServiceManualInstanceEnumerationElement* currentElementP; Linux_DnsNotifyACLForServiceManualInstanceEnumerationElement* endElementP; public: Linux_DnsNotifyACLForServiceManualInstanceEnumeration(); Linux_DnsNotifyACLForServiceManualInstanceEnumeration( const Linux_DnsNotifyACLForServiceManualInstanceEnumeration& original); ~Linux_DnsNotifyACLForServiceManualInstanceEnumeration(); void reset(); bool hasNext() const; const Linux_DnsNotifyACLForServiceManualInstance& getNext(); int getSize() const; const Linux_DnsNotifyACLForServiceManualInstance& getElement(int pos) const; void addElement(const Linux_DnsNotifyACLForServiceManualInstance& elementP); }; } #endif --- NEW FILE: Linux_DnsNotifyACLForServiceManualInstance.cpp --- /** * Linux_DnsNotifyACLForServiceManualInstance.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_DnsNotifyACLForServiceManualInstance.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //Linux_DnsNotifyACLForServiceManualInstance //********************************************************* //empty constructor Linux_DnsNotifyACLForServiceManualInstance:: Linux_DnsNotifyACLForServiceManualInstance(){ init(); }; //copy constructor Linux_DnsNotifyACLForServiceManualInstance:: Linux_DnsNotifyACLForServiceManualInstance (const Linux_DnsNotifyACLForServiceManualInstance& original){ init(original); }; //constructor using CmpiInstance Linux_DnsNotifyACLForServiceManualInstance:: Linux_DnsNotifyACLForServiceManualInstance (const CmpiInstance& inst, const char* instanceNamespace){ CmpiData cmpiData; init(); CmpiObjectPath cop=inst.getObjectPath(); cop.setNameSpace(instanceNamespace); setInstanceName(Linux_DnsNotifyACLForServiceInstanceName(cop)); } //Destructor Linux_DnsNotifyACLForServiceManualInstance:: ~Linux_DnsNotifyACLForServiceManualInstance(){ reset(); }; //copy operator Linux_DnsNotifyACLForServiceManualInstance& Linux_DnsNotifyACLForServiceManualInstance::operator= (const Linux_DnsNotifyACLForServiceManualInstance& original){ init(original); return *this; }; //converts to CmpiInstance CmpiInstance Linux_DnsNotifyACLForServiceManualInstance:: 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_DnsNotifyACLForServiceManualInstance:: isInstanceNameSet() const{ return isSet.instanceName; } const Linux_DnsNotifyACLForServiceInstanceName& Linux_DnsNotifyACLForServiceManualInstance::getInstanceName() const{ if(!isSet.instanceName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "InstanceName not set in Linux_DnsNotifyACLForService instance"); return m_instanceName; } void Linux_DnsNotifyACLForServiceManualInstance::setInstanceName( const Linux_DnsNotifyACLForServiceInstanceName& val){ m_instanceName = val; isSet.instanceName=1; } //set isSet attributes to FALSE void Linux_DnsNotifyACLForServiceManualInstance::init(){ isSet.instanceName=0; }; //copies another instance properties in this void Linux_DnsNotifyACLForServiceManualInstance::init (const Linux_DnsNotifyACLForServiceManualInstance& original){ init(); if(original.isInstanceNameSet()){ setInstanceName(original.getInstanceName()); } } //reset the instance data void Linux_DnsNotifyACLForServiceManualInstance::reset(){ }; //********************************************************* //Linux_DnsNotifyACLForServiceManualInstanceEnumerationElement //********************************************************* Linux_DnsNotifyACLForServiceManualInstanceEnumerationElement:: Linux_DnsNotifyACLForServiceManualInstanceEnumerationElement(){ m_elementP=0; m_nextP=0; }; Linux_DnsNotifyACLForServiceManualInstanceEnumerationElement:: ~Linux_DnsNotifyACLForServiceManualInstanceEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //Linux_DnsNotifyACLForServiceManualInstanceNameEnumeration //********************************************************* Linux_DnsNotifyACLForServiceManualInstanceEnumeration:: Linux_DnsNotifyACLForServiceManualInstanceEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; Linux_DnsNotifyACLForServiceManualInstanceEnumeration:: Linux_DnsNotifyACLForServiceManualInstanceEnumeration( const Linux_DnsNotifyACLForServiceManualInstanceEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; Linux_DnsNotifyACLForServiceManualInstanceEnumeration:: ~Linux_DnsNotifyACLForServiceManualInstanceEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void Linux_DnsNotifyACLForServiceManualInstanceEnumeration::reset(){ currentElementP=firstElementP; }; bool Linux_DnsNotifyACLForServiceManualInstanceEnumeration::hasNext() const{ return (currentElementP!=0); }; int Linux_DnsNotifyACLForServiceManualInstanceEnumeration::getSize() const{ int size=0; Linux_DnsNotifyACLForServiceManualInstanceEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const Linux_DnsNotifyACLForServiceManualInstance& Linux_DnsNotifyACLForServiceManualInstanceEnumeration::getElement(int pos) const{ Linux_DnsNotifyACLForServiceManualInstanceEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const Linux_DnsNotifyACLForServiceManualInstance& Linux_DnsNotifyACLForServiceManualInstanceEnumeration::getNext() { Linux_DnsNotifyACLForServiceManualInstanceEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void Linux_DnsNotifyACLForServiceManualInstanceEnumeration::addElement (const Linux_DnsNotifyACLForServiceManualInstance& elementP){ if(firstElementP==0){ firstElementP=new Linux_DnsNotifyACLForServiceManualInstanceEnumerationElement(); firstElementP->m_elementP=new Linux_DnsNotifyACLForServiceManualInstance(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new Linux_DnsNotifyACLForServiceManualInstanceEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new Linux_DnsNotifyACLForServiceManualInstance(elementP); } }; } --- NEW FILE: CmpiLinux_DnsNotifyACLForServiceProvider.h --- /** * CmpiLinux_DnsNotifyACLForServiceProvider.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_DnsNotifyACLForServiceProvider_h #define CmpiLinux_DnsNotifyACLForServiceProvider_h #include "CmpiInstanceMI.h" #include "CmpiMethodMI.h" #include "Linux_DnsNotifyACLForServiceFactory.h" #include "CmpiAssociationMI.h" namespace genProvider{ class CmpiLinux_DnsNotifyACLForServiceProvider : public CmpiInstanceMI, public CmpiMethodMI, public CmpiAssociationMI{ private: Linux_DnsNotifyACLForServiceInterface* interfaceP; const static char * shadowNameSpaceP; CmpiBroker cppBroker; void completeInstance ( const Linux_DnsNotifyACLForServiceInstanceName& intanceNameP, CmpiInstance& target, const CmpiContext& ctx); void copyShadowData ( const CmpiInstance* source, CmpiInstance* target); CmpiInstance* getShadowInstance ( const CmpiInstance& original, const Linux_DnsNotifyACLForServiceInstanceName& intanceName); void removeDanglingShadowInstances ( const Linux_DnsNotifyACLForServiceInstanceNameEnumeration& dinInsNames); public: CmpiLinux_DnsNotifyACLForServiceProvider ( const CmpiBroker &mbp, const CmpiContext& ctx); ~CmpiLinux_DnsNotifyACLForServiceProvider (); 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: CmpiLinux_DnsNotifyACLForServiceProvider.cpp --- /** * CmpiLinux_DnsNotifyACLForServiceProvider.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_DnsNotifyACLForServiceProvider.h" #include "ArrayConverter.h" #include "Linux_DnsNotifyACLForServiceManualInstance.h" #include "Linux_DnsNotifyACLForServiceRepositoryInstance.h" #include "Linux_DnsServiceInstance.h" #include "Linux_DnsAddressMatchListInstance.h" #include <iostream> #include <strings.h> using namespace std; namespace genProvider { CmpiLinux_DnsNotifyACLForServiceProvider:: CmpiLinux_DnsNotifyACLForServiceProvider ( const CmpiBroker &mbp, const CmpiContext& ctx): CmpiBaseMI(mbp, ctx), CmpiInstanceMI(mbp,ctx), CmpiMethodMI(mbp,ctx), CmpiAssociationMI(mbp,ctx), cppBroker(mbp) { interfaceP=Linux_DnsNotifyACLForServiceFactory::getImplementation(); cout<<"Provider was constructed"<<endl; }; const char * CmpiLinux_DnsNotifyACLForServiceProvider:: shadowNameSpaceP="IBMShadow/cimv2"; CmpiLinux_DnsNotifyACLForServiceProvider:: ~CmpiLinux_DnsNotifyACLForServiceProvider(){ delete interfaceP; }; int CmpiLinux_DnsNotifyACLForServiceProvider::isUnloadable() const{ return 0; } /* -----------------------------------------------------------------------*/ /* Adding shadow properties ... [truncated message content] |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:58:44
|
Update of /cvsroot/sblim/cmpi-dns/provider/CIM_CollectionOfMSEs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20455/provider/CIM_CollectionOfMSEs Added Files: CIM_CollectionOfMSEsInstance.h CIM_CollectionOfMSEsExternal.cpp CIM_CollectionOfMSEsInstance.cpp CIM_CollectionOfMSEsInstanceName.cpp CIM_CollectionOfMSEsExternal.h makefile CIM_CollectionOfMSEsInstanceName.h Log Message: WBEM-SMT DNS provider component. First initial upload. This module includes: - CIM model for DNS - CMPI provider for DNS - Resource Access layer for DNS --- NEW FILE: CIM_CollectionOfMSEsInstance.cpp --- /** * CIM_CollectionOfMSEsInstance.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 "CIM_CollectionOfMSEsInstance.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //CIM_CollectionOfMSEsInstance //********************************************************* //empty constructor CIM_CollectionOfMSEsInstance:: CIM_CollectionOfMSEsInstance(){ init(); }; //copy constructor CIM_CollectionOfMSEsInstance:: CIM_CollectionOfMSEsInstance (const CIM_CollectionOfMSEsInstance& original){ init(original); }; //constructor using CmpiInstance CIM_CollectionOfMSEsInstance:: CIM_CollectionOfMSEsInstance (const CmpiInstance& inst, const char* instanceNamespace){ CmpiData cmpiData; init(); CmpiObjectPath cop=inst.getObjectPath(); cop.setNameSpace(instanceNamespace); setInstanceName(CIM_CollectionOfMSEsInstanceName(cop)); cmpiData = inst.getProperty("Caption"); if(!cmpiData.isNullValue()){ CmpiString Caption = cmpiData; setCaption(Caption.charPtr()); } cmpiData = inst.getProperty("CollectionID"); if(!cmpiData.isNullValue()){ CmpiString CollectionID = cmpiData; setCollectionID(CollectionID.charPtr()); } cmpiData = inst.getProperty("Description"); if(!cmpiData.isNullValue()){ CmpiString Description = cmpiData; setDescription(Description.charPtr()); } cmpiData = inst.getProperty("ElementName"); if(!cmpiData.isNullValue()){ CmpiString ElementName = cmpiData; setElementName(ElementName.charPtr()); } } //Destructor CIM_CollectionOfMSEsInstance:: ~CIM_CollectionOfMSEsInstance(){ reset(); }; //copy operator CIM_CollectionOfMSEsInstance& CIM_CollectionOfMSEsInstance::operator= (const CIM_CollectionOfMSEsInstance& original){ init(original); return *this; }; //converts to CmpiInstance CmpiInstance CIM_CollectionOfMSEsInstance:: getCmpiInstance(const char** properties) const{ CmpiObjectPath objectPath=getInstanceName().getObjectPath(); CmpiInstance cmpiInstance(objectPath); getInstanceName().fillKeys(cmpiInstance); if (properties) { cmpiInstance.setPropertyFilter(properties,0); } if(isSet.Caption){ cmpiInstance.setProperty("Caption",CmpiData(m_Caption)); } if(isSet.CollectionID){ cmpiInstance.setProperty("CollectionID",CmpiData(m_CollectionID)); } if(isSet.Description){ cmpiInstance.setProperty("Description",CmpiData(m_Description)); } if(isSet.ElementName){ cmpiInstance.setProperty("ElementName",CmpiData(m_ElementName)); } return cmpiInstance; } //InstanceName related methods unsigned int CIM_CollectionOfMSEsInstance:: isInstanceNameSet() const{ return isSet.instanceName; } const CIM_CollectionOfMSEsInstanceName& CIM_CollectionOfMSEsInstance::getInstanceName() const{ if(!isSet.instanceName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "InstanceName not set in CIM_CollectionOfMSEs instance"); return m_instanceName; } void CIM_CollectionOfMSEsInstance::setInstanceName( const CIM_CollectionOfMSEsInstanceName& val){ m_instanceName = val; isSet.instanceName=1; } //Caption related methods unsigned int CIM_CollectionOfMSEsInstance::isCaptionSet() const{ return isSet.Caption; } void CIM_CollectionOfMSEsInstance:: setCaption(const char* val, int makeCopy){ if (isSet.Caption) { delete []m_Caption; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_Caption = tmpval; } else { m_Caption = val; } isSet.Caption=1; } const char* CIM_CollectionOfMSEsInstance:: getCaption() const{ if(!isSet.Caption) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Caption not set"); return m_Caption; } //CollectionID related methods unsigned int CIM_CollectionOfMSEsInstance::isCollectionIDSet() const{ return isSet.CollectionID; } void CIM_CollectionOfMSEsInstance:: setCollectionID(const char* val, int makeCopy){ if (isSet.CollectionID) { delete []m_CollectionID; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_CollectionID = tmpval; } else { m_CollectionID = val; } isSet.CollectionID=1; } const char* CIM_CollectionOfMSEsInstance:: getCollectionID() const{ if(!isSet.CollectionID) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "CollectionID not set"); return m_CollectionID; } //Description related methods unsigned int CIM_CollectionOfMSEsInstance::isDescriptionSet() const{ return isSet.Description; } void CIM_CollectionOfMSEsInstance:: setDescription(const char* val, int makeCopy){ if (isSet.Description) { delete []m_Description; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_Description = tmpval; } else { m_Description = val; } isSet.Description=1; } const char* CIM_CollectionOfMSEsInstance:: getDescription() const{ if(!isSet.Description) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Description not set"); return m_Description; } //ElementName related methods unsigned int CIM_CollectionOfMSEsInstance::isElementNameSet() const{ return isSet.ElementName; } void CIM_CollectionOfMSEsInstance:: setElementName(const char* val, int makeCopy){ if (isSet.ElementName) { delete []m_ElementName; } if (makeCopy&&val) { char* tmpval = new char[strlen(val)+1]; strcpy(tmpval,val); m_ElementName = tmpval; } else { m_ElementName = val; } isSet.ElementName=1; } const char* CIM_CollectionOfMSEsInstance:: getElementName() const{ if(!isSet.ElementName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "ElementName not set"); return m_ElementName; } //set isSet attributes to FALSE void CIM_CollectionOfMSEsInstance::init(){ isSet.instanceName=0; isSet.Caption=0; isSet.CollectionID=0; isSet.Description=0; isSet.ElementName=0; }; //copies another instance properties in this void CIM_CollectionOfMSEsInstance::init (const CIM_CollectionOfMSEsInstance& original){ init(); if(original.isInstanceNameSet()){ setInstanceName(original.getInstanceName()); } if(original.isCaptionSet()){ const char* CaptionOriginal=original.getCaption(); setCaption(CaptionOriginal, 1); } if(original.isCollectionIDSet()){ const char* CollectionIDOriginal=original.getCollectionID(); setCollectionID(CollectionIDOriginal, 1); } if(original.isDescriptionSet()){ const char* DescriptionOriginal=original.getDescription(); setDescription(DescriptionOriginal, 1); } if(original.isElementNameSet()){ const char* ElementNameOriginal=original.getElementName(); setElementName(ElementNameOriginal, 1); } } //reset the instance data void CIM_CollectionOfMSEsInstance::reset(){ if (isSet.Caption) delete(m_Caption); if (isSet.CollectionID) delete(m_CollectionID); if (isSet.Description) delete(m_Description); if (isSet.ElementName) delete(m_ElementName); }; //********************************************************* //CIM_CollectionOfMSEsInstanceEnumerationElement //********************************************************* CIM_CollectionOfMSEsInstanceEnumerationElement:: CIM_CollectionOfMSEsInstanceEnumerationElement(){ m_elementP=0; m_nextP=0; }; CIM_CollectionOfMSEsInstanceEnumerationElement:: ~CIM_CollectionOfMSEsInstanceEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //CIM_CollectionOfMSEsInstanceNameEnumeration //********************************************************* CIM_CollectionOfMSEsInstanceEnumeration:: CIM_CollectionOfMSEsInstanceEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; CIM_CollectionOfMSEsInstanceEnumeration:: CIM_CollectionOfMSEsInstanceEnumeration( const CIM_CollectionOfMSEsInstanceEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; CIM_CollectionOfMSEsInstanceEnumeration:: ~CIM_CollectionOfMSEsInstanceEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void CIM_CollectionOfMSEsInstanceEnumeration::reset(){ currentElementP=firstElementP; }; bool CIM_CollectionOfMSEsInstanceEnumeration::hasNext() const{ return (currentElementP!=0); }; int CIM_CollectionOfMSEsInstanceEnumeration::getSize() const{ int size=0; CIM_CollectionOfMSEsInstanceEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const CIM_CollectionOfMSEsInstance& CIM_CollectionOfMSEsInstanceEnumeration::getElement(int pos) const{ CIM_CollectionOfMSEsInstanceEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const CIM_CollectionOfMSEsInstance& CIM_CollectionOfMSEsInstanceEnumeration::getNext() { CIM_CollectionOfMSEsInstanceEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void CIM_CollectionOfMSEsInstanceEnumeration::addElement (const CIM_CollectionOfMSEsInstance& elementP){ if(firstElementP==0){ firstElementP=new CIM_CollectionOfMSEsInstanceEnumerationElement(); firstElementP->m_elementP=new CIM_CollectionOfMSEsInstance(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new CIM_CollectionOfMSEsInstanceEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new CIM_CollectionOfMSEsInstance(elementP); } }; } --- NEW FILE: CIM_CollectionOfMSEsInstanceName.cpp --- /** * CIM_CollectionOfMSEsInstanceName.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 "CIM_CollectionOfMSEsInstanceName.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //CIM_CollectionOfMSEsInstanceName //********************************************************* //empty constructor CIM_CollectionOfMSEsInstanceName:: CIM_CollectionOfMSEsInstanceName(){ init(); }; //copy constructor CIM_CollectionOfMSEsInstanceName:: CIM_CollectionOfMSEsInstanceName (const CIM_CollectionOfMSEsInstanceName& original){ init(original); }; //contructor using CmpiObjectPath CIM_CollectionOfMSEsInstanceName:: CIM_CollectionOfMSEsInstanceName (const CmpiObjectPath& path){ init(); m_CIMClassNameP=path.getClassName().charPtr(); CmpiString namespaceOP; namespaceOP=path.getNameSpace(); setNamespace(namespaceOP.charPtr(),1); } //destructor CIM_CollectionOfMSEsInstanceName:: ~CIM_CollectionOfMSEsInstanceName(){ reset(); }; //copy operator CIM_CollectionOfMSEsInstanceName& CIM_CollectionOfMSEsInstanceName::operator= (const CIM_CollectionOfMSEsInstanceName& original){ init(original); return *this; } //returns the related CmpiObjectPath CmpiObjectPath CIM_CollectionOfMSEsInstanceName:: getObjectPath() const{ CmpiObjectPath objectPath(m_namespace, m_CIMClassNameP); return objectPath; } //adds the related CmpiObjectPath to an existing cmpiInstance void CIM_CollectionOfMSEsInstanceName::fillKeys(CmpiInstance& cmpiInstance) const{ } //NameSpace related methods unsigned int CIM_CollectionOfMSEsInstanceName:: isNameSpaceSet() const{ return isSet.m_namespace; } const char * CIM_CollectionOfMSEsInstanceName:: getNamespace() const { if(!isSet.m_namespace) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "NameSpace not set in CIM_CollectionOfMSEs instanceName"); return m_namespace; } void CIM_CollectionOfMSEsInstanceName:: 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; } //set isSet variables to FALSE void CIM_CollectionOfMSEsInstanceName::init(){ m_CIMClassNameP="CIM_CollectionOfMSEs"; isSet.m_namespace=0; } //copies another instance properties in this void CIM_CollectionOfMSEsInstanceName::init (const CIM_CollectionOfMSEsInstanceName& original){ init(); m_CIMClassNameP=original.m_CIMClassNameP; if(original.isNameSpaceSet()){ setNamespace(original.getNamespace(),1); } } //reset the instanceName data void CIM_CollectionOfMSEsInstanceName::reset(){ if (isSet.m_namespace) delete(m_namespace); }; //********************************************************* //CIM_CollectionOfMSEsInstanceNameEnumerationElement //********************************************************* CIM_CollectionOfMSEsInstanceNameEnumerationElement:: CIM_CollectionOfMSEsInstanceNameEnumerationElement(){ m_elementP=0; m_nextP=0; }; CIM_CollectionOfMSEsInstanceNameEnumerationElement:: ~CIM_CollectionOfMSEsInstanceNameEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //CIM_CollectionOfMSEsInstanceNameEnumeration //********************************************************* CIM_CollectionOfMSEsInstanceNameEnumeration:: CIM_CollectionOfMSEsInstanceNameEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; CIM_CollectionOfMSEsInstanceNameEnumeration:: CIM_CollectionOfMSEsInstanceNameEnumeration(const CmpiArray& arr){ firstElementP=0; currentElementP=0; endElementP=0; int size = arr.size(); for (int i=0; i < size; i++) { addElement(CIM_CollectionOfMSEsInstanceName(arr[i])); } } CIM_CollectionOfMSEsInstanceNameEnumeration:: CIM_CollectionOfMSEsInstanceNameEnumeration( const CIM_CollectionOfMSEsInstanceNameEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; CIM_CollectionOfMSEsInstanceNameEnumeration:: ~CIM_CollectionOfMSEsInstanceNameEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void CIM_CollectionOfMSEsInstanceNameEnumeration::reset(){ currentElementP=firstElementP; }; bool CIM_CollectionOfMSEsInstanceNameEnumeration::hasNext() const{ return (currentElementP!=0); }; int CIM_CollectionOfMSEsInstanceNameEnumeration::getSize() const{ int size=0; CIM_CollectionOfMSEsInstanceNameEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const CIM_CollectionOfMSEsInstanceName& CIM_CollectionOfMSEsInstanceNameEnumeration::getElement(int pos) const{ CIM_CollectionOfMSEsInstanceNameEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const CIM_CollectionOfMSEsInstanceName& CIM_CollectionOfMSEsInstanceNameEnumeration::getNext() { CIM_CollectionOfMSEsInstanceNameEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void CIM_CollectionOfMSEsInstanceNameEnumeration::addElement (const CIM_CollectionOfMSEsInstanceName& elementP){ if(firstElementP==0){ firstElementP=new CIM_CollectionOfMSEsInstanceNameEnumerationElement(); firstElementP->m_elementP=new CIM_CollectionOfMSEsInstanceName(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new CIM_CollectionOfMSEsInstanceNameEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new CIM_CollectionOfMSEsInstanceName(elementP); } }; CIM_CollectionOfMSEsInstanceNameEnumeration::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: makefile --- include ../setting.cmpi CPPFLAGS=-I. -I$(CIMOMINC) -I$(COMMONINC) -I$(CIMOMINC)/cpp -D_COMPILE_UNIX -DCMPI_STANDALONE CXXFLAGS=-Wall -g -fPIC -fno-implicit-templates LDFLAGS=-L. -L$(COMMONLIB) -L$(COMMONLIB_OUT) -shared -lcmpiCppImpl -lIBM_ProviderTooling OBJECTS=CIM_CollectionOfMSEsInstanceName.o \ CIM_CollectionOfMSEsInstance.o \ CIM_CollectionOfMSEsExternal.o all: clean testfiles prelink install #------------------------------------------------------------------------------# compile: $(OBJECTS) prelink: libCIM_CollectionOfMSEsSupport.so libCIM_CollectionOfMSEsSupport.so: $(OBJECTS) $(LINK.cpp) -o $@ $^ link: #nothing to here #------------------------------------------------------------------------------# preinstall: prelink install libCIM_CollectionOfMSEsSupport.so $(COMMONLIB_OUT) #------------------------------------------------------------------------------# install: link install libCIM_CollectionOfMSEsSupport.so $(COMMONLIB_OUT) # install -m 644 CIM_CollectionOfMSEs*.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)/CIM_CollectionOfMSEs*.h \ $(RM) $(COMMONLIB)/libCIM_CollectionOfMSEsSupport.so --- NEW FILE: CIM_CollectionOfMSEsExternal.h --- /** * CIM_CollectionOfMSEsExternal.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 CIM_CollectionOfMSEsExternal_h #define CIM_CollectionOfMSEsExternal_h #include "CIM_CollectionOfMSEsInstance.h" #include "CmpiBroker.h" namespace genProvider { class CIM_CollectionOfMSEsExternal { public: CIM_CollectionOfMSEsExternal( const CmpiBroker& brkr, const CmpiContext& ctx); virtual ~CIM_CollectionOfMSEsExternal(); virtual void enumInstanceNames( const char *nsp, CIM_CollectionOfMSEsInstanceNameEnumeration&); virtual void enumInstances( const char *nsp, const char* *properties, CIM_CollectionOfMSEsInstanceEnumeration&); virtual CIM_CollectionOfMSEsInstance getInstance( const char* *properties, const CIM_CollectionOfMSEsInstanceName&); virtual void setInstance( const char* *properties, const CIM_CollectionOfMSEsInstance&); virtual void createInstance( const CIM_CollectionOfMSEsInstance&); virtual void deleteInstance( const CIM_CollectionOfMSEsInstanceName&); private: CmpiBroker broker; CmpiContext context; }; } #endif --- NEW FILE: CIM_CollectionOfMSEsInstanceName.h --- /** * CIM_CollectionOfMSEsInstanceName.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 CIM_CollectionOfMSEsInstanceName_h #define CIM_CollectionOfMSEsInstanceName_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" namespace genProvider { class CIM_CollectionOfMSEsInstanceName { public: CIM_CollectionOfMSEsInstanceName(); CIM_CollectionOfMSEsInstanceName (const CIM_CollectionOfMSEsInstanceName& original); CIM_CollectionOfMSEsInstanceName (const CmpiObjectPath& path); ~CIM_CollectionOfMSEsInstanceName(); CIM_CollectionOfMSEsInstanceName& operator= (const CIM_CollectionOfMSEsInstanceName& 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; private: void init(); void init(const CIM_CollectionOfMSEsInstanceName& original); void reset(); const char* m_CIMClassNameP; const char* m_namespace; struct isSetType{ unsigned int m_namespace:1; } isSet; }; struct CIM_CollectionOfMSEsInstanceNameEnumerationElement{ CIM_CollectionOfMSEsInstanceName* m_elementP; CIM_CollectionOfMSEsInstanceNameEnumerationElement* m_nextP; CIM_CollectionOfMSEsInstanceNameEnumerationElement(); ~CIM_CollectionOfMSEsInstanceNameEnumerationElement(); }; class CIM_CollectionOfMSEsInstanceNameEnumeration { private: CIM_CollectionOfMSEsInstanceNameEnumerationElement* firstElementP; CIM_CollectionOfMSEsInstanceNameEnumerationElement* currentElementP; CIM_CollectionOfMSEsInstanceNameEnumerationElement* endElementP; public: CIM_CollectionOfMSEsInstanceNameEnumeration(); CIM_CollectionOfMSEsInstanceNameEnumeration(const CmpiArray& arr); CIM_CollectionOfMSEsInstanceNameEnumeration( const CIM_CollectionOfMSEsInstanceNameEnumeration& original); ~CIM_CollectionOfMSEsInstanceNameEnumeration(); void reset(); bool hasNext() const; const CIM_CollectionOfMSEsInstanceName& getNext(); int getSize() const; const CIM_CollectionOfMSEsInstanceName& getElement(int pos) const; //no copy of the element is done void addElement(const CIM_CollectionOfMSEsInstanceName& elementP); operator CmpiArray() const; }; } #endif --- NEW FILE: CIM_CollectionOfMSEsInstance.h --- /** * CIM_CollectionOfMSEsInstance.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 CIM_CollectionOfMSEsInstance_h #define CIM_CollectionOfMSEsInstance_h #include "cmpidt.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiBooleanData.h" #include "CmpiCharData.h" #include "CmpiDateTime.h" #include "CIM_CollectionOfMSEsInstanceName.h" namespace genProvider { class CIM_CollectionOfMSEsInstance { public: CIM_CollectionOfMSEsInstance(); CIM_CollectionOfMSEsInstance (const CIM_CollectionOfMSEsInstance& original); CIM_CollectionOfMSEsInstance (const CmpiInstance& inst, const char* instanceNamespace); ~CIM_CollectionOfMSEsInstance(); CIM_CollectionOfMSEsInstance& operator= (const CIM_CollectionOfMSEsInstance& original); CmpiInstance getCmpiInstance(const char** properties=0) const; unsigned int isInstanceNameSet() const; void setInstanceName( const CIM_CollectionOfMSEsInstanceName& val); const CIM_CollectionOfMSEsInstanceName& getInstanceName() const; unsigned int isCaptionSet() const; void setCaption(const char* val, int makeCopy = 1); const char* getCaption() const; unsigned int isCollectionIDSet() const; void setCollectionID(const char* val, int makeCopy = 1); const char* getCollectionID() const; unsigned int isDescriptionSet() const; void setDescription(const char* val, int makeCopy = 1); const char* getDescription() const; unsigned int isElementNameSet() const; void setElementName(const char* val, int makeCopy = 1); const char* getElementName() const; private: void init(); void init(const CIM_CollectionOfMSEsInstance& original); void reset(); CIM_CollectionOfMSEsInstanceName m_instanceName; const char* m_Caption; const char* m_CollectionID; const char* m_Description; const char* m_ElementName; struct isSetType{ unsigned int instanceName:1; unsigned int Caption:1; unsigned int CollectionID:1; unsigned int Description:1; unsigned int ElementName:1; } isSet; }; struct CIM_CollectionOfMSEsInstanceEnumerationElement{ CIM_CollectionOfMSEsInstance* m_elementP; CIM_CollectionOfMSEsInstanceEnumerationElement* m_nextP; CIM_CollectionOfMSEsInstanceEnumerationElement(); ~CIM_CollectionOfMSEsInstanceEnumerationElement(); }; class CIM_CollectionOfMSEsInstanceEnumeration { private: CIM_CollectionOfMSEsInstanceEnumerationElement* firstElementP; CIM_CollectionOfMSEsInstanceEnumerationElement* currentElementP; CIM_CollectionOfMSEsInstanceEnumerationElement* endElementP; public: CIM_CollectionOfMSEsInstanceEnumeration(); CIM_CollectionOfMSEsInstanceEnumeration( const CIM_CollectionOfMSEsInstanceEnumeration& original); ~CIM_CollectionOfMSEsInstanceEnumeration(); void reset(); bool hasNext() const; const CIM_CollectionOfMSEsInstance& getNext(); int getSize() const; const CIM_CollectionOfMSEsInstance& getElement(int pos) const; void addElement(const CIM_CollectionOfMSEsInstance& elementP); }; } #endif --- NEW FILE: CIM_CollectionOfMSEsExternal.cpp --- /** * CIM_CollectionOfMSEsExternal.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 "CIM_CollectionOfMSEsExternal.h" namespace genProvider{ CIM_CollectionOfMSEsExternal::CIM_CollectionOfMSEsExternal( const CmpiBroker& brkr, const CmpiContext& ctx ) : broker(brkr), context(ctx) {}; CIM_CollectionOfMSEsExternal:: ~CIM_CollectionOfMSEsExternal(){}; void CIM_CollectionOfMSEsExternal::enumInstanceNames( const char *nsp, CIM_CollectionOfMSEsInstanceNameEnumeration& instnames) { CmpiObjectPath op(nsp,"CIM_CollectionOfMSEs"); CmpiEnumeration en=broker.enumInstanceNames(context,op); while(en.hasNext()) { CmpiObjectPath opi = en.getNext(); CIM_CollectionOfMSEsInstanceName iname(opi); instnames.addElement(iname); } }; void CIM_CollectionOfMSEsExternal::enumInstances( const char *nsp, const char* *properties, CIM_CollectionOfMSEsInstanceEnumeration& instances) { CmpiObjectPath op(nsp,"CIM_CollectionOfMSEs"); CmpiEnumeration en=broker.enumInstances(context,op,properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); CIM_CollectionOfMSEsInstance instance(inst,nsp); instances.addElement(instance); } }; CIM_CollectionOfMSEsInstance CIM_CollectionOfMSEsExternal::getInstance( const char* *properties, const CIM_CollectionOfMSEsInstanceName& instanceName) { CmpiObjectPath op=instanceName.getObjectPath(); CmpiInstance inst=broker.getInstance(context,op,properties); return CIM_CollectionOfMSEsInstance(inst,instanceName.getNamespace()); } void CIM_CollectionOfMSEsExternal::setInstance( const char* *properties, const CIM_CollectionOfMSEsInstance& instance){ CmpiObjectPath op=instance.getInstanceName().getObjectPath(); CmpiInstance inst=instance.getCmpiInstance(); broker.setInstance(context,op,inst,properties); } void CIM_CollectionOfMSEsExternal::createInstance( const CIM_CollectionOfMSEsInstance& instance){ CmpiObjectPath op=instance.getInstanceName().getObjectPath(); CmpiInstance inst=instance.getCmpiInstance(); broker.createInstance(context,op,inst); } void CIM_CollectionOfMSEsExternal::deleteInstance( const CIM_CollectionOfMSEsInstanceName& instanceName){ CmpiObjectPath op=instanceName.getObjectPath(); broker.deleteInstance(context,op); } } |
Update of /cvsroot/sblim/cmpi-dns/provider/Linux_DnsAddressMatchListOfService In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20455/provider/Linux_DnsAddressMatchListOfService Added Files: makefile Linux_DnsAddressMatchListOfServiceDefaultImplementation.h Linux_DnsAddressMatchListOfServiceInterface.h setting.provider Linux_DnsAddressMatchListOfServiceInstanceName.h Linux_DnsAddressMatchListOfServiceResourceAccess.cpp Linux_DnsAddressMatchListOfServiceRepositoryInstance.cpp Linux_DnsAddressMatchListOfServiceRepositoryExternal.cpp Linux_DnsAddressMatchListOfServiceInstance.h Linux_DnsAddressMatchListOfServiceDefaultImplementation.cpp Linux_DnsAddressMatchListOfServiceResourceAccess.h Linux_DnsAddressMatchListOfServiceFakeFactory.cpp Linux_DnsAddressMatchListOfServiceManualInstance.h Linux_DnsAddressMatchListOfServiceInstance.cpp Linux_DnsAddressMatchListOfServiceExternal.h Linux_DnsAddressMatchListOfServiceRepositoryExternal.h Linux_DnsAddressMatchListOfServiceFactory.h Linux_DnsAddressMatchListOfServiceRepositoryInstance.h Linux_DnsAddressMatchListOfServiceExternal.cpp CmpiLinux_DnsAddressMatchListOfServiceProvider.h Linux_DnsAddressMatchListOfServiceFactory.cpp Linux_DnsAddressMatchListOfServiceManualInstance.cpp Linux_DnsAddressMatchListOfServiceInstanceName.cpp CmpiLinux_DnsAddressMatchListOfServiceProvider.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_DnsAddressMatchListOfServiceDefaultImplementation.h --- /** * Linux_DnsAddressMatchListOfServiceDefaultImplementation.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_DnsAddressMatchListOfServiceDefaultImplementation_h #define Linux_DnsAddressMatchListOfServiceDefaultImplementation_h #include "Linux_DnsAddressMatchListOfServiceInstanceName.h" #include "Linux_DnsAddressMatchListOfServiceManualInstance.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiDateTime.h" #include "CmpiBroker.h" #include "Linux_DnsServiceInstance.h" #include "Linux_DnsAddressMatchListInstance.h" #include "Linux_DnsServiceExternal.h" #include "Linux_DnsAddressMatchListExternal.h" #include "Linux_DnsAddressMatchListOfServiceInterface.h" namespace genProvider { class Linux_DnsAddressMatchListOfServiceDefaultImplementation: public Linux_DnsAddressMatchListOfServiceInterface { public: virtual ~Linux_DnsAddressMatchListOfServiceDefaultImplementation() { }; /* intrinsic methods */ virtual void enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsAddressMatchListOfServiceInstanceNameEnumeration& instnames); virtual void enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsAddressMatchListOfServiceManualInstanceEnumeration& instances); virtual Linux_DnsAddressMatchListOfServiceManualInstance getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsAddressMatchListOfServiceInstanceName&); virtual void setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsAddressMatchListOfServiceManualInstance&); virtual void createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsAddressMatchListOfServiceManualInstance&); virtual void deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsAddressMatchListOfServiceInstanceName&); /* Association Interface */ virtual void referencesAntecedent( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsAddressMatchListOfServiceManualInstanceEnumeration& instances); virtual void referencesDependent( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsAddressMatchListOfServiceManualInstanceEnumeration& instances); virtual void associatorsAntecedent( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsServiceInstanceEnumeration& instances); virtual void associatorsDependent( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceEnumeration& instances); /* extrinsic methods */ }; } #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_DnsAddressMatchListOfServiceInstanceName.o \ Linux_DnsAddressMatchListOfServiceInstance.o \ Linux_DnsAddressMatchListOfServiceExternal.o \ Linux_DnsAddressMatchListOfServiceRepositoryInstance.o \ Linux_DnsAddressMatchListOfServiceRepositoryExternal.o \ Linux_DnsAddressMatchListOfServiceManualInstance.o \ Linux_DnsAddressMatchListOfServiceDefaultImplementation.o FAKEFACTORY= Linux_DnsAddressMatchListOfServiceFakeFactory.o NORMALFACTORY= Linux_DnsAddressMatchListOfServiceFactory.o RESOURCEOBJECT= Linux_DnsAddressMatchListOfServiceResourceAccess.o PROVIDEROBJECT=CmpiLinux_DnsAddressMatchListOfServiceProvider.o all: testfiles preinstall install buildall: clean all #------------------------------------------------------------------------------# compile: $(OBJECTS) $(FAKEFACTORY) $(NORMALFACTORY) $(RESOURCEOBJECT) $(PROVIDEROBJECT) #------------------------------------------------------------------------------# prelink: $(OBJECTS) $(FAKEFACTORY) $(LINK.cpp) -o libLinux_DnsAddressMatchListOfServiceSupport.so $^ link: deleteFakeLib \ libLinux_DnsAddressMatchListOfServiceSupport.so \ libLinux_DnsAddressMatchListOfService.so libLinux_DnsAddressMatchListOfServiceSupport.so: LDFLAGS+=$(LDFLAGS.provider) libLinux_DnsAddressMatchListOfServiceSupport.so: $(OBJECTS) $(NORMALFACTORY) $(RESOURCEOBJECT) $(PROVIDEROBJECT) $(LINK.cpp) -o $@ $^ libLinux_DnsAddressMatchListOfService.so: LDFLAGS+=-lLinux_DnsAddressMatchListOfServiceSupport libLinux_DnsAddressMatchListOfService.so: $(PROVIDEROBJECT) $(LINK.cpp) -o $@ $^ deleteFakeLib: $(RM) *.so #------------------------------------------------------------------------------# preinstall: prelink install libLinux_DnsAddressMatchListOfServiceSupport.so $(COMMONLIB_OUT) #------------------------------------------------------------------------------# install: link install libLinux_DnsAddressMatchListOfServiceSupport.so $(COMMONLIB_OUT) install libLinux_DnsAddressMatchListOfService.so $(CIMOMLIB_OUT) # install -m 644 Linux_DnsAddressMatchListOfService*.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_DnsAddressMatchListOfService*.h \ $(RM) $(COMMONLIB)/libLinux_DnsAddressMatchListOfServiceSupport.so \ $(RM) $(CIMOMLIB)/libLinux_DnsAddressMatchListOfService.so --- NEW FILE: Linux_DnsAddressMatchListOfServiceInstanceName.h --- /** * Linux_DnsAddressMatchListOfServiceInstanceName.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_DnsAddressMatchListOfServiceInstanceName_h #define Linux_DnsAddressMatchListOfServiceInstanceName_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_DnsAddressMatchListOfServiceInstanceName { public: Linux_DnsAddressMatchListOfServiceInstanceName(); Linux_DnsAddressMatchListOfServiceInstanceName (const Linux_DnsAddressMatchListOfServiceInstanceName& original); Linux_DnsAddressMatchListOfServiceInstanceName (const CmpiObjectPath& path); ~Linux_DnsAddressMatchListOfServiceInstanceName(); Linux_DnsAddressMatchListOfServiceInstanceName& operator= (const Linux_DnsAddressMatchListOfServiceInstanceName& 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 isAntecedentSet() const; void setAntecedent(const Linux_DnsServiceInstanceName& val); const Linux_DnsServiceInstanceName& getAntecedent() const; unsigned int isDependentSet() const; void setDependent(const Linux_DnsAddressMatchListInstanceName& val); const Linux_DnsAddressMatchListInstanceName& getDependent() const; private: void init(); void init(const Linux_DnsAddressMatchListOfServiceInstanceName& original); void reset(); const char* m_CIMClassNameP; const char* m_namespace; Linux_DnsServiceInstanceName m_Antecedent; Linux_DnsAddressMatchListInstanceName m_Dependent; struct isSetType{ unsigned int m_namespace:1; unsigned int Antecedent:1; unsigned int Dependent:1; } isSet; }; struct Linux_DnsAddressMatchListOfServiceInstanceNameEnumerationElement{ Linux_DnsAddressMatchListOfServiceInstanceName* m_elementP; Linux_DnsAddressMatchListOfServiceInstanceNameEnumerationElement* m_nextP; Linux_DnsAddressMatchListOfServiceInstanceNameEnumerationElement(); ~Linux_DnsAddressMatchListOfServiceInstanceNameEnumerationElement(); }; class Linux_DnsAddressMatchListOfServiceInstanceNameEnumeration { private: Linux_DnsAddressMatchListOfServiceInstanceNameEnumerationElement* firstElementP; Linux_DnsAddressMatchListOfServiceInstanceNameEnumerationElement* currentElementP; Linux_DnsAddressMatchListOfServiceInstanceNameEnumerationElement* endElementP; public: Linux_DnsAddressMatchListOfServiceInstanceNameEnumeration(); Linux_DnsAddressMatchListOfServiceInstanceNameEnumeration(const CmpiArray& arr); Linux_DnsAddressMatchListOfServiceInstanceNameEnumeration( const Linux_DnsAddressMatchListOfServiceInstanceNameEnumeration& original); ~Linux_DnsAddressMatchListOfServiceInstanceNameEnumeration(); void reset(); bool hasNext() const; const Linux_DnsAddressMatchListOfServiceInstanceName& getNext(); int getSize() const; const Linux_DnsAddressMatchListOfServiceInstanceName& getElement(int pos) const; //no copy of the element is done void addElement(const Linux_DnsAddressMatchListOfServiceInstanceName& elementP); operator CmpiArray() const; }; } #endif --- NEW FILE: CmpiLinux_DnsAddressMatchListOfServiceProvider.cpp --- /** * CmpiLinux_DnsAddressMatchListOfServiceProvider.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_DnsAddressMatchListOfServiceProvider.h" #include "ArrayConverter.h" #include "Linux_DnsAddressMatchListOfServiceManualInstance.h" #include "Linux_DnsAddressMatchListOfServiceRepositoryInstance.h" #include "Linux_DnsServiceInstance.h" #include "Linux_DnsAddressMatchListInstance.h" #include <iostream> #include <strings.h> using namespace std; namespace genProvider { CmpiLinux_DnsAddressMatchListOfServiceProvider:: CmpiLinux_DnsAddressMatchListOfServiceProvider ( const CmpiBroker &mbp, const CmpiContext& ctx): CmpiBaseMI(mbp, ctx), CmpiInstanceMI(mbp,ctx), CmpiMethodMI(mbp,ctx), CmpiAssociationMI(mbp,ctx), cppBroker(mbp) { interfaceP=Linux_DnsAddressMatchListOfServiceFactory::getImplementation(); cout<<"Provider was constructed"<<endl; }; const char * CmpiLinux_DnsAddressMatchListOfServiceProvider:: shadowNameSpaceP="IBMShadow/cimv2"; CmpiLinux_DnsAddressMatchListOfServiceProvider:: ~CmpiLinux_DnsAddressMatchListOfServiceProvider(){ delete interfaceP; }; int CmpiLinux_DnsAddressMatchListOfServiceProvider::isUnloadable() const{ return 0; } /* -----------------------------------------------------------------------*/ /* Adding shadow properties */ /* -----------------------------------------------------------------------*/ void CmpiLinux_DnsAddressMatchListOfServiceProvider::completeInstance( const Linux_DnsAddressMatchListOfServiceInstanceName& instanceName, CmpiInstance& target, const CmpiContext& ctx){ Linux_DnsAddressMatchListOfServiceInstanceName 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_DnsAddressMatchListOfServiceProvider::copyShadowData ( const CmpiInstance* source, CmpiInstance* target){ }; /* -----------------------------------------------------------------------*/ /* Extracting shadow instance */ /* -----------------------------------------------------------------------*/ CmpiInstance* CmpiLinux_DnsAddressMatchListOfServiceProvider:: getShadowInstance (const CmpiInstance& original, const Linux_DnsAddressMatchListOfServiceInstanceName& instanceName){ Linux_DnsAddressMatchListOfServiceInstanceName 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_DnsAddressMatchListOfServiceProvider::removeDanglingShadowInstances ( const Linux_DnsAddressMatchListOfServiceInstanceNameEnumeration& dinInsNames){ //TODO: enumerate shadow instance names and remove those not included // in dinInsNames }; /* -----------------------------------------------------------------------*/ /* Provider Factory */ /* -----------------------------------------------------------------------*/ CMProviderBase(CmpiLinux_DnsAddressMatchListOfServiceProvider); CMInstanceMIFactory( CmpiLinux_DnsAddressMatchListOfServiceProvider, CmpiLinux_DnsAddressMatchListOfServiceProvider); CMMethodMIFactory( CmpiLinux_DnsAddressMatchListOfServiceProvider, CmpiLinux_DnsAddressMatchListOfServiceProvider); CMAssociationMIFactory( CmpiLinux_DnsAddressMatchListOfServiceProvider, CmpiLinux_DnsAddressMatchListOfServiceProvider); /* -----------------------------------------------------------------------*/ /* Instance Provider Interface */ /* -----------------------------------------------------------------------*/ //enumInstanceNames CmpiStatus CmpiLinux_DnsAddressMatchListOfServiceProvider::enumInstanceNames ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop){ cout<<"enumerating instanceNames"<<endl; CmpiString nameSpace=cop.getNameSpace(); const char* nameSpaceP=nameSpace.charPtr(); Linux_DnsAddressMatchListOfServiceInstanceNameEnumeration enumeration; interfaceP->enumInstanceNames(ctx, cppBroker, nameSpaceP, enumeration); while ( enumeration.hasNext() ){ const Linux_DnsAddressMatchListOfServiceInstanceName& 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_DnsAddressMatchListOfServiceProvider::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_DnsAddressMatchListOfServiceManualInstanceEnumeration enumeration; interfaceP->enumInstances(ctx, cppBroker, nameSpaceP, properties, enumeration); cout<<"enumerated"<<endl; while ( enumeration.hasNext() ){ const Linux_DnsAddressMatchListOfServiceManualInstance& instance= enumeration.getNext(); cout<<"enumerating getNext"<<endl; CmpiInstance cmpiInstance=instance.getCmpiInstance(properties); cout<<"transformed"<<endl; //add the static data completeInstance(instance.getInstanceName(),cmpiInstance,ctx); rslt.returnData(cmpiInstance); } rslt.returnDone(); return CmpiStatus(CMPI_RC_OK); }; //getInstance CmpiStatus CmpiLinux_DnsAddressMatchListOfServiceProvider::getInstance ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop, const char* *properties){ //covert to instanceName Linux_DnsAddressMatchListOfServiceInstanceName instanceName(cop); //get instance for instanceName Linux_DnsAddressMatchListOfServiceManualInstance instance; instance=interfaceP->getInstance(ctx, cppBroker, properties, instanceName); //we convert the instance in a cmpiInstance CmpiInstance cmpiInstance=instance.getCmpiInstance(properties); //add the static data completeInstance(instance.getInstanceName(), cmpiInstance, ctx); rslt.returnData(cmpiInstance); rslt.returnDone(); return CmpiStatus(CMPI_RC_OK); }; CmpiStatus CmpiLinux_DnsAddressMatchListOfServiceProvider::createInstance ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop,const CmpiInstance& inst){ Linux_DnsAddressMatchListOfServiceManualInstance instance ( inst,cop.getNameSpace().charPtr()); //REPOSITORY DATA CmpiInstance* backupShadowInstance=0; CmpiInstance shadowInstance= Linux_DnsAddressMatchListOfServiceRepositoryInstance(inst,shadowNameSpaceP) .getCmpiInstance(0); //We keep a backup of the existing data for recovering previous //state if the resource access raise an exception CmpiObjectPath shadowOp=shadowInstance.getObjectPath(); try{ backupShadowInstance=new CmpiInstance( cppBroker.getInstance (ctx, shadowOp,0)); //if the shadow instance exist we delete it cppBroker.deleteInstance(ctx, shadowOp); }catch(CmpiStatus& rc){}; cppBroker.createInstance(ctx, shadowOp,shadowInstance); //RESOURCE ACCESS DATA try{ interfaceP->createInstance(ctx, cppBroker, instance); }catch(CmpiStatus& rc){ //If something went wrong we recover the previous state cppBroker.deleteInstance(ctx, shadowOp); if(backupShadowInstance){ cppBroker.createInstance(ctx, shadowOp,*backupShadowInstance); } throw rc; } if(backupShadowInstance) delete(backupShadowInstance); rslt.returnDone(); return CmpiStatus(CMPI_RC_OK); }; CmpiStatus CmpiLinux_DnsAddressMatchListOfServiceProvider::setInstance ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop, const CmpiInstance& inst, const char* *properties){ Linux_DnsAddressMatchListOfServiceManualInstance instance ( inst,cop.getNameSpace().charPtr()); //REPOSITORY DATA CmpiInstance* backupShadowInstance=0; CmpiInstance shadowInstance= Linux_DnsAddressMatchListOfServiceRepositoryInstance(inst,shadowNameSpaceP) .getCmpiInstance(0); //We keep a backup of the existing data for recovering previous //state if the resource access raise an exception CmpiObjectPath shadowOp=shadowInstance.getObjectPath(); try{ backupShadowInstance=new CmpiInstance( cppBroker.getInstance (ctx, shadowOp,0)); }catch(CmpiStatus& rc){ throw rc; }; //if the instance existed before we delete it //(setInstance is buggy in Pegasus) if(backupShadowInstance) cppBroker.setInstance(ctx, shadowOp,shadowInstance,properties); else cppBroker.createInstance(ctx, shadowOp,shadowInstance); //RESOURCE ACCESS DATA try{ interfaceP->setInstance(ctx, cppBroker, properties, instance); }catch(CmpiStatus& rc){ //If something went wrong we recover the previous state cppBroker.deleteInstance(ctx, shadowOp); if(backupShadowInstance){ cppBroker.createInstance(ctx, shadowOp,*backupShadowInstance); } throw rc; }; if(backupShadowInstance) delete(backupShadowInstance); rslt.returnDone(); return CmpiStatus(CMPI_RC_OK); }; CmpiStatus CmpiLinux_DnsAddressMatchListOfServiceProvider::deleteInstance ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop){ Linux_DnsAddressMatchListOfServiceInstanceName instanceName= Linux_DnsAddressMatchListOfServiceInstanceName(cop); interfaceP->deleteInstance(ctx, cppBroker, instanceName); instanceName.setNamespace(shadowNameSpaceP); CmpiObjectPath op=instanceName.getObjectPath(); try{ //The instance could not have static data cppBroker.deleteInstance(ctx, op); }catch(CmpiStatus& rc){}; rslt.returnDone(); return CmpiStatus(CMPI_RC_OK); }; CmpiStatus CmpiLinux_DnsAddressMatchListOfServiceProvider::invokeMethod ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& ref, const char* methodName, const CmpiArgs& in, CmpiArgs& out){ Linux_DnsAddressMatchListOfServiceInstanceName instanceName= Linux_DnsAddressMatchListOfServiceInstanceName(ref); { rslt.returnDone(); return CmpiErrorFormater::getErrorException( CmpiErrorFormater::METHOD_NOT_FOUND, "Method not available"); } rslt.returnDone(); return CmpiStatus(CMPI_RC_OK); }; /* -----------------------------------------------------------------------*/ /* Association Logic */ /* -----------------------------------------------------------------------*/ CmpiStatus CmpiLinux_DnsAddressMatchListOfServiceProvider::associationLogic( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop, const int instances, const int references, const char** properties) { /* TODO : check if source instance cop exists */ const char * nsp = cop.getNameSpace().charPtr(); if( references == 0 && instances == 1 ) { /* associators() */ if(cop.classPathIsA("Linux_DnsService")) { Linux_DnsAddressMatchListInstanceEnumeration enumeration; Linux_DnsServiceInstanceName Antecedent(cop); interfaceP->associatorsDependent( ctx, cppBroker, nsp, properties, Antecedent, enumeration); while(enumeration.hasNext()) { const Linux_DnsAddressMatchListInstance instance = enumeration.getNext(); CmpiInstance cmpiInstance = instance.getCmpiInstance(properties); rslt.returnData(cmpiInstance); } } else if(cop.classPathIsA("Linux_DnsAddressMatchList")) { Linux_DnsServiceInstanceEnumeration enumeration; Linux_DnsAddressMatchListInstanceName Dependent(cop); interfaceP->associatorsAntecedent( ctx, cppBroker, nsp, properties, Dependent, enumeration); while(enumeration.hasNext()) { const Linux_DnsServiceInstance instance = enumeration.getNext(); CmpiInstance cmpiInstance = instance.getCmpiInstance(properties); rslt.returnData(cmpiInstance); } } } /* end of associators() */ else { /* associatorNames() || references() || referenceNames() */ Linux_DnsAddressMatchListOfServiceManualInstanceEnumeration enumeration; if(cop.classPathIsA("Linux_DnsService")) { Linux_DnsServiceInstanceName Antecedent(cop); interfaceP->referencesDependent( ctx, cppBroker, nsp, properties, Antecedent, enumeration); } if(cop.classPathIsA("Linux_DnsAddressMatchList")) { Linux_DnsAddressMatchListInstanceName Dependent(cop); interfaceP->referencesAntecedent( ctx, cppBroker, nsp, properties, Dependent, enumeration); } while(enumeration.hasNext()) { const Linux_DnsAddressMatchListOfServiceManualInstance manualInstance = enumeration.getNext(); const Linux_DnsAddressMatchListOfServiceInstanceName instanceName = manualInstance.getInstanceName(); if( references == 1 ) { /* referenceNames() : references == 1 && instances == 0 */ if(instances == 0 ) { CmpiObjectPath cmpiObjectPath = instanceName.getObjectPath(); rslt.returnData(cmpiObjectPath); } /* references() : references == 1 && instances == 1 */ else { CmpiInstance cmpiInstance = manualInstance.getCmpiInstance(properties); /* todo: complete the Instance */ rslt.returnData(cmpiInstance); } } /* associatorNames() : references == 0 && instances == 0 */ else { if(cop.classPathIsA("Linux_DnsService")) { const Linux_DnsAddressMatchListInstanceName Dependent = instanceName.getDependent(); CmpiObjectPath cmpiObjectPath = Dependent.getObjectPath(); rslt.returnData(cmpiObjectPath); } if(cop.classPathIsA("Linux_DnsAddressMatchList")) { const Linux_DnsServiceInstanceName Antecedent = instanceName.getAntecedent(); CmpiObjectPath cmpiObjectPath = Antecedent.getObjectPath(); rslt.returnData(cmpiObjectPath); } } } } /* end of associatorNames() || references() || referenceNames() */ rslt.returnDone(); return CmpiStatus(CMPI_RC_OK); }; /* -----------------------------------------------------------------------*/ /* Association Provider Interface */ /* -----------------------------------------------------------------------*/ CmpiStatus CmpiLinux_DnsAddressMatchListOfServiceProvider::associators ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop, const char * assocClass, const char * resultClass, const char * role, const char * resultRole, const char** properties) { cout<<"calling associators() of class Linux_DnsAddressMatchListOfService"<<endl; CmpiStatus rc = associationLogic(ctx,rslt,cop,1,0,properties); return CmpiStatus(rc); } CmpiStatus CmpiLinux_DnsAddressMatchListOfServiceProvider::associatorNames ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop, const char * assocClass, const char * resultClass, const char * role, const char * resultRole) { cout<<"calling associatorNames() of class Linux_DnsAddressMatchListOfService"<<endl; CmpiStatus rc = associationLogic(ctx,rslt,cop,0,0); return CmpiStatus(rc); } CmpiStatus CmpiLinux_DnsAddressMatchListOfServiceProvider::references ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop, const char * assocClass, const char * role, const char** properties) { cout<<"calling references() of class Linux_DnsAddressMatchListOfService"<<endl; CmpiStatus rc = associationLogic(ctx,rslt,cop,1,1,properties); return CmpiStatus(rc); } CmpiStatus CmpiLinux_DnsAddressMatchListOfServiceProvider::referenceNames ( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath& cop, const char * assocClass, const char * role) { cout<<"calling referenceNames() of class Linux_DnsAddressMatchListOfService"<<endl; CmpiStatus rc = associationLogic(ctx,rslt,cop,0,1); return CmpiStatus(rc); } } --- NEW FILE: Linux_DnsAddressMatchListOfServiceFactory.cpp --- /** * Linux_DnsAddressMatchListOfServiceFactory.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_DnsAddressMatchListOfServiceFactory.h" #include "Linux_DnsAddressMatchListOfServiceResourceAccess.h" namespace genProvider{ Linux_DnsAddressMatchListOfServiceInterface* Linux_DnsAddressMatchListOfServiceFactory::getImplementation(){ return (new Linux_DnsAddressMatchListOfServiceResourceAccess()); }; } --- NEW FILE: CmpiLinux_DnsAddressMatchListOfServiceProvider.h --- /** * CmpiLinux_DnsAddressMatchListOfServiceProvider.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_DnsAddressMatchListOfServiceProvider_h #define CmpiLinux_DnsAddressMatchListOfServiceProvider_h #include "CmpiInstanceMI.h" #include "CmpiMethodMI.h" #include "Linux_DnsAddressMatchListOfServiceFactory.h" #include "CmpiAssociationMI.h" namespace genProvider{ class CmpiLinux_DnsAddressMatchListOfServiceProvider : public CmpiInstanceMI, public CmpiMethodMI, public CmpiAssociationMI{ private: Linux_DnsAddressMatchListOfServiceInterface* interfaceP; const static char * shadowNameSpaceP; CmpiBroker cppBroker; void completeInstance ( const Linux_DnsAddressMatchListOfServiceInstanceName& intanceNameP, CmpiInstance& target, const CmpiContext& ctx); void copyShadowData ( const CmpiInstance* source, CmpiInstance* target); CmpiInstance* getShadowInstance ( const CmpiInstance& original, const Linux_DnsAddressMatchListOfServiceInstanceName& intanceName); void removeDanglingShadowInstances ( const Linux_DnsAddressMatchListOfServiceInstanceNameEnumeration& dinInsNames); public: CmpiLinux_DnsAddressMatchListOfServiceProvider ( const CmpiBroker &mbp, const CmpiContext& ctx); ~CmpiLinux_DnsAddressMatchListOfServiceProvider (); 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_DnsAddressMatchListOfServiceManualInstance.cpp --- /** * Linux_DnsAddressMatchListOfServiceManualInstance.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_DnsAddressMatchListOfServiceManualInstance.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //Linux_DnsAddressMatchListOfServiceManualInstance //********************************************************* //empty constructor Linux_DnsAddressMatchListOfServiceManualInstance:: Linux_DnsAddressMatchListOfServiceManualInstance(){ init(); }; //copy constructor Linux_DnsAddressMatchListOfServiceManualInstance:: Linux_DnsAddressMatchListOfServiceManualInstance (const Linux_DnsAddressMatchListOfServiceManualInstance& original){ init(original); }; //constructor using CmpiInstance Linux_DnsAddressMatchListOfServiceManualInstance:: Linux_DnsAddressMatchListOfServiceManualInstance (const CmpiInstance& inst, const char* instanceNamespace){ CmpiData cmpiData; init(); CmpiObjectPath cop=inst.getObjectPath(); cop.setNameSpace(instanceNamespace); setInstanceName(Linux_DnsAddressMatchListOfServiceInstanceName(cop)); } //Destructor Linux_DnsAddressMatchListOfServiceManualInstance:: ~Linux_DnsAddressMatchListOfServiceManualInstance(){ reset(); }; //copy operator Linux_DnsAddressMatchListOfServiceManualInstance& Linux_DnsAddressMatchListOfServiceManualInstance::operator= (const Linux_DnsAddressMatchListOfServiceManualInstance& original){ init(original); return *this; }; //converts to CmpiInstance CmpiInstance Linux_DnsAddressMatchListOfServiceManualInstance:: 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_DnsAddressMatchListOfServiceManualInstance:: isInstanceNameSet() const{ return isSet.instanceName; } const Linux_DnsAddressMatchListOfServiceInstanceName& Linux_DnsAddressMatchListOfServiceManualInstance::getInstanceName() const{ if(!isSet.instanceName) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "InstanceName not set in Linux_DnsAddressMatchListOfService instance"); return m_instanceName; } void Linux_DnsAddressMatchListOfServiceManualInstance::setInstanceName( const Linux_DnsAddressMatchListOfServiceInstanceName& val){ m_instanceName = val; isSet.instanceName=1; } //set isSet attributes to FALSE void Linux_DnsAddressMatchListOfServiceManualInstance::init(){ isSet.instanceName=0; }; //copies another instance properties in this void Linux_DnsAddressMatchListOfServiceManualInstance::init (const Linux_DnsAddressMatchListOfServiceManualInstance& original){ init(); if(original.isInstanceNameSet()){ setInstanceName(original.getInstanceName()); } } //reset the instance data void Linux_DnsAddressMatchListOfServiceManualInstance::reset(){ }; //********************************************************* //Linux_DnsAddressMatchListOfServiceManualInstanceEnumerationElement //********************************************************* Linux_DnsAddressMatchListOfServiceManualInstanceEnumerationElement:: Linux_DnsAddressMatchListOfServiceManualInstanceEnumerationElement(){ m_elementP=0; m_nextP=0; }; Linux_DnsAddressMatchListOfServiceManualInstanceEnumerationElement:: ~Linux_DnsAddressMatchListOfServiceManualInstanceEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //Linux_DnsAddressMatchListOfServiceManualInstanceNameEnumeration //********************************************************* Linux_DnsAddressMatchListOfServiceManualInstanceEnumeration:: Linux_DnsAddressMatchListOfServiceManualInstanceEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; Linux_DnsAddressMatchListOfServiceManualInstanceEnumeration:: Linux_DnsAddressMatchListOfServiceManualInstanceEnumeration( const Linux_DnsAddressMatchListOfServiceManualInstanceEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; Linux_DnsAddressMatchListOfServiceManualInstanceEnumeration:: ~Linux_DnsAddressMatchListOfServiceManualInstanceEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void Linux_DnsAddressMatchListOfServiceManualInstanceEnumeration::reset(){ currentElementP=firstElementP; }; bool Linux_DnsAddressMatchListOfServiceManualInstanceEnumeration::hasNext() const{ return (currentElementP!=0); }; int Linux_DnsAddressMatchListOfServiceManualInstanceEnumeration::getSize() const{ int size=0; Linux_DnsAddressMatchListOfServiceManualInstanceEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const Linux_DnsAddressMatchListOfServiceManualInstance& Linux_DnsAddressMatchListOfServiceManualInstanceEnumeration::getElement(int pos) const{ Linux_DnsAddressMatchListOfServiceManualInstanceEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const Linux_DnsAddressMatchListOfServiceManualInstance& Linux_DnsAddressMatchListOfServiceManualInstanceEnumeration::getNext() { Linux_DnsAddressMatchListOfServiceManualInstanceEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void Linux_DnsAddressMatchListOfServiceManualInstanceEnumeration::addElement (const Linux_DnsAddressMatchListOfServiceManualInstance& elementP){ if(firstElementP==0){ firstElementP=new Linux_DnsAddressMatchListOfServiceManualInstanceEnumerationElement(); firstElementP->m_elementP=new Linux_DnsAddressMatchListOfServiceManualInstance(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new Linux_DnsAddressMatchListOfServiceManualInstanceEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new Linux_DnsAddressMatchListOfServiceManualInstance(elementP); } }; } --- NEW FILE: Linux_DnsAddressMatchListOfServiceManualInstance.h --- /** * Linux_DnsAddressMatchListOfServiceManualInstance.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_DnsAddressMatchListOfServiceManualInstance_h #define Linux_DnsAddressMatchListOfServiceManualInstance_h #include "cmpidt.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiBooleanData.h" #include "CmpiCharData.h" #include "CmpiDateTime.h" #include "Linux_DnsAddressMatchListOfServiceInstanceName.h" namespace genProvider { class Linux_DnsAddressMatchListOfServiceManualInstance { public: Linux_DnsAddressMatchListOfServiceManualInstance(); Linux_DnsAddressMatchListOfServiceManualInstance (const Linux_DnsAddressMatchListOfServiceManualInstance& original); Linux_DnsAddressMatchListOfServiceManualInstance (const CmpiInstance& inst, const char* instanceNamespace); ~Linux_DnsAddressMatchListOfServiceManualInstance(); Linux_DnsAddressMatchListOfServiceManualInstance& operator= (const Linux_DnsAddressMatchListOfServiceManualInstance& original); CmpiInstance getCmpiInstance(const char** properties=0) const; unsigned int isInstanceNameSet() const; void setInstanceName( const Linux_DnsAddressMatchListOfServiceInstanceName& val); const Linux_DnsAddressMatchListOfServiceInstanceName& getInstanceName() const; private: void init(); void init(const Linux_DnsAddressMatchListOfServiceManualInstance& original); void reset(); Linux_DnsAddressMatchListOfServiceInstanceName m_instanceName; struct isSetType{ unsigned int instanceName:1; } isSet; }; struct Linux_DnsAddressMatchListOfServiceManualInstanceEnumerationElement{ Linux_DnsAddressMatchListOfServiceManualInstance* m_elementP; Linux_DnsAddressMatchListOfServiceManualInstanceEnumerationElement* m_nextP; Linux_DnsAddressMatchListOfServiceManualInstanceEnumerationElement(); ~Linux_DnsAddressMatchListOfServiceManualInstanceEnumerationElement(); }; class Linux_DnsAddressMatchListOfServiceManualInstanceEnumeration { private: Linux_DnsAddressMatchListOfServiceManualInstanceEnumerationElement* firstElementP; Linux_DnsAddressMatchListOfServiceManualInstanceEnumerationElement* currentElementP; Linux_DnsAddressMatchListOfServiceManualInstanceEnumerationElement* endElementP; public: Linux_DnsAddressMatchListOfServiceManualInstanceEnumeration(); Linux_DnsAddressMatchListOfServiceManualInstanceEnumeration( const Linux_DnsAddressMatchListOfServiceManualInstanceEnumeration& original); ~Linux_DnsAddressMatchListOfServiceManualInstanceEnumeration(); void reset(); bool hasNext() const; const Linux_DnsAddressMatchListOfServiceManualInstance& getNext(); int getSize() const; const Linux_DnsAddressMatchListOfServiceManualInstance& getElement(int pos) const; void addElement(const Linux_DnsAddressMatchListOfServiceManualInstance& elementP); }; } #endif --- NEW FILE: Linux_DnsAddressMatchListOfServiceInterface.h --- /** * Linux_DnsAddressMatchListOfServiceInterface.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_DnsAddressMatchListOfServiceInterface_h #define Linux_DnsAddressMatchListOfServiceInterface_h #include "Linux_DnsAddressMatchListOfServiceInstanceName.h" #include "Linux_DnsAddressMatchListOfServiceManualInstance.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_DnsAddressMatchListOfServiceInterface { public: virtual ~Linux_DnsAddressMatchListOfServiceInterface() { }; /* intrinsic methods */ virtual void enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsAddressMatchListOfServiceInstanceNameEnumeration& instnames) = 0; virtual void enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsAddressMatchListOfServiceManualInstanceEnumeration& instances) = 0; virtual Linux_DnsAddressMatchListOfServiceManualInstance getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsAddressMatchListOfServiceInstanceName&) = 0; virtual void setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsAddressMatchListOfServiceManualInstance&) = 0; virtual void createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsAddressMatchListOfServiceManualInstance&) = 0; virtual void deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsAddressMatchListOfServiceInstanceName&) = 0; /* Association Interface */ virtual void referencesAntecedent( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsAddressMatchListOfServiceManualInstanceEnumeration& instances) = 0; virtual void referencesDependent( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsAddressMatchListOfServiceManualInstanceEnumeration& instances) = 0; virtual void associatorsAntecedent( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsServiceInstanceEnumeration& instances) = 0; virtual void associatorsDependent( 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_DnsAddressMatchListOfServiceExternal.cpp --- /** * Linux_DnsAddressMatchListOfServiceExternal.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_DnsAddressMatchListOfServiceExternal.h" namespace genProvider{ Linux_DnsAddressMatchListOfServiceExternal::Linux_DnsAddressMatchListOfServiceExternal( const CmpiBroker& brkr, const CmpiContext& ctx ) : broker(brkr), context(ctx) {}; Linux_DnsAddressMatchListOfServiceExternal:: ~Linux_DnsAddressMatchListOfServiceExternal(){}; void Linux_DnsAddressMatchListOfServiceExternal::enumInstanceNames( const char *nsp, Linux_DnsAddressMatchListOfServiceInstanceNameEnumeration& instnames) { CmpiObjectPath op(nsp,"Linux_DnsAddressMatchListOfService"); CmpiEnumeration en=broker.enumInstanceNames(context,op); while(en.hasNext()) { CmpiObjectPath opi = en.getNext(); Linux_DnsAddressMatchListOfServiceInstanceName iname(opi); instnames.addElement(iname); } }; void Linux_DnsAddressMatchListOfServiceExternal::enumInstances( const char *nsp, const char* *properties, Linux_DnsAddressMatchListOfServiceInstanceEnumeration& instances) { CmpiObjectPath op(nsp,"Linux_DnsAddressMatchListOfService"); CmpiEnumeration en=broker.enumInstances(context,op,properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); Linux_DnsAddressMatchListOfServiceInstance instance(inst,nsp); instances.addElement(instance); } }; Linux_DnsAddressMatchListOfServiceInstance Linux_DnsAddressMatchListOfServiceExternal::getInstance( const char* *properties, const Linux_DnsAddressMatchListOfServiceInstanceName& instanceName) { CmpiObjectPath op=instanceName.getObjectPath(); CmpiInstance inst=broker.getInstance(context,op,properties); return Linux_DnsAddressMatchListOfServiceInstance(inst,instanceName.getNamespace()); } void Linux_DnsAddressMatchListOfServiceExternal::setInstance( const char* *properties, const Linux_DnsAddressMatchListOfServiceInstance& instance){ CmpiObjectPath op=instance.getInstanceName().getObjectPath(); CmpiInstance inst=instance.getCmpiInstance(); broker.setInstance(context,op,inst,properties); } void Linux_DnsAddressMatchListOfServiceExternal::createInstance( const Linux_DnsAddressMatchListOfServiceInstance& instance){ CmpiObjectPath op=instance.getInstanceName().getObjectPath(); CmpiInstance inst=instance.getCmpiInstance(); broker.createInstance(context,op,inst); } void Linux_DnsAddressMatchListOfServiceExternal::deleteInstance( const Linux_DnsAddressMatchListOfServiceInstanceName& instanceName){ CmpiObjectPath op=instanceName.getObjectPath(); broker.deleteInstance(context,op); } //Reference calls void Linux_DnsAddressMatchListOfServiceExternal:: referencesAntecedent( const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsAddressMatchListOfServiceInstanceEnumeration& instances){ CmpiObjectPath op=sourceInst.getObjectPath(); CmpiEnumeration en=broker.references (context, op, "Linux_DnsAddressMatchList", "Antecedent", properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); Linux_DnsAddressMatchListOfServiceInstance instance(inst,nsp); instances.addElement(instance); } } void Linux_DnsAddressMatchListOfServiceExternal:: referenceNamesAntecedent( const char *nsp, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsAddressMatchListOfServiceInstanceNameEnumeration& instanceNames){ CmpiObjectPath op=sourceInst.getObjectPath(); CmpiEnumeration en=broker.referenceNames (context, op, "Linux_DnsAddressMatchList", "Antecedent"); while(en.hasNext()) { CmpiObjectPath instName = en.getNext(); Linux_DnsAddressMatchListOfServiceInstanceName instanceName(instName); instanceNames.addElement(instanceName); } } void Linux_DnsAddressMatchListOfServiceExternal:: referencesDependent( const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsAddressMatchListOfServiceInstanceEnumeration& instances){ CmpiObjectPath op=sourceInst.getObjectPath(); CmpiEnumeration en=broker.references (context, op, "Linux_DnsService", "Dependent", properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); Linux_DnsAddressMatchListOfServiceInstance instance(inst,nsp); instances.addElement(instance); } } void Linux_DnsAddressMatchListOfServiceExternal:: referenceNamesDependent( const char *nsp, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsAddressMatchListOfServiceInstanceNameEnumeration& instanceNames){ CmpiObjectPath op=sourceInst.getObjectPath(); CmpiEnumeration en=broker.referenceNames (context, op, "Linux_DnsService", "Dependent"); while(en.hasNext()) { CmpiObjectPath instName = en.getNext(); Linux_DnsAddressMatchListOfServiceInstanceName instanceName(instName); instanceNames.addElement(instanceName); } } //Associator calls void Linux_DnsAddressMatchListOfServiceExternal:: associatorsAntecedent( const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsServiceInstanceEnumeration& instances){ CmpiObjectPath op=sourceInst.getObjectPath(); CmpiEnumeration en=broker.associators (context,op,0,0,0,0,properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); Linux_DnsServiceInstance instance(inst,nsp); instances.addElement(instance); } } void Linux_DnsAddressMatchListOfServiceExternal:: associatorNamesAntecedent( const char *nsp, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsServiceInstanceNameEnumeration& instanceNames){ CmpiObjectPath op=sourceInst.getObjectPath(); CmpiEnumeration en=broker.associatorNames (context,op,0,0,0,0); while(en.hasNext()) { CmpiObjectPath instName = en.getNext(); Linux_DnsServiceInstanceName instanceName(instName); instanceNames.addElement(instanceName); } } void Linux_DnsAddressMatchListOfServiceExternal:: associatorsDependent( const char *nsp, const char** properties, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceEnumeration& instances){ CmpiObjectPath op=sourceInst.getObjectPath(); CmpiEnumeration en=broker.associators (context,op,0,0,0,0,properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); Linux_DnsAddressMatchListInstance instance(inst,nsp); instances.addElement(instance); } } void Linux_DnsAddressMatchListOfServiceExternal:: associatorNamesDependent( const char *nsp, const Linux_DnsServiceInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceNameEnumeration& instanceNames){ CmpiObjectPath op=sourceInst.getObjectPath(); CmpiEnumeration en=broker.associatorNames (context,op,0,0,0,0); while(en.hasNext()) { CmpiObjectPath instName = en.getNext(); Linux_DnsAddressMatchListInstanceName instanceName(instName); instanceNames.addElement(instanceName); } } } --- NEW FILE: Linux_DnsAddressMatchListOfServiceFactory.h --- /** * Linux_DnsAddressMatchListOfServiceFactory.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_DnsAddressMatchListOfServiceFactory_h #define Linux_DnsAddressMatchListOfServiceFactory_h #include "Linux_DnsAddressMatchListO... [truncated message content] |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:58:44
|
Update of /cvsroot/sblim/cmpi-dns/provider/mof/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20455/provider/mof/common Added Files: IBMQualifiers.mof 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: IBMQualifiers.mof --- // =================================================================== // This file was created by the CRM Tooling for Rational Rose // Version 1.6 // It contains the required IBM-defined qualifiers // =================================================================== Qualifier IBM_HasInstances : boolean = false, Scope(class, association), Flavor(restricted); Qualifier IBM_HasProvider : boolean = false, Scope(class, association), Flavor(restricted); Qualifier IBM_ImplementationType : string = "NotSupported", Scope(property, method), Flavor(restricted); |
Update of /cvsroot/sblim/cmpi-dns/provider/Linux_DnsHintZone/mof In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20455/provider/Linux_DnsHintZone/mof Added Files: Linux_DnsHintZoneRegister.mof makefile.standalone Linux_DnsHintZone.mof makefile.pegasus Linux_DnsHintZoneRepository.mof 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: Linux_DnsHintZoneRepository.mof --- // =================================================================== // This file was created using ECUTE. // Version 2.0 Beta-1 // by exporting package Linux_DnsHintZoneRepository // from model // on 5/18/2005 // Origin of package: Manually created // =================================================================== // =================================================================== // Linux_DnsHintZone // =================================================================== class Linux_DnsHintZone : Linux_DnsZone { [Key] string Name; }; // =================================================================== // end of file // =================================================================== --- NEW FILE: makefile.standalone --- # Makefile for Linux_DnsHintZone # (Standalone flavor) include ../../setting.cmpi install: install -m 644 Linux_DnsHintZone*.mof $(CIMOMMOF) uninstall: $(RM) $(CIMOMMOF)/Linux_DnsHintZone*.mof --- NEW FILE: Linux_DnsHintZone.mof --- // =================================================================== // This file was created using ECUTE. // Version 2.0 Beta-1 // by exporting package Linux_DnsHintZone // from model // on 5/18/2005 // Origin of package: Manually created // =================================================================== // =================================================================== // Linux_DnsHintZone // =================================================================== [Description ("Class representing DNS zones of type Hint.") , IBM_HasInstances, IBM_HasProvider] class Linux_DnsHintZone : Linux_DnsZone { [Key, Override ("Name"), IBM_ImplementationType ("Manual")] string Name; [Override ("ResourceRecordFile"), IBM_ImplementationType ( "Manual")] string ResourceRecordFile; [Override ("Type"), Description ("Value = 5 for Type Hint.") , IBM_ImplementationType ("Manual")] uint16 Type; }; // =================================================================== // end of file // =================================================================== --- NEW FILE: makefile.pegasus --- # Makefile for Linux_DnsHintZone # (Pegasus flavor) include ../../setting.cmpi install: cimmofl -I. -aE -nroot/cimv2 Linux_DnsHintZone.mof if [ -f Linux_DnsHintZoneRepository.mof ]; then \ cimmofl -I. -nIBMShadow/cimv2 Linux_DnsHintZoneRepository.mof; \ fi if [ -f Linux_DnsHintZoneRegister.mof ]; then \ cimmofl -I. -nroot/PG_InterOp Linux_DnsHintZoneRegister.mof; \ fi uninstall: --- NEW FILE: Linux_DnsHintZoneRegister.mof --- // =================================================================== // Linux_DnsHintZone // =================================================================== instance of PG_ProviderModule { Name = "Linux_DnsHintZoneProviderModule"; //The library name on disk Location = "Linux_DnsHintZone"; Vendor = "SBLIM"; Version = "2.0.0"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { //The provider module as defined in PG_ProviderModule ProviderModuleName = "Linux_DnsHintZoneProviderModule"; // The provider name as referenced in the code Name = "CmpiLinux_DnsHintZoneProvider"; }; instance of PG_ProviderCapabilities { //The provider module as defined in PG_ProviderModule ProviderModuleName = "Linux_DnsHintZoneProviderModule"; //The provider name as defined in PG_Provider ProviderName = "CmpiLinux_DnsHintZoneProvider"; CapabilityID = "1"; //Name of the CIM class as defined in the mof ClassName = "Linux_DnsHintZone"; Namespaces = {"root/cimv2"}; ProviderType = {2, 5}; // Instance Method SupportedProperties = NULL; // All properties SupportedMethods = NULL; // All methods }; |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:58:43
|
Update of /cvsroot/sblim/cmpi-dns/provider/Linux_DnsNotifyACLForService/mof In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20455/provider/Linux_DnsNotifyACLForService/mof Added Files: makefile.standalone Linux_DnsNotifyACLForServiceRepository.mof makefile.pegasus Linux_DnsNotifyACLForService.mof Linux_DnsNotifyACLForServiceRegister.mof 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: Linux_DnsNotifyACLForService.mof --- // =================================================================== // This file was created using ECUTE. // Version 2.0 Beta-1 // by exporting package Linux_DnsNotifyACLForService // from model // on 5/18/2005 // Origin of package: Manually created // =================================================================== // =================================================================== // Linux_DnsNotifyACLForService // =================================================================== [Association, Description ( "Association pointing to Address Match Lists, hosting the list of" " elements that are allowed to support the request type: " "notify."), IBM_HasInstances, IBM_HasProvider] class Linux_DnsNotifyACLForService : CIM_ElementSetting { [Key, Override ("Element"), Description ( "The scoping DNS Service.")] Linux_DnsService REF Element; [Key, Override ("Setting")] Linux_DnsAddressMatchList REF Setting; }; // =================================================================== // end of file // =================================================================== --- NEW FILE: Linux_DnsNotifyACLForServiceRegister.mof --- // =================================================================== // Linux_DnsNotifyACLForService // =================================================================== instance of PG_ProviderModule { Name = "Linux_DnsNotifyACLForServiceProviderModule"; //The library name on disk Location = "Linux_DnsNotifyACLForService"; Vendor = "SBLIM"; Version = "2.0.0"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { //The provider module as defined in PG_ProviderModule ProviderModuleName = "Linux_DnsNotifyACLForServiceProviderModule"; // The provider name as referenced in the code Name = "CmpiLinux_DnsNotifyACLForServiceProvider"; }; instance of PG_ProviderCapabilities { //The provider module as defined in PG_ProviderModule ProviderModuleName = "Linux_DnsNotifyACLForServiceProviderModule"; //The provider name as defined in PG_Provider ProviderName = "CmpiLinux_DnsNotifyACLForServiceProvider"; CapabilityID = "1"; //Name of the CIM class as defined in the mof ClassName = "Linux_DnsNotifyACLForService"; Namespaces = {"root/cimv2"}; ProviderType = {2, 3}; // Instance Association SupportedProperties = NULL; // All properties SupportedMethods = NULL; // All methods }; --- NEW FILE: makefile.standalone --- # Makefile for Linux_DnsNotifyACLForService # (Standalone flavor) include ../../setting.cmpi install: install -m 644 Linux_DnsNotifyACLForService*.mof $(CIMOMMOF) uninstall: $(RM) $(CIMOMMOF)/Linux_DnsNotifyACLForService*.mof --- NEW FILE: makefile.pegasus --- # Makefile for Linux_DnsNotifyACLForService # (Pegasus flavor) include ../../setting.cmpi install: cimmofl -I. -aE -nroot/cimv2 Linux_DnsNotifyACLForService.mof if [ -f Linux_DnsNotifyACLForServiceRepository.mof ]; then \ cimmofl -I. -nIBMShadow/cimv2 Linux_DnsNotifyACLForServiceRepository.mof; \ fi if [ -f Linux_DnsNotifyACLForServiceRegister.mof ]; then \ cimmofl -I. -nroot/PG_InterOp Linux_DnsNotifyACLForServiceRegister.mof; \ fi uninstall: --- NEW FILE: Linux_DnsNotifyACLForServiceRepository.mof --- // =================================================================== // This file was created using ECUTE. // Version 2.0 Beta-1 // by exporting package Linux_DnsNotifyACLForServiceRepository // from model // on 5/18/2005 // Origin of package: Manually created // =================================================================== // =================================================================== // Linux_DnsNotifyACLForService // =================================================================== class Linux_DnsNotifyACLForService { [Key] Linux_DnsService REF Element; [Key] Linux_DnsAddressMatchList REF Setting; }; // =================================================================== // end of file // =================================================================== |
Update of /cvsroot/sblim/cmpi-dns/provider/Linux_DnsAllowTransferACLForZone In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20455/provider/Linux_DnsAllowTransferACLForZone Added Files: Linux_DnsAllowTransferACLForZoneExternal.h Linux_DnsAllowTransferACLForZoneRepositoryExternal.cpp Linux_DnsAllowTransferACLForZoneDefaultImplementation.cpp Linux_DnsAllowTransferACLForZoneDefaultImplementation.h Linux_DnsAllowTransferACLForZoneInstance.h Linux_DnsAllowTransferACLForZoneFactory.h Linux_DnsAllowTransferACLForZoneFactory.cpp Linux_DnsAllowTransferACLForZoneRepositoryExternal.h Linux_DnsAllowTransferACLForZoneResourceAccess.h Linux_DnsAllowTransferACLForZoneRepositoryInstance.h setting.provider makefile Linux_DnsAllowTransferACLForZoneResourceAccess.cpp CmpiLinux_DnsAllowTransferACLForZoneProvider.h Linux_DnsAllowTransferACLForZoneInterface.h Linux_DnsAllowTransferACLForZoneManualInstance.cpp Linux_DnsAllowTransferACLForZoneFakeFactory.cpp Linux_DnsAllowTransferACLForZoneExternal.cpp Linux_DnsAllowTransferACLForZoneInstanceName.h Linux_DnsAllowTransferACLForZoneInstance.cpp Linux_DnsAllowTransferACLForZoneInstanceName.cpp CmpiLinux_DnsAllowTransferACLForZoneProvider.cpp Linux_DnsAllowTransferACLForZoneManualInstance.h Linux_DnsAllowTransferACLForZoneRepositoryInstance.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 --- NEW FILE: Linux_DnsAllowTransferACLForZoneInstanceName.cpp --- /** * Linux_DnsAllowTransferACLForZoneInstanceName.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_DnsAllowTransferACLForZoneInstanceName.h" #include "CmpiData.h" #include "CmpiString.h" #include "CmpiArray.h" #include <string> namespace genProvider { //********************************************************* //Linux_DnsAllowTransferACLForZoneInstanceName //********************************************************* //empty constructor Linux_DnsAllowTransferACLForZoneInstanceName:: Linux_DnsAllowTransferACLForZoneInstanceName(){ init(); }; //copy constructor Linux_DnsAllowTransferACLForZoneInstanceName:: Linux_DnsAllowTransferACLForZoneInstanceName (const Linux_DnsAllowTransferACLForZoneInstanceName& original){ init(original); }; //contructor using CmpiObjectPath Linux_DnsAllowTransferACLForZoneInstanceName:: Linux_DnsAllowTransferACLForZoneInstanceName (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_DnsAllowTransferACLForZoneInstanceName:: ~Linux_DnsAllowTransferACLForZoneInstanceName(){ reset(); }; //copy operator Linux_DnsAllowTransferACLForZoneInstanceName& Linux_DnsAllowTransferACLForZoneInstanceName::operator= (const Linux_DnsAllowTransferACLForZoneInstanceName& original){ init(original); return *this; } //returns the related CmpiObjectPath CmpiObjectPath Linux_DnsAllowTransferACLForZoneInstanceName:: 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_DnsAllowTransferACLForZoneInstanceName::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_DnsAllowTransferACLForZoneInstanceName:: isNameSpaceSet() const{ return isSet.m_namespace; } const char * Linux_DnsAllowTransferACLForZoneInstanceName:: getNamespace() const { if(!isSet.m_namespace) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "NameSpace not set in Linux_DnsAllowTransferACLForZone instanceName"); return m_namespace; } void Linux_DnsAllowTransferACLForZoneInstanceName:: 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_DnsAllowTransferACLForZoneInstanceName::isElementSet() const{ return isSet.Element; } void Linux_DnsAllowTransferACLForZoneInstanceName:: setElement(const Linux_DnsZoneInstanceName& val){ m_Element = val; isSet.Element=1; } const Linux_DnsZoneInstanceName& Linux_DnsAllowTransferACLForZoneInstanceName:: getElement() const{ if(!isSet.Element) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Element not set"); return m_Element; } //Setting related methods unsigned int Linux_DnsAllowTransferACLForZoneInstanceName::isSettingSet() const{ return isSet.Setting; } void Linux_DnsAllowTransferACLForZoneInstanceName:: setSetting(const Linux_DnsAddressMatchListInstanceName& val){ m_Setting = val; isSet.Setting=1; } const Linux_DnsAddressMatchListInstanceName& Linux_DnsAllowTransferACLForZoneInstanceName:: getSetting() const{ if(!isSet.Setting) throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_SET, "Setting not set"); return m_Setting; } //set isSet variables to FALSE void Linux_DnsAllowTransferACLForZoneInstanceName::init(){ m_CIMClassNameP="Linux_DnsAllowTransferACLForZone"; isSet.m_namespace=0; isSet.Element=0; isSet.Setting=0; } //copies another instance properties in this void Linux_DnsAllowTransferACLForZoneInstanceName::init (const Linux_DnsAllowTransferACLForZoneInstanceName& 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_DnsAllowTransferACLForZoneInstanceName::reset(){ if (isSet.m_namespace) delete(m_namespace); }; //********************************************************* //Linux_DnsAllowTransferACLForZoneInstanceNameEnumerationElement //********************************************************* Linux_DnsAllowTransferACLForZoneInstanceNameEnumerationElement:: Linux_DnsAllowTransferACLForZoneInstanceNameEnumerationElement(){ m_elementP=0; m_nextP=0; }; Linux_DnsAllowTransferACLForZoneInstanceNameEnumerationElement:: ~Linux_DnsAllowTransferACLForZoneInstanceNameEnumerationElement(){ if (m_elementP!=0) delete(m_elementP); if (m_nextP!=0) delete(m_nextP); }; //********************************************************* //Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration //********************************************************* Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration:: Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration(){ firstElementP=0; currentElementP=0; endElementP=0; }; Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration:: Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration(const CmpiArray& arr){ firstElementP=0; currentElementP=0; endElementP=0; int size = arr.size(); for (int i=0; i < size; i++) { addElement(Linux_DnsAllowTransferACLForZoneInstanceName(arr[i])); } } Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration:: Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration( const Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration& original){ firstElementP=0; currentElementP=0; endElementP=0; int size=original.getSize(); for(int i=0;i<size;i++) addElement(original.getElement(i)); }; Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration:: ~Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration(){ if (firstElementP!=0) delete(firstElementP); }; void Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration::reset(){ currentElementP=firstElementP; }; bool Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration::hasNext() const{ return (currentElementP!=0); }; int Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration::getSize() const{ int size=0; Linux_DnsAllowTransferACLForZoneInstanceNameEnumerationElement* followingP=firstElementP; while(followingP!=0){ followingP=followingP->m_nextP; size++; } return size; }; const Linux_DnsAllowTransferACLForZoneInstanceName& Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration::getElement(int pos) const{ Linux_DnsAllowTransferACLForZoneInstanceNameEnumerationElement* followingP=firstElementP; int i=0; while((followingP!=0)&&(i<pos)){ followingP=followingP->m_nextP; i++; } return *(followingP->m_elementP); }; const Linux_DnsAllowTransferACLForZoneInstanceName& Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration::getNext() { Linux_DnsAllowTransferACLForZoneInstanceNameEnumerationElement* currentP= currentElementP; currentElementP=currentElementP->m_nextP; return *(currentP->m_elementP); }; void Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration::addElement (const Linux_DnsAllowTransferACLForZoneInstanceName& elementP){ if(firstElementP==0){ firstElementP=new Linux_DnsAllowTransferACLForZoneInstanceNameEnumerationElement(); firstElementP->m_elementP=new Linux_DnsAllowTransferACLForZoneInstanceName(elementP); endElementP=firstElementP; currentElementP=firstElementP; }else{ endElementP->m_nextP=new Linux_DnsAllowTransferACLForZoneInstanceNameEnumerationElement(); endElementP=endElementP->m_nextP; endElementP->m_elementP=new Linux_DnsAllowTransferACLForZoneInstanceName(elementP); } }; Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration::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_DnsAllowTransferACLForZoneResourceAccess.h --- /** * Linux_DnsAllowTransferACLForZoneResourceAccess.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_DnsAllowTransferACLForZoneResourceAccess_h #define Linux_DnsAllowTransferACLForZoneResourceAccess_h #include "Linux_DnsAllowTransferACLForZoneInstanceName.h" #include "Linux_DnsAllowTransferACLForZoneManualInstance.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiDateTime.h" #include "CmpiBroker.h" #include "Linux_DnsZoneInstance.h" #include "Linux_DnsAddressMatchListInstance.h" #include "Linux_DnsZoneExternal.h" #include "Linux_DnsAddressMatchListExternal.h" #include "Linux_DnsAllowTransferACLForZoneDefaultImplementation.h" #include <string> #include <list> using namespace std; #include "dnssupport.h" #include "defaultvalues.h" #include "DnsArray.h" #include "DnsValueMap.h" namespace genProvider { class Linux_DnsAllowTransferACLForZoneResourceAccess: public Linux_DnsAllowTransferACLForZoneDefaultImplementation { public: /*Linux_DnsAllowTransferACLForZoneResourceAccess();*/ virtual ~Linux_DnsAllowTransferACLForZoneResourceAccess() ; /* intrinsic methods */ virtual void enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration& instnames); virtual void enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsAllowTransferACLForZoneManualInstanceEnumeration& instances); virtual Linux_DnsAllowTransferACLForZoneManualInstance getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsAllowTransferACLForZoneInstanceName&); /*virtual void setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsAllowTransferACLForZoneManualInstance&);*/ virtual void createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsAllowTransferACLForZoneManualInstance&); virtual void deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsAllowTransferACLForZoneInstanceName&); /* Association Interface */ virtual void referencesElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsAllowTransferACLForZoneManualInstanceEnumeration& instances); virtual void referencesSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsZoneInstanceName& sourceInst, Linux_DnsAllowTransferACLForZoneManualInstanceEnumeration& instances); virtual void associatorsElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsZoneInstanceEnumeration& instances); virtual void associatorsSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsZoneInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceEnumeration& instances); /* extrinsic methods */ }; } #endif --- NEW FILE: Linux_DnsAllowTransferACLForZoneRepositoryExternal.h --- /** * Linux_DnsAllowTransferACLForZoneRepositoryExternal.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_DnsAllowTransferACLForZoneRepositoryExternal_h #define Linux_DnsAllowTransferACLForZoneRepositoryExternal_h #include "Linux_DnsAllowTransferACLForZoneInstanceName.h" #include "Linux_DnsAllowTransferACLForZoneRepositoryInstance.h" #include "CmpiBroker.h" namespace genProvider { class Linux_DnsAllowTransferACLForZoneRepositoryExternal { public: Linux_DnsAllowTransferACLForZoneRepositoryExternal( const CmpiBroker& brkr, const CmpiContext& ctx); virtual ~Linux_DnsAllowTransferACLForZoneRepositoryExternal(); virtual void enumInstanceNames( Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration&); virtual void enumInstances( const char* *properties, Linux_DnsAllowTransferACLForZoneRepositoryInstanceEnumeration&); virtual Linux_DnsAllowTransferACLForZoneRepositoryInstance getInstance( const char* *properties, const Linux_DnsAllowTransferACLForZoneInstanceName&); virtual void setInstance( const char* *properties, const Linux_DnsAllowTransferACLForZoneRepositoryInstance&); virtual void createInstance( const Linux_DnsAllowTransferACLForZoneRepositoryInstance&); virtual void deleteInstance( const Linux_DnsAllowTransferACLForZoneInstanceName&); private: CmpiBroker broker; CmpiContext context; const static char *nsp; }; } #endif --- NEW FILE: Linux_DnsAllowTransferACLForZoneRepositoryExternal.cpp --- /** * Linux_DnsAllowTransferACLForZoneRepositoryExternal.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_DnsAllowTransferACLForZoneRepositoryExternal.h" namespace genProvider{ Linux_DnsAllowTransferACLForZoneRepositoryExternal::Linux_DnsAllowTransferACLForZoneRepositoryExternal( const CmpiBroker& brkr, const CmpiContext& ctx ) : broker(brkr), context(ctx) {}; const char * Linux_DnsAllowTransferACLForZoneRepositoryExternal:: nsp="IBMShadow/cimv2"; Linux_DnsAllowTransferACLForZoneRepositoryExternal:: ~Linux_DnsAllowTransferACLForZoneRepositoryExternal(){}; void Linux_DnsAllowTransferACLForZoneRepositoryExternal::enumInstanceNames( Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration& instnames) { CmpiObjectPath op(nsp,"Linux_DnsAllowTransferACLForZone"); CmpiEnumeration en=broker.enumInstanceNames(context,op); while(en.hasNext()) { CmpiObjectPath opi = en.getNext(); Linux_DnsAllowTransferACLForZoneInstanceName iname(opi); instnames.addElement(iname); } }; void Linux_DnsAllowTransferACLForZoneRepositoryExternal::enumInstances( const char* *properties, Linux_DnsAllowTransferACLForZoneRepositoryInstanceEnumeration& instances) { CmpiObjectPath op(nsp,"Linux_DnsAllowTransferACLForZone"); CmpiEnumeration en=broker.enumInstances(context,op,properties); while(en.hasNext()) { CmpiInstance inst = en.getNext(); Linux_DnsAllowTransferACLForZoneRepositoryInstance instance(inst,nsp); instances.addElement(instance); } }; Linux_DnsAllowTransferACLForZoneRepositoryInstance Linux_DnsAllowTransferACLForZoneRepositoryExternal::getInstance( const char* *properties, const Linux_DnsAllowTransferACLForZoneInstanceName& instanceName) { CmpiObjectPath op=instanceName.getObjectPath(); op.setNameSpace(nsp); CmpiInstance inst=broker.getInstance(context,op,properties); return Linux_DnsAllowTransferACLForZoneRepositoryInstance(inst,nsp); } void Linux_DnsAllowTransferACLForZoneRepositoryExternal::setInstance( const char* *properties, const Linux_DnsAllowTransferACLForZoneRepositoryInstance& instance){ //make a copy of the given instance and set it to the right nameSpace Linux_DnsAllowTransferACLForZoneInstanceName instanceName(instance.getInstanceName()); instanceName.setNamespace(nsp,1); Linux_DnsAllowTransferACLForZoneRepositoryInstance copiedInstance(instance); copiedInstance.setInstanceName(instanceName); CmpiObjectPath op=instanceName.getObjectPath(); CmpiInstance inst=copiedInstance.getCmpiInstance(); broker.setInstance(context,op,inst,properties); } void Linux_DnsAllowTransferACLForZoneRepositoryExternal::createInstance( const Linux_DnsAllowTransferACLForZoneRepositoryInstance& instance){ //make a copy of the given instance and set it to the right nameSpace Linux_DnsAllowTransferACLForZoneInstanceName instanceName(instance.getInstanceName()); instanceName.setNamespace(nsp,1); Linux_DnsAllowTransferACLForZoneRepositoryInstance copiedInstance(instance); copiedInstance.setInstanceName(instanceName); CmpiObjectPath op=instanceName.getObjectPath(); CmpiInstance inst=copiedInstance.getCmpiInstance(); broker.createInstance(context,op,inst); } void Linux_DnsAllowTransferACLForZoneRepositoryExternal::deleteInstance( const Linux_DnsAllowTransferACLForZoneInstanceName& instanceName){ CmpiObjectPath op=instanceName.getObjectPath(); op.setNameSpace(nsp); broker.deleteInstance(context,op); } } --- NEW FILE: Linux_DnsAllowTransferACLForZoneInstanceName.h --- /** * Linux_DnsAllowTransferACLForZoneInstanceName.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_DnsAllowTransferACLForZoneInstanceName_h #define Linux_DnsAllowTransferACLForZoneInstanceName_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_DnsAllowTransferACLForZoneInstanceName { public: Linux_DnsAllowTransferACLForZoneInstanceName(); Linux_DnsAllowTransferACLForZoneInstanceName (const Linux_DnsAllowTransferACLForZoneInstanceName& original); Linux_DnsAllowTransferACLForZoneInstanceName (const CmpiObjectPath& path); ~Linux_DnsAllowTransferACLForZoneInstanceName(); Linux_DnsAllowTransferACLForZoneInstanceName& operator= (const Linux_DnsAllowTransferACLForZoneInstanceName& 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_DnsAllowTransferACLForZoneInstanceName& 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_DnsAllowTransferACLForZoneInstanceNameEnumerationElement{ Linux_DnsAllowTransferACLForZoneInstanceName* m_elementP; Linux_DnsAllowTransferACLForZoneInstanceNameEnumerationElement* m_nextP; Linux_DnsAllowTransferACLForZoneInstanceNameEnumerationElement(); ~Linux_DnsAllowTransferACLForZoneInstanceNameEnumerationElement(); }; class Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration { private: Linux_DnsAllowTransferACLForZoneInstanceNameEnumerationElement* firstElementP; Linux_DnsAllowTransferACLForZoneInstanceNameEnumerationElement* currentElementP; Linux_DnsAllowTransferACLForZoneInstanceNameEnumerationElement* endElementP; public: Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration(); Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration(const CmpiArray& arr); Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration( const Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration& original); ~Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration(); void reset(); bool hasNext() const; const Linux_DnsAllowTransferACLForZoneInstanceName& getNext(); int getSize() const; const Linux_DnsAllowTransferACLForZoneInstanceName& getElement(int pos) const; //no copy of the element is done void addElement(const Linux_DnsAllowTransferACLForZoneInstanceName& elementP); operator CmpiArray() const; }; } #endif --- NEW FILE: Linux_DnsAllowTransferACLForZoneDefaultImplementation.cpp --- /** * Linux_DnsAllowTransferACLForZoneDefaultImplementation.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_DnsAllowTransferACLForZoneDefaultImplementation.h" #include <iostream> using namespace std; namespace genProvider { /* intrinsic methods */ void Linux_DnsAllowTransferACLForZoneDefaultImplementation::enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration& instnames){ cout<<"enumInstances not supported for Linux_DnsAllowTransferACLForZone"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "enumInstances not implemented for Linux_DnsAllowTransferACLForZone"); } void Linux_DnsAllowTransferACLForZoneDefaultImplementation::enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsAllowTransferACLForZoneManualInstanceEnumeration& instances){ cout<<"Using default enumInstances implementation for Linux_DnsAllowTransferACLForZone"<<endl; cout<<"LetŽs get the instanceNames"<<endl; Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration namesEnumeration; enumInstanceNames(ctx, mbp,nsp,namesEnumeration); cout<<"Getting each instance"<<endl; while(namesEnumeration.hasNext()){ Linux_DnsAllowTransferACLForZoneInstanceName name= namesEnumeration.getNext(); cout<<"Getting an instance for instanceName"<<endl; Linux_DnsAllowTransferACLForZoneManualInstance instance= getInstance(ctx, mbp, properties, name); cout<<"adding instance to enum"<<endl; instances.addElement(instance); cout<<"Added!"<<endl; }; } Linux_DnsAllowTransferACLForZoneManualInstance Linux_DnsAllowTransferACLForZoneDefaultImplementation::getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsAllowTransferACLForZoneInstanceName&){ cout<<"getInstance not supported for Linux_DnsAllowTransferACLForZone"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "getInstance not implemented for Linux_DnsAllowTransferACLForZone"); } void Linux_DnsAllowTransferACLForZoneDefaultImplementation::setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsAllowTransferACLForZoneManualInstance&){ cout<<"setInstance not supported for Linux_DnsAllowTransferACLForZone"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "setInstance not implemented for Linux_DnsAllowTransferACLForZone"); } void Linux_DnsAllowTransferACLForZoneDefaultImplementation:: createInstance(const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsAllowTransferACLForZoneManualInstance&){ cout<<"createInstance not supported for Linux_DnsAllowTransferACLForZone"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "createInstance not implemented for Linux_DnsAllowTransferACLForZone"); } void Linux_DnsAllowTransferACLForZoneDefaultImplementation:: deleteInstance(const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsAllowTransferACLForZoneInstanceName&){ cout<<"deleteInstance not supported for Linux_DnsAllowTransferACLForZone"<<endl; throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "deleteInstance not implemented for Linux_DnsAllowTransferACLForZone"); } /* Association Interface */ void Linux_DnsAllowTransferACLForZoneDefaultImplementation:: referencesElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsAllowTransferACLForZoneManualInstanceEnumeration& instances){ throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "getElementReferences between Linux_DnsZone and Linux_DnsAddressMatchList not implemented for Linux_DnsAllowTransferACLForZone"); } void Linux_DnsAllowTransferACLForZoneDefaultImplementation:: referencesSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsZoneInstanceName& sourceInst, Linux_DnsAllowTransferACLForZoneManualInstanceEnumeration& instances){ throw CmpiErrorFormater::getErrorException( CmpiErrorFormater::NOT_IMPLEMENTED, "getSettingReferences between Linux_DnsZone and Linux_DnsAddressMatchList not implemented for Linux_DnsAllowTransferACLForZone"); } void Linux_DnsAllowTransferACLForZoneDefaultImplementation:: associatorsElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsZoneInstanceEnumeration& instances){ std::cout<<"Linux_DnsAllowTransferACLForZone : associatorsLinux_DnsZone() ... returns one instance"<<std::endl; Linux_DnsAllowTransferACLForZoneManualInstanceEnumeration enumeration; referencesElement(ctx, mbp, sourceInst.getNamespace(), properties, sourceInst, enumeration); Linux_DnsZoneExternal external(mbp, ctx); while(enumeration.hasNext()) { const Linux_DnsAllowTransferACLForZoneManualInstance instance = enumeration.getNext(); const Linux_DnsAllowTransferACLForZoneInstanceName instanceName = instance.getInstanceName(); const Linux_DnsZoneInstanceName Element = instanceName.getElement(); Linux_DnsZoneInstance inst = external.getInstance(properties,Element); instances.addElement(inst); } } void Linux_DnsAllowTransferACLForZoneDefaultImplementation:: associatorsSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsZoneInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceEnumeration& instances){ std::cout<<"Linux_DnsAllowTransferACLForZone : associatorsLinux_DnsAddressMatchList() ... returns one instance"<<std::endl; Linux_DnsAllowTransferACLForZoneManualInstanceEnumeration enumeration; referencesSetting(ctx, mbp, sourceInst.getNamespace(), properties, sourceInst, enumeration); Linux_DnsAddressMatchListExternal external(mbp, ctx); while(enumeration.hasNext()) { const Linux_DnsAllowTransferACLForZoneManualInstance instance = enumeration.getNext(); const Linux_DnsAllowTransferACLForZoneInstanceName instanceName = instance.getInstanceName(); const Linux_DnsAddressMatchListInstanceName Setting = instanceName.getSetting(); Linux_DnsAddressMatchListInstance inst = external.getInstance(properties,Setting); instances.addElement(inst); } } /* extrinsic methods */ } --- NEW FILE: Linux_DnsAllowTransferACLForZoneFactory.h --- /** * Linux_DnsAllowTransferACLForZoneFactory.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_DnsAllowTransferACLForZoneFactory_h #define Linux_DnsAllowTransferACLForZoneFactory_h #include "Linux_DnsAllowTransferACLForZoneInterface.h" namespace genProvider{ class Linux_DnsAllowTransferACLForZoneFactory{ public: Linux_DnsAllowTransferACLForZoneFactory(){}; ~Linux_DnsAllowTransferACLForZoneFactory(){}; static Linux_DnsAllowTransferACLForZoneInterface* getImplementation(); }; } #endif --- NEW FILE: Linux_DnsAllowTransferACLForZoneFactory.cpp --- /** * Linux_DnsAllowTransferACLForZoneFactory.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_DnsAllowTransferACLForZoneFactory.h" #include "Linux_DnsAllowTransferACLForZoneResourceAccess.h" namespace genProvider{ Linux_DnsAllowTransferACLForZoneInterface* Linux_DnsAllowTransferACLForZoneFactory::getImplementation(){ return (new Linux_DnsAllowTransferACLForZoneResourceAccess()); }; } --- NEW FILE: Linux_DnsAllowTransferACLForZoneFakeFactory.cpp --- /** * Linux_DnsAllowTransferACLForZoneFakeFactory.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_DnsAllowTransferACLForZoneFactory.h" using namespace std; namespace genProvider{ Linux_DnsAllowTransferACLForZoneInterface* Linux_DnsAllowTransferACLForZoneFactory::getImplementation(){ cout<<"ERROR: incomplete support library is being used"<<endl; cout<<" in provider from class Linux_DnsAllowTransferACLForZone"<<endl; cout<<" Use the link-install options for the makefile"<<endl; return 0; }; } --- 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_DnsAllowTransferACLForZoneInstanceName.o \ Linux_DnsAllowTransferACLForZoneInstance.o \ Linux_DnsAllowTransferACLForZoneExternal.o \ Linux_DnsAllowTransferACLForZoneRepositoryInstance.o \ Linux_DnsAllowTransferACLForZoneRepositoryExternal.o \ Linux_DnsAllowTransferACLForZoneManualInstance.o \ Linux_DnsAllowTransferACLForZoneDefaultImplementation.o FAKEFACTORY= Linux_DnsAllowTransferACLForZoneFakeFactory.o NORMALFACTORY= Linux_DnsAllowTransferACLForZoneFactory.o RESOURCEOBJECT= Linux_DnsAllowTransferACLForZoneResourceAccess.o PROVIDEROBJECT=CmpiLinux_DnsAllowTransferACLForZoneProvider.o all: testfiles preinstall install buildall: clean all #------------------------------------------------------------------------------# compile: $(OBJECTS) $(FAKEFACTORY) $(NORMALFACTORY) $(RESOURCEOBJECT) $(PROVIDEROBJECT) #------------------------------------------------------------------------------# prelink: $(OBJECTS) $(FAKEFACTORY) $(LINK.cpp) -o libLinux_DnsAllowTransferACLForZoneSupport.so $^ link: deleteFakeLib \ libLinux_DnsAllowTransferACLForZoneSupport.so \ libLinux_DnsAllowTransferACLForZone.so libLinux_DnsAllowTransferACLForZoneSupport.so: LDFLAGS+=$(LDFLAGS.provider) libLinux_DnsAllowTransferACLForZoneSupport.so: $(OBJECTS) $(NORMALFACTORY) $(RESOURCEOBJECT) $(PROVIDEROBJECT) $(LINK.cpp) -o $@ $^ libLinux_DnsAllowTransferACLForZone.so: LDFLAGS+=-lLinux_DnsAllowTransferACLForZoneSupport libLinux_DnsAllowTransferACLForZone.so: $(PROVIDEROBJECT) $(LINK.cpp) -o $@ $^ deleteFakeLib: $(RM) *.so #------------------------------------------------------------------------------# preinstall: prelink install libLinux_DnsAllowTransferACLForZoneSupport.so $(COMMONLIB_OUT) #------------------------------------------------------------------------------# install: link install libLinux_DnsAllowTransferACLForZoneSupport.so $(COMMONLIB_OUT) install libLinux_DnsAllowTransferACLForZone.so $(CIMOMLIB_OUT) # install -m 644 Linux_DnsAllowTransferACLForZone*.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_DnsAllowTransferACLForZone*.h \ $(RM) $(COMMONLIB)/libLinux_DnsAllowTransferACLForZoneSupport.so \ $(RM) $(CIMOMLIB)/libLinux_DnsAllowTransferACLForZone.so --- NEW FILE: CmpiLinux_DnsAllowTransferACLForZoneProvider.h --- /** * CmpiLinux_DnsAllowTransferACLForZoneProvider.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_DnsAllowTransferACLForZoneProvider_h #define CmpiLinux_DnsAllowTransferACLForZoneProvider_h #include "CmpiInstanceMI.h" #include "CmpiMethodMI.h" #include "Linux_DnsAllowTransferACLForZoneFactory.h" #include "CmpiAssociationMI.h" namespace genProvider{ class CmpiLinux_DnsAllowTransferACLForZoneProvider : public CmpiInstanceMI, public CmpiMethodMI, public CmpiAssociationMI{ private: Linux_DnsAllowTransferACLForZoneInterface* interfaceP; const static char * shadowNameSpaceP; CmpiBroker cppBroker; void completeInstance ( const Linux_DnsAllowTransferACLForZoneInstanceName& intanceNameP, CmpiInstance& target, const CmpiContext& ctx); void copyShadowData ( const CmpiInstance* source, CmpiInstance* target); CmpiInstance* getShadowInstance ( const CmpiInstance& original, const Linux_DnsAllowTransferACLForZoneInstanceName& intanceName); void removeDanglingShadowInstances ( const Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration& dinInsNames); public: CmpiLinux_DnsAllowTransferACLForZoneProvider ( const CmpiBroker &mbp, const CmpiContext& ctx); ~CmpiLinux_DnsAllowTransferACLForZoneProvider (); 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_DnsAllowTransferACLForZoneExternal.h --- /** * Linux_DnsAllowTransferACLForZoneExternal.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_DnsAllowTransferACLForZoneExternal_h #define Linux_DnsAllowTransferACLForZoneExternal_h #include "Linux_DnsAllowTransferACLForZoneInstance.h" #include "Linux_DnsZoneInstance.h" #include "Linux_DnsAddressMatchListInstance.h" #include "CmpiBroker.h" namespace genProvider { class Linux_DnsAllowTransferACLForZoneExternal { public: Linux_DnsAllowTransferACLForZoneExternal( const CmpiBroker& brkr, const CmpiContext& ctx); virtual ~Linux_DnsAllowTransferACLForZoneExternal(); virtual void enumInstanceNames( const char *nsp, Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration&); virtual void enumInstances( const char *nsp, const char* *properties, Linux_DnsAllowTransferACLForZoneInstanceEnumeration&); virtual Linux_DnsAllowTransferACLForZoneInstance getInstance( const char* *properties, const Linux_DnsAllowTransferACLForZoneInstanceName&); virtual void setInstance( const char* *properties, const Linux_DnsAllowTransferACLForZoneInstance&); virtual void createInstance( const Linux_DnsAllowTransferACLForZoneInstance&); virtual void deleteInstance( const Linux_DnsAllowTransferACLForZoneInstanceName&); //association calls void referencesElement( const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsAllowTransferACLForZoneInstanceEnumeration& instances); void referenceNamesElement( const char *nsp, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration& instanceNames); void referencesSetting( const char *nsp, const char** properties, const Linux_DnsZoneInstanceName& sourceInst, Linux_DnsAllowTransferACLForZoneInstanceEnumeration& instances); void referenceNamesSetting( const char *nsp, const Linux_DnsZoneInstanceName& sourceInst, Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration& instanceNames); void associatorsElement( const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsZoneInstanceEnumeration& instances); void associatorNamesElement( const char *nsp, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsZoneInstanceNameEnumeration& instanceNames); void associatorsSetting( const char *nsp, const char** properties, const Linux_DnsZoneInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceEnumeration& instances); void associatorNamesSetting( const char *nsp, const Linux_DnsZoneInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceNameEnumeration& instanceNames); private: CmpiBroker broker; CmpiContext context; }; } #endif --- NEW FILE: Linux_DnsAllowTransferACLForZoneDefaultImplementation.h --- /** * Linux_DnsAllowTransferACLForZoneDefaultImplementation.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_DnsAllowTransferACLForZoneDefaultImplementation_h #define Linux_DnsAllowTransferACLForZoneDefaultImplementation_h #include "Linux_DnsAllowTransferACLForZoneInstanceName.h" #include "Linux_DnsAllowTransferACLForZoneManualInstance.h" #include "CmpiObjectPath.h" #include "CmpiInstance.h" #include "CmpiDateTime.h" #include "CmpiBroker.h" #include "Linux_DnsZoneInstance.h" #include "Linux_DnsAddressMatchListInstance.h" #include "Linux_DnsZoneExternal.h" #include "Linux_DnsAddressMatchListExternal.h" #include "Linux_DnsAllowTransferACLForZoneInterface.h" namespace genProvider { class Linux_DnsAllowTransferACLForZoneDefaultImplementation: public Linux_DnsAllowTransferACLForZoneInterface { public: virtual ~Linux_DnsAllowTransferACLForZoneDefaultImplementation() { }; /* intrinsic methods */ virtual void enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration& instnames); virtual void enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsAllowTransferACLForZoneManualInstanceEnumeration& instances); virtual Linux_DnsAllowTransferACLForZoneManualInstance getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsAllowTransferACLForZoneInstanceName&); virtual void setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsAllowTransferACLForZoneManualInstance&); virtual void createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsAllowTransferACLForZoneManualInstance&); virtual void deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsAllowTransferACLForZoneInstanceName&); /* Association Interface */ virtual void referencesElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsAllowTransferACLForZoneManualInstanceEnumeration& instances); virtual void referencesSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsZoneInstanceName& sourceInst, Linux_DnsAllowTransferACLForZoneManualInstanceEnumeration& instances); virtual void associatorsElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsZoneInstanceEnumeration& instances); virtual void associatorsSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsZoneInstanceName& sourceInst, Linux_DnsAddressMatchListInstanceEnumeration& instances); /* extrinsic methods */ }; } #endif --- NEW FILE: Linux_DnsAllowTransferACLForZoneResourceAccess.cpp --- /** * Linux_DnsAllowTransferACLForZoneResourceAccess.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_DnsAllowTransferACLForZoneResourceAccess.h" #define DNS_ATTR_STR "allow-transfer" namespace genProvider { //Linux_DnsAllowTransferACLForZoneResourceAccess::Linux_DnsAllowTransferACLForZoneResourceAccess(); Linux_DnsAllowTransferACLForZoneResourceAccess::~Linux_DnsAllowTransferACLForZoneResourceAccess() { }; /* intrinsic methods */ void Linux_DnsAllowTransferACLForZoneResourceAccess::enumInstanceNames( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, Linux_DnsAllowTransferACLForZoneInstanceNameEnumeration& instnames){ 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_DnsAllowTransferACLForZoneInstanceName 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); } } } void Linux_DnsAllowTransferACLForZoneResourceAccess::enumInstances( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char* *properties, Linux_DnsAllowTransferACLForZoneManualInstanceEnumeration& 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_DnsAllowTransferACLForZoneInstanceName AuInstName; Linux_DnsAllowTransferACLForZoneManualInstance 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( all_zones ); }; Linux_DnsAllowTransferACLForZoneManualInstance Linux_DnsAllowTransferACLForZoneResourceAccess::getInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsAllowTransferACLForZoneInstanceName& instanceName){ Linux_DnsAllowTransferACLForZoneManualInstance AuInst; AuInst.setInstanceName( instanceName ); return AuInst; } /* void Linux_DnsAllowTransferACLForZoneResourceAccess::setInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const char* *properties, const Linux_DnsAllowTransferACLForZoneManualInstance&){}; */ void Linux_DnsAllowTransferACLForZoneResourceAccess::createInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsAllowTransferACLForZoneManualInstance& anInstance){ 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 (zopts && zopts->value) { 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_DnsAllowTransferACLForZoneResourceAccess::deleteInstance( const CmpiContext& ctx, const CmpiBroker &mbp, const Linux_DnsAllowTransferACLForZoneInstanceName& 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 (zopts && zopts->value) { 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_DnsAllowTransferACLForZoneResourceAccess::referencesElement( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsAddressMatchListInstanceName& sourceInst, Linux_DnsAllowTransferACLForZoneManualInstanceEnumeration& instEnum) { cout << "Linux_DnsAllowTransferACLForZoneResourceAccess::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_DnsAllowTransferACLForZoneInstanceName AuInstName; Linux_DnsAllowTransferACLForZoneManualInstance 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_DnsAllowTransferACLForZoneResourceAccess::referencesSetting( const CmpiContext& ctx, const CmpiBroker &mbp, const char *nsp, const char** properties, const Linux_DnsZoneInstanceName& sourceInst, Linux_DnsAllowTransferACLForZoneManualInstanceEnumeration& instEnum) { cout << "Linux_DnsAllowTransferACLForZoneResourceAccess::referencesSetting()" << endl; DNSZONE *zones = getZones(); DNSZONE *a... [truncated message content] |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:58:19
|
Update of /cvsroot/sblim/cmpi-dns/resource-access In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19906/resource-access Log Message: Directory /cvsroot/sblim/cmpi-dns/resource-access added to the repository |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:58:19
|
Update of /cvsroot/sblim/cmpi-dns/provider/Linux_DnsSlaveZone In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19906/provider/Linux_DnsSlaveZone Log Message: Directory /cvsroot/sblim/cmpi-dns/provider/Linux_DnsSlaveZone added to the repository |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:58:19
|
Update of /cvsroot/sblim/cmpi-dns/provider/Linux_DnsResourceRecordInZone In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19906/provider/Linux_DnsResourceRecordInZone Log Message: Directory /cvsroot/sblim/cmpi-dns/provider/Linux_DnsResourceRecordInZone added to the repository |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:58:18
|
Update of /cvsroot/sblim/cmpi-dns/provider/Linux_DnsSettingContext/mof In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19906/provider/Linux_DnsSettingContext/mof Log Message: Directory /cvsroot/sblim/cmpi-dns/provider/Linux_DnsSettingContext/mof added to the repository |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:58:18
|
Update of /cvsroot/sblim/cmpi-dns/provider/Linux_DnsService/mof In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19906/provider/Linux_DnsService/mof Log Message: Directory /cvsroot/sblim/cmpi-dns/provider/Linux_DnsService/mof added to the repository |
From: Wolfgang T. <ta...@us...> - 2005-08-16 15:58:18
|
Update of /cvsroot/sblim/cmpi-dns/provider/mof In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19906/provider/mof Log Message: Directory /cvsroot/sblim/cmpi-dns/provider/mof added to the repository |