opendrim-lmp-powersupply-1.0.0~ppa/0000755000175000017500000000000011401064722020150 5ustar guillaumeguillaumeopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_MemberOfPowerSupplyCollection/0000755000175000017500000000000011401064722027547 5ustar guillaumeguillaumeopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_MemberOfPowerSupplyCollection/Makefile.am0000644000175000017500000000510211401064722031601 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProvider.la libcmpiPowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProvider_la_SOURCES = OpenDRIM_MemberOfPowerSupplyCollectionAccess.cpp OpenDRIM_MemberOfPowerSupplyCollectionProvider.cpp cmpiOpenDRIM_MemberOfPowerSupplyCollection.cpp assocOpenDRIM_MemberOfPowerSupplyCollection.cpp # May have to be adjusted for direct invocation libcmpiPowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProvider_la_CPPFLAGS = -I../CIM_ManagedElement -I../CIM_Collection # Uncomment the end for direct invocation, may have to be adjusted libcmpiPowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProvider_la_LIBADD = ../Common/libcmpiPowerSupply_Common.la #../CIM_ManagedElement/libcmpiPowerSupply_CIM_ManagedElementProvider.la ../CIM_Collection/libcmpiPowerSupply_CIM_CollectionProvider.la libcmpiPowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_MemberOfPowerSupplyCollection.h OpenDRIM_MemberOfPowerSupplyCollection.h OpenDRIM_MemberOfPowerSupplyCollectionAccess.h ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_MemberOfPowerSupplyCollection/OpenDRIM_MemberOfPowerSupplyCollectionAccess.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_MemberOfPowerSupplyCollection/OpenDRIM_MemberOfPowerSupp0000644000175000017500000001106011401064722034506 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef OPENDRIM_MEMBEROFPOWERSUPPLYCOLLECTIONACCESS_H_ #define OPENDRIM_MEMBEROFPOWERSUPPLYCOLLECTIONACCESS_H_ #include "PowerSupply_Common.h" #include "OpenDRIM_MemberOfPowerSupplyCollection.h" #include "assocOpenDRIM_MemberOfPowerSupplyCollection.h" int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_load(const CMPIBroker* broker, string& errorMessage); int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_unload(string& errorMessage); int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_MemberOfPowerSupplyCollection& instance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_MemberOfPowerSupplyCollection& newInstance, const OpenDRIM_MemberOfPowerSupplyCollection& oldInstance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_MemberOfPowerSupplyCollection& instance, string& errorMessage); int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_MemberOfPowerSupplyCollection& instance, string& errorMessage); int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_associatorMemberToCollection(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Member_instance, const char** properties, vector& Collection_associatedInstances, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_associatorCollectionToMember(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Collection_instance, const char** properties, vector& Member_associatedInstances, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_referenceMemberToCollection(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Member_instance, const vector& Collection_instances, vector& OpenDRIM_MemberOfPowerSupplyCollection_instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_referenceCollectionToMember(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Collection_instance, const vector& Member_instances, vector& OpenDRIM_MemberOfPowerSupplyCollection_instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_populate(OpenDRIM_MemberOfPowerSupplyCollection& instance, string& errorMessage); #endif /*OPENDRIM_MEMBEROFPOWERSUPPLYCOLLECTIONACCESS_H_*/ ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_MemberOfPowerSupplyCollection/assocOpenDRIM_MemberOfPowerSupplyCollection.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_MemberOfPowerSupplyCollection/assocOpenDRIM_MemberOfPowe0000644000175000017500000002121211401064722034505 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "assocOpenDRIM_MemberOfPowerSupplyCollection.h" int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage) { _E_; string _assocClass, _resultClass, _resultRole, _role; assocClass == NULL ? _assocClass = "null" : _assocClass = assocClass; resultClass == NULL ? _resultClass = "null" : _resultClass = resultClass; resultRole == NULL ? _resultRole = "null" : _resultRole = resultRole; role == NULL ? _role = "null" : _role = role; for (unsigned int i=0; i& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant) { _E_; int errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_associatorFilter(broker, ctx, cop, knownInstance, assocClass, resultClass, role, resultRole, leftToRight, errorMessage); if (errorCode == -1) return OK; if (errorCode != OK) return errorCode; if (leftToRight) { if (role != NULL && strcasecmp(role, "Member") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "Collection") != 0) return OK; CF_assert(PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_associatorMemberToCollection(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } else { if (role != NULL && strcasecmp(role, "Collection") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "Member") != 0) return OK; CF_assert(PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_associatorCollectionToMember(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_enumerateMembers(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, Member_NAMESPACE, Member_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(PowerSupply_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PowerSupply_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PowerSupply_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_getMember(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Member_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Member_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_ManagedElement _instance; PowerSupply_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PowerSupply_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PowerSupply_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_enumerateCollections(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, Collection_NAMESPACE, Collection_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(PowerSupply_CIM_Collection_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PowerSupply_CIM_Collection_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PowerSupply_CIM_Collection_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_getCollection(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Collection_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Collection_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_Collection _instance; PowerSupply_CIM_Collection_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PowerSupply_CIM_Collection_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PowerSupply_CIM_Collection_toCMPIInstance(broker, _instance)); */ _L_; return OK; } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_MemberOfPowerSupplyCollection/OpenDRIM_MemberOfPowerSupplyCollectionProvider.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_MemberOfPowerSupplyCollection/OpenDRIM_MemberOfPowerSupp0000644000175000017500000004412311401064722034514 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_MemberOfPowerSupplyCollection.h" #include "OpenDRIM_MemberOfPowerSupplyCollectionAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProviderSetInstance PowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProviderModifyInstance #endif int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_init(const CMPIBroker* broker); int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPowerSupplyCollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProviderEnumInstances(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPowerSupplyCollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_MemberOfPowerSupplyCollection instance; PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPowerSupplyCollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProviderSetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_MemberOfPowerSupplyCollection newInstance, oldInstance; PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_toCPP(_broker, ci, newInstance); PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPowerSupplyCollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPowerSupplyCollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_MemberOfPowerSupplyCollection instance; PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_MemberOfPowerSupplyCollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPowerSupplyCollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPowerSupplyCollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_MemberOfPowerSupplyCollection instance; PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPowerSupplyCollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPowerSupplyCollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProviderExecQuery(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* lang, const char* query) { _E_; CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } /* ---------------------------------------------------------------------------*/ /* End of Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Association Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProviderAssociatorNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPowerSupplyCollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnObjectPath(rslt, associatedInstances[i].getObjectpath().getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProviderAssociators(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPowerSupplyCollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnInstance(rslt, associatedInstances[i].getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProviderReferenceNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPowerSupplyCollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_referenceMemberToCollection(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_referenceCollectionToMember(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPowerSupplyCollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProviderReferences(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPowerSupplyCollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_referenceMemberToCollection(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_referenceCollectionToMember(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_MemberOfPowerSupplyCollection_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_init FAILED: " + (string) OpenDRIM_MemberOfPowerSupplyCollection_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_unload(errorMessage); if (errorCode != OK) { errorMessage += "PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_unload FAILED: " + (string) OpenDRIM_MemberOfPowerSupplyCollection_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_INIT if (PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_init(_broker) < 0) return NULL CMInstanceMIStub(PowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProvider, PowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProvider, _broker, PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_INIT); CMAssociationMIStub(PowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProvider, PowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProvider, _broker, PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_MemberOfPowerSupplyCollection/cmpiOpenDRIM_MemberOfPowerSupplyCollection.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_MemberOfPowerSupplyCollection/cmpiOpenDRIM_MemberOfPower0000644000175000017500000000620511401064722034514 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_MemberOfPowerSupplyCollection.h" CMPIObjectPath* PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_MemberOfPowerSupplyCollection& instance) { _E_; Objectpath op(broker, OpenDRIM_MemberOfPowerSupplyCollection_classnames[0], OpenDRIM_MemberOfPowerSupplyCollection_NAMESPACE); if (!instance.Collection_isNULL) op.addKey("Collection", instance.Collection); if (!instance.Member_isNULL) op.addKey("Member", instance.Member); _L_; return op.getHdl(); } CMPIInstance* PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_MemberOfPowerSupplyCollection& instance) { _E_; Objectpath op(broker, PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_MemberOfPowerSupplyCollection& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("Member", instance.Member) == OK) instance.Member_isNULL = false; if (op.getKey("Collection", instance.Collection) == OK) instance.Collection_isNULL = false; _L_; } void PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_MemberOfPowerSupplyCollection& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("Collection", instance.Collection) == OK) instance.Collection_isNULL = false; if (inst.getProperty("Member", instance.Member) == OK) instance.Member_isNULL = false; _L_; } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_MemberOfPowerSupplyCollection/OpenDRIM_MemberOfPowerSupplyCollection.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_MemberOfPowerSupplyCollection/OpenDRIM_MemberOfPowerSupp0000644000175000017500000000663611401064722034523 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef OPENDRIM_MEMBEROFPOWERSUPPLYCOLLECTION_H_ #define OPENDRIM_MEMBEROFPOWERSUPPLYCOLLECTION_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_ManagedElement.h" #include "CIM_ManagedElementAccess.h" #include "cmpiCIM_Collection.h" #include "CIM_CollectionAccess.h" */ const static char* OpenDRIM_MemberOfPowerSupplyCollection_classnames[] = {"OpenDRIM_MemberOfPowerSupplyCollection"}; static string OpenDRIM_MemberOfPowerSupplyCollection_NAMESPACE = _NAMESPACE; const static string Member_role = "Member"; const static char* Member_classnames[] = {"OpenDRIM_PowerSupply"}; const static string Member_NAMESPACE = _NAMESPACE; const static string Collection_role = "Collection"; const static char* Collection_classnames[] = {"OpenDRIM_PowerSupplyRedundancySet"}; const static string Collection_NAMESPACE = _NAMESPACE; class OpenDRIM_MemberOfPowerSupplyCollection { public: Objectpath Collection; bool Collection_isNULL; Objectpath Member; bool Member_isNULL; OpenDRIM_MemberOfPowerSupplyCollection() { Collection_isNULL = true; Member_isNULL = true; } ~OpenDRIM_MemberOfPowerSupplyCollection() {} string getKeys() const { return CF_toLowCase(".Collection=\"" + CF_quoteString(Collection.toString()) + "\""".Member=\"" + CF_quoteString(Member.toString()) + "\""); } int getCollection(Objectpath& value) const { if (Collection_isNULL==true) return NOT_FOUND; value = Collection; return OK; } int setCollection(const Objectpath& newValue) { Collection = newValue; Collection.setNamespace(Collection_NAMESPACE); Collection_isNULL = false; return OK; } int getMember(Objectpath& value) const { if (Member_isNULL==true) return NOT_FOUND; value = Member; return OK; } int setMember(const Objectpath& newValue) { Member = newValue; Member.setNamespace(Member_NAMESPACE); Member_isNULL = false; return OK; } }; #endif /*OPENDRIM_MEMBEROFPOWERSUPPLYCOLLECTION_H_*/ ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_MemberOfPowerSupplyCollection/assocOpenDRIM_MemberOfPowerSupplyCollection.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_MemberOfPowerSupplyCollection/assocOpenDRIM_MemberOfPowe0000644000175000017500000000633411401064722034515 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef ASSOCOPENDRIM_MEMBEROFPOWERSUPPLYCOLLECTION_H_ #define ASSOCOPENDRIM_MEMBEROFPOWERSUPPLYCOLLECTION_H_ #include "OpenDRIM_MemberOfPowerSupplyCollectionAccess.h" int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage); int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_associator(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties, vector& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant); int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_enumerateMembers(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_getMember(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_enumerateCollections(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_getCollection(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_MEMBEROFPOWERSUPPLYCOLLECTION_H_*/ ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_MemberOfPowerSupplyCollection/cmpiOpenDRIM_MemberOfPowerSupplyCollection.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_MemberOfPowerSupplyCollection/cmpiOpenDRIM_MemberOfPower0000644000175000017500000000451211401064722034513 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef CMPIOPENDRIM_MEMBEROFPOWERSUPPLYCOLLECTION_H_ #define CMPIOPENDRIM_MEMBEROFPOWERSUPPLYCOLLECTION_H_ #include "OpenDRIM_MemberOfPowerSupplyCollection.h" CMPIObjectPath* PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_MemberOfPowerSupplyCollection& instance); CMPIInstance* PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_MemberOfPowerSupplyCollection& instance); void PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_MemberOfPowerSupplyCollection& instance); void PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_MemberOfPowerSupplyCollection& instance); #endif /*CMPIOPENDRIM_MEMBEROFPOWERSUPPLYCOLLECTION_H_*/ ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_MemberOfPowerSupplyCollection/OpenDRIM_MemberOfPowerSupplyCollectionAccess.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_MemberOfPowerSupplyCollection/OpenDRIM_MemberOfPowerSupp0000644000175000017500000002504611401064722034517 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "OpenDRIM_MemberOfPowerSupplyCollectionAccess.h" int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PowerSupply_CIM_ManagedElement_load(broker, errorMessage)); CF_assert(PowerSupply_CIM_Collection_load(broker, errorMessage)); */ // TODO _L_; return OK; } int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PowerSupply_CIM_ManagedElement_unload(errorMessage)); CF_assert(PowerSupply_CIM_Collection_unload(errorMessage)); */ // TODO _L_; return OK; } int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_isAssociated(const Instance& Member, const Instance& Collection, bool& isAssociated, string& errorMessage) { _E_; // TODO Determine if the association can be established or not isAssociated=true; _L_; return OK; } int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector subjects; // Only get the instance names CF_assert(PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_enumerateMembers(broker, ctx, subjects, NULL, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_enumerateMembers(broker, ctx, subjects, NULL, false, errorMessage)); vector::iterator c = subjects.begin(); vector::iterator end = subjects.end(); for (; c != end; ++c) { bool leftToRight = true; vector associatedInstances; PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_associator(broker, ctx, (*c).getObjectpath().getHdl(), (*c), Member_classnames[0], Collection_classnames[0], Member_role.c_str(), Collection_role.c_str(), NULL, associatedInstances, leftToRight, errorMessage, "an"); string ref_discriminant = discriminant == "ein" ? "rn" : "r"; CF_assert(PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_referenceMemberToCollection(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_MemberOfPowerSupplyCollection& instance, const char** properties, string& errorMessage) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ Objectpath Member_objectpath; instance.getMember(Member_objectpath); Instance Member_instance; CF_assert(PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_getMember(broker, ctx, Member_objectpath, Member_instance, NULL, errorMessage)); Objectpath Collection_objectpath; instance.getCollection(Collection_objectpath); Instance Collection_instance; CF_assert(PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_getCollection(broker, ctx, Collection_objectpath, Collection_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_isAssociated(Member_instance, Collection_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_MemberOfPowerSupplyCollection& newInstance, const OpenDRIM_MemberOfPowerSupplyCollection& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_MemberOfPowerSupplyCollection& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_MemberOfPowerSupplyCollection& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_associatorMemberToCollection(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Member_instance, const char** properties, vector& Collection_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector Collection_instances; if (discriminant=="a") CF_assert(PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_enumerateCollections(broker, ctx, Collection_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_enumerateCollections(broker, ctx, Collection_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_enumerateCollections(broker, ctx, Collection_instances, properties, false, errorMessage)); } for (size_t i=0; i& Member_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector Member_instances; if (discriminant=="a") CF_assert(PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_enumerateMembers(broker, ctx, Member_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_enumerateMembers(broker, ctx, Member_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_enumerateMembers(broker, ctx, Member_instances, properties, false, errorMessage)); } for (size_t i=0; i& Collection_instances, vector& OpenDRIM_MemberOfPowerSupplyCollection_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < Collection_instances.size(); i++) { OpenDRIM_MemberOfPowerSupplyCollection instance; instance.setMember(((Instance) Member_instance).getObjectpath()); instance.setCollection(((Instance) Collection_instances[i]).getObjectpath()); OpenDRIM_MemberOfPowerSupplyCollection_instances.push_back(instance); } _L_; return OK; } int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_referenceCollectionToMember(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Collection_instance, const vector& Member_instances, vector& OpenDRIM_MemberOfPowerSupplyCollection_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < Member_instances.size(); i++) { OpenDRIM_MemberOfPowerSupplyCollection instance; instance.setMember(((Instance) Member_instances[i]).getObjectpath()); instance.setCollection(((Instance) Collection_instance).getObjectpath()); OpenDRIM_MemberOfPowerSupplyCollection_instances.push_back(instance); } _L_; return OK; } int PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_populate(OpenDRIM_MemberOfPowerSupplyCollection& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_ComputerSystemPowerSupply/0000755000175000017500000000000011401064722027042 5ustar guillaumeguillaume././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_ComputerSystemPowerSupply/assocOpenDRIM_ComputerSystemPowerSupply.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_ComputerSystemPowerSupply/assocOpenDRIM_ComputerSystemPo0000644000175000017500000002132211401064722034755 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "assocOpenDRIM_ComputerSystemPowerSupply.h" int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage) { _E_; string _assocClass, _resultClass, _resultRole, _role; assocClass == NULL ? _assocClass = "null" : _assocClass = assocClass; resultClass == NULL ? _resultClass = "null" : _resultClass = resultClass; resultRole == NULL ? _resultRole = "null" : _resultRole = resultRole; role == NULL ? _role = "null" : _role = role; for (unsigned int i=0; i& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant) { _E_; int errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_associatorFilter(broker, ctx, cop, knownInstance, assocClass, resultClass, role, resultRole, leftToRight, errorMessage); if (errorCode == -1) return OK; if (errorCode != OK) return errorCode; if (leftToRight) { if (role != NULL && strcasecmp(role, "PartComponent") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "GroupComponent") != 0) return OK; CF_assert(PowerSupply_OpenDRIM_ComputerSystemPowerSupply_associatorPartComponentToGroupComponent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } else { if (role != NULL && strcasecmp(role, "GroupComponent") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "PartComponent") != 0) return OK; CF_assert(PowerSupply_OpenDRIM_ComputerSystemPowerSupply_associatorGroupComponentToPartComponent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_enumeratePartComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, PartComponent_NAMESPACE, PartComponent_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(PowerSupply_CIM_LogicalDevice_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PowerSupply_CIM_LogicalDevice_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PowerSupply_CIM_LogicalDevice_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_getPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), PartComponent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), PartComponent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_LogicalDevice _instance; PowerSupply_CIM_LogicalDevice_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PowerSupply_CIM_LogicalDevice_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PowerSupply_CIM_LogicalDevice_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_enumerateGroupComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, GroupComponent_NAMESPACE, GroupComponent_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(PowerSupply_CIM_System_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PowerSupply_CIM_System_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PowerSupply_CIM_System_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_getGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), GroupComponent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), GroupComponent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_System _instance; PowerSupply_CIM_System_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PowerSupply_CIM_System_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PowerSupply_CIM_System_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_ComputerSystemPowerSupply/Makefile.am0000644000175000017500000000500311401064722031074 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPowerSupply_OpenDRIM_ComputerSystemPowerSupplyProvider.la libcmpiPowerSupply_OpenDRIM_ComputerSystemPowerSupplyProvider_la_SOURCES = OpenDRIM_ComputerSystemPowerSupplyAccess.cpp OpenDRIM_ComputerSystemPowerSupplyProvider.cpp cmpiOpenDRIM_ComputerSystemPowerSupply.cpp assocOpenDRIM_ComputerSystemPowerSupply.cpp # May have to be adjusted for direct invocation libcmpiPowerSupply_OpenDRIM_ComputerSystemPowerSupplyProvider_la_CPPFLAGS = -I../CIM_LogicalDevice -I../CIM_System # Uncomment the end for direct invocation, may have to be adjusted libcmpiPowerSupply_OpenDRIM_ComputerSystemPowerSupplyProvider_la_LIBADD = ../Common/libcmpiPowerSupply_Common.la #../CIM_LogicalDevice/libcmpiPowerSupply_CIM_LogicalDeviceProvider.la ../CIM_System/libcmpiPowerSupply_CIM_SystemProvider.la libcmpiPowerSupply_OpenDRIM_ComputerSystemPowerSupplyProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_ComputerSystemPowerSupply.h OpenDRIM_ComputerSystemPowerSupply.h OpenDRIM_ComputerSystemPowerSupplyAccess.h ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_ComputerSystemPowerSupply/cmpiOpenDRIM_ComputerSystemPowerSupply.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_ComputerSystemPowerSupply/cmpiOpenDRIM_ComputerSystemPow0000644000175000017500000000443211401064722034767 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef CMPIOPENDRIM_COMPUTERSYSTEMPOWERSUPPLY_H_ #define CMPIOPENDRIM_COMPUTERSYSTEMPOWERSUPPLY_H_ #include "OpenDRIM_ComputerSystemPowerSupply.h" CMPIObjectPath* PowerSupply_OpenDRIM_ComputerSystemPowerSupply_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_ComputerSystemPowerSupply& instance); CMPIInstance* PowerSupply_OpenDRIM_ComputerSystemPowerSupply_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_ComputerSystemPowerSupply& instance); void PowerSupply_OpenDRIM_ComputerSystemPowerSupply_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_ComputerSystemPowerSupply& instance); void PowerSupply_OpenDRIM_ComputerSystemPowerSupply_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_ComputerSystemPowerSupply& instance); #endif /*CMPIOPENDRIM_COMPUTERSYSTEMPOWERSUPPLY_H_*/ ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_ComputerSystemPowerSupply/cmpiOpenDRIM_ComputerSystemPowerSupply.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_ComputerSystemPowerSupply/cmpiOpenDRIM_ComputerSystemPow0000644000175000017500000000627011401064722034771 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_ComputerSystemPowerSupply.h" CMPIObjectPath* PowerSupply_OpenDRIM_ComputerSystemPowerSupply_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_ComputerSystemPowerSupply& instance) { _E_; Objectpath op(broker, OpenDRIM_ComputerSystemPowerSupply_classnames[0], OpenDRIM_ComputerSystemPowerSupply_NAMESPACE); if (!instance.GroupComponent_isNULL) op.addKey("GroupComponent", instance.GroupComponent); if (!instance.PartComponent_isNULL) op.addKey("PartComponent", instance.PartComponent); _L_; return op.getHdl(); } CMPIInstance* PowerSupply_OpenDRIM_ComputerSystemPowerSupply_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_ComputerSystemPowerSupply& instance) { _E_; Objectpath op(broker, PowerSupply_OpenDRIM_ComputerSystemPowerSupply_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void PowerSupply_OpenDRIM_ComputerSystemPowerSupply_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_ComputerSystemPowerSupply& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("PartComponent", instance.PartComponent) == OK) instance.PartComponent_isNULL = false; if (op.getKey("GroupComponent", instance.GroupComponent) == OK) instance.GroupComponent_isNULL = false; _L_; } void PowerSupply_OpenDRIM_ComputerSystemPowerSupply_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_ComputerSystemPowerSupply& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("GroupComponent", instance.GroupComponent) == OK) instance.GroupComponent_isNULL = false; if (inst.getProperty("PartComponent", instance.PartComponent) == OK) instance.PartComponent_isNULL = false; _L_; } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_ComputerSystemPowerSupply/OpenDRIM_ComputerSystemPowerSupplyProvider.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_ComputerSystemPowerSupply/OpenDRIM_ComputerSystemPowerSu0000644000175000017500000004342711401064722034764 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_ComputerSystemPowerSupply.h" #include "OpenDRIM_ComputerSystemPowerSupplyAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PowerSupply_OpenDRIM_ComputerSystemPowerSupplyProviderSetInstance PowerSupply_OpenDRIM_ComputerSystemPowerSupplyProviderModifyInstance #endif int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_init(const CMPIBroker* broker); int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PowerSupply_OpenDRIM_ComputerSystemPowerSupplyProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_ComputerSystemPowerSupplyProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_ComputerSystemPowerSupplyProviderEnumInstances(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_ComputerSystemPowerSupplyProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ComputerSystemPowerSupply instance; PowerSupply_OpenDRIM_ComputerSystemPowerSupply_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_ComputerSystemPowerSupplyProviderSetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ComputerSystemPowerSupply newInstance, oldInstance; PowerSupply_OpenDRIM_ComputerSystemPowerSupply_toCPP(_broker, ci, newInstance); PowerSupply_OpenDRIM_ComputerSystemPowerSupply_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_ComputerSystemPowerSupplyProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ComputerSystemPowerSupply instance; PowerSupply_OpenDRIM_ComputerSystemPowerSupply_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_ComputerSystemPowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_ComputerSystemPowerSupplyProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ComputerSystemPowerSupply instance; PowerSupply_OpenDRIM_ComputerSystemPowerSupply_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_ComputerSystemPowerSupplyProviderExecQuery(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* lang, const char* query) { _E_; CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } /* ---------------------------------------------------------------------------*/ /* End of Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Association Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PowerSupply_OpenDRIM_ComputerSystemPowerSupplyProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_ComputerSystemPowerSupplyProviderAssociatorNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnObjectPath(rslt, associatedInstances[i].getObjectpath().getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_ComputerSystemPowerSupplyProviderAssociators(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnInstance(rslt, associatedInstances[i].getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_ComputerSystemPowerSupplyProviderReferenceNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_referencePartComponentToGroupComponent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_referenceGroupComponentToPartComponent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_ComputerSystemPowerSupplyProviderReferences(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_referencePartComponentToGroupComponent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_referenceGroupComponentToPartComponent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemPowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PowerSupply_OpenDRIM_ComputerSystemPowerSupply_init FAILED: " + (string) OpenDRIM_ComputerSystemPowerSupply_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_unload(errorMessage); if (errorCode != OK) { errorMessage += "PowerSupply_OpenDRIM_ComputerSystemPowerSupply_unload FAILED: " + (string) OpenDRIM_ComputerSystemPowerSupply_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PowerSupply_OpenDRIM_ComputerSystemPowerSupply_INIT if (PowerSupply_OpenDRIM_ComputerSystemPowerSupply_init(_broker) < 0) return NULL CMInstanceMIStub(PowerSupply_OpenDRIM_ComputerSystemPowerSupplyProvider, PowerSupply_OpenDRIM_ComputerSystemPowerSupplyProvider, _broker, PowerSupply_OpenDRIM_ComputerSystemPowerSupply_INIT); CMAssociationMIStub(PowerSupply_OpenDRIM_ComputerSystemPowerSupplyProvider, PowerSupply_OpenDRIM_ComputerSystemPowerSupplyProvider, _broker, PowerSupply_OpenDRIM_ComputerSystemPowerSupply_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_ComputerSystemPowerSupply/OpenDRIM_ComputerSystemPowerSupplyAccess.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_ComputerSystemPowerSupply/OpenDRIM_ComputerSystemPowerSu0000644000175000017500000002542111401064722034756 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "OpenDRIM_ComputerSystemPowerSupplyAccess.h" int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PowerSupply_CIM_LogicalDevice_load(broker, errorMessage)); CF_assert(PowerSupply_CIM_System_load(broker, errorMessage)); */ // TODO _L_; return OK; } int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PowerSupply_CIM_LogicalDevice_unload(errorMessage)); CF_assert(PowerSupply_CIM_System_unload(errorMessage)); */ // TODO _L_; return OK; } int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_isAssociated(const Instance& PartComponent, const Instance& GroupComponent, bool& isAssociated, string& errorMessage) { _E_; // TODO Determine if the association can be established or not isAssociated=true; _L_; return OK; } int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector subjects; // Only get the instance names CF_assert(PowerSupply_OpenDRIM_ComputerSystemPowerSupply_enumeratePartComponents(broker, ctx, subjects, NULL, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PowerSupply_OpenDRIM_ComputerSystemPowerSupply_enumeratePartComponents(broker, ctx, subjects, NULL, false, errorMessage)); vector::iterator c = subjects.begin(); vector::iterator end = subjects.end(); for (; c != end; ++c) { bool leftToRight = true; vector associatedInstances; PowerSupply_OpenDRIM_ComputerSystemPowerSupply_associator(broker, ctx, (*c).getObjectpath().getHdl(), (*c), PartComponent_classnames[0], GroupComponent_classnames[0], PartComponent_role.c_str(), GroupComponent_role.c_str(), NULL, associatedInstances, leftToRight, errorMessage, "an"); string ref_discriminant = discriminant == "ein" ? "rn" : "r"; CF_assert(PowerSupply_OpenDRIM_ComputerSystemPowerSupply_referencePartComponentToGroupComponent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_ComputerSystemPowerSupply& instance, const char** properties, string& errorMessage) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ Objectpath PartComponent_objectpath; instance.getPartComponent(PartComponent_objectpath); Instance PartComponent_instance; CF_assert(PowerSupply_OpenDRIM_ComputerSystemPowerSupply_getPartComponent(broker, ctx, PartComponent_objectpath, PartComponent_instance, NULL, errorMessage)); Objectpath GroupComponent_objectpath; instance.getGroupComponent(GroupComponent_objectpath); Instance GroupComponent_instance; CF_assert(PowerSupply_OpenDRIM_ComputerSystemPowerSupply_getGroupComponent(broker, ctx, GroupComponent_objectpath, GroupComponent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(PowerSupply_OpenDRIM_ComputerSystemPowerSupply_isAssociated(PartComponent_instance, GroupComponent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemPowerSupply& newInstance, const OpenDRIM_ComputerSystemPowerSupply& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemPowerSupply& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemPowerSupply& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_associatorPartComponentToGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& PartComponent_instance, const char** properties, vector& GroupComponent_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector GroupComponent_instances; if (discriminant=="a") CF_assert(PowerSupply_OpenDRIM_ComputerSystemPowerSupply_enumerateGroupComponents(broker, ctx, GroupComponent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PowerSupply_OpenDRIM_ComputerSystemPowerSupply_enumerateGroupComponents(broker, ctx, GroupComponent_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PowerSupply_OpenDRIM_ComputerSystemPowerSupply_enumerateGroupComponents(broker, ctx, GroupComponent_instances, properties, false, errorMessage)); } for (size_t i=0; i& PartComponent_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector PartComponent_instances; if (discriminant=="a") CF_assert(PowerSupply_OpenDRIM_ComputerSystemPowerSupply_enumeratePartComponents(broker, ctx, PartComponent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PowerSupply_OpenDRIM_ComputerSystemPowerSupply_enumeratePartComponents(broker, ctx, PartComponent_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PowerSupply_OpenDRIM_ComputerSystemPowerSupply_enumeratePartComponents(broker, ctx, PartComponent_instances, properties, false, errorMessage)); } for (size_t i=0; i& GroupComponent_instances, vector& OpenDRIM_ComputerSystemPowerSupply_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < GroupComponent_instances.size(); i++) { OpenDRIM_ComputerSystemPowerSupply instance; instance.setPartComponent(((Instance) PartComponent_instance).getObjectpath()); instance.setGroupComponent(((Instance) GroupComponent_instances[i]).getObjectpath()); OpenDRIM_ComputerSystemPowerSupply_instances.push_back(instance); } _L_; return OK; } int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_referenceGroupComponentToPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& GroupComponent_instance, const vector& PartComponent_instances, vector& OpenDRIM_ComputerSystemPowerSupply_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < PartComponent_instances.size(); i++) { OpenDRIM_ComputerSystemPowerSupply instance; instance.setPartComponent(((Instance) PartComponent_instances[i]).getObjectpath()); instance.setGroupComponent(((Instance) GroupComponent_instance).getObjectpath()); OpenDRIM_ComputerSystemPowerSupply_instances.push_back(instance); } _L_; return OK; } int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_populate(OpenDRIM_ComputerSystemPowerSupply& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_ComputerSystemPowerSupply/assocOpenDRIM_ComputerSystemPowerSupply.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_ComputerSystemPowerSupply/assocOpenDRIM_ComputerSystemPo0000644000175000017500000000631211401064722034757 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef ASSOCOPENDRIM_COMPUTERSYSTEMPOWERSUPPLY_H_ #define ASSOCOPENDRIM_COMPUTERSYSTEMPOWERSUPPLY_H_ #include "OpenDRIM_ComputerSystemPowerSupplyAccess.h" int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage); int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_associator(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties, vector& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant); int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_enumeratePartComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_getPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_enumerateGroupComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_getGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_COMPUTERSYSTEMPOWERSUPPLY_H_*/ ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_ComputerSystemPowerSupply/OpenDRIM_ComputerSystemPowerSupplyAccess.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_ComputerSystemPowerSupply/OpenDRIM_ComputerSystemPowerSu0000644000175000017500000001103011401064722034745 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef OPENDRIM_COMPUTERSYSTEMPOWERSUPPLYACCESS_H_ #define OPENDRIM_COMPUTERSYSTEMPOWERSUPPLYACCESS_H_ #include "PowerSupply_Common.h" #include "OpenDRIM_ComputerSystemPowerSupply.h" #include "assocOpenDRIM_ComputerSystemPowerSupply.h" int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_load(const CMPIBroker* broker, string& errorMessage); int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_unload(string& errorMessage); int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_ComputerSystemPowerSupply& instance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemPowerSupply& newInstance, const OpenDRIM_ComputerSystemPowerSupply& oldInstance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemPowerSupply& instance, string& errorMessage); int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemPowerSupply& instance, string& errorMessage); int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_associatorPartComponentToGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& PartComponent_instance, const char** properties, vector& GroupComponent_associatedInstances, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_associatorGroupComponentToPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& GroupComponent_instance, const char** properties, vector& PartComponent_associatedInstances, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_referencePartComponentToGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& PartComponent_instance, const vector& GroupComponent_instances, vector& OpenDRIM_ComputerSystemPowerSupply_instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_referenceGroupComponentToPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& GroupComponent_instance, const vector& PartComponent_instances, vector& OpenDRIM_ComputerSystemPowerSupply_instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_ComputerSystemPowerSupply_populate(OpenDRIM_ComputerSystemPowerSupply& instance, string& errorMessage); #endif /*OPENDRIM_COMPUTERSYSTEMPOWERSUPPLYACCESS_H_*/ ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_ComputerSystemPowerSupply/OpenDRIM_ComputerSystemPowerSupply.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_ComputerSystemPowerSupply/OpenDRIM_ComputerSystemPowerSu0000644000175000017500000000704111401064722034754 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef OPENDRIM_COMPUTERSYSTEMPOWERSUPPLY_H_ #define OPENDRIM_COMPUTERSYSTEMPOWERSUPPLY_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_LogicalDevice.h" #include "CIM_LogicalDeviceAccess.h" #include "cmpiCIM_System.h" #include "CIM_SystemAccess.h" */ const static char* OpenDRIM_ComputerSystemPowerSupply_classnames[] = {"OpenDRIM_ComputerSystemPowerSupply"}; static string OpenDRIM_ComputerSystemPowerSupply_NAMESPACE = _NAMESPACE; const static string PartComponent_role = "PartComponent"; const static char* PartComponent_classnames[] = {"OpenDRIM_PowerSupply"}; const static string PartComponent_NAMESPACE = _NAMESPACE; const static string GroupComponent_role = "GroupComponent"; const static char* GroupComponent_classnames[] = {"OpenDRIM_ComputerSystem"}; const static string GroupComponent_NAMESPACE = _NAMESPACE; class OpenDRIM_ComputerSystemPowerSupply { public: Objectpath GroupComponent; bool GroupComponent_isNULL; Objectpath PartComponent; bool PartComponent_isNULL; OpenDRIM_ComputerSystemPowerSupply() { GroupComponent_isNULL = true; PartComponent_isNULL = true; } ~OpenDRIM_ComputerSystemPowerSupply() {} string getKeys() const { return CF_toLowCase(".GroupComponent=\"" + CF_quoteString(GroupComponent.toString()) + "\""".PartComponent=\"" + CF_quoteString(PartComponent.toString()) + "\""); } int getGroupComponent(Objectpath& value) const { if (GroupComponent_isNULL==true) return NOT_FOUND; value = GroupComponent; return OK; } int setGroupComponent(const Objectpath& newValue) { GroupComponent = newValue; GroupComponent.setNamespace(GroupComponent_NAMESPACE); GroupComponent_isNULL = false; return OK; } int getPartComponent(Objectpath& value) const { if (PartComponent_isNULL==true) return NOT_FOUND; value = PartComponent; return OK; } int setPartComponent(const Objectpath& newValue) { PartComponent = newValue; PartComponent.setNamespace(PartComponent_NAMESPACE); PartComponent_isNULL = false; return OK; } }; #endif /*OPENDRIM_COMPUTERSYSTEMPOWERSUPPLY_H_*/ opendrim-lmp-powersupply-1.0.0~ppa/Makefile.am0000644000175000017500000001130711401064722022206 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### VENDOR = OpenDRIM VERSION = $(shell cat ./VERSION) APP_NAME = opendrim-lmp-powersupply RPM_PACKAGE_DIR = packaging PLATFORM = $(shell rpm --eval %_target_cpu) WORKING_DIR = $(shell pwd) SUBDIRS = Common OpenDRIM_PowerSupply OpenDRIM_RegisteredPowerSupplyProfile OpenDRIM_PowerSupplyRedundancySet OpenDRIM_EnabledPowerSupplyCapabilities OpenDRIM_PowerSupplyCapabilities OpenDRIM_OwningPowerSupplyRedundancySet OpenDRIM_HostedPowerSupplyRedundancySet OpenDRIM_MemberOfPowerSupplyCollection OpenDRIM_PowerSupplyIsSpare OpenDRIM_PowerSupplyConformsToProfile OpenDRIM_SuppliesPower OpenDRIM_ComputerSystemPowerSupply test postinstall: registration/PowerSupply.sh @CIMNAMESPACE@ $(VENDOR) @CIMSERVER@ @INTEROPNAMESPACE@ $(VERSION) . preuninstall: registration/PowerSupply-remove.sh @CIMNAMESPACE@ @CIMSERVER@ @INTEROPNAMESPACE@ . test-OpenDRIM_PowerSupplyCapabilities: all make -C test test-OpenDRIM_PowerSupplyCapabilities test-OpenDRIM_OwningPowerSupplyRedundancySet: all make -C test test-OpenDRIM_OwningPowerSupplyRedundancySet test-OpenDRIM_HostedPowerSupplyRedundancySet: all make -C test test-OpenDRIM_HostedPowerSupplyRedundancySet test-OpenDRIM_PowerSupply: all make -C test test-OpenDRIM_PowerSupply test-OpenDRIM_RegisteredPowerSupplyProfile: all make -C test test-OpenDRIM_RegisteredPowerSupplyProfile test-OpenDRIM_PowerSupplyRedundancySet: all make -C test test-OpenDRIM_PowerSupplyRedundancySet test-OpenDRIM_EnabledPowerSupplyCapabilities: all make -C test test-OpenDRIM_EnabledPowerSupplyCapabilities test-OpenDRIM_MemberOfPowerSupplyCollection: all make -C test test-OpenDRIM_MemberOfPowerSupplyCollection test-OpenDRIM_PowerSupplyIsSpare: all make -C test test-OpenDRIM_PowerSupplyIsSpare test-OpenDRIM_PowerSupplyConformsToProfile: all make -C test test-OpenDRIM_PowerSupplyConformsToProfile test-OpenDRIM_SuppliesPower: all make -C test test-OpenDRIM_SuppliesPower test-OpenDRIM_ComputerSystemPowerSupply: all make -C test test-OpenDRIM_ComputerSystemPowerSupply pkg-src: rm -rf packaging/$(APP_NAME)-$(VERSION) rm -rf .tmp mkdir .tmp cp -r ./* .tmp/ rm -rf ./tmp/packaging/ mv .tmp packaging/$(APP_NAME)-$(VERSION) tar --directory packaging -zcf packaging/$(APP_NAME)-$(VERSION).tar.gz $(APP_NAME)-$(VERSION) rm -rf packaging/$(APP_NAME)-$(VERSION) pkg-rpm: pkg-src mkdir -p $(RPM_PACKAGE_DIR)/rpm/RPMS/$(PLATFORM) mkdir -p $(RPM_PACKAGE_DIR)/rpm/SRPMS mkdir -p $(RPM_PACKAGE_DIR)/rpm/BUILD mkdir -p $(RPM_PACKAGE_DIR)/rpm/SOURCES mkdir -p $(RPM_PACKAGE_DIR)/rpm/tmp - rm -r $(RPM_PACKAGE_DIR)/rpm/BUILD/$(APP_NAME)-root - rm -r $(RPM_PACKAGE_DIR)/rpm/RPMS/$(APP_NAME)-* - rm -r $(RPM_PACKAGE_DIR)/rpm/SRPMS/$(APP_NAME)-* - rm -r $(RPM_PACKAGE_DIR)/rpm/SOURCES/$(APP_NAME)-* mv packaging/$(APP_NAME)-$(VERSION).tar.gz $(RPM_PACKAGE_DIR)/rpm/SOURCES/ rpmbuild --define="_topdir $(WORKING_DIR)/$(RPM_PACKAGE_DIR)/rpm" --define="version $(VERSION)" -ba $(RPM_PACKAGE_DIR)/$(APP_NAME).spec pkg-deb: pkg-src cp packaging/$(APP_NAME)-$(VERSION).tar.gz packaging/$(APP_NAME)-$(VERSION).orig.tar.gz cd packaging/ && tar axf $(APP_NAME)-$(VERSION).tar.gz cp -R packaging/debian packaging/$(APP_NAME)-$(VERSION) - cd packaging/$(APP_NAME)-$(VERSION) && dpkg-buildpackage -b rm -rf packaging/$(APP_NAME)-$(VERSION)* packaging/*.changes opendrim-lmp-powersupply-1.0.0~ppa/registration/0000755000175000017500000000000011401064722022662 5ustar guillaumeguillaumeopendrim-lmp-powersupply-1.0.0~ppa/registration/OpenDRIM_HostedPowerSupplyRedundancySet.sh0000755000175000017500000000675311401064722033042 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_HostedPowerSupplyRedundancySet.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_HostedPowerSupplyRedundancySet provider module"; Name = "PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetModule"; Location = "cmpiPowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_HostedPowerSupplyRedundancySet provider"; Name = "PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProvider"; ProviderModuleName = "PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_HostedPowerSupplyRedundancySet provider capabilities"; ProviderModuleName = "PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetModule"; ProviderName = "PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProvider"; ClassName = "OpenDRIM_HostedPowerSupplyRedundancySet"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Antecedent", "Dependent"}; CapabilityID = "PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_HostedPowerSupplyRedundancySet.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-powersupply-1.0.0~ppa/registration/OpenDRIM_EnabledPowerSupplyCapabilities-remove.sh0000755000175000017500000000645011401064722034254 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### if test "$2" = pegasus then cimprovider -d -m PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilitiesModule cimprovider -r -m PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilitiesModule OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE < EOFC namespace=$1 index=`expr index $namespace /` while [ $index != 0 ] do namespaceFragment=${namespace:0:index-1} namespace=${namespace:index:${#namespace}-index} index=`expr index $namespace /` cat >> $OUTFILE < EOFC done cat >> $OUTFILE < EOFC cat >> $OUTFILE < EOFC PATH=$PATH:$PEGASUS_HOME/bin wbemexec $OUTFILE rm -f $OUTFILE fi if test "$2" = sfcb then OUTFILE=./OpenDRIM_EnabledPowerSupplyCapabilities.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-powersupply-1.0.0~ppa/registration/OpenDRIM_SuppliesPower.sh0000755000175000017500000000625011401064722027502 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_SuppliesPower.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_SuppliesPower provider module"; Name = "PowerSupply_OpenDRIM_SuppliesPowerModule"; Location = "cmpiPowerSupply_OpenDRIM_SuppliesPowerProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_SuppliesPower provider"; Name = "PowerSupply_OpenDRIM_SuppliesPowerProvider"; ProviderModuleName = "PowerSupply_OpenDRIM_SuppliesPowerModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_SuppliesPower provider capabilities"; ProviderModuleName = "PowerSupply_OpenDRIM_SuppliesPowerModule"; ProviderName = "PowerSupply_OpenDRIM_SuppliesPowerProvider"; ClassName = "OpenDRIM_SuppliesPower"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Antecedent", "Dependent"}; CapabilityID = "PowerSupply_OpenDRIM_SuppliesPower"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_SuppliesPower.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-powersupply-1.0.0~ppa/registration/OpenDRIM_PowerSupplyIsSpare.sh0000755000175000017500000000645311401064722030466 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_PowerSupplyIsSpare.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_PowerSupplyIsSpare provider module"; Name = "PowerSupply_OpenDRIM_PowerSupplyIsSpareModule"; Location = "cmpiPowerSupply_OpenDRIM_PowerSupplyIsSpareProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_PowerSupplyIsSpare provider"; Name = "PowerSupply_OpenDRIM_PowerSupplyIsSpareProvider"; ProviderModuleName = "PowerSupply_OpenDRIM_PowerSupplyIsSpareModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_PowerSupplyIsSpare provider capabilities"; ProviderModuleName = "PowerSupply_OpenDRIM_PowerSupplyIsSpareModule"; ProviderName = "PowerSupply_OpenDRIM_PowerSupplyIsSpareProvider"; ClassName = "OpenDRIM_PowerSupplyIsSpare"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Antecedent", "Dependent", "SpareStatus", "FailoverSupported"}; CapabilityID = "PowerSupply_OpenDRIM_PowerSupplyIsSpare"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_PowerSupplyIsSpare.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-powersupply-1.0.0~ppa/registration/PowerSupply-remove.sh0000755000175000017500000000531211401064722027026 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### if test "$2" = pegasus then if !( ps -C cimserver > /dev/null 2>&1 ) then echo "ERROR: Pegasus CIM server is not running" exit 1 fi fi if test "$2" = openwbem then if !( ps -C owcimomd > /dev/null 2>&1 ) then echo "ERROR: OpenWBEM CIM server is not running" exit 1 fi fi if test "$2" = sfcb then /etc/init.d/sfcb stop fi $4/registration/OpenDRIM_ComputerSystemPowerSupply-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_SuppliesPower-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_PowerSupplyConformsToProfile-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_PowerSupplyIsSpare-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_MemberOfPowerSupplyCollection-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_EnabledPowerSupplyCapabilities-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_PowerSupplyRedundancySet-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_RegisteredPowerSupplyProfile-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_PowerSupply-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_HostedPowerSupplyRedundancySet-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_OwningPowerSupplyRedundancySet-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_PowerSupplyCapabilities-remove.sh $1 $2 $3 $4 if test "$2" = sfcb then /etc/init.d/sfcb start fi opendrim-lmp-powersupply-1.0.0~ppa/registration/OpenDRIM_RegisteredPowerSupplyProfile-remove.sh0000755000175000017500000000642411401064722034027 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### if test "$2" = pegasus then cimprovider -d -m PowerSupply_OpenDRIM_RegisteredPowerSupplyProfileModule cimprovider -r -m PowerSupply_OpenDRIM_RegisteredPowerSupplyProfileModule OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE < EOFC namespace=$3 index=`expr index $namespace /` while [ $index != 0 ] do namespaceFragment=${namespace:0:index-1} namespace=${namespace:index:${#namespace}-index} index=`expr index $namespace /` cat >> $OUTFILE < EOFC done cat >> $OUTFILE < EOFC cat >> $OUTFILE < EOFC PATH=$PATH:$PEGASUS_HOME/bin wbemexec $OUTFILE rm -f $OUTFILE fi if test "$2" = sfcb then OUTFILE=./OpenDRIM_RegisteredPowerSupplyProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$3 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-powersupply-1.0.0~ppa/registration/OpenDRIM_EnabledPowerSupplyCapabilities.sh0000755000175000017500000000713011401064722032755 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_EnabledPowerSupplyCapabilities.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_EnabledPowerSupplyCapabilities provider module"; Name = "PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilitiesModule"; Location = "cmpiPowerSupply_OpenDRIM_EnabledPowerSupplyCapabilitiesProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_EnabledPowerSupplyCapabilities provider"; Name = "PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilitiesProvider"; ProviderModuleName = "PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilitiesModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_EnabledPowerSupplyCapabilities provider capabilities"; ProviderModuleName = "PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilitiesModule"; ProviderName = "PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilitiesProvider"; ClassName = "OpenDRIM_EnabledPowerSupplyCapabilities"; ProviderType = {2}; Namespaces = {"$1"}; SupportedProperties = {"Caption", "Description", "InstanceID", "ElementName", "ElementNameEditSupported", "MaxElementNameLen", "RequestedStatesSupported", "ElementNameMask"}; CapabilityID = "PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_EnabledPowerSupplyCapabilities.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-powersupply-1.0.0~ppa/registration/OpenDRIM_RegisteredPowerSupplyProfile.sh0000755000175000017500000000714111401064722032531 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### if test "$3" = pegasus then cimmof -aE -n $4 $6/mof/OpenDRIM_RegisteredPowerSupplyProfile.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_RegisteredPowerSupplyProfile provider module"; Name = "PowerSupply_OpenDRIM_RegisteredPowerSupplyProfileModule"; Location = "cmpiPowerSupply_OpenDRIM_RegisteredPowerSupplyProfileProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_RegisteredPowerSupplyProfile provider"; Name = "PowerSupply_OpenDRIM_RegisteredPowerSupplyProfileProvider"; ProviderModuleName = "PowerSupply_OpenDRIM_RegisteredPowerSupplyProfileModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_RegisteredPowerSupplyProfile provider capabilities"; ProviderModuleName = "PowerSupply_OpenDRIM_RegisteredPowerSupplyProfileModule"; ProviderName = "PowerSupply_OpenDRIM_RegisteredPowerSupplyProfileProvider"; ClassName = "OpenDRIM_RegisteredPowerSupplyProfile"; ProviderType = {2}; Namespaces = {"$4"}; SupportedProperties = {"Caption", "Description", "ElementName", "InstanceID", "RegisteredOrganization", "OtherRegisteredOrganization", "RegisteredName", "RegisteredVersion", "AdvertiseTypes", "AdvertiseTypeDescriptions"}; CapabilityID = "PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_RegisteredPowerSupplyProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$4 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-powersupply-1.0.0~ppa/registration/OpenDRIM_PowerSupplyIsSpare-remove.sh0000755000175000017500000000627411401064722031762 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### if test "$2" = pegasus then cimprovider -d -m PowerSupply_OpenDRIM_PowerSupplyIsSpareModule cimprovider -r -m PowerSupply_OpenDRIM_PowerSupplyIsSpareModule OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE < EOFC namespace=$1 index=`expr index $namespace /` while [ $index != 0 ] do namespaceFragment=${namespace:0:index-1} namespace=${namespace:index:${#namespace}-index} index=`expr index $namespace /` cat >> $OUTFILE < EOFC done cat >> $OUTFILE < EOFC cat >> $OUTFILE < EOFC PATH=$PATH:$PEGASUS_HOME/bin wbemexec $OUTFILE rm -f $OUTFILE fi if test "$2" = sfcb then OUTFILE=./OpenDRIM_PowerSupplyIsSpare.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-powersupply-1.0.0~ppa/registration/OpenDRIM_PowerSupplyCapabilities-remove.sh0000755000175000017500000000635611401064722033006 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### if test "$2" = pegasus then cimprovider -d -m PowerSupply_OpenDRIM_PowerSupplyCapabilitiesModule cimprovider -r -m PowerSupply_OpenDRIM_PowerSupplyCapabilitiesModule OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE < EOFC namespace=$1 index=`expr index $namespace /` while [ $index != 0 ] do namespaceFragment=${namespace:0:index-1} namespace=${namespace:index:${#namespace}-index} index=`expr index $namespace /` cat >> $OUTFILE < EOFC done cat >> $OUTFILE < EOFC cat >> $OUTFILE < EOFC PATH=$PATH:$PEGASUS_HOME/bin wbemexec $OUTFILE rm -f $OUTFILE fi if test "$2" = sfcb then OUTFILE=./OpenDRIM_PowerSupplyCapabilities.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-powersupply-1.0.0~ppa/registration/OpenDRIM_HostedPowerSupplyRedundancySet-remove.sh0000755000175000017500000000646411401064722034334 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### if test "$2" = pegasus then cimprovider -d -m PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetModule cimprovider -r -m PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetModule OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE < EOFC namespace=$1 index=`expr index $namespace /` while [ $index != 0 ] do namespaceFragment=${namespace:0:index-1} namespace=${namespace:index:${#namespace}-index} index=`expr index $namespace /` cat >> $OUTFILE < EOFC done cat >> $OUTFILE < EOFC cat >> $OUTFILE < EOFC PATH=$PATH:$PEGASUS_HOME/bin wbemexec $OUTFILE rm -f $OUTFILE fi if test "$2" = sfcb then OUTFILE=./OpenDRIM_HostedPowerSupplyRedundancySet.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-powersupply-1.0.0~ppa/registration/OpenDRIM_SuppliesPower-remove.sh0000755000175000017500000000621211401064722030773 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### if test "$2" = pegasus then cimprovider -d -m PowerSupply_OpenDRIM_SuppliesPowerModule cimprovider -r -m PowerSupply_OpenDRIM_SuppliesPowerModule OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE < EOFC namespace=$1 index=`expr index $namespace /` while [ $index != 0 ] do namespaceFragment=${namespace:0:index-1} namespace=${namespace:index:${#namespace}-index} index=`expr index $namespace /` cat >> $OUTFILE < EOFC done cat >> $OUTFILE < EOFC cat >> $OUTFILE < EOFC PATH=$PATH:$PEGASUS_HOME/bin wbemexec $OUTFILE rm -f $OUTFILE fi if test "$2" = sfcb then OUTFILE=./OpenDRIM_SuppliesPower.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-powersupply-1.0.0~ppa/registration/OpenDRIM_ComputerSystemPowerSupply-remove.sh0000755000175000017500000000640211401064722033410 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### if test "$2" = pegasus then cimprovider -d -m PowerSupply_OpenDRIM_ComputerSystemPowerSupplyModule cimprovider -r -m PowerSupply_OpenDRIM_ComputerSystemPowerSupplyModule OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE < EOFC namespace=$1 index=`expr index $namespace /` while [ $index != 0 ] do namespaceFragment=${namespace:0:index-1} namespace=${namespace:index:${#namespace}-index} index=`expr index $namespace /` cat >> $OUTFILE < EOFC done cat >> $OUTFILE < EOFC cat >> $OUTFILE < EOFC PATH=$PATH:$PEGASUS_HOME/bin wbemexec $OUTFILE rm -f $OUTFILE fi if test "$2" = sfcb then OUTFILE=./OpenDRIM_ComputerSystemPowerSupply.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-powersupply-1.0.0~ppa/registration/OpenDRIM_PowerSupplyRedundancySet.sh0000755000175000017500000000713311401064722031664 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_PowerSupplyRedundancySet.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_PowerSupplyRedundancySet provider module"; Name = "PowerSupply_OpenDRIM_PowerSupplyRedundancySetModule"; Location = "cmpiPowerSupply_OpenDRIM_PowerSupplyRedundancySetProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_PowerSupplyRedundancySet provider"; Name = "PowerSupply_OpenDRIM_PowerSupplyRedundancySetProvider"; ProviderModuleName = "PowerSupply_OpenDRIM_PowerSupplyRedundancySetModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_PowerSupplyRedundancySet provider capabilities"; ProviderModuleName = "PowerSupply_OpenDRIM_PowerSupplyRedundancySetModule"; ProviderName = "PowerSupply_OpenDRIM_PowerSupplyRedundancySetProvider"; ClassName = "OpenDRIM_PowerSupplyRedundancySet"; ProviderType = {2, 5}; Namespaces = {"$1"}; SupportedProperties = {"Caption", "Description", "ElementName", "InstanceID", "RedundancyStatus", "TypeOfSet", "MinNumberNeeded", "MaxNumberSupported", "VendorIdentifyingInfo", "OtherTypeOfSet", "LoadBalanceAlgorithm", "OtherLoadBalanceAlgorithm"}; SupportedMethods = {"Failover"}; CapabilityID = "PowerSupply_OpenDRIM_PowerSupplyRedundancySet"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_PowerSupplyRedundancySet.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-powersupply-1.0.0~ppa/registration/OpenDRIM_PowerSupplyCapabilities.sh0000755000175000017500000000660011401064722031503 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_PowerSupplyCapabilities.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_PowerSupplyCapabilities provider module"; Name = "PowerSupply_OpenDRIM_PowerSupplyCapabilitiesModule"; Location = "cmpiPowerSupply_OpenDRIM_PowerSupplyCapabilitiesProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_PowerSupplyCapabilities provider"; Name = "PowerSupply_OpenDRIM_PowerSupplyCapabilitiesProvider"; ProviderModuleName = "PowerSupply_OpenDRIM_PowerSupplyCapabilitiesModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_PowerSupplyCapabilities provider capabilities"; ProviderModuleName = "PowerSupply_OpenDRIM_PowerSupplyCapabilitiesModule"; ProviderName = "PowerSupply_OpenDRIM_PowerSupplyCapabilitiesProvider"; ClassName = "OpenDRIM_PowerSupplyCapabilities"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"ManagedElement", "Capabilities", "Characteristics"}; CapabilityID = "PowerSupply_OpenDRIM_PowerSupplyCapabilities"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_PowerSupplyCapabilities.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-powersupply-1.0.0~ppa/registration/OpenDRIM_PowerSupplyRedundancySet-remove.sh0000755000175000017500000000636311401064722033163 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### if test "$2" = pegasus then cimprovider -d -m PowerSupply_OpenDRIM_PowerSupplyRedundancySetModule cimprovider -r -m PowerSupply_OpenDRIM_PowerSupplyRedundancySetModule OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE < EOFC namespace=$1 index=`expr index $namespace /` while [ $index != 0 ] do namespaceFragment=${namespace:0:index-1} namespace=${namespace:index:${#namespace}-index} index=`expr index $namespace /` cat >> $OUTFILE < EOFC done cat >> $OUTFILE < EOFC cat >> $OUTFILE < EOFC PATH=$PATH:$PEGASUS_HOME/bin wbemexec $OUTFILE rm -f $OUTFILE fi if test "$2" = sfcb then OUTFILE=./OpenDRIM_PowerSupplyRedundancySet.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-powersupply-1.0.0~ppa/registration/OpenDRIM_ComputerSystemPowerSupply.sh0000755000175000017500000000662411401064722032123 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_ComputerSystemPowerSupply.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_ComputerSystemPowerSupply provider module"; Name = "PowerSupply_OpenDRIM_ComputerSystemPowerSupplyModule"; Location = "cmpiPowerSupply_OpenDRIM_ComputerSystemPowerSupplyProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_ComputerSystemPowerSupply provider"; Name = "PowerSupply_OpenDRIM_ComputerSystemPowerSupplyProvider"; ProviderModuleName = "PowerSupply_OpenDRIM_ComputerSystemPowerSupplyModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_ComputerSystemPowerSupply provider capabilities"; ProviderModuleName = "PowerSupply_OpenDRIM_ComputerSystemPowerSupplyModule"; ProviderName = "PowerSupply_OpenDRIM_ComputerSystemPowerSupplyProvider"; ClassName = "OpenDRIM_ComputerSystemPowerSupply"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"GroupComponent", "PartComponent"}; CapabilityID = "PowerSupply_OpenDRIM_ComputerSystemPowerSupply"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_ComputerSystemPowerSupply.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-powersupply-1.0.0~ppa/registration/OpenDRIM_MemberOfPowerSupplyCollection-remove.sh0000755000175000017500000000645211401064722034122 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### if test "$2" = pegasus then cimprovider -d -m PowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionModule cimprovider -r -m PowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionModule OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE < EOFC namespace=$1 index=`expr index $namespace /` while [ $index != 0 ] do namespaceFragment=${namespace:0:index-1} namespace=${namespace:index:${#namespace}-index} index=`expr index $namespace /` cat >> $OUTFILE < EOFC done cat >> $OUTFILE < EOFC cat >> $OUTFILE < EOFC PATH=$PATH:$PEGASUS_HOME/bin wbemexec $OUTFILE rm -f $OUTFILE fi if test "$2" = sfcb then OUTFILE=./OpenDRIM_MemberOfPowerSupplyCollection.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-powersupply-1.0.0~ppa/registration/OpenDRIM_PowerSupplyConformsToProfile.sh0000755000175000017500000000722411401064722032527 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_PowerSupplyConformsToProfile.mof cimmof -aE -n $4 $6/mof/OpenDRIM_PowerSupplyConformsToProfile.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_PowerSupplyConformsToProfile provider module"; Name = "PowerSupply_OpenDRIM_PowerSupplyConformsToProfileModule"; Location = "cmpiPowerSupply_OpenDRIM_PowerSupplyConformsToProfileProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_PowerSupplyConformsToProfile provider"; Name = "PowerSupply_OpenDRIM_PowerSupplyConformsToProfileProvider"; ProviderModuleName = "PowerSupply_OpenDRIM_PowerSupplyConformsToProfileModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_PowerSupplyConformsToProfile provider capabilities"; ProviderModuleName = "PowerSupply_OpenDRIM_PowerSupplyConformsToProfileModule"; ProviderName = "PowerSupply_OpenDRIM_PowerSupplyConformsToProfileProvider"; ClassName = "OpenDRIM_PowerSupplyConformsToProfile"; ProviderType = {2, 3}; Namespaces = {"$1", "$4"}; SupportedProperties = {"ConformantStandard", "ManagedElement"}; CapabilityID = "PowerSupply_OpenDRIM_PowerSupplyConformsToProfile"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_PowerSupplyConformsToProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE owmofc -u http://localhost/$4 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-powersupply-1.0.0~ppa/registration/OpenDRIM_PowerSupply-remove.sh0000755000175000017500000000616111401064722030466 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### if test "$2" = pegasus then cimprovider -d -m PowerSupply_OpenDRIM_PowerSupplyModule cimprovider -r -m PowerSupply_OpenDRIM_PowerSupplyModule OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE < EOFC namespace=$1 index=`expr index $namespace /` while [ $index != 0 ] do namespaceFragment=${namespace:0:index-1} namespace=${namespace:index:${#namespace}-index} index=`expr index $namespace /` cat >> $OUTFILE < EOFC done cat >> $OUTFILE < EOFC cat >> $OUTFILE < EOFC PATH=$PATH:$PEGASUS_HOME/bin wbemexec $OUTFILE rm -f $OUTFILE fi if test "$2" = sfcb then OUTFILE=./OpenDRIM_PowerSupply.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-powersupply-1.0.0~ppa/registration/OpenDRIM_OwningPowerSupplyRedundancySet.sh0000755000175000017500000000676111401064722033054 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_OwningPowerSupplyRedundancySet.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_OwningPowerSupplyRedundancySet provider module"; Name = "PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetModule"; Location = "cmpiPowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_OwningPowerSupplyRedundancySet provider"; Name = "PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProvider"; ProviderModuleName = "PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_OwningPowerSupplyRedundancySet provider capabilities"; ProviderModuleName = "PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetModule"; ProviderName = "PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProvider"; ClassName = "OpenDRIM_OwningPowerSupplyRedundancySet"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"OwningElement", "OwnedElement"}; CapabilityID = "PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_OwningPowerSupplyRedundancySet.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-powersupply-1.0.0~ppa/registration/OpenDRIM_PowerSupply.sh0000755000175000017500000001037311401064722027173 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_PowerSupply.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_PowerSupply provider module"; Name = "PowerSupply_OpenDRIM_PowerSupplyModule"; Location = "cmpiPowerSupply_OpenDRIM_PowerSupplyProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_PowerSupply provider"; Name = "PowerSupply_OpenDRIM_PowerSupplyProvider"; ProviderModuleName = "PowerSupply_OpenDRIM_PowerSupplyModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_PowerSupply provider capabilities"; ProviderModuleName = "PowerSupply_OpenDRIM_PowerSupplyModule"; ProviderName = "PowerSupply_OpenDRIM_PowerSupplyProvider"; ClassName = "OpenDRIM_PowerSupply"; ProviderType = {2, 5}; Namespaces = {"$1"}; SupportedProperties = {"InstanceID", "Caption", "Description", "ElementName", "InstallDate", "Name", "OperationalStatus", "StatusDescriptions", "Status", "HealthState", "CommunicationStatus", "DetailedStatus", "OperatingStatus", "PrimaryStatus", "EnabledState", "OtherEnabledState", "RequestedState", "EnabledDefault", "TimeOfLastStateChange", "AvailableRequestedStates", "TransitioningToState", "SystemCreationClassName", "SystemName", "CreationClassName", "DeviceID", "PowerManagementSupported", "PowerManagementCapabilities", "Availability", "StatusInfo", "LastErrorCode", "ErrorDescription", "ErrorCleared", "OtherIdentifyingInfo", "PowerOnHours", "TotalPowerOnHours", "IdentifyingDescriptions", "AdditionalAvailability", "MaxQuiesceTime", "IsSwitchingSupply", "Range1InputVoltageLow", "Range1InputVoltageHigh", "Range1InputFrequencyLow", "Range1InputFrequencyHigh", "Range2InputVoltageLow", "Range2InputVoltageHigh", "Range2InputFrequencyLow", "Range2InputFrequencyHigh", "ActiveInputVoltage", "TypeOfRangeSwitching", "TotalOutputPower"}; SupportedMethods = {"RequestStateChange", "SetPowerState", "Reset", "EnableDevice", "OnlineDevice", "QuiesceDevice", "SaveProperties", "RestoreProperties"}; CapabilityID = "PowerSupply_OpenDRIM_PowerSupply"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_PowerSupply.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-powersupply-1.0.0~ppa/registration/PowerSupply.sh0000755000175000017500000000527611401064722025544 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### if test "$3" = pegasus then if !( ps -C cimserver > /dev/null 2>&1 ) then echo "ERROR: Pegasus CIM server is not running" exit 1 fi fi if test "$3" = openwbem then if !( ps -C owcimomd > /dev/null 2>&1 ) then echo "ERROR: OpenWBEM CIM server is not running" exit 1 fi fi if test "$3" = sfcb then /etc/init.d/sfcb stop fi $6/registration/OpenDRIM_PowerSupplyCapabilities.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_OwningPowerSupplyRedundancySet.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_HostedPowerSupplyRedundancySet.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_PowerSupply.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_RegisteredPowerSupplyProfile.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_PowerSupplyRedundancySet.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_EnabledPowerSupplyCapabilities.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_MemberOfPowerSupplyCollection.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_PowerSupplyIsSpare.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_PowerSupplyConformsToProfile.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_SuppliesPower.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_ComputerSystemPowerSupply.sh $1 $2 $3 $4 $5 $6 if test "$3" = sfcb then /etc/init.d/sfcb start fi opendrim-lmp-powersupply-1.0.0~ppa/registration/OpenDRIM_MemberOfPowerSupplyCollection.sh0000755000175000017500000000672511401064722032632 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_MemberOfPowerSupplyCollection.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_MemberOfPowerSupplyCollection provider module"; Name = "PowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionModule"; Location = "cmpiPowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_MemberOfPowerSupplyCollection provider"; Name = "PowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProvider"; ProviderModuleName = "PowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_MemberOfPowerSupplyCollection provider capabilities"; ProviderModuleName = "PowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionModule"; ProviderName = "PowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProvider"; ClassName = "OpenDRIM_MemberOfPowerSupplyCollection"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Collection", "Member"}; CapabilityID = "PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_MemberOfPowerSupplyCollection.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-powersupply-1.0.0~ppa/registration/OpenDRIM_PowerSupplyConformsToProfile-remove.sh0000755000175000017500000001036611401064722034023 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### if test "$2" = pegasus then cimprovider -d -m PowerSupply_OpenDRIM_PowerSupplyConformsToProfileModule cimprovider -r -m PowerSupply_OpenDRIM_PowerSupplyConformsToProfileModule OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE < EOFC namespace=$1 index=`expr index $namespace /` while [ $index != 0 ] do namespaceFragment=${namespace:0:index-1} namespace=${namespace:index:${#namespace}-index} index=`expr index $namespace /` cat >> $OUTFILE < EOFC done cat >> $OUTFILE < EOFC cat >> $OUTFILE < EOFC PATH=$PATH:$PEGASUS_HOME/bin wbemexec $OUTFILE rm -f $OUTFILE cat >> $OUTFILE < EOFC namespace=$3 index=`expr index $namespace /` while [ $index != 0 ] do namespaceFragment=${namespace:0:index-1} namespace=${namespace:index:${#namespace}-index} index=`expr index $namespace /` cat >> $OUTFILE < EOFC done cat >> $OUTFILE < EOFC cat >> $OUTFILE < EOFC wbemexec $OUTFILE rm -f $OUTFILE fi if test "$2" = sfcb then OUTFILE=./OpenDRIM_PowerSupplyConformsToProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE owmofc -u http://localhost/$3 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-powersupply-1.0.0~ppa/registration/OpenDRIM_OwningPowerSupplyRedundancySet-remove.sh0000755000175000017500000000646411401064722034347 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### if test "$2" = pegasus then cimprovider -d -m PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetModule cimprovider -r -m PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetModule OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE < EOFC namespace=$1 index=`expr index $namespace /` while [ $index != 0 ] do namespaceFragment=${namespace:0:index-1} namespace=${namespace:index:${#namespace}-index} index=`expr index $namespace /` cat >> $OUTFILE < EOFC done cat >> $OUTFILE < EOFC cat >> $OUTFILE < EOFC PATH=$PATH:$PEGASUS_HOME/bin wbemexec $OUTFILE rm -f $OUTFILE fi if test "$2" = sfcb then OUTFILE=./OpenDRIM_OwningPowerSupplyRedundancySet.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyCapabilities/0000755000175000017500000000000011401064722026430 5ustar guillaumeguillaumeopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyCapabilities/Makefile.am0000644000175000017500000000500011401064722030457 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPowerSupply_OpenDRIM_PowerSupplyCapabilitiesProvider.la libcmpiPowerSupply_OpenDRIM_PowerSupplyCapabilitiesProvider_la_SOURCES = OpenDRIM_PowerSupplyCapabilitiesAccess.cpp OpenDRIM_PowerSupplyCapabilitiesProvider.cpp cmpiOpenDRIM_PowerSupplyCapabilities.cpp assocOpenDRIM_PowerSupplyCapabilities.cpp # May have to be adjusted for direct invocation libcmpiPowerSupply_OpenDRIM_PowerSupplyCapabilitiesProvider_la_CPPFLAGS = -I../CIM_Capabilities -I../CIM_ManagedElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiPowerSupply_OpenDRIM_PowerSupplyCapabilitiesProvider_la_LIBADD = ../Common/libcmpiPowerSupply_Common.la #../CIM_Capabilities/libcmpiPowerSupply_CIM_CapabilitiesProvider.la ../CIM_ManagedElement/libcmpiPowerSupply_CIM_ManagedElementProvider.la libcmpiPowerSupply_OpenDRIM_PowerSupplyCapabilitiesProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_PowerSupplyCapabilities.h OpenDRIM_PowerSupplyCapabilities.h OpenDRIM_PowerSupplyCapabilitiesAccess.h ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyCapabilities/OpenDRIM_PowerSupplyCapabilitiesAccess.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyCapabilities/OpenDRIM_PowerSupplyCapabilities0000644000175000017500000001073011401064722034634 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef OPENDRIM_POWERSUPPLYCAPABILITIESACCESS_H_ #define OPENDRIM_POWERSUPPLYCAPABILITIESACCESS_H_ #include "PowerSupply_Common.h" #include "OpenDRIM_PowerSupplyCapabilities.h" #include "assocOpenDRIM_PowerSupplyCapabilities.h" int PowerSupply_OpenDRIM_PowerSupplyCapabilities_load(const CMPIBroker* broker, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyCapabilities_unload(string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyCapabilities_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_PowerSupplyCapabilities_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_PowerSupplyCapabilities& instance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyCapabilities_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupplyCapabilities& newInstance, const OpenDRIM_PowerSupplyCapabilities& oldInstance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyCapabilities_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupplyCapabilities& instance, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyCapabilities_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupplyCapabilities& instance, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyCapabilities_associatorCapabilitiesToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Capabilities_instance, const char** properties, vector& ManagedElement_associatedInstances, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_PowerSupplyCapabilities_associatorManagedElementToCapabilities(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const char** properties, vector& Capabilities_associatedInstances, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_PowerSupplyCapabilities_referenceCapabilitiesToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Capabilities_instance, const vector& ManagedElement_instances, vector& OpenDRIM_PowerSupplyCapabilities_instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_PowerSupplyCapabilities_referenceManagedElementToCapabilities(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& Capabilities_instances, vector& OpenDRIM_PowerSupplyCapabilities_instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_PowerSupplyCapabilities_populate(OpenDRIM_PowerSupplyCapabilities& instance, string& errorMessage); #endif /*OPENDRIM_POWERSUPPLYCAPABILITIESACCESS_H_*/ ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyCapabilities/OpenDRIM_PowerSupplyCapabilitiesAccess.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyCapabilities/OpenDRIM_PowerSupplyCapabilities0000644000175000017500000002577711401064722034655 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "OpenDRIM_PowerSupplyCapabilitiesAccess.h" int PowerSupply_OpenDRIM_PowerSupplyCapabilities_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PowerSupply_CIM_Capabilities_load(broker, errorMessage)); CF_assert(PowerSupply_CIM_ManagedElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyCapabilities_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PowerSupply_CIM_Capabilities_unload(errorMessage)); CF_assert(PowerSupply_CIM_ManagedElement_unload(errorMessage)); */ // TODO _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyCapabilities_isAssociated(const Instance& Capabilities, const Instance& ManagedElement, bool& isAssociated, string& errorMessage) { _E_; // TODO Determine if the association can be established or not isAssociated=true; _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyCapabilities_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector subjects; // Only get the instance names CF_assert(PowerSupply_OpenDRIM_PowerSupplyCapabilities_enumerateCapabilitiess(broker, ctx, subjects, NULL, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PowerSupply_OpenDRIM_PowerSupplyCapabilities_enumerateCapabilitiess(broker, ctx, subjects, NULL, false, errorMessage)); vector::iterator c = subjects.begin(); vector::iterator end = subjects.end(); for (; c != end; ++c) { bool leftToRight = true; vector associatedInstances; PowerSupply_OpenDRIM_PowerSupplyCapabilities_associator(broker, ctx, (*c).getObjectpath().getHdl(), (*c), Capabilities_classnames[0], ManagedElement_classnames[0], Capabilities_role.c_str(), ManagedElement_role.c_str(), NULL, associatedInstances, leftToRight, errorMessage, "an"); string ref_discriminant = discriminant == "ein" ? "rn" : "r"; CF_assert(PowerSupply_OpenDRIM_PowerSupplyCapabilities_referenceCapabilitiesToManagedElement(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyCapabilities_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_PowerSupplyCapabilities& instance, const char** properties, string& errorMessage) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ Objectpath Capabilities_objectpath; instance.getCapabilities(Capabilities_objectpath); Instance Capabilities_instance; CF_assert(PowerSupply_OpenDRIM_PowerSupplyCapabilities_getCapabilities(broker, ctx, Capabilities_objectpath, Capabilities_instance, NULL, errorMessage)); Objectpath ManagedElement_objectpath; instance.getManagedElement(ManagedElement_objectpath); Instance ManagedElement_instance; CF_assert(PowerSupply_OpenDRIM_PowerSupplyCapabilities_getManagedElement(broker, ctx, ManagedElement_objectpath, ManagedElement_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(PowerSupply_OpenDRIM_PowerSupplyCapabilities_isAssociated(Capabilities_instance, ManagedElement_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } CF_assert(PowerSupply_OpenDRIM_PowerSupplyCapabilities_populate(instance, errorMessage)); _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyCapabilities_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupplyCapabilities& newInstance, const OpenDRIM_PowerSupplyCapabilities& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_PowerSupplyCapabilities_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupplyCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_PowerSupplyCapabilities_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupplyCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_PowerSupplyCapabilities_associatorCapabilitiesToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Capabilities_instance, const char** properties, vector& ManagedElement_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector ManagedElement_instances; if (discriminant=="a") CF_assert(PowerSupply_OpenDRIM_PowerSupplyCapabilities_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PowerSupply_OpenDRIM_PowerSupplyCapabilities_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PowerSupply_OpenDRIM_PowerSupplyCapabilities_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); } for (size_t i=0; i& Capabilities_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector Capabilities_instances; if (discriminant=="a") CF_assert(PowerSupply_OpenDRIM_PowerSupplyCapabilities_enumerateCapabilitiess(broker, ctx, Capabilities_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PowerSupply_OpenDRIM_PowerSupplyCapabilities_enumerateCapabilitiess(broker, ctx, Capabilities_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PowerSupply_OpenDRIM_PowerSupplyCapabilities_enumerateCapabilitiess(broker, ctx, Capabilities_instances, properties, false, errorMessage)); } for (size_t i=0; i& ManagedElement_instances, vector& OpenDRIM_PowerSupplyCapabilities_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < ManagedElement_instances.size(); i++) { OpenDRIM_PowerSupplyCapabilities instance; instance.setCapabilities(((Instance) Capabilities_instance).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instances[i]).getObjectpath()); if (discriminant == "r") { CF_assert(PowerSupply_OpenDRIM_PowerSupplyCapabilities_populate(instance, errorMessage)); } OpenDRIM_PowerSupplyCapabilities_instances.push_back(instance); } _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyCapabilities_referenceManagedElementToCapabilities(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& Capabilities_instances, vector& OpenDRIM_PowerSupplyCapabilities_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < Capabilities_instances.size(); i++) { OpenDRIM_PowerSupplyCapabilities instance; instance.setCapabilities(((Instance) Capabilities_instances[i]).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instance).getObjectpath()); if (discriminant == "r") { CF_assert(PowerSupply_OpenDRIM_PowerSupplyCapabilities_populate(instance, errorMessage)); } OpenDRIM_PowerSupplyCapabilities_instances.push_back(instance); } _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyCapabilities_populate(OpenDRIM_PowerSupplyCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyCapabilities/cmpiOpenDRIM_PowerSupplyCapabilities.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyCapabilities/cmpiOpenDRIM_PowerSupplyCapabili0000644000175000017500000000656411401064722034632 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_PowerSupplyCapabilities.h" CMPIObjectPath* PowerSupply_OpenDRIM_PowerSupplyCapabilities_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PowerSupplyCapabilities& instance) { _E_; Objectpath op(broker, OpenDRIM_PowerSupplyCapabilities_classnames[0], OpenDRIM_PowerSupplyCapabilities_NAMESPACE); if (!instance.ManagedElement_isNULL) op.addKey("ManagedElement", instance.ManagedElement); if (!instance.Capabilities_isNULL) op.addKey("Capabilities", instance.Capabilities); _L_; return op.getHdl(); } CMPIInstance* PowerSupply_OpenDRIM_PowerSupplyCapabilities_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PowerSupplyCapabilities& instance) { _E_; Objectpath op(broker, PowerSupply_OpenDRIM_PowerSupplyCapabilities_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.Characteristics_isNULL) ci.setProperty("Characteristics", instance.Characteristics); _L_; return ci.getHdl(); } void PowerSupply_OpenDRIM_PowerSupplyCapabilities_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PowerSupplyCapabilities& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("Capabilities", instance.Capabilities) == OK) instance.Capabilities_isNULL = false; if (op.getKey("ManagedElement", instance.ManagedElement) == OK) instance.ManagedElement_isNULL = false; _L_; } void PowerSupply_OpenDRIM_PowerSupplyCapabilities_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PowerSupplyCapabilities& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("ManagedElement", instance.ManagedElement) == OK) instance.ManagedElement_isNULL = false; if (inst.getProperty("Capabilities", instance.Capabilities) == OK) instance.Capabilities_isNULL = false; if (inst.getProperty("Characteristics", instance.Characteristics) == OK) instance.Characteristics_isNULL = false; _L_; } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyCapabilities/OpenDRIM_PowerSupplyCapabilities.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyCapabilities/OpenDRIM_PowerSupplyCapabilities0000644000175000017500000000767611401064722034653 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef OPENDRIM_POWERSUPPLYCAPABILITIES_H_ #define OPENDRIM_POWERSUPPLYCAPABILITIES_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_Capabilities.h" #include "CIM_CapabilitiesAccess.h" #include "cmpiCIM_ManagedElement.h" #include "CIM_ManagedElementAccess.h" */ const static char* OpenDRIM_PowerSupplyCapabilities_classnames[] = {"OpenDRIM_PowerSupplyCapabilities"}; static string OpenDRIM_PowerSupplyCapabilities_NAMESPACE = _NAMESPACE; const static string Capabilities_role = "Capabilities"; const static char* Capabilities_classnames[] = {"OpenDRIM_EnabledPowerSupplyCapabilities"}; const static string Capabilities_NAMESPACE = _NAMESPACE; const static string ManagedElement_role = "ManagedElement"; const static char* ManagedElement_classnames[] = {"OpenDRIM_PowerSupply"}; const static string ManagedElement_NAMESPACE = _NAMESPACE; class OpenDRIM_PowerSupplyCapabilities { public: Objectpath ManagedElement; bool ManagedElement_isNULL; Objectpath Capabilities; bool Capabilities_isNULL; vector Characteristics; bool Characteristics_isNULL; OpenDRIM_PowerSupplyCapabilities() { ManagedElement_isNULL = true; Capabilities_isNULL = true; Characteristics_isNULL = true; } ~OpenDRIM_PowerSupplyCapabilities() {} string getKeys() const { return CF_toLowCase(".ManagedElement=\"" + CF_quoteString(ManagedElement.toString()) + "\""".Capabilities=\"" + CF_quoteString(Capabilities.toString()) + "\""); } int getManagedElement(Objectpath& value) const { if (ManagedElement_isNULL==true) return NOT_FOUND; value = ManagedElement; return OK; } int setManagedElement(const Objectpath& newValue) { ManagedElement = newValue; ManagedElement.setNamespace(ManagedElement_NAMESPACE); ManagedElement_isNULL = false; return OK; } int getCapabilities(Objectpath& value) const { if (Capabilities_isNULL==true) return NOT_FOUND; value = Capabilities; return OK; } int setCapabilities(const Objectpath& newValue) { Capabilities = newValue; Capabilities.setNamespace(Capabilities_NAMESPACE); Capabilities_isNULL = false; return OK; } int getCharacteristics(vector& value) const { if (Characteristics_isNULL==true) return NOT_FOUND; value = Characteristics; return OK; } int setCharacteristics(const vector& newValue) { Characteristics = newValue; Characteristics_isNULL = false; return OK; } }; #endif /*OPENDRIM_POWERSUPPLYCAPABILITIES_H_*/ ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyCapabilities/OpenDRIM_PowerSupplyCapabilitiesProvider.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyCapabilities/OpenDRIM_PowerSupplyCapabilities0000644000175000017500000004313711401064722034643 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_PowerSupplyCapabilities.h" #include "OpenDRIM_PowerSupplyCapabilitiesAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PowerSupply_OpenDRIM_PowerSupplyCapabilitiesProviderSetInstance PowerSupply_OpenDRIM_PowerSupplyCapabilitiesProviderModifyInstance #endif int PowerSupply_OpenDRIM_PowerSupplyCapabilities_init(const CMPIBroker* broker); int PowerSupply_OpenDRIM_PowerSupplyCapabilities_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PowerSupply_OpenDRIM_PowerSupplyCapabilitiesProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyCapabilitiesProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PowerSupply_OpenDRIM_PowerSupplyCapabilities_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyCapabilitiesProviderEnumInstances(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PowerSupply_OpenDRIM_PowerSupplyCapabilities_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyCapabilitiesProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PowerSupplyCapabilities instance; PowerSupply_OpenDRIM_PowerSupplyCapabilities_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PowerSupply_OpenDRIM_PowerSupplyCapabilities_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyCapabilitiesProviderSetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PowerSupplyCapabilities newInstance, oldInstance; PowerSupply_OpenDRIM_PowerSupplyCapabilities_toCPP(_broker, ci, newInstance); PowerSupply_OpenDRIM_PowerSupplyCapabilities_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyCapabilitiesProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PowerSupplyCapabilities instance; PowerSupply_OpenDRIM_PowerSupplyCapabilities_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_PowerSupplyCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PowerSupply_OpenDRIM_PowerSupplyCapabilities_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyCapabilitiesProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PowerSupplyCapabilities instance; PowerSupply_OpenDRIM_PowerSupplyCapabilities_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyCapabilitiesProviderExecQuery(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* lang, const char* query) { _E_; CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } /* ---------------------------------------------------------------------------*/ /* End of Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Association Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PowerSupply_OpenDRIM_PowerSupplyCapabilitiesProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyCapabilitiesProviderAssociatorNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnObjectPath(rslt, associatedInstances[i].getObjectpath().getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyCapabilitiesProviderAssociators(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnInstance(rslt, associatedInstances[i].getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyCapabilitiesProviderReferenceNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_referenceCapabilitiesToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_referenceManagedElementToCapabilities(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = PowerSupply_OpenDRIM_PowerSupplyCapabilities_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyCapabilitiesProviderReferences(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_referenceCapabilitiesToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_referenceManagedElementToCapabilities(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = PowerSupply_OpenDRIM_PowerSupplyCapabilities_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int PowerSupply_OpenDRIM_PowerSupplyCapabilities_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PowerSupply_OpenDRIM_PowerSupplyCapabilities_init FAILED: " + (string) OpenDRIM_PowerSupplyCapabilities_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyCapabilities_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_unload(errorMessage); if (errorCode != OK) { errorMessage += "PowerSupply_OpenDRIM_PowerSupplyCapabilities_unload FAILED: " + (string) OpenDRIM_PowerSupplyCapabilities_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PowerSupply_OpenDRIM_PowerSupplyCapabilities_INIT if (PowerSupply_OpenDRIM_PowerSupplyCapabilities_init(_broker) < 0) return NULL CMInstanceMIStub(PowerSupply_OpenDRIM_PowerSupplyCapabilitiesProvider, PowerSupply_OpenDRIM_PowerSupplyCapabilitiesProvider, _broker, PowerSupply_OpenDRIM_PowerSupplyCapabilities_INIT); CMAssociationMIStub(PowerSupply_OpenDRIM_PowerSupplyCapabilitiesProvider, PowerSupply_OpenDRIM_PowerSupplyCapabilitiesProvider, _broker, PowerSupply_OpenDRIM_PowerSupplyCapabilities_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyCapabilities/cmpiOpenDRIM_PowerSupplyCapabilities.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyCapabilities/cmpiOpenDRIM_PowerSupplyCapabili0000644000175000017500000000440211401064722034617 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef CMPIOPENDRIM_POWERSUPPLYCAPABILITIES_H_ #define CMPIOPENDRIM_POWERSUPPLYCAPABILITIES_H_ #include "OpenDRIM_PowerSupplyCapabilities.h" CMPIObjectPath* PowerSupply_OpenDRIM_PowerSupplyCapabilities_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PowerSupplyCapabilities& instance); CMPIInstance* PowerSupply_OpenDRIM_PowerSupplyCapabilities_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PowerSupplyCapabilities& instance); void PowerSupply_OpenDRIM_PowerSupplyCapabilities_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PowerSupplyCapabilities& instance); void PowerSupply_OpenDRIM_PowerSupplyCapabilities_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PowerSupplyCapabilities& instance); #endif /*CMPIOPENDRIM_POWERSUPPLYCAPABILITIES_H_*/ ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyCapabilities/assocOpenDRIM_PowerSupplyCapabilities.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyCapabilities/assocOpenDRIM_PowerSupplyCapabil0000644000175000017500000000626411401064722034636 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef ASSOCOPENDRIM_POWERSUPPLYCAPABILITIES_H_ #define ASSOCOPENDRIM_POWERSUPPLYCAPABILITIES_H_ #include "OpenDRIM_PowerSupplyCapabilitiesAccess.h" int PowerSupply_OpenDRIM_PowerSupplyCapabilities_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyCapabilities_associator(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties, vector& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant); int PowerSupply_OpenDRIM_PowerSupplyCapabilities_enumerateCapabilitiess(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyCapabilities_getCapabilities(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyCapabilities_enumerateManagedElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyCapabilities_getManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_POWERSUPPLYCAPABILITIES_H_*/ ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyCapabilities/assocOpenDRIM_PowerSupplyCapabilities.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyCapabilities/assocOpenDRIM_PowerSupplyCapabil0000644000175000017500000002133211401064722034627 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "assocOpenDRIM_PowerSupplyCapabilities.h" int PowerSupply_OpenDRIM_PowerSupplyCapabilities_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage) { _E_; string _assocClass, _resultClass, _resultRole, _role; assocClass == NULL ? _assocClass = "null" : _assocClass = assocClass; resultClass == NULL ? _resultClass = "null" : _resultClass = resultClass; resultRole == NULL ? _resultRole = "null" : _resultRole = resultRole; role == NULL ? _role = "null" : _role = role; for (unsigned int i=0; i& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant) { _E_; int errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_associatorFilter(broker, ctx, cop, knownInstance, assocClass, resultClass, role, resultRole, leftToRight, errorMessage); if (errorCode == -1) return OK; if (errorCode != OK) return errorCode; if (leftToRight) { if (role != NULL && strcasecmp(role, "Capabilities") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "ManagedElement") != 0) return OK; CF_assert(PowerSupply_OpenDRIM_PowerSupplyCapabilities_associatorCapabilitiesToManagedElement(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } else { if (role != NULL && strcasecmp(role, "ManagedElement") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "Capabilities") != 0) return OK; CF_assert(PowerSupply_OpenDRIM_PowerSupplyCapabilities_associatorManagedElementToCapabilities(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyCapabilities_enumerateCapabilitiess(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, Capabilities_NAMESPACE, Capabilities_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(PowerSupply_CIM_Capabilities_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PowerSupply_CIM_Capabilities_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PowerSupply_CIM_Capabilities_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyCapabilities_getCapabilities(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Capabilities_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Capabilities_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_Capabilities _instance; PowerSupply_CIM_Capabilities_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PowerSupply_CIM_Capabilities_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PowerSupply_CIM_Capabilities_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyCapabilities_enumerateManagedElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, ManagedElement_NAMESPACE, ManagedElement_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(PowerSupply_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PowerSupply_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PowerSupply_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyCapabilities_getManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), ManagedElement_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), ManagedElement_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_ManagedElement _instance; PowerSupply_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PowerSupply_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PowerSupply_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-powersupply-1.0.0~ppa/VERSION0000644000175000017500000000000611401064722021214 0ustar guillaumeguillaume1.0.0 opendrim-lmp-powersupply-1.0.0~ppa/test/0000755000175000017500000000000011401064722021127 5ustar guillaumeguillaumeopendrim-lmp-powersupply-1.0.0~ppa/test/testOpenDRIM_PowerSupplyCapabilities.cpp0000644000175000017500000001141711401064722031017 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_PowerSupplyCapabilities.h" #include "OpenDRIM_PowerSupplyCapabilitiesAccess.h" #include #define ToString(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value; os << endl #define ToStringInt(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << (long) instance.value; os << endl #define ToStringRef(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value.toString(); os << endl #define ToStringArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringArrayInt(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << (long) instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringRefArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i].toString(); if (i < instance.value.size()-1) os << ","; } os << "]" << endl ostream& operator<<(ostream& os, OpenDRIM_PowerSupplyCapabilities& instance) { os << " [OpenDRIM_PowerSupplyCapabilities]" << endl; ToStringRef("ManagedElement", ManagedElement, ManagedElement_isNULL); ToStringRef("Capabilities", Capabilities, Capabilities_isNULL); ToStringArrayInt("Characteristics", Characteristics, Characteristics_isNULL); os << " [\\OpenDRIM_PowerSupplyCapabilities]" << endl; return os; } int main() { string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_retrieve(NULL, NULL, instances, NULL, errorMessage, "ei"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } vector::iterator it = instances.begin(); for (; it != instances.end(); ++it) { cout << *it; } cout << "[\\enumInstances]" << endl; cout << endl << "[enumInstanceNames & getInstance]" << endl; instances.clear(); errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_retrieve(NULL, NULL, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } it = instances.begin(); for (; it != instances.end(); ++it) { errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_getInstance(NULL, NULL, *it, NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << *it; } cout << "[\\enumInstanceNames & getInstance]" << endl; cout << endl; errorCode = PowerSupply_OpenDRIM_PowerSupplyCapabilities_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-powersupply-1.0.0~ppa/test/testOpenDRIM_ComputerSystemPowerSupply.cpp0000644000175000017500000001133311401064722031426 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_ComputerSystemPowerSupply.h" #include "OpenDRIM_ComputerSystemPowerSupplyAccess.h" #include #define ToString(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value; os << endl #define ToStringInt(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << (long) instance.value; os << endl #define ToStringRef(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value.toString(); os << endl #define ToStringArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringArrayInt(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << (long) instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringRefArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i].toString(); if (i < instance.value.size()-1) os << ","; } os << "]" << endl ostream& operator<<(ostream& os, OpenDRIM_ComputerSystemPowerSupply& instance) { os << " [OpenDRIM_ComputerSystemPowerSupply]" << endl; ToStringRef("GroupComponent", GroupComponent, GroupComponent_isNULL); ToStringRef("PartComponent", PartComponent, PartComponent_isNULL); os << " [\\OpenDRIM_ComputerSystemPowerSupply]" << endl; return os; } int main() { string errorMessage; int errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_retrieve(NULL, NULL, instances, NULL, errorMessage, "ei"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } vector::iterator it = instances.begin(); for (; it != instances.end(); ++it) { cout << *it; } cout << "[\\enumInstances]" << endl; cout << endl << "[enumInstanceNames & getInstance]" << endl; instances.clear(); errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_retrieve(NULL, NULL, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } it = instances.begin(); for (; it != instances.end(); ++it) { errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_getInstance(NULL, NULL, *it, NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << *it; } cout << "[\\enumInstanceNames & getInstance]" << endl; cout << endl; errorCode = PowerSupply_OpenDRIM_ComputerSystemPowerSupply_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-powersupply-1.0.0~ppa/test/Makefile.am0000644000175000017500000001736411401064722023176 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### noinst_PROGRAMS = testOpenDRIM_PowerSupplyCapabilities testOpenDRIM_OwningPowerSupplyRedundancySet testOpenDRIM_HostedPowerSupplyRedundancySet testOpenDRIM_PowerSupply testOpenDRIM_RegisteredPowerSupplyProfile testOpenDRIM_PowerSupplyRedundancySet testOpenDRIM_EnabledPowerSupplyCapabilities testOpenDRIM_MemberOfPowerSupplyCollection testOpenDRIM_PowerSupplyIsSpare testOpenDRIM_PowerSupplyConformsToProfile testOpenDRIM_SuppliesPower testOpenDRIM_ComputerSystemPowerSupply # May have to be adjusted for direct invocation testOpenDRIM_PowerSupplyCapabilities_CPPFLAGS = -I../OpenDRIM_PowerSupplyCapabilities/ -I../null/ -I../null/ testOpenDRIM_PowerSupplyCapabilities_SOURCES = testOpenDRIM_PowerSupplyCapabilities.cpp testOpenDRIM_PowerSupplyCapabilities_LDADD = ../OpenDRIM_PowerSupplyCapabilities/libcmpiPowerSupply_OpenDRIM_PowerSupplyCapabilitiesProvider.la test-OpenDRIM_PowerSupplyCapabilities: testOpenDRIM_PowerSupplyCapabilities ./testOpenDRIM_PowerSupplyCapabilities # May have to be adjusted for direct invocation testOpenDRIM_OwningPowerSupplyRedundancySet_CPPFLAGS = -I../OpenDRIM_OwningPowerSupplyRedundancySet/ -I../null/ -I../null/ testOpenDRIM_OwningPowerSupplyRedundancySet_SOURCES = testOpenDRIM_OwningPowerSupplyRedundancySet.cpp testOpenDRIM_OwningPowerSupplyRedundancySet_LDADD = ../OpenDRIM_OwningPowerSupplyRedundancySet/libcmpiPowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProvider.la test-OpenDRIM_OwningPowerSupplyRedundancySet: testOpenDRIM_OwningPowerSupplyRedundancySet ./testOpenDRIM_OwningPowerSupplyRedundancySet # May have to be adjusted for direct invocation testOpenDRIM_HostedPowerSupplyRedundancySet_CPPFLAGS = -I../OpenDRIM_HostedPowerSupplyRedundancySet/ -I../null/ -I../null/ testOpenDRIM_HostedPowerSupplyRedundancySet_SOURCES = testOpenDRIM_HostedPowerSupplyRedundancySet.cpp testOpenDRIM_HostedPowerSupplyRedundancySet_LDADD = ../OpenDRIM_HostedPowerSupplyRedundancySet/libcmpiPowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProvider.la test-OpenDRIM_HostedPowerSupplyRedundancySet: testOpenDRIM_HostedPowerSupplyRedundancySet ./testOpenDRIM_HostedPowerSupplyRedundancySet testOpenDRIM_PowerSupply_CPPFLAGS = -I../OpenDRIM_PowerSupply/ testOpenDRIM_PowerSupply_SOURCES = testOpenDRIM_PowerSupply.cpp testOpenDRIM_PowerSupply_LDADD = ../OpenDRIM_PowerSupply/libcmpiPowerSupply_OpenDRIM_PowerSupplyProvider.la test-OpenDRIM_PowerSupply: testOpenDRIM_PowerSupply ./testOpenDRIM_PowerSupply testOpenDRIM_RegisteredPowerSupplyProfile_CPPFLAGS = -I../OpenDRIM_RegisteredPowerSupplyProfile/ testOpenDRIM_RegisteredPowerSupplyProfile_SOURCES = testOpenDRIM_RegisteredPowerSupplyProfile.cpp testOpenDRIM_RegisteredPowerSupplyProfile_LDADD = ../OpenDRIM_RegisteredPowerSupplyProfile/libcmpiPowerSupply_OpenDRIM_RegisteredPowerSupplyProfileProvider.la test-OpenDRIM_RegisteredPowerSupplyProfile: testOpenDRIM_RegisteredPowerSupplyProfile ./testOpenDRIM_RegisteredPowerSupplyProfile testOpenDRIM_PowerSupplyRedundancySet_CPPFLAGS = -I../OpenDRIM_PowerSupplyRedundancySet/ testOpenDRIM_PowerSupplyRedundancySet_SOURCES = testOpenDRIM_PowerSupplyRedundancySet.cpp testOpenDRIM_PowerSupplyRedundancySet_LDADD = ../OpenDRIM_PowerSupplyRedundancySet/libcmpiPowerSupply_OpenDRIM_PowerSupplyRedundancySetProvider.la test-OpenDRIM_PowerSupplyRedundancySet: testOpenDRIM_PowerSupplyRedundancySet ./testOpenDRIM_PowerSupplyRedundancySet testOpenDRIM_EnabledPowerSupplyCapabilities_CPPFLAGS = -I../OpenDRIM_EnabledPowerSupplyCapabilities/ testOpenDRIM_EnabledPowerSupplyCapabilities_SOURCES = testOpenDRIM_EnabledPowerSupplyCapabilities.cpp testOpenDRIM_EnabledPowerSupplyCapabilities_LDADD = ../OpenDRIM_EnabledPowerSupplyCapabilities/libcmpiPowerSupply_OpenDRIM_EnabledPowerSupplyCapabilitiesProvider.la test-OpenDRIM_EnabledPowerSupplyCapabilities: testOpenDRIM_EnabledPowerSupplyCapabilities ./testOpenDRIM_EnabledPowerSupplyCapabilities # May have to be adjusted for direct invocation testOpenDRIM_MemberOfPowerSupplyCollection_CPPFLAGS = -I../OpenDRIM_MemberOfPowerSupplyCollection/ -I../null/ -I../null/ testOpenDRIM_MemberOfPowerSupplyCollection_SOURCES = testOpenDRIM_MemberOfPowerSupplyCollection.cpp testOpenDRIM_MemberOfPowerSupplyCollection_LDADD = ../OpenDRIM_MemberOfPowerSupplyCollection/libcmpiPowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProvider.la test-OpenDRIM_MemberOfPowerSupplyCollection: testOpenDRIM_MemberOfPowerSupplyCollection ./testOpenDRIM_MemberOfPowerSupplyCollection # May have to be adjusted for direct invocation testOpenDRIM_PowerSupplyIsSpare_CPPFLAGS = -I../OpenDRIM_PowerSupplyIsSpare/ -I../null/ -I../null/ testOpenDRIM_PowerSupplyIsSpare_SOURCES = testOpenDRIM_PowerSupplyIsSpare.cpp testOpenDRIM_PowerSupplyIsSpare_LDADD = ../OpenDRIM_PowerSupplyIsSpare/libcmpiPowerSupply_OpenDRIM_PowerSupplyIsSpareProvider.la test-OpenDRIM_PowerSupplyIsSpare: testOpenDRIM_PowerSupplyIsSpare ./testOpenDRIM_PowerSupplyIsSpare # May have to be adjusted for direct invocation testOpenDRIM_PowerSupplyConformsToProfile_CPPFLAGS = -I../OpenDRIM_PowerSupplyConformsToProfile/ -I../null/ -I../null/ testOpenDRIM_PowerSupplyConformsToProfile_SOURCES = testOpenDRIM_PowerSupplyConformsToProfile.cpp testOpenDRIM_PowerSupplyConformsToProfile_LDADD = ../OpenDRIM_PowerSupplyConformsToProfile/libcmpiPowerSupply_OpenDRIM_PowerSupplyConformsToProfileProvider.la test-OpenDRIM_PowerSupplyConformsToProfile: testOpenDRIM_PowerSupplyConformsToProfile ./testOpenDRIM_PowerSupplyConformsToProfile # May have to be adjusted for direct invocation testOpenDRIM_SuppliesPower_CPPFLAGS = -I../OpenDRIM_SuppliesPower/ -I../null/ -I../null/ testOpenDRIM_SuppliesPower_SOURCES = testOpenDRIM_SuppliesPower.cpp testOpenDRIM_SuppliesPower_LDADD = ../OpenDRIM_SuppliesPower/libcmpiPowerSupply_OpenDRIM_SuppliesPowerProvider.la test-OpenDRIM_SuppliesPower: testOpenDRIM_SuppliesPower ./testOpenDRIM_SuppliesPower # May have to be adjusted for direct invocation testOpenDRIM_ComputerSystemPowerSupply_CPPFLAGS = -I../OpenDRIM_ComputerSystemPowerSupply/ -I../null/ -I../null/ testOpenDRIM_ComputerSystemPowerSupply_SOURCES = testOpenDRIM_ComputerSystemPowerSupply.cpp testOpenDRIM_ComputerSystemPowerSupply_LDADD = ../OpenDRIM_ComputerSystemPowerSupply/libcmpiPowerSupply_OpenDRIM_ComputerSystemPowerSupplyProvider.la test-OpenDRIM_ComputerSystemPowerSupply: testOpenDRIM_ComputerSystemPowerSupply ./testOpenDRIM_ComputerSystemPowerSupply opendrim-lmp-powersupply-1.0.0~ppa/test/testOpenDRIM_OwningPowerSupplyRedundancySet.cpp0000644000175000017500000001142111401064722032353 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_OwningPowerSupplyRedundancySet.h" #include "OpenDRIM_OwningPowerSupplyRedundancySetAccess.h" #include #define ToString(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value; os << endl #define ToStringInt(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << (long) instance.value; os << endl #define ToStringRef(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value.toString(); os << endl #define ToStringArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringArrayInt(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << (long) instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringRefArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i].toString(); if (i < instance.value.size()-1) os << ","; } os << "]" << endl ostream& operator<<(ostream& os, OpenDRIM_OwningPowerSupplyRedundancySet& instance) { os << " [OpenDRIM_OwningPowerSupplyRedundancySet]" << endl; ToStringRef("OwningElement", OwningElement, OwningElement_isNULL); ToStringRef("OwnedElement", OwnedElement, OwnedElement_isNULL); os << " [\\OpenDRIM_OwningPowerSupplyRedundancySet]" << endl; return os; } int main() { string errorMessage; int errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_retrieve(NULL, NULL, instances, NULL, errorMessage, "ei"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } vector::iterator it = instances.begin(); for (; it != instances.end(); ++it) { cout << *it; } cout << "[\\enumInstances]" << endl; cout << endl << "[enumInstanceNames & getInstance]" << endl; instances.clear(); errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_retrieve(NULL, NULL, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } it = instances.begin(); for (; it != instances.end(); ++it) { errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_getInstance(NULL, NULL, *it, NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << *it; } cout << "[\\enumInstanceNames & getInstance]" << endl; cout << endl; errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-powersupply-1.0.0~ppa/test/testOpenDRIM_PowerSupplyRedundancySet.cpp0000644000175000017500000001264211401064722031177 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_PowerSupplyRedundancySet.h" #include "OpenDRIM_PowerSupplyRedundancySetAccess.h" #include #define ToString(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value; os << endl #define ToStringInt(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << (long) instance.value; os << endl #define ToStringRef(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value.toString(); os << endl #define ToStringArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringArrayInt(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << (long) instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringRefArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i].toString(); if (i < instance.value.size()-1) os << ","; } os << "]" << endl ostream& operator<<(ostream& os, OpenDRIM_PowerSupplyRedundancySet& instance) { os << " [OpenDRIM_PowerSupplyRedundancySet]" << endl; ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("InstanceID", InstanceID, InstanceID_isNULL); ToStringInt("RedundancyStatus", RedundancyStatus, RedundancyStatus_isNULL); ToStringArrayInt("TypeOfSet", TypeOfSet, TypeOfSet_isNULL); ToString("MinNumberNeeded", MinNumberNeeded, MinNumberNeeded_isNULL); ToString("MaxNumberSupported", MaxNumberSupported, MaxNumberSupported_isNULL); ToString("VendorIdentifyingInfo", VendorIdentifyingInfo, VendorIdentifyingInfo_isNULL); ToStringArray("OtherTypeOfSet", OtherTypeOfSet, OtherTypeOfSet_isNULL); ToStringInt("LoadBalanceAlgorithm", LoadBalanceAlgorithm, LoadBalanceAlgorithm_isNULL); ToString("OtherLoadBalanceAlgorithm", OtherLoadBalanceAlgorithm, OtherLoadBalanceAlgorithm_isNULL); os << " [\\OpenDRIM_PowerSupplyRedundancySet]" << endl; return os; } int main() { string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyRedundancySet_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PowerSupply_OpenDRIM_PowerSupplyRedundancySet_retrieve(NULL, NULL, instances, NULL, errorMessage, "ei"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } vector::iterator it = instances.begin(); for (; it != instances.end(); ++it) { cout << *it; } cout << "[\\enumInstances]" << endl; cout << endl << "[enumInstanceNames & getInstance]" << endl; instances.clear(); errorCode = PowerSupply_OpenDRIM_PowerSupplyRedundancySet_retrieve(NULL, NULL, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } it = instances.begin(); for (; it != instances.end(); ++it) { errorCode = PowerSupply_OpenDRIM_PowerSupplyRedundancySet_getInstance(NULL, NULL, *it, NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << *it; } cout << "[\\enumInstanceNames & getInstance]" << endl; cout << endl; errorCode = PowerSupply_OpenDRIM_PowerSupplyRedundancySet_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-powersupply-1.0.0~ppa/test/testOpenDRIM_PowerSupply.cpp0000644000175000017500000002025611401064722026506 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_PowerSupply.h" #include "OpenDRIM_PowerSupplyAccess.h" #include #define ToString(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value; os << endl #define ToStringInt(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << (long) instance.value; os << endl #define ToStringRef(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value.toString(); os << endl #define ToStringArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringArrayInt(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << (long) instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringRefArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i].toString(); if (i < instance.value.size()-1) os << ","; } os << "]" << endl ostream& operator<<(ostream& os, OpenDRIM_PowerSupply& instance) { os << " [OpenDRIM_PowerSupply]" << endl; ToString("InstanceID", InstanceID, InstanceID_isNULL); ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("InstallDate", InstallDate, InstallDate_isNULL); ToString("Name", Name, Name_isNULL); ToStringArrayInt("OperationalStatus", OperationalStatus, OperationalStatus_isNULL); ToStringArray("StatusDescriptions", StatusDescriptions, StatusDescriptions_isNULL); ToString("Status", Status, Status_isNULL); ToStringInt("HealthState", HealthState, HealthState_isNULL); ToStringInt("CommunicationStatus", CommunicationStatus, CommunicationStatus_isNULL); ToStringInt("DetailedStatus", DetailedStatus, DetailedStatus_isNULL); ToStringInt("OperatingStatus", OperatingStatus, OperatingStatus_isNULL); ToStringInt("PrimaryStatus", PrimaryStatus, PrimaryStatus_isNULL); ToStringInt("EnabledState", EnabledState, EnabledState_isNULL); ToString("OtherEnabledState", OtherEnabledState, OtherEnabledState_isNULL); ToStringInt("RequestedState", RequestedState, RequestedState_isNULL); ToStringInt("EnabledDefault", EnabledDefault, EnabledDefault_isNULL); ToString("TimeOfLastStateChange", TimeOfLastStateChange, TimeOfLastStateChange_isNULL); ToStringArrayInt("AvailableRequestedStates", AvailableRequestedStates, AvailableRequestedStates_isNULL); ToStringInt("TransitioningToState", TransitioningToState, TransitioningToState_isNULL); ToString("SystemCreationClassName", SystemCreationClassName, SystemCreationClassName_isNULL); ToString("SystemName", SystemName, SystemName_isNULL); ToString("CreationClassName", CreationClassName, CreationClassName_isNULL); ToString("DeviceID", DeviceID, DeviceID_isNULL); ToString("PowerManagementSupported", PowerManagementSupported, PowerManagementSupported_isNULL); ToStringArrayInt("PowerManagementCapabilities", PowerManagementCapabilities, PowerManagementCapabilities_isNULL); ToStringInt("Availability", Availability, Availability_isNULL); ToStringInt("StatusInfo", StatusInfo, StatusInfo_isNULL); ToString("LastErrorCode", LastErrorCode, LastErrorCode_isNULL); ToString("ErrorDescription", ErrorDescription, ErrorDescription_isNULL); ToString("ErrorCleared", ErrorCleared, ErrorCleared_isNULL); ToStringArray("OtherIdentifyingInfo", OtherIdentifyingInfo, OtherIdentifyingInfo_isNULL); ToString("PowerOnHours", PowerOnHours, PowerOnHours_isNULL); ToString("TotalPowerOnHours", TotalPowerOnHours, TotalPowerOnHours_isNULL); ToStringArray("IdentifyingDescriptions", IdentifyingDescriptions, IdentifyingDescriptions_isNULL); ToStringArrayInt("AdditionalAvailability", AdditionalAvailability, AdditionalAvailability_isNULL); ToString("MaxQuiesceTime", MaxQuiesceTime, MaxQuiesceTime_isNULL); ToString("IsSwitchingSupply", IsSwitchingSupply, IsSwitchingSupply_isNULL); ToString("Range1InputVoltageLow", Range1InputVoltageLow, Range1InputVoltageLow_isNULL); ToString("Range1InputVoltageHigh", Range1InputVoltageHigh, Range1InputVoltageHigh_isNULL); ToString("Range1InputFrequencyLow", Range1InputFrequencyLow, Range1InputFrequencyLow_isNULL); ToString("Range1InputFrequencyHigh", Range1InputFrequencyHigh, Range1InputFrequencyHigh_isNULL); ToString("Range2InputVoltageLow", Range2InputVoltageLow, Range2InputVoltageLow_isNULL); ToString("Range2InputVoltageHigh", Range2InputVoltageHigh, Range2InputVoltageHigh_isNULL); ToString("Range2InputFrequencyLow", Range2InputFrequencyLow, Range2InputFrequencyLow_isNULL); ToString("Range2InputFrequencyHigh", Range2InputFrequencyHigh, Range2InputFrequencyHigh_isNULL); ToStringInt("ActiveInputVoltage", ActiveInputVoltage, ActiveInputVoltage_isNULL); ToStringInt("TypeOfRangeSwitching", TypeOfRangeSwitching, TypeOfRangeSwitching_isNULL); ToString("TotalOutputPower", TotalOutputPower, TotalOutputPower_isNULL); os << " [\\OpenDRIM_PowerSupply]" << endl; return os; } int main() { string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupply_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PowerSupply_OpenDRIM_PowerSupply_retrieve(NULL, NULL, instances, NULL, errorMessage, "ei"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } vector::iterator it = instances.begin(); for (; it != instances.end(); ++it) { cout << *it; } cout << "[\\enumInstances]" << endl; cout << endl << "[enumInstanceNames & getInstance]" << endl; instances.clear(); errorCode = PowerSupply_OpenDRIM_PowerSupply_retrieve(NULL, NULL, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } it = instances.begin(); for (; it != instances.end(); ++it) { errorCode = PowerSupply_OpenDRIM_PowerSupply_getInstance(NULL, NULL, *it, NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << *it; } cout << "[\\enumInstanceNames & getInstance]" << endl; cout << endl; errorCode = PowerSupply_OpenDRIM_PowerSupply_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-powersupply-1.0.0~ppa/test/testOpenDRIM_MemberOfPowerSupplyCollection.cpp0000644000175000017500000001135211401064722032134 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_MemberOfPowerSupplyCollection.h" #include "OpenDRIM_MemberOfPowerSupplyCollectionAccess.h" #include #define ToString(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value; os << endl #define ToStringInt(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << (long) instance.value; os << endl #define ToStringRef(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value.toString(); os << endl #define ToStringArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringArrayInt(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << (long) instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringRefArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i].toString(); if (i < instance.value.size()-1) os << ","; } os << "]" << endl ostream& operator<<(ostream& os, OpenDRIM_MemberOfPowerSupplyCollection& instance) { os << " [OpenDRIM_MemberOfPowerSupplyCollection]" << endl; ToStringRef("Collection", Collection, Collection_isNULL); ToStringRef("Member", Member, Member_isNULL); os << " [\\OpenDRIM_MemberOfPowerSupplyCollection]" << endl; return os; } int main() { string errorMessage; int errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_retrieve(NULL, NULL, instances, NULL, errorMessage, "ei"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } vector::iterator it = instances.begin(); for (; it != instances.end(); ++it) { cout << *it; } cout << "[\\enumInstances]" << endl; cout << endl << "[enumInstanceNames & getInstance]" << endl; instances.clear(); errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_retrieve(NULL, NULL, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } it = instances.begin(); for (; it != instances.end(); ++it) { errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_getInstance(NULL, NULL, *it, NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << *it; } cout << "[\\enumInstanceNames & getInstance]" << endl; cout << endl; errorCode = PowerSupply_OpenDRIM_MemberOfPowerSupplyCollection_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-powersupply-1.0.0~ppa/test/testOpenDRIM_RegisteredPowerSupplyProfile.cpp0000644000175000017500000001254211401064722032044 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_RegisteredPowerSupplyProfile.h" #include "OpenDRIM_RegisteredPowerSupplyProfileAccess.h" #include #define ToString(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value; os << endl #define ToStringInt(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << (long) instance.value; os << endl #define ToStringRef(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value.toString(); os << endl #define ToStringArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringArrayInt(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << (long) instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringRefArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i].toString(); if (i < instance.value.size()-1) os << ","; } os << "]" << endl ostream& operator<<(ostream& os, OpenDRIM_RegisteredPowerSupplyProfile& instance) { os << " [OpenDRIM_RegisteredPowerSupplyProfile]" << endl; ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("InstanceID", InstanceID, InstanceID_isNULL); ToStringInt("RegisteredOrganization", RegisteredOrganization, RegisteredOrganization_isNULL); ToString("OtherRegisteredOrganization", OtherRegisteredOrganization, OtherRegisteredOrganization_isNULL); ToString("RegisteredName", RegisteredName, RegisteredName_isNULL); ToString("RegisteredVersion", RegisteredVersion, RegisteredVersion_isNULL); ToStringArrayInt("AdvertiseTypes", AdvertiseTypes, AdvertiseTypes_isNULL); ToStringArray("AdvertiseTypeDescriptions", AdvertiseTypeDescriptions, AdvertiseTypeDescriptions_isNULL); os << " [\\OpenDRIM_RegisteredPowerSupplyProfile]" << endl; return os; } int main() { string errorMessage; int errorCode = PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_retrieve(NULL, NULL, instances, NULL, errorMessage, "ei"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } vector::iterator it = instances.begin(); for (; it != instances.end(); ++it) { cout << *it; } cout << "[\\enumInstances]" << endl; cout << endl << "[enumInstanceNames & getInstance]" << endl; instances.clear(); errorCode = PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_retrieve(NULL, NULL, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } it = instances.begin(); for (; it != instances.end(); ++it) { errorCode = PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_getInstance(NULL, NULL, *it, NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << *it; } cout << "[\\enumInstanceNames & getInstance]" << endl; cout << endl; errorCode = PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-powersupply-1.0.0~ppa/test/testOpenDRIM_PowerSupplyIsSpare.cpp0000644000175000017500000001137511401064722027777 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_PowerSupplyIsSpare.h" #include "OpenDRIM_PowerSupplyIsSpareAccess.h" #include #define ToString(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value; os << endl #define ToStringInt(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << (long) instance.value; os << endl #define ToStringRef(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value.toString(); os << endl #define ToStringArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringArrayInt(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << (long) instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringRefArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i].toString(); if (i < instance.value.size()-1) os << ","; } os << "]" << endl ostream& operator<<(ostream& os, OpenDRIM_PowerSupplyIsSpare& instance) { os << " [OpenDRIM_PowerSupplyIsSpare]" << endl; ToStringRef("Antecedent", Antecedent, Antecedent_isNULL); ToStringRef("Dependent", Dependent, Dependent_isNULL); ToStringInt("SpareStatus", SpareStatus, SpareStatus_isNULL); ToStringInt("FailoverSupported", FailoverSupported, FailoverSupported_isNULL); os << " [\\OpenDRIM_PowerSupplyIsSpare]" << endl; return os; } int main() { string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_retrieve(NULL, NULL, instances, NULL, errorMessage, "ei"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } vector::iterator it = instances.begin(); for (; it != instances.end(); ++it) { cout << *it; } cout << "[\\enumInstances]" << endl; cout << endl << "[enumInstanceNames & getInstance]" << endl; instances.clear(); errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_retrieve(NULL, NULL, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } it = instances.begin(); for (; it != instances.end(); ++it) { errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_getInstance(NULL, NULL, *it, NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << *it; } cout << "[\\enumInstanceNames & getInstance]" << endl; cout << endl; errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-powersupply-1.0.0~ppa/test/testOpenDRIM_PowerSupplyConformsToProfile.cpp0000644000175000017500000001141611401064722032037 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_PowerSupplyConformsToProfile.h" #include "OpenDRIM_PowerSupplyConformsToProfileAccess.h" #include #define ToString(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value; os << endl #define ToStringInt(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << (long) instance.value; os << endl #define ToStringRef(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value.toString(); os << endl #define ToStringArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringArrayInt(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << (long) instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringRefArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i].toString(); if (i < instance.value.size()-1) os << ","; } os << "]" << endl ostream& operator<<(ostream& os, OpenDRIM_PowerSupplyConformsToProfile& instance) { os << " [OpenDRIM_PowerSupplyConformsToProfile]" << endl; ToStringRef("ConformantStandard", ConformantStandard, ConformantStandard_isNULL); ToStringRef("ManagedElement", ManagedElement, ManagedElement_isNULL); os << " [\\OpenDRIM_PowerSupplyConformsToProfile]" << endl; return os; } int main() { string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_retrieve(NULL, NULL, instances, NULL, errorMessage, "ei"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } vector::iterator it = instances.begin(); for (; it != instances.end(); ++it) { cout << *it; } cout << "[\\enumInstances]" << endl; cout << endl << "[enumInstanceNames & getInstance]" << endl; instances.clear(); errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_retrieve(NULL, NULL, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } it = instances.begin(); for (; it != instances.end(); ++it) { errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_getInstance(NULL, NULL, *it, NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << *it; } cout << "[\\enumInstanceNames & getInstance]" << endl; cout << endl; errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-powersupply-1.0.0~ppa/test/testOpenDRIM_EnabledPowerSupplyCapabilities.cpp0000644000175000017500000001231411401064722032267 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_EnabledPowerSupplyCapabilities.h" #include "OpenDRIM_EnabledPowerSupplyCapabilitiesAccess.h" #include #define ToString(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value; os << endl #define ToStringInt(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << (long) instance.value; os << endl #define ToStringRef(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value.toString(); os << endl #define ToStringArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringArrayInt(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << (long) instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringRefArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i].toString(); if (i < instance.value.size()-1) os << ","; } os << "]" << endl ostream& operator<<(ostream& os, OpenDRIM_EnabledPowerSupplyCapabilities& instance) { os << " [OpenDRIM_EnabledPowerSupplyCapabilities]" << endl; ToString("Caption", Caption, Caption_isNULL); ToString("Description", Description, Description_isNULL); ToString("InstanceID", InstanceID, InstanceID_isNULL); ToString("ElementName", ElementName, ElementName_isNULL); ToString("ElementNameEditSupported", ElementNameEditSupported, ElementNameEditSupported_isNULL); ToStringInt("MaxElementNameLen", MaxElementNameLen, MaxElementNameLen_isNULL); ToStringArrayInt("RequestedStatesSupported", RequestedStatesSupported, RequestedStatesSupported_isNULL); ToString("ElementNameMask", ElementNameMask, ElementNameMask_isNULL); os << " [\\OpenDRIM_EnabledPowerSupplyCapabilities]" << endl; return os; } int main() { string errorMessage; int errorCode = PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_retrieve(NULL, NULL, instances, NULL, errorMessage, "ei"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } vector::iterator it = instances.begin(); for (; it != instances.end(); ++it) { cout << *it; } cout << "[\\enumInstances]" << endl; cout << endl << "[enumInstanceNames & getInstance]" << endl; instances.clear(); errorCode = PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_retrieve(NULL, NULL, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } it = instances.begin(); for (; it != instances.end(); ++it) { errorCode = PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_getInstance(NULL, NULL, *it, NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << *it; } cout << "[\\enumInstanceNames & getInstance]" << endl; cout << endl; errorCode = PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-powersupply-1.0.0~ppa/test/testOpenDRIM_SuppliesPower.cpp0000644000175000017500000001106311401064722027012 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_SuppliesPower.h" #include "OpenDRIM_SuppliesPowerAccess.h" #include #define ToString(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value; os << endl #define ToStringInt(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << (long) instance.value; os << endl #define ToStringRef(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value.toString(); os << endl #define ToStringArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringArrayInt(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << (long) instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringRefArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i].toString(); if (i < instance.value.size()-1) os << ","; } os << "]" << endl ostream& operator<<(ostream& os, OpenDRIM_SuppliesPower& instance) { os << " [OpenDRIM_SuppliesPower]" << endl; ToStringRef("Antecedent", Antecedent, Antecedent_isNULL); ToStringRef("Dependent", Dependent, Dependent_isNULL); os << " [\\OpenDRIM_SuppliesPower]" << endl; return os; } int main() { string errorMessage; int errorCode = PowerSupply_OpenDRIM_SuppliesPower_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PowerSupply_OpenDRIM_SuppliesPower_retrieve(NULL, NULL, instances, NULL, errorMessage, "ei"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } vector::iterator it = instances.begin(); for (; it != instances.end(); ++it) { cout << *it; } cout << "[\\enumInstances]" << endl; cout << endl << "[enumInstanceNames & getInstance]" << endl; instances.clear(); errorCode = PowerSupply_OpenDRIM_SuppliesPower_retrieve(NULL, NULL, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } it = instances.begin(); for (; it != instances.end(); ++it) { errorCode = PowerSupply_OpenDRIM_SuppliesPower_getInstance(NULL, NULL, *it, NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << *it; } cout << "[\\enumInstanceNames & getInstance]" << endl; cout << endl; errorCode = PowerSupply_OpenDRIM_SuppliesPower_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-powersupply-1.0.0~ppa/test/testOpenDRIM_HostedPowerSupplyRedundancySet.cpp0000644000175000017500000001137711401064722032352 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_HostedPowerSupplyRedundancySet.h" #include "OpenDRIM_HostedPowerSupplyRedundancySetAccess.h" #include #define ToString(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value; os << endl #define ToStringInt(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << (long) instance.value; os << endl #define ToStringRef(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value.toString(); os << endl #define ToStringArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringArrayInt(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << (long) instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl #define ToStringRefArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i].toString(); if (i < instance.value.size()-1) os << ","; } os << "]" << endl ostream& operator<<(ostream& os, OpenDRIM_HostedPowerSupplyRedundancySet& instance) { os << " [OpenDRIM_HostedPowerSupplyRedundancySet]" << endl; ToStringRef("Antecedent", Antecedent, Antecedent_isNULL); ToStringRef("Dependent", Dependent, Dependent_isNULL); os << " [\\OpenDRIM_HostedPowerSupplyRedundancySet]" << endl; return os; } int main() { string errorMessage; int errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_retrieve(NULL, NULL, instances, NULL, errorMessage, "ei"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } vector::iterator it = instances.begin(); for (; it != instances.end(); ++it) { cout << *it; } cout << "[\\enumInstances]" << endl; cout << endl << "[enumInstanceNames & getInstance]" << endl; instances.clear(); errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_retrieve(NULL, NULL, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } it = instances.begin(); for (; it != instances.end(); ++it) { errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_getInstance(NULL, NULL, *it, NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << *it; } cout << "[\\enumInstanceNames & getInstance]" << endl; cout << endl; errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-powersupply-1.0.0~ppa/acinclude.m40000644000175000017500000002102611401064722022342 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### AC_DEFUN([SHOW_COPYRIGHT], [ echo "################################################################################# # Linux Management Providers (LMP), PowerSupply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# " ] ) AC_DEFUN([CHECK_CIMSERVER], [ AC_MSG_CHECKING(for CIM servers) if test x"$CIMSERVER" == x then AC_MSG_ERROR([[please define the CIMSERVER variable (see ./configure --help)]]) fi if test "$CIMSERVER" != pegasus && test "$CIMSERVER" != sfcb && test "$CIMSERVER" != openwbem then AC_MSG_ERROR([[please define the CIMSERVER variable (see ./configure --help)]]) fi if test "$CIMSERVER" == pegasus then if !( command -v cimmof > /dev/null ) then AC_MSG_ERROR([[no. the Pegasus mof compiler could not be found (cimmof)]]) fi fi if test "$CIMSERVER" == openwbem then if !( command -v owmofc > /dev/null) then AC_MSG_ERROR([[no. the OpenWBEM mof compiler could not be found (owmofc)]]) fi fi if test "$CIMSERVER" == sfcb then if !( command -v sfcbd > /dev/null ) then AC_MSG_ERROR([[no. the SBLIM sfcb deamon could not be found (sfcbd)]]) fi if !( command -v sfcbstage > /dev/null ) then AC_MSG_ERROR([[no. the SBLIM mof stager could not be found (sfcbstage)]]) fi if !( command -v sfcbrepos > /dev/null ) then AC_MSG_ERROR([[no. the SBLIM repository builder could no be found (sfcbrepos)]]) fi fi if test "$CIMSERVER" == pegasus then if test x"$prefix" == xNONE then if test "$HW" == X86_64 || test "$HW" == IA64 then PROVIDERDIR_TMP=/usr/lib64/Pegasus/providers COMMONLIBDIR_TMP=/usr/lib64 OPENDRIMCOMMONLIBDIR_TMP=/usr/lib64 else PROVIDERDIR_TMP=/usr/lib/Pegasus/providers COMMONLIBDIR_TMP=/usr/lib OPENDRIMCOMMONLIBDIR_TMP=/usr/lib fi OPENDRIMCOMMONINCLUDE_TMP=/usr/include/OpenDRIM else if test "$HW" == X86_64 || test "$HW" == IA64 then PROVIDERDIR_TMP=$prefix/lib64/Pegasus/providers COMMONLIBDIR_TMP=$prefix/lib64 OPENDRIMCOMMONLIBDIR_TMP=$prefix/lib64 else PROVIDERDIR_TMP=$prefix/lib/Pegasus/providers COMMONLIBDIR_TMP=$prefix/lib OPENDRIMCOMMONLIBDIR_TMP=$prefix/lib fi OPENDRIMCOMMONINCLUDE_TMP=$prefix/include/OpenDRIM fi if test x"$PEGASUS_HOME" != x then PROVIDERDIR_TMP=$PEGASUS_HOME/lib COMMONLIBDIR_TMP=$PEGASUS_HOME/lib OPENDRIMCOMMONLIBDIR_TMP=$PEGASUS_HOME/lib OPENDRIMCOMMONINCLUDE_TMP=$PEGASUS_HOME/include/OpenDRIM fi fi if test "$CIMSERVER" == sfcb then if test x"$prefix" == xNONE then PROVIDERDIR_TMP=$ac_default_prefix/lib/cmpi COMMONLIBDIR_TMP=$ac_default_prefix/lib OPENDRIMCOMMONLIBDIR_TMP=$ac_default_prefix/lib OPENDRIMCOMMONINCLUDE_TMP=$ac_default_prefix/include/OpenDRIM else PROVIDERDIR_TMP=$prefix/lib/cmpi COMMONLIBDIR_TMP=$prefix/lib OPENDRIMCOMMONLIBDIR_TMP=$prefix/lib OPENDRIMCOMMONINCLUDE_TMP=$prefix/include/OpenDRIM fi fi if test "$CIMSERVER" == openwbem then if test x"$prefix" == xNONE then if test "$HW" == X86_64 || test "$HW" == IA64 then PROVIDERDIR_TMP=/usr/lib64/openwbem/cmpiproviders COMMONLIBDIR_TMP=/usr/lib64 OPENDRIMCOMMONLIBDIR_TMP=/usr/lib64 else PROVIDERDIR_TMP=/usr/lib/openwbem/cmpiproviders COMMONLIBDIR_TMP=/usr/lib OPENDRIMCOMMONLIBDIR_TMP=/usr/lib fi OPENDRIMCOMMONINCLUDE_TMP=/usr/include/OpenDRIM else PROVIDERDIR_TMP=$prefix/lib/openwbem/cmpiproviders COMMONLIBDIR_TMP=$prefix/lib OPENDRIMCOMMONLIBDIR_TMP=$prefix/lib OPENDRIMCOMMONINCLUDE_TMP=$prefix/include/OpenDRIM fi fi if test x"$PROVIDERDIR" = x then PROVIDERDIR=$PROVIDERDIR_TMP fi if test x"$COMMONLIBDIR" = x then COMMONLIBDIR=$COMMONLIBDIR_TMP fi if test x"$OPENDRIMCOMMONLIBDIR" = x then OPENDRIMCOMMONLIBDIR=$OPENDRIMCOMMONLIBDIR_TMP fi if test x"$OPENDRIMCOMMONINCLUDE" = x then OPENDRIMCOMMONINCLUDE=$OPENDRIMCOMMONINCLUDE_TMP fi TEMP_CPPFLAGS="$CPPFLAGS -D_REENTRANT" CFLAGS="-Wall -Wunused -fPIC -O2 $CFLAGS" CXXFLAGS="-Wall -Wunused -fPIC -fno-rtti -fno-exceptions -O2 $CXXFLAGS" LDFLAGS="$LDFLAGS -L. -L$PROVIDERDIR -L$COMMONLIBDIR" AC_MSG_RESULT(yes) ] ) AC_DEFUN([CHECK_CIMNAMESPACE], [ if test x"$CIMNAMESPACE" == x then CIMNAMESPACE=root/cimv2 fi TEMP_CPPFLAGS="$TEMP_CPPFLAGS -D_NAMESPACE=\\\"$CIMNAMESPACE\\\"" ] ) AC_DEFUN([CHECK_INTEROPNAMESPACE], [ if test x"$INTEROPNAMESPACE" == x then if test "$CIMSERVER" == pegasus then INTEROPNAMESPACE=Interop fi if test "$CIMSERVER" == openwbem then INTEROPNAMESPACE=root/Interop fi if test "$CIMSERVER" == sfcb then INTEROPNAMESPACE=Interop fi fi TEMP_CPPFLAGS="$TEMP_CPPFLAGS -D_INTEROP_NAMESPACE=\\\"$INTEROPNAMESPACE\\\"" ] ) AC_DEFUN([CHECK_OPENDRIMCOMMONHEADERS], [ AC_MSG_CHECKING(for OpenDRIM Common headers) _HEADERS="Common.h Datastore.h CMPIBroking.h Association.h Indication.h Instance.h Objectpath.h Transtype.h" for _HEADER in $_HEADERS do if !( test -e $OPENDRIMCOMMONINCLUDE/$_HEADER ) then AC_MSG_ERROR([[no. Could not find OpenDRIM Common headers:] $_HEADER]) fi done AC_MSG_RESULT(yes) ] ) AC_DEFUN([CHECK_OPENDRIMCOMMONLIBRARY], [ AC_MSG_CHECKING(for OpenDRIM Common library) if test -e $OPENDRIMCOMMONLIBDIR/libopendrim.so then AC_MSG_RESULT(yes) else AC_MSG_ERROR([[no. The OpenDRIM Common library could not be found (libopendrim.so)]]) fi ] ) AC_DEFUN([_CHECK_CMPIHEADERS], [ AC_MSG_CHECKING($1) AC_TRY_LINK( [ #include #include #include ], [ CMPIBroker broker; CMPIStatus status = {CMPI_RC_OK, NULL}; CMPIString *s = CMNewString(&broker, "TEST", &status); ], [ have_CMPI=yes ], [ have_CMPI=no ]) ]) AC_DEFUN([CHECK_CMPIHEADERS], [ AC_MSG_CHECKING(for CMPI headers) CPPFLAGS="$TEMP_CPPFLAGS -DCMPI_PLATFORM_LINUX_GENERIC_GNU -I$OPENDRIMCOMMONINCLUDE/cmpi" _CHECK_CMPIHEADERS($OPENDRIMCOMMONINCLUDE) if test "$have_CMPI" == "yes" then CPPFLAGS="$TEMP_CPPFLAGS" AC_MSG_RESULT(yes) else _CHECK_CMPIHEADERS(standard) if test "$have_CMPI" == "yes" then CPPFLAGS="$TEMP_CPPFLAGS" AC_MSG_RESULT(yes) fi fi if test "$have_CMPI" == "no" then AC_MSG_ERROR([[no. The CMPI headers could not be found (cmpidt.h, cmpimacs.h, cmpift.h)]]) fi ] ) opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_HostedPowerSupplyRedundancySet/0000755000175000017500000000000011401064722027756 5ustar guillaumeguillaume././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_HostedPowerSupplyRedundancySet/assocOpenDRIM_HostedPowerSupplyRedundancySet.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_HostedPowerSupplyRedundancySet/assocOpenDRIM_HostedPower0000644000175000017500000000635411401064722034642 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef ASSOCOPENDRIM_HOSTEDPOWERSUPPLYREDUNDANCYSET_H_ #define ASSOCOPENDRIM_HOSTEDPOWERSUPPLYREDUNDANCYSET_H_ #include "OpenDRIM_HostedPowerSupplyRedundancySetAccess.h" int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage); int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_associator(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties, vector& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant); int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_HOSTEDPOWERSUPPLYREDUNDANCYSET_H_*/ opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_HostedPowerSupplyRedundancySet/Makefile.am0000644000175000017500000000514011401064722032012 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProvider.la libcmpiPowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProvider_la_SOURCES = OpenDRIM_HostedPowerSupplyRedundancySetAccess.cpp OpenDRIM_HostedPowerSupplyRedundancySetProvider.cpp cmpiOpenDRIM_HostedPowerSupplyRedundancySet.cpp assocOpenDRIM_HostedPowerSupplyRedundancySet.cpp # May have to be adjusted for direct invocation libcmpiPowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProvider_la_CPPFLAGS = -I../CIM_System -I../CIM_SystemSpecificCollection # Uncomment the end for direct invocation, may have to be adjusted libcmpiPowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProvider_la_LIBADD = ../Common/libcmpiPowerSupply_Common.la #../CIM_System/libcmpiPowerSupply_CIM_SystemProvider.la ../CIM_SystemSpecificCollection/libcmpiPowerSupply_CIM_SystemSpecificCollectionProvider.la libcmpiPowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_HostedPowerSupplyRedundancySet.h OpenDRIM_HostedPowerSupplyRedundancySet.h OpenDRIM_HostedPowerSupplyRedundancySetAccess.h ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_HostedPowerSupplyRedundancySet/assocOpenDRIM_HostedPowerSupplyRedundancySet.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_HostedPowerSupplyRedundancySet/assocOpenDRIM_HostedPower0000644000175000017500000002137211401064722034637 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "assocOpenDRIM_HostedPowerSupplyRedundancySet.h" int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage) { _E_; string _assocClass, _resultClass, _resultRole, _role; assocClass == NULL ? _assocClass = "null" : _assocClass = assocClass; resultClass == NULL ? _resultClass = "null" : _resultClass = resultClass; resultRole == NULL ? _resultRole = "null" : _resultRole = resultRole; role == NULL ? _role = "null" : _role = role; for (unsigned int i=0; i& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant) { _E_; int errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_associatorFilter(broker, ctx, cop, knownInstance, assocClass, resultClass, role, resultRole, leftToRight, errorMessage); if (errorCode == -1) return OK; if (errorCode != OK) return errorCode; if (leftToRight) { if (role != NULL && strcasecmp(role, "Antecedent") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "Dependent") != 0) return OK; CF_assert(PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_associatorAntecedentToDependent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } else { if (role != NULL && strcasecmp(role, "Dependent") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "Antecedent") != 0) return OK; CF_assert(PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_associatorDependentToAntecedent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, Antecedent_NAMESPACE, Antecedent_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(PowerSupply_CIM_System_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PowerSupply_CIM_System_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PowerSupply_CIM_System_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Antecedent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Antecedent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_System _instance; PowerSupply_CIM_System_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PowerSupply_CIM_System_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PowerSupply_CIM_System_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, Dependent_NAMESPACE, Dependent_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(PowerSupply_CIM_SystemSpecificCollection_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PowerSupply_CIM_SystemSpecificCollection_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PowerSupply_CIM_SystemSpecificCollection_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Dependent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Dependent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_SystemSpecificCollection _instance; PowerSupply_CIM_SystemSpecificCollection_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PowerSupply_CIM_SystemSpecificCollection_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PowerSupply_CIM_SystemSpecificCollection_toCMPIInstance(broker, _instance)); */ _L_; return OK; } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_HostedPowerSupplyRedundancySet/OpenDRIM_HostedPowerSupplyRedundancySetAccess.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_HostedPowerSupplyRedundancySet/OpenDRIM_HostedPowerSuppl0000644000175000017500000002532511401064722034634 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "OpenDRIM_HostedPowerSupplyRedundancySetAccess.h" int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PowerSupply_CIM_System_load(broker, errorMessage)); CF_assert(PowerSupply_CIM_SystemSpecificCollection_load(broker, errorMessage)); */ // TODO _L_; return OK; } int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PowerSupply_CIM_System_unload(errorMessage)); CF_assert(PowerSupply_CIM_SystemSpecificCollection_unload(errorMessage)); */ // TODO _L_; return OK; } int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_isAssociated(const Instance& Antecedent, const Instance& Dependent, bool& isAssociated, string& errorMessage) { _E_; // TODO Determine if the association can be established or not isAssociated=true; _L_; return OK; } int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector subjects; // Only get the instance names CF_assert(PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_enumerateAntecedents(broker, ctx, subjects, NULL, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_enumerateAntecedents(broker, ctx, subjects, NULL, false, errorMessage)); vector::iterator c = subjects.begin(); vector::iterator end = subjects.end(); for (; c != end; ++c) { bool leftToRight = true; vector associatedInstances; PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_associator(broker, ctx, (*c).getObjectpath().getHdl(), (*c), Antecedent_classnames[0], Dependent_classnames[0], Antecedent_role.c_str(), Dependent_role.c_str(), NULL, associatedInstances, leftToRight, errorMessage, "an"); string ref_discriminant = discriminant == "ein" ? "rn" : "r"; CF_assert(PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_referenceAntecedentToDependent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_HostedPowerSupplyRedundancySet& instance, const char** properties, string& errorMessage) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ Objectpath Antecedent_objectpath; instance.getAntecedent(Antecedent_objectpath); Instance Antecedent_instance; CF_assert(PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_getAntecedent(broker, ctx, Antecedent_objectpath, Antecedent_instance, NULL, errorMessage)); Objectpath Dependent_objectpath; instance.getDependent(Dependent_objectpath); Instance Dependent_instance; CF_assert(PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_getDependent(broker, ctx, Dependent_objectpath, Dependent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_isAssociated(Antecedent_instance, Dependent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HostedPowerSupplyRedundancySet& newInstance, const OpenDRIM_HostedPowerSupplyRedundancySet& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HostedPowerSupplyRedundancySet& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HostedPowerSupplyRedundancySet& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector Dependent_instances; if (discriminant=="a") CF_assert(PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_enumerateDependents(broker, ctx, Dependent_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Antecedent_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector Antecedent_instances; if (discriminant=="a") CF_assert(PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Dependent_instances, vector& OpenDRIM_HostedPowerSupplyRedundancySet_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < Dependent_instances.size(); i++) { OpenDRIM_HostedPowerSupplyRedundancySet instance; instance.setAntecedent(((Instance) Antecedent_instance).getObjectpath()); instance.setDependent(((Instance) Dependent_instances[i]).getObjectpath()); OpenDRIM_HostedPowerSupplyRedundancySet_instances.push_back(instance); } _L_; return OK; } int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_HostedPowerSupplyRedundancySet_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < Antecedent_instances.size(); i++) { OpenDRIM_HostedPowerSupplyRedundancySet instance; instance.setAntecedent(((Instance) Antecedent_instances[i]).getObjectpath()); instance.setDependent(((Instance) Dependent_instance).getObjectpath()); OpenDRIM_HostedPowerSupplyRedundancySet_instances.push_back(instance); } _L_; return OK; } int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_populate(OpenDRIM_HostedPowerSupplyRedundancySet& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_HostedPowerSupplyRedundancySet/cmpiOpenDRIM_HostedPowerSupplyRedundancySet.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_HostedPowerSupplyRedundancySet/cmpiOpenDRIM_HostedPowerS0000644000175000017500000000452611401064722034604 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef CMPIOPENDRIM_HOSTEDPOWERSUPPLYREDUNDANCYSET_H_ #define CMPIOPENDRIM_HOSTEDPOWERSUPPLYREDUNDANCYSET_H_ #include "OpenDRIM_HostedPowerSupplyRedundancySet.h" CMPIObjectPath* PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_HostedPowerSupplyRedundancySet& instance); CMPIInstance* PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_HostedPowerSupplyRedundancySet& instance); void PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_HostedPowerSupplyRedundancySet& instance); void PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_HostedPowerSupplyRedundancySet& instance); #endif /*CMPIOPENDRIM_HOSTEDPOWERSUPPLYREDUNDANCYSET_H_*/ ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_HostedPowerSupplyRedundancySet/OpenDRIM_HostedPowerSupplyRedundancySet.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_HostedPowerSupplyRedundancySet/OpenDRIM_HostedPowerSuppl0000644000175000017500000000675111401064722034636 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef OPENDRIM_HOSTEDPOWERSUPPLYREDUNDANCYSET_H_ #define OPENDRIM_HOSTEDPOWERSUPPLYREDUNDANCYSET_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_System.h" #include "CIM_SystemAccess.h" #include "cmpiCIM_SystemSpecificCollection.h" #include "CIM_SystemSpecificCollectionAccess.h" */ const static char* OpenDRIM_HostedPowerSupplyRedundancySet_classnames[] = {"OpenDRIM_HostedPowerSupplyRedundancySet"}; static string OpenDRIM_HostedPowerSupplyRedundancySet_NAMESPACE = _NAMESPACE; const static string Antecedent_role = "Antecedent"; const static char* Antecedent_classnames[] = {"OpenDRIM_ComputerSystem"}; const static string Antecedent_NAMESPACE = _NAMESPACE; const static string Dependent_role = "Dependent"; const static char* Dependent_classnames[] = {"OpenDRIM_PowerSupplyRedundancySet"}; const static string Dependent_NAMESPACE = _NAMESPACE; class OpenDRIM_HostedPowerSupplyRedundancySet { public: Objectpath Antecedent; bool Antecedent_isNULL; Objectpath Dependent; bool Dependent_isNULL; OpenDRIM_HostedPowerSupplyRedundancySet() { Antecedent_isNULL = true; Dependent_isNULL = true; } ~OpenDRIM_HostedPowerSupplyRedundancySet() {} string getKeys() const { return CF_toLowCase(".Antecedent=\"" + CF_quoteString(Antecedent.toString()) + "\""".Dependent=\"" + CF_quoteString(Dependent.toString()) + "\""); } int getAntecedent(Objectpath& value) const { if (Antecedent_isNULL==true) return NOT_FOUND; value = Antecedent; return OK; } int setAntecedent(const Objectpath& newValue) { Antecedent = newValue; Antecedent.setNamespace(Antecedent_NAMESPACE); Antecedent_isNULL = false; return OK; } int getDependent(Objectpath& value) const { if (Dependent_isNULL==true) return NOT_FOUND; value = Dependent; return OK; } int setDependent(const Objectpath& newValue) { Dependent = newValue; Dependent.setNamespace(Dependent_NAMESPACE); Dependent_isNULL = false; return OK; } }; #endif /*OPENDRIM_HOSTEDPOWERSUPPLYREDUNDANCYSET_H_*/ ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_HostedPowerSupplyRedundancySet/OpenDRIM_HostedPowerSupplyRedundancySetAccess.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_HostedPowerSupplyRedundancySet/OpenDRIM_HostedPowerSuppl0000644000175000017500000001114411401064722034626 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef OPENDRIM_HOSTEDPOWERSUPPLYREDUNDANCYSETACCESS_H_ #define OPENDRIM_HOSTEDPOWERSUPPLYREDUNDANCYSETACCESS_H_ #include "PowerSupply_Common.h" #include "OpenDRIM_HostedPowerSupplyRedundancySet.h" #include "assocOpenDRIM_HostedPowerSupplyRedundancySet.h" int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_load(const CMPIBroker* broker, string& errorMessage); int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_unload(string& errorMessage); int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_HostedPowerSupplyRedundancySet& instance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HostedPowerSupplyRedundancySet& newInstance, const OpenDRIM_HostedPowerSupplyRedundancySet& oldInstance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HostedPowerSupplyRedundancySet& instance, string& errorMessage); int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_HostedPowerSupplyRedundancySet& instance, string& errorMessage); int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_associatorDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const char** properties, vector& Antecedent_associatedInstances, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_referenceAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const vector& Dependent_instances, vector& OpenDRIM_HostedPowerSupplyRedundancySet_instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_HostedPowerSupplyRedundancySet_instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_populate(OpenDRIM_HostedPowerSupplyRedundancySet& instance, string& errorMessage); #endif /*OPENDRIM_HOSTEDPOWERSUPPLYREDUNDANCYSETACCESS_H_*/ ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_HostedPowerSupplyRedundancySet/cmpiOpenDRIM_HostedPowerSupplyRedundancySet.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_HostedPowerSupplyRedundancySet/cmpiOpenDRIM_HostedPowerS0000644000175000017500000000625411401064722034604 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_HostedPowerSupplyRedundancySet.h" CMPIObjectPath* PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_HostedPowerSupplyRedundancySet& instance) { _E_; Objectpath op(broker, OpenDRIM_HostedPowerSupplyRedundancySet_classnames[0], OpenDRIM_HostedPowerSupplyRedundancySet_NAMESPACE); if (!instance.Antecedent_isNULL) op.addKey("Antecedent", instance.Antecedent); if (!instance.Dependent_isNULL) op.addKey("Dependent", instance.Dependent); _L_; return op.getHdl(); } CMPIInstance* PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_HostedPowerSupplyRedundancySet& instance) { _E_; Objectpath op(broker, PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_HostedPowerSupplyRedundancySet& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("Antecedent", instance.Antecedent) == OK) instance.Antecedent_isNULL = false; if (op.getKey("Dependent", instance.Dependent) == OK) instance.Dependent_isNULL = false; _L_; } void PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_HostedPowerSupplyRedundancySet& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("Antecedent", instance.Antecedent) == OK) instance.Antecedent_isNULL = false; if (inst.getProperty("Dependent", instance.Dependent) == OK) instance.Dependent_isNULL = false; _L_; } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_HostedPowerSupplyRedundancySet/OpenDRIM_HostedPowerSupplyRedundancySetProvider.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_HostedPowerSupplyRedundancySet/OpenDRIM_HostedPowerSuppl0000644000175000017500000004427111401064722034635 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_HostedPowerSupplyRedundancySet.h" #include "OpenDRIM_HostedPowerSupplyRedundancySetAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProviderSetInstance PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProviderModifyInstance #endif int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_init(const CMPIBroker* broker); int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProviderEnumInstances(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_HostedPowerSupplyRedundancySet instance; PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProviderSetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_HostedPowerSupplyRedundancySet newInstance, oldInstance; PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_toCPP(_broker, ci, newInstance); PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_HostedPowerSupplyRedundancySet instance; PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_HostedPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_HostedPowerSupplyRedundancySet instance; PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProviderExecQuery(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* lang, const char* query) { _E_; CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } /* ---------------------------------------------------------------------------*/ /* End of Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Association Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProviderAssociatorNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnObjectPath(rslt, associatedInstances[i].getObjectpath().getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProviderAssociators(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnInstance(rslt, associatedInstances[i].getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProviderReferenceNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProviderReferences(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_HostedPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_init FAILED: " + (string) OpenDRIM_HostedPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_unload(errorMessage); if (errorCode != OK) { errorMessage += "PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_unload FAILED: " + (string) OpenDRIM_HostedPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_INIT if (PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_init(_broker) < 0) return NULL CMInstanceMIStub(PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProvider, PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProvider, _broker, PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_INIT); CMAssociationMIStub(PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProvider, PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProvider, _broker, PowerSupply_OpenDRIM_HostedPowerSupplyRedundancySet_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-powersupply-1.0.0~ppa/Common/0000755000175000017500000000000011401064722021400 5ustar guillaumeguillaumeopendrim-lmp-powersupply-1.0.0~ppa/Common/Makefile.am0000644000175000017500000000336611401064722023444 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### commonlibdir = @COMMONLIBDIR@ commonlib_LTLIBRARIES = libcmpiPowerSupply_Common.la libcmpiPowerSupply_Common_la_SOURCES = PowerSupply_Common.cpp libcmpiPowerSupply_Common_la_LDFLAGS = -avoid-version libcmpiPowerSupply_Common_la_LIBADD = -lopendrim noinst_HEADERS = PowerSupply_Common.h opendrim-lmp-powersupply-1.0.0~ppa/Common/PowerSupply_Common.h0000644000175000017500000000477511401064722025407 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef POWERSUPPLY_COMMON_H_ #define POWERSUPPLY_COMMON_H_ #include #include typedef struct _system_power_supply { BYTE type; // 39 BYTE length; // Varies WORD handle; // Varies BYTE power_unit_group; // Varies BYTE location; // STRING BYTE device_name; // STRING BYTE manufacturer; // STRING BYTE serial_number; // STRING BYTE asset_tag_number; // STRING BYTE model_part_number; // STRING BYTE revision_level; // STRING WORD max_power_capacity; // Varies WORD power_supply_characteristics; // Varies WORD input_voltage_probe_handle; // Varies WORD cooling_device_handle; // Varies WORD input_current_probe_handle; // Varies }system_power_supply; int SMBIOS_getPowerSupplyInformation(vector& power,vector< vector >& dmi_strings,string& errorMessage); #endif /*POWERSUPPLY_COMMON_H_*/ opendrim-lmp-powersupply-1.0.0~ppa/Common/PowerSupply_Common.cpp0000644000175000017500000000574311401064722025736 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "PowerSupply_Common.h" int SMBIOS_getPowerSupplyInformation(vector& power,vector< vector >& dmi_strings,string& errorMessage) { vector _power; void *start_ptr; char *tableAddress; _smbios_entry_point *anchor; if((start_ptr=SMBIOS_getRawData(_SMBIOS_ANCHOR_SEARCH_OFFSET,_SMBIOS_ANCHOR_SEARCH_RANGE,errorMessage))==NULL) return FAILED; anchor = SMBIOS_getEntryPoint(start_ptr); if((tableAddress=(char*)SMBIOS_getRawData(anchor->structure_table_address,anchor->structure_table_length,errorMessage))==NULL) { free(start_ptr); return FAILED; } SMBIOS_getStructure(_power,tableAddress,anchor-> number_of_smbios_structure,39); // System Power Supply - type 39 for(unsigned int i=0;i<_power.size();i++) { vector _dmi_strings; vector indexes; int index_max; power.push_back(*(system_power_supply*)_power[i]); indexes.push_back((int)power[i].location); indexes.push_back((int)power[i].device_name); indexes.push_back((int)power[i].manufacturer); indexes.push_back((int)power[i].serial_number); indexes.push_back((int)power[i].asset_tag_number); indexes.push_back((int)power[i].model_part_number); indexes.push_back((int)power[i].revision_level); index_max=*max_element(indexes.begin(), indexes.end()); for(unsigned int j=0;j<=index_max;j++) _dmi_strings.push_back(SMBIOS_getDmiString((_smbios_structure_header*)_power[i],j)); dmi_strings.push_back(_dmi_strings); } free(tableAddress); free(start_ptr); return OK; } opendrim-lmp-powersupply-1.0.0~ppa/configure.ac0000644000175000017500000001300211401064722022432 0ustar guillaumeguillaume# Process this file with autoconf to produce a configure script. ############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### AC_PREREQ(2.59) AC_COPYRIGHT([[############################################################################### Note: This Copyright statement covers the OpenDRIM original parts of this file. It does NOT concern the parts generated by autoconf. Linux Management Providers (LMP), PowerSupply provider package Copyright (C) 2009 Shakhrom RUSTAMOV This program is being developed under the "OpenDRIM" project. The "OpenDRIM" project web page: http://opendrim.sourceforge.net The "OpenDRIM" project mailing list: opendrim@googlegroups.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ###############################################################################]]) AC_INIT(PowerSupply provider package, -, -) SHOW_COPYRIGHT AC_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE([foreign]) AC_CANONICAL_HOST case $host_cpu in i*86) HW=INTEL;; s390*) HW=S390;; ppc*) HW=PPC;; x86_64) HW=X86_64;; ia64) HW=IA64;; **) HW=GENERIC;; esac # Configuration AC_ARG_VAR([CIMSERVER],[the target CIM server (pegasus|sfcb|openwbem).]) AC_ARG_VAR([CIMNAMESPACE],[the target CIM namespace (default: root/cimv2)]) AC_ARG_VAR([INTEROPNAMESPACE],[the target interoperability namespace (default: Interop (pegasus and sfcb) or root/Interop (openwbem))]) AC_ARG_VAR([PROVIDERDIR],[the directory where the CMPI providers will be installed.]) AC_ARG_VAR([COMMONLIBDIR],[the directory where the package common libraries will be installed.]) # Checks for programs. AC_PROG_CXX AC_PROG_CC AC_PROG_INSTALL AC_PROG_LIBTOOL # Check for CIM server (defined in acinclude.m4) CHECK_CIMSERVER # Check for CIM namespace (defined in acinclude.m4) CHECK_CIMNAMESPACE # Check for interoperability namespace (defined in acinclude.m4) CHECK_INTEROPNAMESPACE # Check for OpenDRIM Common library (defined in acinclude.m4) CHECK_OPENDRIMCOMMONLIBRARY # Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([pthread.h]) # Check for CMPI headers (defined in acinclude.m4) CHECK_CMPIHEADERS # Check for OpenDRIM Common headers (defined in acinclude.m4) CHECK_OPENDRIMCOMMONHEADERS # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_CONST AC_C_INLINE AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_SIZE_T AC_HEADER_TIME AC_STRUCT_TM AC_CONFIG_FILES([Makefile Common/Makefile OpenDRIM_PowerSupplyCapabilities/Makefile OpenDRIM_OwningPowerSupplyRedundancySet/Makefile OpenDRIM_HostedPowerSupplyRedundancySet/Makefile OpenDRIM_PowerSupply/Makefile OpenDRIM_RegisteredPowerSupplyProfile/Makefile OpenDRIM_PowerSupplyRedundancySet/Makefile OpenDRIM_EnabledPowerSupplyCapabilities/Makefile OpenDRIM_MemberOfPowerSupplyCollection/Makefile OpenDRIM_PowerSupplyIsSpare/Makefile OpenDRIM_PowerSupplyConformsToProfile/Makefile OpenDRIM_SuppliesPower/Makefile OpenDRIM_ComputerSystemPowerSupply/Makefile test/Makefile]) CFLAGS="$CFLAGS -D$HW -DCMPI_PLATFORM_LINUX_GENERIC_GNU -I../Common -I$OPENDRIMCOMMONINCLUDE -I$OPENDRIMCOMMONINCLUDE/cmpi" CPPFLAGS="$CPPFLAGS -D$HW -DCMPI_PLATFORM_LINUX_GENERIC_GNU -I../Common -I$OPENDRIMCOMMONINCLUDE -I$OPENDRIMCOMMONINCLUDE/cmpi" echo "-------------------------------------------------------" echo "CIMSERVER: " $CIMSERVER echo "PROVIDERDIR: " $PROVIDERDIR echo "COMMONLIBDIR: " $COMMONLIBDIR echo "CFLAGS : " $CFLAGS echo "CXXFLAGS : " $CXXFLAGS echo "CPPFLAGS:" $CPPFLAGS echo "-------------------------------------------------------" AC_OUTPUT echo "You may now run make" opendrim-lmp-powersupply-1.0.0~ppa/TODO0000644000175000017500000000010111401064722020630 0ustar guillaumeguillaumeTODO for Major.Minor.Revision ========================= // TODO opendrim-lmp-powersupply-1.0.0~ppa/INSTALL0000644000175000017500000000370211401064722021203 0ustar guillaumeguillaume --------------------------------------------------------- BUILD --------------------------------------------------------- ./configure CIMSERVER= // For seeing the possible options: ./configure --help make --------------------------------------------------------- INSTALLATION --------------------------------------------------------- make install // Complile and copy the libraries to the provider library directory make postinstall // Register the providers --------------------------------------------------------- REMOVAL --------------------------------------------------------- make preuninstall // Deregister the providers make uninstall // Delete the libraries from the provider directory --------------------------------------------------------- CLEANUP --------------------------------------------------------- make clean --------------------------------------------------------- DEBUG --------------------------------------------------------- Configure (./configure) the source code with 'CPPFLAGS=-D__DEBUG__'. The debugging information is printed in a file called 'cmpi_prov_debug.txt'. OpenPegasus from source: ----------------------- The file is located in the directory where you executed 'cimserver' (to start the CIM server). OpenPegasus from RPM: -------------------- If Pegasus is installed from RPM the file is located in the '/var/lib/Pegasus/cache' directory. SBLIM sfcb: ---------- The file is located in the directory where you executed 'sfcbd' (to start the CIM server). OpenWBEM: -------- // TODO --------------------------------------------------------- OFFLINE TEST --------------------------------------------------------- make test- If you enabled the debugging information, 'cmpi_prov_debug.txt' is created in the 'test' directory. The test MAY BE impossible to run for associations. If it is the case you have to install the provider package and test the association providers online (CIM server running). opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_EnabledPowerSupplyCapabilities/0000755000175000017500000000000011401064722027703 5ustar guillaumeguillaume././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_EnabledPowerSupplyCapabilities/OpenDRIM_EnabledPowerSupplyCapabilitiesAccess.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_EnabledPowerSupplyCapabilities/OpenDRIM_EnabledPowerSupp0000644000175000017500000000643211401064722034507 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "OpenDRIM_EnabledPowerSupplyCapabilitiesAccess.h" int PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_load(const CMPIBroker* broker, string& errorMessage) { _E_; // TODO _L_; return OK; } int PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; _L_; return OK; } int PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_EnabledPowerSupplyCapabilities& instance, const char** properties, string& errorMessage) { _E_; _L_; return OK; } int PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledPowerSupplyCapabilities& newInstance, const OpenDRIM_EnabledPowerSupplyCapabilities& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledPowerSupplyCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledPowerSupplyCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_populate(OpenDRIM_EnabledPowerSupplyCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_EnabledPowerSupplyCapabilities/Makefile.am0000644000175000017500000000424511401064722031744 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPowerSupply_OpenDRIM_EnabledPowerSupplyCapabilitiesProvider.la libcmpiPowerSupply_OpenDRIM_EnabledPowerSupplyCapabilitiesProvider_la_SOURCES = OpenDRIM_EnabledPowerSupplyCapabilitiesAccess.cpp OpenDRIM_EnabledPowerSupplyCapabilitiesProvider.cpp cmpiOpenDRIM_EnabledPowerSupplyCapabilities.cpp libcmpiPowerSupply_OpenDRIM_EnabledPowerSupplyCapabilitiesProvider_la_LIBADD = ../Common/libcmpiPowerSupply_Common.la libcmpiPowerSupply_OpenDRIM_EnabledPowerSupplyCapabilitiesProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_EnabledPowerSupplyCapabilities.h OpenDRIM_EnabledPowerSupplyCapabilities.h OpenDRIM_EnabledPowerSupplyCapabilitiesAccess.h ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_EnabledPowerSupplyCapabilities/cmpiOpenDRIM_EnabledPowerSupplyCapabilities.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_EnabledPowerSupplyCapabilities/cmpiOpenDRIM_EnabledPower0000644000175000017500000001067611401064722034515 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_EnabledPowerSupplyCapabilities.h" CMPIObjectPath* PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_EnabledPowerSupplyCapabilities& instance) { _E_; Objectpath op(broker, OpenDRIM_EnabledPowerSupplyCapabilities_classnames[0], OpenDRIM_EnabledPowerSupplyCapabilities_NAMESPACE); if (!instance.InstanceID_isNULL) op.addKey("InstanceID", instance.InstanceID); _L_; return op.getHdl(); } CMPIInstance* PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_EnabledPowerSupplyCapabilities& instance) { _E_; Objectpath op(broker, PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.Caption_isNULL) ci.setProperty("Caption", instance.Caption); if (!instance.Description_isNULL) ci.setProperty("Description", instance.Description); if (!instance.ElementName_isNULL) ci.setProperty("ElementName", instance.ElementName); if (!instance.ElementNameEditSupported_isNULL) ci.setProperty("ElementNameEditSupported", instance.ElementNameEditSupported); if (!instance.MaxElementNameLen_isNULL) ci.setProperty("MaxElementNameLen", instance.MaxElementNameLen); if (!instance.RequestedStatesSupported_isNULL) ci.setProperty("RequestedStatesSupported", instance.RequestedStatesSupported); if (!instance.ElementNameMask_isNULL) ci.setProperty("ElementNameMask", instance.ElementNameMask); _L_; return ci.getHdl(); } void PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_EnabledPowerSupplyCapabilities& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; _L_; } void PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_EnabledPowerSupplyCapabilities& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("Caption", instance.Caption) == OK) instance.Caption_isNULL = false; if (inst.getProperty("Description", instance.Description) == OK) instance.Description_isNULL = false; if (inst.getProperty("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getProperty("ElementNameEditSupported", instance.ElementNameEditSupported) == OK) instance.ElementNameEditSupported_isNULL = false; if (inst.getProperty("MaxElementNameLen", instance.MaxElementNameLen) == OK) instance.MaxElementNameLen_isNULL = false; if (inst.getProperty("RequestedStatesSupported", instance.RequestedStatesSupported) == OK) instance.RequestedStatesSupported_isNULL = false; if (inst.getProperty("ElementNameMask", instance.ElementNameMask) == OK) instance.ElementNameMask_isNULL = false; _L_; } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_EnabledPowerSupplyCapabilities/cmpiOpenDRIM_EnabledPowerSupplyCapabilities.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_EnabledPowerSupplyCapabilities/cmpiOpenDRIM_EnabledPower0000644000175000017500000000452611401064722034512 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef CMPIOPENDRIM_ENABLEDPOWERSUPPLYCAPABILITIES_H_ #define CMPIOPENDRIM_ENABLEDPOWERSUPPLYCAPABILITIES_H_ #include "OpenDRIM_EnabledPowerSupplyCapabilities.h" CMPIObjectPath* PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_EnabledPowerSupplyCapabilities& instance); CMPIInstance* PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_EnabledPowerSupplyCapabilities& instance); void PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_EnabledPowerSupplyCapabilities& instance); void PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_EnabledPowerSupplyCapabilities& instance); #endif /*CMPIOPENDRIM_ENABLEDPOWERSUPPLYCAPABILITIES_H_*/ ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_EnabledPowerSupplyCapabilities/OpenDRIM_EnabledPowerSupplyCapabilities.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_EnabledPowerSupplyCapabilities/OpenDRIM_EnabledPowerSupp0000644000175000017500000001204711401064722034506 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef OPENDRIM_ENABLEDPOWERSUPPLYCAPABILITIES_H_ #define OPENDRIM_ENABLEDPOWERSUPPLYCAPABILITIES_H_ #include const static char* OpenDRIM_EnabledPowerSupplyCapabilities_classnames[] = {"OpenDRIM_EnabledPowerSupplyCapabilities"}; static string OpenDRIM_EnabledPowerSupplyCapabilities_NAMESPACE = _NAMESPACE; class OpenDRIM_EnabledPowerSupplyCapabilities { public: string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string InstanceID; bool InstanceID_isNULL; string ElementName; bool ElementName_isNULL; bool ElementNameEditSupported; bool ElementNameEditSupported_isNULL; unsigned short MaxElementNameLen; bool MaxElementNameLen_isNULL; vector RequestedStatesSupported; bool RequestedStatesSupported_isNULL; string ElementNameMask; bool ElementNameMask_isNULL; OpenDRIM_EnabledPowerSupplyCapabilities() { Caption_isNULL = true; Description_isNULL = true; InstanceID_isNULL = true; ElementName_isNULL = true; ElementNameEditSupported_isNULL = true; MaxElementNameLen_isNULL = true; RequestedStatesSupported_isNULL = true; ElementNameMask_isNULL = true; } ~OpenDRIM_EnabledPowerSupplyCapabilities() {} string getKeys() const { return CF_toLowCase(".InstanceID=\"" + CF_quoteString(InstanceID) + "\""); } int getCaption(string& value) const { if (Caption_isNULL==true) return NOT_FOUND; value = Caption; return OK; } int setCaption(const string& newValue) { Caption = newValue; Caption_isNULL = false; return OK; } int getDescription(string& value) const { if (Description_isNULL==true) return NOT_FOUND; value = Description; return OK; } int setDescription(const string& newValue) { Description = newValue; Description_isNULL = false; return OK; } int getInstanceID(string& value) const { if (InstanceID_isNULL==true) return NOT_FOUND; value = InstanceID; return OK; } int setInstanceID(const string& newValue) { InstanceID = newValue; InstanceID_isNULL = false; return OK; } int getElementName(string& value) const { if (ElementName_isNULL==true) return NOT_FOUND; value = ElementName; return OK; } int setElementName(const string& newValue) { ElementName = newValue; ElementName_isNULL = false; return OK; } int getElementNameEditSupported(bool& value) const { if (ElementNameEditSupported_isNULL==true) return NOT_FOUND; value = ElementNameEditSupported; return OK; } int setElementNameEditSupported(const bool& newValue) { ElementNameEditSupported = newValue; ElementNameEditSupported_isNULL = false; return OK; } int getMaxElementNameLen(unsigned short& value) const { if (MaxElementNameLen_isNULL==true) return NOT_FOUND; value = MaxElementNameLen; return OK; } int setMaxElementNameLen(const unsigned short& newValue) { MaxElementNameLen = newValue; MaxElementNameLen_isNULL = false; return OK; } int getRequestedStatesSupported(vector& value) const { if (RequestedStatesSupported_isNULL==true) return NOT_FOUND; value = RequestedStatesSupported; return OK; } int setRequestedStatesSupported(const vector& newValue) { RequestedStatesSupported = newValue; RequestedStatesSupported_isNULL = false; return OK; } int getElementNameMask(string& value) const { if (ElementNameMask_isNULL==true) return NOT_FOUND; value = ElementNameMask; return OK; } int setElementNameMask(const string& newValue) { ElementNameMask = newValue; ElementNameMask_isNULL = false; return OK; } }; #endif /*OPENDRIM_ENABLEDPOWERSUPPLYCAPABILITIES_H_*/ ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_EnabledPowerSupplyCapabilities/OpenDRIM_EnabledPowerSupplyCapabilitiesProvider.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_EnabledPowerSupplyCapabilities/OpenDRIM_EnabledPowerSupp0000644000175000017500000002741511401064722034513 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_EnabledPowerSupplyCapabilities.h" #include "OpenDRIM_EnabledPowerSupplyCapabilitiesAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilitiesProviderSetInstance PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilitiesProviderModifyInstance #endif int PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_init(const CMPIBroker* broker); int PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilitiesProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilitiesProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledPowerSupplyCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilitiesProviderEnumInstances(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledPowerSupplyCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilitiesProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_EnabledPowerSupplyCapabilities instance; PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledPowerSupplyCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilitiesProviderSetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_EnabledPowerSupplyCapabilities newInstance, oldInstance; PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_toCPP(_broker, ci, newInstance); PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledPowerSupplyCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledPowerSupplyCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilitiesProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_EnabledPowerSupplyCapabilities instance; PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_EnabledPowerSupplyCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledPowerSupplyCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledPowerSupplyCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilitiesProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_EnabledPowerSupplyCapabilities instance; PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledPowerSupplyCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledPowerSupplyCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilitiesProviderExecQuery(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* lang, const char* query) { _E_; CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } /* ---------------------------------------------------------------------------*/ /* End of Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_init FAILED: " + (string) OpenDRIM_EnabledPowerSupplyCapabilities_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_unload(errorMessage); if (errorCode != OK) { errorMessage += "PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_unload FAILED: " + (string) OpenDRIM_EnabledPowerSupplyCapabilities_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_INIT if (PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_init(_broker) < 0) return NULL CMInstanceMIStub(PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilitiesProvider, PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilitiesProvider, _broker, PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_EnabledPowerSupplyCapabilities/OpenDRIM_EnabledPowerSupplyCapabilitiesAccess.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_EnabledPowerSupplyCapabilities/OpenDRIM_EnabledPowerSupp0000644000175000017500000000627011401064722034507 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef OPENDRIM_ENABLEDPOWERSUPPLYCAPABILITIESACCESS_H_ #define OPENDRIM_ENABLEDPOWERSUPPLYCAPABILITIESACCESS_H_ #include "PowerSupply_Common.h" #include "OpenDRIM_EnabledPowerSupplyCapabilities.h" int PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_load(const CMPIBroker* broker, string& errorMessage); int PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_unload(string& errorMessage); int PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_EnabledPowerSupplyCapabilities& instance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledPowerSupplyCapabilities& newInstance, const OpenDRIM_EnabledPowerSupplyCapabilities& oldInstance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledPowerSupplyCapabilities& instance, string& errorMessage); int PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledPowerSupplyCapabilities& instance, string& errorMessage); int PowerSupply_OpenDRIM_EnabledPowerSupplyCapabilities_populate(OpenDRIM_EnabledPowerSupplyCapabilities& instance, string& errorMessage); #endif /*OPENDRIM_ENABLEDPOWERSUPPLYCAPABILITIESACCESS_H_*/ opendrim-lmp-powersupply-1.0.0~ppa/AUTHORS0000644000175000017500000000012711401064722021220 0ustar guillaumeguillaumeShakhrom RUSTAMOV Guillaume BOTTEX opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_OwningPowerSupplyRedundancySet/0000755000175000017500000000000011401064722027771 5ustar guillaumeguillaume././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_OwningPowerSupplyRedundancySet/OpenDRIM_OwningPowerSupplyRedundancySetAccess.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_OwningPowerSupplyRedundancySet/OpenDRIM_OwningPowerSuppl0000644000175000017500000001122411401064722034653 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef OPENDRIM_OWNINGPOWERSUPPLYREDUNDANCYSETACCESS_H_ #define OPENDRIM_OWNINGPOWERSUPPLYREDUNDANCYSETACCESS_H_ #include "PowerSupply_Common.h" #include "OpenDRIM_OwningPowerSupplyRedundancySet.h" #include "assocOpenDRIM_OwningPowerSupplyRedundancySet.h" int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_load(const CMPIBroker* broker, string& errorMessage); int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_unload(string& errorMessage); int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_OwningPowerSupplyRedundancySet& instance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OwningPowerSupplyRedundancySet& newInstance, const OpenDRIM_OwningPowerSupplyRedundancySet& oldInstance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OwningPowerSupplyRedundancySet& instance, string& errorMessage); int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OwningPowerSupplyRedundancySet& instance, string& errorMessage); int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_associatorOwnedElementToOwningElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& OwnedElement_instance, const char** properties, vector& OwningElement_associatedInstances, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_associatorOwningElementToOwnedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& OwningElement_instance, const char** properties, vector& OwnedElement_associatedInstances, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_referenceOwnedElementToOwningElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& OwnedElement_instance, const vector& OwningElement_instances, vector& OpenDRIM_OwningPowerSupplyRedundancySet_instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_referenceOwningElementToOwnedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& OwningElement_instance, const vector& OwnedElement_instances, vector& OpenDRIM_OwningPowerSupplyRedundancySet_instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_populate(OpenDRIM_OwningPowerSupplyRedundancySet& instance, string& errorMessage); #endif /*OPENDRIM_OWNINGPOWERSUPPLYREDUNDANCYSETACCESS_H_*/ opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_OwningPowerSupplyRedundancySet/Makefile.am0000644000175000017500000000511611401064722032030 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProvider.la libcmpiPowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProvider_la_SOURCES = OpenDRIM_OwningPowerSupplyRedundancySetAccess.cpp OpenDRIM_OwningPowerSupplyRedundancySetProvider.cpp cmpiOpenDRIM_OwningPowerSupplyRedundancySet.cpp assocOpenDRIM_OwningPowerSupplyRedundancySet.cpp # May have to be adjusted for direct invocation libcmpiPowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProvider_la_CPPFLAGS = -I../CIM_Collection -I../CIM_ManagedElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiPowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProvider_la_LIBADD = ../Common/libcmpiPowerSupply_Common.la #../CIM_Collection/libcmpiPowerSupply_CIM_CollectionProvider.la ../CIM_ManagedElement/libcmpiPowerSupply_CIM_ManagedElementProvider.la libcmpiPowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_OwningPowerSupplyRedundancySet.h OpenDRIM_OwningPowerSupplyRedundancySet.h OpenDRIM_OwningPowerSupplyRedundancySetAccess.h ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_OwningPowerSupplyRedundancySet/OpenDRIM_OwningPowerSupplyRedundancySetProvider.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_OwningPowerSupplyRedundancySet/OpenDRIM_OwningPowerSuppl0000644000175000017500000004432111401064722034657 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_OwningPowerSupplyRedundancySet.h" #include "OpenDRIM_OwningPowerSupplyRedundancySetAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProviderSetInstance PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProviderModifyInstance #endif int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_init(const CMPIBroker* broker); int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OwningPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProviderEnumInstances(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OwningPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OwningPowerSupplyRedundancySet instance; PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OwningPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProviderSetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OwningPowerSupplyRedundancySet newInstance, oldInstance; PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_toCPP(_broker, ci, newInstance); PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OwningPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OwningPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OwningPowerSupplyRedundancySet instance; PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_OwningPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OwningPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OwningPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_OwningPowerSupplyRedundancySet instance; PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OwningPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OwningPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProviderExecQuery(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* lang, const char* query) { _E_; CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } /* ---------------------------------------------------------------------------*/ /* End of Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Association Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProviderAssociatorNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OwningPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnObjectPath(rslt, associatedInstances[i].getObjectpath().getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProviderAssociators(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OwningPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnInstance(rslt, associatedInstances[i].getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProviderReferenceNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OwningPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_referenceOwnedElementToOwningElement(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_referenceOwningElementToOwnedElement(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OwningPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProviderReferences(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OwningPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_referenceOwnedElementToOwningElement(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_referenceOwningElementToOwnedElement(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_OwningPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_init FAILED: " + (string) OpenDRIM_OwningPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_unload(errorMessage); if (errorCode != OK) { errorMessage += "PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_unload FAILED: " + (string) OpenDRIM_OwningPowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_INIT if (PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_init(_broker) < 0) return NULL CMInstanceMIStub(PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProvider, PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProvider, _broker, PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_INIT); CMAssociationMIStub(PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProvider, PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProvider, _broker, PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_OwningPowerSupplyRedundancySet/cmpiOpenDRIM_OwningPowerSupplyRedundancySet.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_OwningPowerSupplyRedundancySet/cmpiOpenDRIM_OwningPowerS0000644000175000017500000000452611401064722034632 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef CMPIOPENDRIM_OWNINGPOWERSUPPLYREDUNDANCYSET_H_ #define CMPIOPENDRIM_OWNINGPOWERSUPPLYREDUNDANCYSET_H_ #include "OpenDRIM_OwningPowerSupplyRedundancySet.h" CMPIObjectPath* PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_OwningPowerSupplyRedundancySet& instance); CMPIInstance* PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_OwningPowerSupplyRedundancySet& instance); void PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_OwningPowerSupplyRedundancySet& instance); void PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_OwningPowerSupplyRedundancySet& instance); #endif /*CMPIOPENDRIM_OWNINGPOWERSUPPLYREDUNDANCYSET_H_*/ ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_OwningPowerSupplyRedundancySet/assocOpenDRIM_OwningPowerSupplyRedundancySet.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_OwningPowerSupplyRedundancySet/assocOpenDRIM_OwningPower0000644000175000017500000002145211401064722034664 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "assocOpenDRIM_OwningPowerSupplyRedundancySet.h" int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage) { _E_; string _assocClass, _resultClass, _resultRole, _role; assocClass == NULL ? _assocClass = "null" : _assocClass = assocClass; resultClass == NULL ? _resultClass = "null" : _resultClass = resultClass; resultRole == NULL ? _resultRole = "null" : _resultRole = resultRole; role == NULL ? _role = "null" : _role = role; for (unsigned int i=0; i& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant) { _E_; int errorCode = PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_associatorFilter(broker, ctx, cop, knownInstance, assocClass, resultClass, role, resultRole, leftToRight, errorMessage); if (errorCode == -1) return OK; if (errorCode != OK) return errorCode; if (leftToRight) { if (role != NULL && strcasecmp(role, "OwnedElement") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "OwningElement") != 0) return OK; CF_assert(PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_associatorOwnedElementToOwningElement(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } else { if (role != NULL && strcasecmp(role, "OwningElement") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "OwnedElement") != 0) return OK; CF_assert(PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_associatorOwningElementToOwnedElement(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_enumerateOwnedElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, OwnedElement_NAMESPACE, OwnedElement_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(PowerSupply_CIM_Collection_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PowerSupply_CIM_Collection_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PowerSupply_CIM_Collection_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_getOwnedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), OwnedElement_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), OwnedElement_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_Collection _instance; PowerSupply_CIM_Collection_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PowerSupply_CIM_Collection_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PowerSupply_CIM_Collection_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_enumerateOwningElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, OwningElement_NAMESPACE, OwningElement_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(PowerSupply_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PowerSupply_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PowerSupply_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_getOwningElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), OwningElement_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), OwningElement_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_ManagedElement _instance; PowerSupply_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PowerSupply_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PowerSupply_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_OwningPowerSupplyRedundancySet/OpenDRIM_OwningPowerSupplyRedundancySet.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_OwningPowerSupplyRedundancySet/OpenDRIM_OwningPowerSuppl0000644000175000017500000000710311401064722034654 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef OPENDRIM_OWNINGPOWERSUPPLYREDUNDANCYSET_H_ #define OPENDRIM_OWNINGPOWERSUPPLYREDUNDANCYSET_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_Collection.h" #include "CIM_CollectionAccess.h" #include "cmpiCIM_ManagedElement.h" #include "CIM_ManagedElementAccess.h" */ const static char* OpenDRIM_OwningPowerSupplyRedundancySet_classnames[] = {"OpenDRIM_OwningPowerSupplyRedundancySet"}; static string OpenDRIM_OwningPowerSupplyRedundancySet_NAMESPACE = _NAMESPACE; const static string OwnedElement_role = "OwnedElement"; const static char* OwnedElement_classnames[] = {"OpenDRIM_PowerSupplyRedundancySet"}; const static string OwnedElement_NAMESPACE = _NAMESPACE; const static string OwningElement_role = "OwningElement"; const static char* OwningElement_classnames[] = {"OpenDRIM_ComputerSystem"}; const static string OwningElement_NAMESPACE = _NAMESPACE; class OpenDRIM_OwningPowerSupplyRedundancySet { public: Objectpath OwningElement; bool OwningElement_isNULL; Objectpath OwnedElement; bool OwnedElement_isNULL; OpenDRIM_OwningPowerSupplyRedundancySet() { OwningElement_isNULL = true; OwnedElement_isNULL = true; } ~OpenDRIM_OwningPowerSupplyRedundancySet() {} string getKeys() const { return CF_toLowCase(".OwningElement=\"" + CF_quoteString(OwningElement.toString()) + "\""".OwnedElement=\"" + CF_quoteString(OwnedElement.toString()) + "\""); } int getOwningElement(Objectpath& value) const { if (OwningElement_isNULL==true) return NOT_FOUND; value = OwningElement; return OK; } int setOwningElement(const Objectpath& newValue) { OwningElement = newValue; OwningElement.setNamespace(OwningElement_NAMESPACE); OwningElement_isNULL = false; return OK; } int getOwnedElement(Objectpath& value) const { if (OwnedElement_isNULL==true) return NOT_FOUND; value = OwnedElement; return OK; } int setOwnedElement(const Objectpath& newValue) { OwnedElement = newValue; OwnedElement.setNamespace(OwnedElement_NAMESPACE); OwnedElement_isNULL = false; return OK; } }; #endif /*OPENDRIM_OWNINGPOWERSUPPLYREDUNDANCYSET_H_*/ ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_OwningPowerSupplyRedundancySet/cmpiOpenDRIM_OwningPowerSupplyRedundancySet.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_OwningPowerSupplyRedundancySet/cmpiOpenDRIM_OwningPowerS0000644000175000017500000000634211401064722034630 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_OwningPowerSupplyRedundancySet.h" CMPIObjectPath* PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_OwningPowerSupplyRedundancySet& instance) { _E_; Objectpath op(broker, OpenDRIM_OwningPowerSupplyRedundancySet_classnames[0], OpenDRIM_OwningPowerSupplyRedundancySet_NAMESPACE); if (!instance.OwningElement_isNULL) op.addKey("OwningElement", instance.OwningElement); if (!instance.OwnedElement_isNULL) op.addKey("OwnedElement", instance.OwnedElement); _L_; return op.getHdl(); } CMPIInstance* PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_OwningPowerSupplyRedundancySet& instance) { _E_; Objectpath op(broker, PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_OwningPowerSupplyRedundancySet& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("OwnedElement", instance.OwnedElement) == OK) instance.OwnedElement_isNULL = false; if (op.getKey("OwningElement", instance.OwningElement) == OK) instance.OwningElement_isNULL = false; _L_; } void PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_OwningPowerSupplyRedundancySet& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("OwningElement", instance.OwningElement) == OK) instance.OwningElement_isNULL = false; if (inst.getProperty("OwnedElement", instance.OwnedElement) == OK) instance.OwnedElement_isNULL = false; _L_; } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_OwningPowerSupplyRedundancySet/OpenDRIM_OwningPowerSupplyRedundancySetAccess.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_OwningPowerSupplyRedundancySet/OpenDRIM_OwningPowerSuppl0000644000175000017500000002565311401064722034666 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "OpenDRIM_OwningPowerSupplyRedundancySetAccess.h" int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PowerSupply_CIM_Collection_load(broker, errorMessage)); CF_assert(PowerSupply_CIM_ManagedElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PowerSupply_CIM_Collection_unload(errorMessage)); CF_assert(PowerSupply_CIM_ManagedElement_unload(errorMessage)); */ // TODO _L_; return OK; } int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_isAssociated(const Instance& OwnedElement, const Instance& OwningElement, bool& isAssociated, string& errorMessage) { _E_; // TODO Determine if the association can be established or not isAssociated=true; _L_; return OK; } int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector subjects; // Only get the instance names CF_assert(PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_enumerateOwnedElements(broker, ctx, subjects, NULL, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_enumerateOwnedElements(broker, ctx, subjects, NULL, false, errorMessage)); vector::iterator c = subjects.begin(); vector::iterator end = subjects.end(); for (; c != end; ++c) { bool leftToRight = true; vector associatedInstances; PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_associator(broker, ctx, (*c).getObjectpath().getHdl(), (*c), OwnedElement_classnames[0], OwningElement_classnames[0], OwnedElement_role.c_str(), OwningElement_role.c_str(), NULL, associatedInstances, leftToRight, errorMessage, "an"); string ref_discriminant = discriminant == "ein" ? "rn" : "r"; CF_assert(PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_referenceOwnedElementToOwningElement(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_OwningPowerSupplyRedundancySet& instance, const char** properties, string& errorMessage) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ Objectpath OwnedElement_objectpath; instance.getOwnedElement(OwnedElement_objectpath); Instance OwnedElement_instance; CF_assert(PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_getOwnedElement(broker, ctx, OwnedElement_objectpath, OwnedElement_instance, NULL, errorMessage)); Objectpath OwningElement_objectpath; instance.getOwningElement(OwningElement_objectpath); Instance OwningElement_instance; CF_assert(PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_getOwningElement(broker, ctx, OwningElement_objectpath, OwningElement_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_isAssociated(OwnedElement_instance, OwningElement_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OwningPowerSupplyRedundancySet& newInstance, const OpenDRIM_OwningPowerSupplyRedundancySet& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OwningPowerSupplyRedundancySet& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_OwningPowerSupplyRedundancySet& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_associatorOwnedElementToOwningElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& OwnedElement_instance, const char** properties, vector& OwningElement_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector OwningElement_instances; if (discriminant=="a") CF_assert(PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_enumerateOwningElements(broker, ctx, OwningElement_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_enumerateOwningElements(broker, ctx, OwningElement_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_enumerateOwningElements(broker, ctx, OwningElement_instances, properties, false, errorMessage)); } for (size_t i=0; i& OwnedElement_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector OwnedElement_instances; if (discriminant=="a") CF_assert(PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_enumerateOwnedElements(broker, ctx, OwnedElement_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_enumerateOwnedElements(broker, ctx, OwnedElement_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_enumerateOwnedElements(broker, ctx, OwnedElement_instances, properties, false, errorMessage)); } for (size_t i=0; i& OwningElement_instances, vector& OpenDRIM_OwningPowerSupplyRedundancySet_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < OwningElement_instances.size(); i++) { OpenDRIM_OwningPowerSupplyRedundancySet instance; instance.setOwnedElement(((Instance) OwnedElement_instance).getObjectpath()); instance.setOwningElement(((Instance) OwningElement_instances[i]).getObjectpath()); OpenDRIM_OwningPowerSupplyRedundancySet_instances.push_back(instance); } _L_; return OK; } int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_referenceOwningElementToOwnedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& OwningElement_instance, const vector& OwnedElement_instances, vector& OpenDRIM_OwningPowerSupplyRedundancySet_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < OwnedElement_instances.size(); i++) { OpenDRIM_OwningPowerSupplyRedundancySet instance; instance.setOwnedElement(((Instance) OwnedElement_instances[i]).getObjectpath()); instance.setOwningElement(((Instance) OwningElement_instance).getObjectpath()); OpenDRIM_OwningPowerSupplyRedundancySet_instances.push_back(instance); } _L_; return OK; } int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_populate(OpenDRIM_OwningPowerSupplyRedundancySet& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_OwningPowerSupplyRedundancySet/assocOpenDRIM_OwningPowerSupplyRedundancySet.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_OwningPowerSupplyRedundancySet/assocOpenDRIM_OwningPower0000644000175000017500000000637011401064722034666 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef ASSOCOPENDRIM_OWNINGPOWERSUPPLYREDUNDANCYSET_H_ #define ASSOCOPENDRIM_OWNINGPOWERSUPPLYREDUNDANCYSET_H_ #include "OpenDRIM_OwningPowerSupplyRedundancySetAccess.h" int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage); int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_associator(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties, vector& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant); int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_enumerateOwnedElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_getOwnedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_enumerateOwningElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PowerSupply_OpenDRIM_OwningPowerSupplyRedundancySet_getOwningElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_OWNINGPOWERSUPPLYREDUNDANCYSET_H_*/ opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyIsSpare/0000755000175000017500000000000011401064722025405 5ustar guillaumeguillaumeopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyIsSpare/Makefile.am0000644000175000017500000000470711401064722027451 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPowerSupply_OpenDRIM_PowerSupplyIsSpareProvider.la libcmpiPowerSupply_OpenDRIM_PowerSupplyIsSpareProvider_la_SOURCES = OpenDRIM_PowerSupplyIsSpareAccess.cpp OpenDRIM_PowerSupplyIsSpareProvider.cpp cmpiOpenDRIM_PowerSupplyIsSpare.cpp assocOpenDRIM_PowerSupplyIsSpare.cpp # May have to be adjusted for direct invocation libcmpiPowerSupply_OpenDRIM_PowerSupplyIsSpareProvider_la_CPPFLAGS = -I../CIM_ManagedElement -I../CIM_RedundancySet # Uncomment the end for direct invocation, may have to be adjusted libcmpiPowerSupply_OpenDRIM_PowerSupplyIsSpareProvider_la_LIBADD = ../Common/libcmpiPowerSupply_Common.la #../CIM_ManagedElement/libcmpiPowerSupply_CIM_ManagedElementProvider.la ../CIM_RedundancySet/libcmpiPowerSupply_CIM_RedundancySetProvider.la libcmpiPowerSupply_OpenDRIM_PowerSupplyIsSpareProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_PowerSupplyIsSpare.h OpenDRIM_PowerSupplyIsSpare.h OpenDRIM_PowerSupplyIsSpareAccess.h opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyIsSpare/OpenDRIM_PowerSupplyIsSpare.h0000644000175000017500000001016611401064722033017 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef OPENDRIM_POWERSUPPLYISSPARE_H_ #define OPENDRIM_POWERSUPPLYISSPARE_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_ManagedElement.h" #include "CIM_ManagedElementAccess.h" #include "cmpiCIM_RedundancySet.h" #include "CIM_RedundancySetAccess.h" */ const static char* OpenDRIM_PowerSupplyIsSpare_classnames[] = {"OpenDRIM_PowerSupplyIsSpare"}; static string OpenDRIM_PowerSupplyIsSpare_NAMESPACE = _NAMESPACE; const static string Antecedent_role = "Antecedent"; const static char* Antecedent_classnames[] = {"OpenDRIM_PowerSupply"}; const static string Antecedent_NAMESPACE = _NAMESPACE; const static string Dependent_role = "Dependent"; const static char* Dependent_classnames[] = {"OpenDRIM_PowerSupplyRedundancySet"}; const static string Dependent_NAMESPACE = _NAMESPACE; class OpenDRIM_PowerSupplyIsSpare { public: Objectpath Antecedent; bool Antecedent_isNULL; Objectpath Dependent; bool Dependent_isNULL; unsigned short SpareStatus; bool SpareStatus_isNULL; unsigned short FailoverSupported; bool FailoverSupported_isNULL; OpenDRIM_PowerSupplyIsSpare() { Antecedent_isNULL = true; Dependent_isNULL = true; SpareStatus_isNULL = true; FailoverSupported_isNULL = true; } ~OpenDRIM_PowerSupplyIsSpare() {} string getKeys() const { return CF_toLowCase(".Antecedent=\"" + CF_quoteString(Antecedent.toString()) + "\""".Dependent=\"" + CF_quoteString(Dependent.toString()) + "\""); } int getAntecedent(Objectpath& value) const { if (Antecedent_isNULL==true) return NOT_FOUND; value = Antecedent; return OK; } int setAntecedent(const Objectpath& newValue) { Antecedent = newValue; Antecedent.setNamespace(Antecedent_NAMESPACE); Antecedent_isNULL = false; return OK; } int getDependent(Objectpath& value) const { if (Dependent_isNULL==true) return NOT_FOUND; value = Dependent; return OK; } int setDependent(const Objectpath& newValue) { Dependent = newValue; Dependent.setNamespace(Dependent_NAMESPACE); Dependent_isNULL = false; return OK; } int getSpareStatus(unsigned short& value) const { if (SpareStatus_isNULL==true) return NOT_FOUND; value = SpareStatus; return OK; } int setSpareStatus(const unsigned short& newValue) { SpareStatus = newValue; SpareStatus_isNULL = false; return OK; } int getFailoverSupported(unsigned short& value) const { if (FailoverSupported_isNULL==true) return NOT_FOUND; value = FailoverSupported; return OK; } int setFailoverSupported(const unsigned short& newValue) { FailoverSupported = newValue; FailoverSupported_isNULL = false; return OK; } }; #endif /*OPENDRIM_POWERSUPPLYISSPARE_H_*/ opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyIsSpare/assocOpenDRIM_PowerSupplyIsSpare.h0000644000175000017500000000616411401064722034053 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef ASSOCOPENDRIM_POWERSUPPLYISSPARE_H_ #define ASSOCOPENDRIM_POWERSUPPLYISSPARE_H_ #include "OpenDRIM_PowerSupplyIsSpareAccess.h" int PowerSupply_OpenDRIM_PowerSupplyIsSpare_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyIsSpare_associator(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties, vector& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant); int PowerSupply_OpenDRIM_PowerSupplyIsSpare_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyIsSpare_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyIsSpare_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyIsSpare_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_POWERSUPPLYISSPARE_H_*/ opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyIsSpare/cmpiOpenDRIM_PowerSupplyIsSpare.cpp0000644000175000017500000000671211401064722034225 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_PowerSupplyIsSpare.h" CMPIObjectPath* PowerSupply_OpenDRIM_PowerSupplyIsSpare_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PowerSupplyIsSpare& instance) { _E_; Objectpath op(broker, OpenDRIM_PowerSupplyIsSpare_classnames[0], OpenDRIM_PowerSupplyIsSpare_NAMESPACE); if (!instance.Antecedent_isNULL) op.addKey("Antecedent", instance.Antecedent); if (!instance.Dependent_isNULL) op.addKey("Dependent", instance.Dependent); _L_; return op.getHdl(); } CMPIInstance* PowerSupply_OpenDRIM_PowerSupplyIsSpare_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PowerSupplyIsSpare& instance) { _E_; Objectpath op(broker, PowerSupply_OpenDRIM_PowerSupplyIsSpare_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.SpareStatus_isNULL) ci.setProperty("SpareStatus", instance.SpareStatus); if (!instance.FailoverSupported_isNULL) ci.setProperty("FailoverSupported", instance.FailoverSupported); _L_; return ci.getHdl(); } void PowerSupply_OpenDRIM_PowerSupplyIsSpare_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PowerSupplyIsSpare& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("Antecedent", instance.Antecedent) == OK) instance.Antecedent_isNULL = false; if (op.getKey("Dependent", instance.Dependent) == OK) instance.Dependent_isNULL = false; _L_; } void PowerSupply_OpenDRIM_PowerSupplyIsSpare_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PowerSupplyIsSpare& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("Antecedent", instance.Antecedent) == OK) instance.Antecedent_isNULL = false; if (inst.getProperty("Dependent", instance.Dependent) == OK) instance.Dependent_isNULL = false; if (inst.getProperty("SpareStatus", instance.SpareStatus) == OK) instance.SpareStatus_isNULL = false; if (inst.getProperty("FailoverSupported", instance.FailoverSupported) == OK) instance.FailoverSupported_isNULL = false; _L_; } ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyIsSpare/OpenDRIM_PowerSupplyIsSpareAccess.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyIsSpare/OpenDRIM_PowerSupplyIsSpareAccess.cpp0000644000175000017500000002501711401064722034475 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "OpenDRIM_PowerSupplyIsSpareAccess.h" int PowerSupply_OpenDRIM_PowerSupplyIsSpare_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PowerSupply_CIM_ManagedElement_load(broker, errorMessage)); CF_assert(PowerSupply_CIM_RedundancySet_load(broker, errorMessage)); */ // TODO _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyIsSpare_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PowerSupply_CIM_ManagedElement_unload(errorMessage)); CF_assert(PowerSupply_CIM_RedundancySet_unload(errorMessage)); */ // TODO _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyIsSpare_isAssociated(const Instance& Antecedent, const Instance& Dependent, bool& isAssociated, string& errorMessage) { _E_; // TODO Determine if the association can be established or not isAssociated=true; _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyIsSpare_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector subjects; // Only get the instance names CF_assert(PowerSupply_OpenDRIM_PowerSupplyIsSpare_enumerateAntecedents(broker, ctx, subjects, NULL, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PowerSupply_OpenDRIM_PowerSupplyIsSpare_enumerateAntecedents(broker, ctx, subjects, NULL, false, errorMessage)); vector::iterator c = subjects.begin(); vector::iterator end = subjects.end(); for (; c != end; ++c) { bool leftToRight = true; vector associatedInstances; PowerSupply_OpenDRIM_PowerSupplyIsSpare_associator(broker, ctx, (*c).getObjectpath().getHdl(), (*c), Antecedent_classnames[0], Dependent_classnames[0], Antecedent_role.c_str(), Dependent_role.c_str(), NULL, associatedInstances, leftToRight, errorMessage, "an"); string ref_discriminant = discriminant == "ein" ? "rn" : "r"; CF_assert(PowerSupply_OpenDRIM_PowerSupplyIsSpare_referenceAntecedentToDependent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyIsSpare_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_PowerSupplyIsSpare& instance, const char** properties, string& errorMessage) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ Objectpath Antecedent_objectpath; instance.getAntecedent(Antecedent_objectpath); Instance Antecedent_instance; CF_assert(PowerSupply_OpenDRIM_PowerSupplyIsSpare_getAntecedent(broker, ctx, Antecedent_objectpath, Antecedent_instance, NULL, errorMessage)); Objectpath Dependent_objectpath; instance.getDependent(Dependent_objectpath); Instance Dependent_instance; CF_assert(PowerSupply_OpenDRIM_PowerSupplyIsSpare_getDependent(broker, ctx, Dependent_objectpath, Dependent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(PowerSupply_OpenDRIM_PowerSupplyIsSpare_isAssociated(Antecedent_instance, Dependent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } CF_assert(PowerSupply_OpenDRIM_PowerSupplyIsSpare_populate(instance, errorMessage)); _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyIsSpare_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupplyIsSpare& newInstance, const OpenDRIM_PowerSupplyIsSpare& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_PowerSupplyIsSpare_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupplyIsSpare& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_PowerSupplyIsSpare_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupplyIsSpare& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_PowerSupplyIsSpare_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector Dependent_instances; if (discriminant=="a") CF_assert(PowerSupply_OpenDRIM_PowerSupplyIsSpare_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PowerSupply_OpenDRIM_PowerSupplyIsSpare_enumerateDependents(broker, ctx, Dependent_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PowerSupply_OpenDRIM_PowerSupplyIsSpare_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Antecedent_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector Antecedent_instances; if (discriminant=="a") CF_assert(PowerSupply_OpenDRIM_PowerSupplyIsSpare_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PowerSupply_OpenDRIM_PowerSupplyIsSpare_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PowerSupply_OpenDRIM_PowerSupplyIsSpare_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Dependent_instances, vector& OpenDRIM_PowerSupplyIsSpare_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < Dependent_instances.size(); i++) { OpenDRIM_PowerSupplyIsSpare instance; instance.setAntecedent(((Instance) Antecedent_instance).getObjectpath()); instance.setDependent(((Instance) Dependent_instances[i]).getObjectpath()); if (discriminant == "r") { CF_assert(PowerSupply_OpenDRIM_PowerSupplyIsSpare_populate(instance, errorMessage)); } OpenDRIM_PowerSupplyIsSpare_instances.push_back(instance); } _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyIsSpare_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_PowerSupplyIsSpare_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < Antecedent_instances.size(); i++) { OpenDRIM_PowerSupplyIsSpare instance; instance.setAntecedent(((Instance) Antecedent_instances[i]).getObjectpath()); instance.setDependent(((Instance) Dependent_instance).getObjectpath()); if (discriminant == "r") { CF_assert(PowerSupply_OpenDRIM_PowerSupplyIsSpare_populate(instance, errorMessage)); } OpenDRIM_PowerSupplyIsSpare_instances.push_back(instance); } _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyIsSpare_populate(OpenDRIM_PowerSupplyIsSpare& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyIsSpare/OpenDRIM_PowerSupplyIsSpareProvider.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyIsSpare/OpenDRIM_PowerSupplyIsSpareProvider.c0000644000175000017500000004220111401064722034520 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_PowerSupplyIsSpare.h" #include "OpenDRIM_PowerSupplyIsSpareAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PowerSupply_OpenDRIM_PowerSupplyIsSpareProviderSetInstance PowerSupply_OpenDRIM_PowerSupplyIsSpareProviderModifyInstance #endif int PowerSupply_OpenDRIM_PowerSupplyIsSpare_init(const CMPIBroker* broker); int PowerSupply_OpenDRIM_PowerSupplyIsSpare_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PowerSupply_OpenDRIM_PowerSupplyIsSpareProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyIsSpareProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyIsSpare_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PowerSupply_OpenDRIM_PowerSupplyIsSpare_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyIsSpareProviderEnumInstances(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyIsSpare_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PowerSupply_OpenDRIM_PowerSupplyIsSpare_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyIsSpareProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PowerSupplyIsSpare instance; PowerSupply_OpenDRIM_PowerSupplyIsSpare_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyIsSpare_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PowerSupply_OpenDRIM_PowerSupplyIsSpare_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyIsSpareProviderSetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PowerSupplyIsSpare newInstance, oldInstance; PowerSupply_OpenDRIM_PowerSupplyIsSpare_toCPP(_broker, ci, newInstance); PowerSupply_OpenDRIM_PowerSupplyIsSpare_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyIsSpare_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyIsSpare_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyIsSpareProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PowerSupplyIsSpare instance; PowerSupply_OpenDRIM_PowerSupplyIsSpare_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_PowerSupplyIsSpare_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyIsSpare_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyIsSpare_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PowerSupply_OpenDRIM_PowerSupplyIsSpare_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyIsSpareProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PowerSupplyIsSpare instance; PowerSupply_OpenDRIM_PowerSupplyIsSpare_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyIsSpare_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyIsSpare_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyIsSpareProviderExecQuery(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* lang, const char* query) { _E_; CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } /* ---------------------------------------------------------------------------*/ /* End of Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Association Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PowerSupply_OpenDRIM_PowerSupplyIsSpareProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyIsSpareProviderAssociatorNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyIsSpare_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnObjectPath(rslt, associatedInstances[i].getObjectpath().getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyIsSpareProviderAssociators(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyIsSpare_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnInstance(rslt, associatedInstances[i].getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyIsSpareProviderReferenceNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyIsSpare_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyIsSpare_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = PowerSupply_OpenDRIM_PowerSupplyIsSpare_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyIsSpareProviderReferences(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyIsSpare_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyIsSpare_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = PowerSupply_OpenDRIM_PowerSupplyIsSpare_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int PowerSupply_OpenDRIM_PowerSupplyIsSpare_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PowerSupply_OpenDRIM_PowerSupplyIsSpare_init FAILED: " + (string) OpenDRIM_PowerSupplyIsSpare_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyIsSpare_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_unload(errorMessage); if (errorCode != OK) { errorMessage += "PowerSupply_OpenDRIM_PowerSupplyIsSpare_unload FAILED: " + (string) OpenDRIM_PowerSupplyIsSpare_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PowerSupply_OpenDRIM_PowerSupplyIsSpare_INIT if (PowerSupply_OpenDRIM_PowerSupplyIsSpare_init(_broker) < 0) return NULL CMInstanceMIStub(PowerSupply_OpenDRIM_PowerSupplyIsSpareProvider, PowerSupply_OpenDRIM_PowerSupplyIsSpareProvider, _broker, PowerSupply_OpenDRIM_PowerSupplyIsSpare_INIT); CMAssociationMIStub(PowerSupply_OpenDRIM_PowerSupplyIsSpareProvider, PowerSupply_OpenDRIM_PowerSupplyIsSpareProvider, _broker, PowerSupply_OpenDRIM_PowerSupplyIsSpare_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyIsSpare/assocOpenDRIM_PowerSupplyIsSpare.cpp0000644000175000017500000002104211401064722034376 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "assocOpenDRIM_PowerSupplyIsSpare.h" int PowerSupply_OpenDRIM_PowerSupplyIsSpare_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage) { _E_; string _assocClass, _resultClass, _resultRole, _role; assocClass == NULL ? _assocClass = "null" : _assocClass = assocClass; resultClass == NULL ? _resultClass = "null" : _resultClass = resultClass; resultRole == NULL ? _resultRole = "null" : _resultRole = resultRole; role == NULL ? _role = "null" : _role = role; for (unsigned int i=0; i& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant) { _E_; int errorCode = PowerSupply_OpenDRIM_PowerSupplyIsSpare_associatorFilter(broker, ctx, cop, knownInstance, assocClass, resultClass, role, resultRole, leftToRight, errorMessage); if (errorCode == -1) return OK; if (errorCode != OK) return errorCode; if (leftToRight) { if (role != NULL && strcasecmp(role, "Antecedent") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "Dependent") != 0) return OK; CF_assert(PowerSupply_OpenDRIM_PowerSupplyIsSpare_associatorAntecedentToDependent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } else { if (role != NULL && strcasecmp(role, "Dependent") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "Antecedent") != 0) return OK; CF_assert(PowerSupply_OpenDRIM_PowerSupplyIsSpare_associatorDependentToAntecedent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyIsSpare_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, Antecedent_NAMESPACE, Antecedent_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(PowerSupply_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PowerSupply_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PowerSupply_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyIsSpare_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Antecedent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Antecedent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_ManagedElement _instance; PowerSupply_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PowerSupply_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PowerSupply_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyIsSpare_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, Dependent_NAMESPACE, Dependent_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(PowerSupply_CIM_RedundancySet_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PowerSupply_CIM_RedundancySet_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PowerSupply_CIM_RedundancySet_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyIsSpare_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Dependent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Dependent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_RedundancySet _instance; PowerSupply_CIM_RedundancySet_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PowerSupply_CIM_RedundancySet_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PowerSupply_CIM_RedundancySet_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyIsSpare/cmpiOpenDRIM_PowerSupplyIsSpare.h0000644000175000017500000000430611401064722033667 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef CMPIOPENDRIM_POWERSUPPLYISSPARE_H_ #define CMPIOPENDRIM_POWERSUPPLYISSPARE_H_ #include "OpenDRIM_PowerSupplyIsSpare.h" CMPIObjectPath* PowerSupply_OpenDRIM_PowerSupplyIsSpare_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PowerSupplyIsSpare& instance); CMPIInstance* PowerSupply_OpenDRIM_PowerSupplyIsSpare_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PowerSupplyIsSpare& instance); void PowerSupply_OpenDRIM_PowerSupplyIsSpare_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PowerSupplyIsSpare& instance); void PowerSupply_OpenDRIM_PowerSupplyIsSpare_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PowerSupplyIsSpare& instance); #endif /*CMPIOPENDRIM_POWERSUPPLYISSPARE_H_*/ opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyIsSpare/OpenDRIM_PowerSupplyIsSpareAccess.h0000644000175000017500000001042411401064722034136 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef OPENDRIM_POWERSUPPLYISSPAREACCESS_H_ #define OPENDRIM_POWERSUPPLYISSPAREACCESS_H_ #include "PowerSupply_Common.h" #include "OpenDRIM_PowerSupplyIsSpare.h" #include "assocOpenDRIM_PowerSupplyIsSpare.h" int PowerSupply_OpenDRIM_PowerSupplyIsSpare_load(const CMPIBroker* broker, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyIsSpare_unload(string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyIsSpare_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_PowerSupplyIsSpare_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_PowerSupplyIsSpare& instance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyIsSpare_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupplyIsSpare& newInstance, const OpenDRIM_PowerSupplyIsSpare& oldInstance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyIsSpare_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupplyIsSpare& instance, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyIsSpare_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupplyIsSpare& instance, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyIsSpare_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_PowerSupplyIsSpare_associatorDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const char** properties, vector& Antecedent_associatedInstances, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_PowerSupplyIsSpare_referenceAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const vector& Dependent_instances, vector& OpenDRIM_PowerSupplyIsSpare_instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_PowerSupplyIsSpare_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_PowerSupplyIsSpare_instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_PowerSupplyIsSpare_populate(OpenDRIM_PowerSupplyIsSpare& instance, string& errorMessage); #endif /*OPENDRIM_POWERSUPPLYISSPAREACCESS_H_*/ opendrim-lmp-powersupply-1.0.0~ppa/packaging/0000755000175000017500000000000011401064722022074 5ustar guillaumeguillaumeopendrim-lmp-powersupply-1.0.0~ppa/packaging/debian/0000755000175000017500000000000011404351012023310 5ustar guillaumeguillaumeopendrim-lmp-powersupply-1.0.0~ppa/packaging/debian/postrm0000644000175000017500000000344311404351012024563 0ustar guillaumeguillaume#!/bin/sh set -e # summary of how this script can be called: # * `remove' # * `purge' # * `upgrade' # * `failed-upgrade' # * `abort-install' # * `abort-install' # * `abort-upgrade' # * `disappear' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in purge) rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_PowerSupplyCapabilities rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_OwningPowerSupplyRedundancySet rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_HostedPowerSupplyRedundancySet rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_PowerSupply rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_RegisteredPowerSupplyProfile rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_PowerSupplyRedundancySet rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_EnabledPowerSupplyCapabilities rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_MemberOfPowerSupplyCollection rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_PowerSupplyIsSpare rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_PowerSupplyConformsToProfile rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_SuppliesPower rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_ComputerSystemPowerSupply ;; remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 opendrim-lmp-powersupply-1.0.0~ppa/packaging/debian/source/0000755000175000017500000000000011401064722024616 5ustar guillaumeguillaumeopendrim-lmp-powersupply-1.0.0~ppa/packaging/debian/source/format0000644000175000017500000000001411401064722026024 0ustar guillaumeguillaume3.0 (quilt) opendrim-lmp-powersupply-1.0.0~ppa/packaging/debian/copyright0000644000175000017500000000276711401064722025265 0ustar guillaumeguillaumeThis package was debianized by Guillaume BOTTEX on Tue, 15 Dec 2009 17:25:37 +0900. It was downloaded from http://opendrim.sourceforge.net/ Upstream Authors: Shakhrom RUSTAMOV Guillaume BOTTEX Copyright: Copyright (C) 2009 ETRI Shakhrom RUSTAMOV Copyright (C) 2009 ETRI Guillaume BOTTEX License: Linux Management Providers (LMP), Power Supply provider package This program is being developed under the "OpenDRIM" project. The "OpenDRIM" project web page: http://opendrim.sourceforge.net The "OpenDRIM" project mailing list: opendrim@googlegroups.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. The Debian packaging is copyright 2009, Guillaume BOTTEX and is licensed under the GPL, see `/usr/share/common-licenses/GPL-2'. opendrim-lmp-powersupply-1.0.0~ppa/packaging/debian/control0000644000175000017500000000126511404351004024720 0ustar guillaumeguillaumeSource: opendrim-lmp-powersupply Priority: optional Section: libs Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Guillaume BOTTEX Build-Depends: debhelper (>= 5), automake, autoconf, libtool, sfcb, libopendrim0-dev (>= 1.1.3), libxml2-dev Standards-Version: 3.8.4 Homepage: http://opendrim.sourceforge.net/ Package: opendrim-lmp-powersupply Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, sfcb, libopendrim0 (>= 1.1.3) Description: OpenDRIM Power Supply provider Provides information about the computer power supply capabilities. . Compliant with the DMTF Power Supply Profile v1.1.0 (DSP1015). opendrim-lmp-powersupply-1.0.0~ppa/packaging/debian/prerm0000644000175000017500000000243511401064722024372 0ustar guillaumeguillaume#!/bin/sh -e # prerm script for opendrim-lmp-baseserver # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `remove' # * `upgrade' # * `failed-upgrade' # * `remove' `in-favour' # * `deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in remove|upgrade|deconfigure) CIMNAMESPACE=root/cimv2 CIMSERVER=sfcb INTEROPNAMESPACE=root/interop APP_NAME=opendrim-lmp-powersupply VERSION=`cat /usr/share/doc/opendrim-lmp-powersupply/VERSION` OPENDRIM_REG_DIR=/usr/share/OpenDRIM PROVIDER_SCRIPT_POST=PowerSupply $OPENDRIM_REG_DIR/$APP_NAME/registration/$PROVIDER_SCRIPT_POST-remove.sh $CIMNAMESPACE $CIMSERVER $INTEROPNAMESPACE $OPENDRIM_REG_DIR/$APP_NAME ;; failed-upgrade) ;; *) echo "prerm called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 opendrim-lmp-powersupply-1.0.0~ppa/packaging/debian/changelog0000644000175000017500000000025111404350772025174 0ustar guillaumeguillaumeopendrim-lmp-powersupply (1.0.0-0ubuntu1) lucid; urgency=low * Initial release -- Guillaume BOTTEX Fri, 11 Jun 2010 15:04:00 +0900 opendrim-lmp-powersupply-1.0.0~ppa/packaging/debian/postinst0000644000175000017500000000261211401064722025125 0ustar guillaumeguillaume#!/bin/sh -e # postinst script for opendrim-lmp-baseserver # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in configure) CIMNAMESPACE=root/cimv2 VENDOR=OpenDRIM CIMSERVER=sfcb INTEROPNAMESPACE=root/interop APP_NAME=opendrim-lmp-powersupply VERSION=`cat /usr/share/doc/opendrim-lmp-powersupply/VERSION` OPENDRIM_REG_DIR=/usr/share/OpenDRIM PROVIDER_SCRIPT_POST=PowerSupply $OPENDRIM_REG_DIR/$APP_NAME/registration/$PROVIDER_SCRIPT_POST.sh $CIMNAMESPACE $VENDOR $CIMSERVER $INTEROPNAMESPACE $VERSION $OPENDRIM_REG_DIR/$APP_NAME ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 opendrim-lmp-powersupply-1.0.0~ppa/packaging/debian/install0000644000175000017500000000004711401064722024710 0ustar guillaumeguillaumeusr/lib/cmpi/*.so usr/share/OpenDRIM/* opendrim-lmp-powersupply-1.0.0~ppa/packaging/debian/rules0000755000175000017500000000356311401064722024405 0ustar guillaumeguillaume#!/usr/bin/make -f INSTALL = /usr/bin/install -c CONFIGURE_OPTIONS := CIMSERVER=sfcb --prefix=/usr INTEROPNAMESPACE=root/interop COMMONLIBDIR=/usr/lib/cmpi DESTDIR = $(CURDIR)/debian/tmp VERSION = $(shell cat ./VERSION) APP_NAME = opendrim-lmp-powersupply OPENDRIM_REG_DIR = /usr/share/OpenDRIM OPENDRIM_MOF_DIR = /usr/share/OpenDRIM/$(APP_NAME)/mof configure: configure-stamp configure-stamp: dh_testdir autoreconf -i --force ./configure $(CONFIGURE_OPTIONS) touch configure-stamp build: build-stamp build-stamp: configure-stamp dh_testdir $(MAKE) #docbook-to-man debian/opendrim-lmp-powersupply.sgml > opendrim-lmp-powersupply.1 touch $@ clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp [ ! -f Makefile ] || $(MAKE) clean dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs $(MAKE) DESTDIR=$(DESTDIR) install $(INSTALL) -d -m 744 $(DESTDIR)$(OPENDRIM_REG_DIR)/$(APP_NAME)/registration $(INSTALL) -p -m 744 registration/*.sh $(DESTDIR)$(OPENDRIM_REG_DIR)/$(APP_NAME)/registration $(INSTALL) -d -m 744 $(DESTDIR)$(OPENDRIM_MOF_DIR) $(INSTALL) -p -m 644 mof/*.mof $(DESTDIR)$(OPENDRIM_MOF_DIR) # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. # Build architecture-dependent files here. binary-arch: build install dh_testdir dh_testroot dh_installchangelogs dh_installdocs dh_installexamples dh_install --sourcedir=$(DESTDIR) # dh_installmenu # dh_installdebconf # dh_installlogrotate # dh_installemacsen # dh_installpam # dh_installmime # dh_python # dh_installinit # dh_installcron # dh_installinfo dh_installman dh_link dh_strip dh_compress dh_fixperms # dh_perl # dh_makeshlibs dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure opendrim-lmp-powersupply-1.0.0~ppa/packaging/debian/docs0000644000175000017500000000003111401064722024163 0ustar guillaumeguillaumeNEWS README TODO VERSION opendrim-lmp-powersupply-1.0.0~ppa/packaging/debian/compat0000644000175000017500000000000211401064722024514 0ustar guillaumeguillaume5 opendrim-lmp-powersupply-1.0.0~ppa/packaging/opendrim-lmp-powersupply.spec0000644000175000017500000000521411401064722027764 0ustar guillaumeguillaume#%///////////////////////////////////////////////////////////////////////////// # # PowerSupply RPM spec file # #%///////////////////////////////////////////////////////////////////////////// %define packageVersion 1 Version: %{version} Release: %{packageVersion}%{?dist} Vendor: OpenDRIM Summary: OpenDRIM PowerSupply Provider Name: opendrim-lmp-powersupply Group: Systems Management/Base License: GPL BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root URL: http://opendrim.sourceforge.net Source: %{name}-%{version}.tar.gz BuildRequires: autoconf, tog-pegasus-devel, libopendrim >= 1.1.1 Requires: tog-pegasus, libopendrim >= 1.1.1 %description %global PEGASUS_ARCH_LIB %{_lib} %global COMMONLIBDIR /usr/%PEGASUS_ARCH_LIB %global PROVIDERDIR %COMMONLIBDIR/Pegasus/providers %global OPENDRIM_REG_DIR /usr/share/OpenDRIM %global OPENDRIM_MOF_DIR /usr/share/OpenDRIM/%{name}/mof %global PROVIDER_SCRIPT_POST PowerSupply %global CIMNAMESPACE %{?CIM_NAMESPACE:%{CIM_NAMESPACE}}%{!?CIM_NAMESPACE:root/cimv2} %global CIMSERVER pegasus %global INTEROPNAMESPACE root/interop %prep %setup -q -n %{name}-%{version} %build autoreconf --install --force ./configure CIMSERVER=%CIMSERVER CIMNAMESPACE=%CIMNAMESPACE INTEROPNAMESPACE=%INTEROPNAMESPACE --prefix=/usr make %pre SERVICE='cimserver' if !(ps ax | grep -v grep | grep $SERVICE > /dev/null) then echo "$SERVICE is not running" exit 1 fi %install make install COMMONLIBDIR=$RPM_BUILD_ROOT%COMMONLIBDIR PROVIDERDIR=$RPM_BUILD_ROOT%PROVIDERDIR %{__install} -d -m 744 $RPM_BUILD_ROOT%OPENDRIM_REG_DIR/%{name}/registration %{__install} -p -m 644 registration/*.sh $RPM_BUILD_ROOT%OPENDRIM_REG_DIR/%{name}/registration %{__install} -d -m 744 $RPM_BUILD_ROOT%OPENDRIM_MOF_DIR/ %{__install} -p -m 644 mof/*.mof $RPM_BUILD_ROOT%OPENDRIM_MOF_DIR/ %post %OPENDRIM_REG_DIR/%{name}-%{version}-script/%PROVIDER_SCRIPT_POST.sh %CIMNAMESPACE %{vendor} %CIMSERVER %INTEROPNAMESPACE %{version} %clean [ "$RPM_BUILD_ROOT" != "/" ] && %{__rm} -rf $RPM_BUILD_ROOT; [ "${RPM_BUILD_DIR}" != "/" ] && %{__rm} -rf ${RPM_BUILD_DIR}/%{name}-%{version}; %preun SERVICE='cimserver' if !(ps ax | grep -v grep | grep $SERVICE > /dev/null) then echo "$SERVICE is not running" exit 1 fi %OPENDRIM_REG_DIR/%{name}-%{version}-script/%PROVIDER_SCRIPT_POST-remove.sh %CIMNAMESPACE %CIMSERVER %INTEROPNAMESPACE %files %defattr(755, root, root, 755) %dir %COMMONLIBDIR %dir %PROVIDERDIR %COMMONLIBDIR/*.so %PROVIDERDIR/*.so %defattr(744, root, root, 755) %dir %OPENDRIM_REG_DIR %dir %OPENDRIM_MOF_DIR %dir %OPENDRIM_REG_DIR/%{name}-%{version}-script %OPENDRIM_REG_DIR/%{name}-%{version}-script/*.sh %OPENDRIM_MOF_DIR/*.mof opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_RegisteredPowerSupplyProfile/0000755000175000017500000000000011401064722027455 5ustar guillaumeguillaumeopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_RegisteredPowerSupplyProfile/Makefile.am0000644000175000017500000000422111401064722031510 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPowerSupply_OpenDRIM_RegisteredPowerSupplyProfileProvider.la libcmpiPowerSupply_OpenDRIM_RegisteredPowerSupplyProfileProvider_la_SOURCES = OpenDRIM_RegisteredPowerSupplyProfileAccess.cpp OpenDRIM_RegisteredPowerSupplyProfileProvider.cpp cmpiOpenDRIM_RegisteredPowerSupplyProfile.cpp libcmpiPowerSupply_OpenDRIM_RegisteredPowerSupplyProfileProvider_la_LIBADD = ../Common/libcmpiPowerSupply_Common.la libcmpiPowerSupply_OpenDRIM_RegisteredPowerSupplyProfileProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_RegisteredPowerSupplyProfile.h OpenDRIM_RegisteredPowerSupplyProfile.h OpenDRIM_RegisteredPowerSupplyProfileAccess.h ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_RegisteredPowerSupplyProfile/OpenDRIM_RegisteredPowerSupplyProfileProvider.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_RegisteredPowerSupplyProfile/OpenDRIM_RegisteredPowerSup0000644000175000017500000002721711401064722034650 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_RegisteredPowerSupplyProfile.h" #include "OpenDRIM_RegisteredPowerSupplyProfileAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PowerSupply_OpenDRIM_RegisteredPowerSupplyProfileProviderSetInstance PowerSupply_OpenDRIM_RegisteredPowerSupplyProfileProviderModifyInstance #endif int PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_init(const CMPIBroker* broker); int PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PowerSupply_OpenDRIM_RegisteredPowerSupplyProfileProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_RegisteredPowerSupplyProfileProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredPowerSupplyProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_RegisteredPowerSupplyProfileProviderEnumInstances(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredPowerSupplyProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_RegisteredPowerSupplyProfileProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredPowerSupplyProfile instance; PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredPowerSupplyProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_RegisteredPowerSupplyProfileProviderSetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredPowerSupplyProfile newInstance, oldInstance; PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_toCPP(_broker, ci, newInstance); PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredPowerSupplyProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredPowerSupplyProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_RegisteredPowerSupplyProfileProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredPowerSupplyProfile instance; PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_RegisteredPowerSupplyProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredPowerSupplyProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredPowerSupplyProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_RegisteredPowerSupplyProfileProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredPowerSupplyProfile instance; PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredPowerSupplyProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredPowerSupplyProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_RegisteredPowerSupplyProfileProviderExecQuery(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* lang, const char* query) { _E_; CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } /* ---------------------------------------------------------------------------*/ /* End of Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_init FAILED: " + (string) OpenDRIM_RegisteredPowerSupplyProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_unload(errorMessage); if (errorCode != OK) { errorMessage += "PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_unload FAILED: " + (string) OpenDRIM_RegisteredPowerSupplyProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_INIT if (PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_init(_broker) < 0) return NULL CMInstanceMIStub(PowerSupply_OpenDRIM_RegisteredPowerSupplyProfileProvider, PowerSupply_OpenDRIM_RegisteredPowerSupplyProfileProvider, _broker, PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_RegisteredPowerSupplyProfile/cmpiOpenDRIM_RegisteredPowerSupplyProfile.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_RegisteredPowerSupplyProfile/cmpiOpenDRIM_RegisteredPowe0000644000175000017500000001162611401064722034644 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_RegisteredPowerSupplyProfile.h" CMPIObjectPath* PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_RegisteredPowerSupplyProfile& instance) { _E_; Objectpath op(broker, OpenDRIM_RegisteredPowerSupplyProfile_classnames[0], OpenDRIM_RegisteredPowerSupplyProfile_NAMESPACE); if (!instance.InstanceID_isNULL) op.addKey("InstanceID", instance.InstanceID); _L_; return op.getHdl(); } CMPIInstance* PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_RegisteredPowerSupplyProfile& instance) { _E_; Objectpath op(broker, PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.Caption_isNULL) ci.setProperty("Caption", instance.Caption); if (!instance.Description_isNULL) ci.setProperty("Description", instance.Description); if (!instance.ElementName_isNULL) ci.setProperty("ElementName", instance.ElementName); if (!instance.RegisteredOrganization_isNULL) ci.setProperty("RegisteredOrganization", instance.RegisteredOrganization); if (!instance.OtherRegisteredOrganization_isNULL) ci.setProperty("OtherRegisteredOrganization", instance.OtherRegisteredOrganization); if (!instance.RegisteredName_isNULL) ci.setProperty("RegisteredName", instance.RegisteredName); if (!instance.RegisteredVersion_isNULL) ci.setProperty("RegisteredVersion", instance.RegisteredVersion); if (!instance.AdvertiseTypes_isNULL) ci.setProperty("AdvertiseTypes", instance.AdvertiseTypes); if (!instance.AdvertiseTypeDescriptions_isNULL) ci.setProperty("AdvertiseTypeDescriptions", instance.AdvertiseTypeDescriptions); _L_; return ci.getHdl(); } void PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_RegisteredPowerSupplyProfile& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; _L_; } void PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_RegisteredPowerSupplyProfile& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("Caption", instance.Caption) == OK) instance.Caption_isNULL = false; if (inst.getProperty("Description", instance.Description) == OK) instance.Description_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getProperty("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; if (inst.getProperty("RegisteredOrganization", instance.RegisteredOrganization) == OK) instance.RegisteredOrganization_isNULL = false; if (inst.getProperty("OtherRegisteredOrganization", instance.OtherRegisteredOrganization) == OK) instance.OtherRegisteredOrganization_isNULL = false; if (inst.getProperty("RegisteredName", instance.RegisteredName) == OK) instance.RegisteredName_isNULL = false; if (inst.getProperty("RegisteredVersion", instance.RegisteredVersion) == OK) instance.RegisteredVersion_isNULL = false; if (inst.getProperty("AdvertiseTypes", instance.AdvertiseTypes) == OK) instance.AdvertiseTypes_isNULL = false; if (inst.getProperty("AdvertiseTypeDescriptions", instance.AdvertiseTypeDescriptions) == OK) instance.AdvertiseTypeDescriptions_isNULL = false; _L_; } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_RegisteredPowerSupplyProfile/OpenDRIM_RegisteredPowerSupplyProfileAccess.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_RegisteredPowerSupplyProfile/OpenDRIM_RegisteredPowerSup0000644000175000017500000000622211401064722034641 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef OPENDRIM_REGISTEREDPOWERSUPPLYPROFILEACCESS_H_ #define OPENDRIM_REGISTEREDPOWERSUPPLYPROFILEACCESS_H_ #include "PowerSupply_Common.h" #include "OpenDRIM_RegisteredPowerSupplyProfile.h" int PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_load(const CMPIBroker* broker, string& errorMessage); int PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_unload(string& errorMessage); int PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_RegisteredPowerSupplyProfile& instance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredPowerSupplyProfile& newInstance, const OpenDRIM_RegisteredPowerSupplyProfile& oldInstance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredPowerSupplyProfile& instance, string& errorMessage); int PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredPowerSupplyProfile& instance, string& errorMessage); int PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_populate(OpenDRIM_RegisteredPowerSupplyProfile& instance, string& errorMessage); #endif /*OPENDRIM_REGISTEREDPOWERSUPPLYPROFILEACCESS_H_*/ ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_RegisteredPowerSupplyProfile/OpenDRIM_RegisteredPowerSupplyProfile.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_RegisteredPowerSupplyProfile/OpenDRIM_RegisteredPowerSup0000644000175000017500000001356011401064722034644 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef OPENDRIM_REGISTEREDPOWERSUPPLYPROFILE_H_ #define OPENDRIM_REGISTEREDPOWERSUPPLYPROFILE_H_ #include const static char* OpenDRIM_RegisteredPowerSupplyProfile_classnames[] = {"OpenDRIM_RegisteredPowerSupplyProfile"}; static string OpenDRIM_RegisteredPowerSupplyProfile_NAMESPACE = _INTEROP_NAMESPACE; class OpenDRIM_RegisteredPowerSupplyProfile { public: string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string ElementName; bool ElementName_isNULL; string InstanceID; bool InstanceID_isNULL; unsigned short RegisteredOrganization; bool RegisteredOrganization_isNULL; string OtherRegisteredOrganization; bool OtherRegisteredOrganization_isNULL; string RegisteredName; bool RegisteredName_isNULL; string RegisteredVersion; bool RegisteredVersion_isNULL; vector AdvertiseTypes; bool AdvertiseTypes_isNULL; vector AdvertiseTypeDescriptions; bool AdvertiseTypeDescriptions_isNULL; OpenDRIM_RegisteredPowerSupplyProfile() { Caption_isNULL = true; Description_isNULL = true; ElementName_isNULL = true; InstanceID_isNULL = true; RegisteredOrganization_isNULL = true; OtherRegisteredOrganization_isNULL = true; RegisteredName_isNULL = true; RegisteredVersion_isNULL = true; AdvertiseTypes_isNULL = true; AdvertiseTypeDescriptions_isNULL = true; } ~OpenDRIM_RegisteredPowerSupplyProfile() {} string getKeys() const { return CF_toLowCase(".InstanceID=\"" + CF_quoteString(InstanceID) + "\""); } int getCaption(string& value) const { if (Caption_isNULL==true) return NOT_FOUND; value = Caption; return OK; } int setCaption(const string& newValue) { Caption = newValue; Caption_isNULL = false; return OK; } int getDescription(string& value) const { if (Description_isNULL==true) return NOT_FOUND; value = Description; return OK; } int setDescription(const string& newValue) { Description = newValue; Description_isNULL = false; return OK; } int getElementName(string& value) const { if (ElementName_isNULL==true) return NOT_FOUND; value = ElementName; return OK; } int setElementName(const string& newValue) { ElementName = newValue; ElementName_isNULL = false; return OK; } int getInstanceID(string& value) const { if (InstanceID_isNULL==true) return NOT_FOUND; value = InstanceID; return OK; } int setInstanceID(const string& newValue) { InstanceID = newValue; InstanceID_isNULL = false; return OK; } int getRegisteredOrganization(unsigned short& value) const { if (RegisteredOrganization_isNULL==true) return NOT_FOUND; value = RegisteredOrganization; return OK; } int setRegisteredOrganization(const unsigned short& newValue) { RegisteredOrganization = newValue; RegisteredOrganization_isNULL = false; return OK; } int getOtherRegisteredOrganization(string& value) const { if (OtherRegisteredOrganization_isNULL==true) return NOT_FOUND; value = OtherRegisteredOrganization; return OK; } int setOtherRegisteredOrganization(const string& newValue) { OtherRegisteredOrganization = newValue; OtherRegisteredOrganization_isNULL = false; return OK; } int getRegisteredName(string& value) const { if (RegisteredName_isNULL==true) return NOT_FOUND; value = RegisteredName; return OK; } int setRegisteredName(const string& newValue) { RegisteredName = newValue; RegisteredName_isNULL = false; return OK; } int getRegisteredVersion(string& value) const { if (RegisteredVersion_isNULL==true) return NOT_FOUND; value = RegisteredVersion; return OK; } int setRegisteredVersion(const string& newValue) { RegisteredVersion = newValue; RegisteredVersion_isNULL = false; return OK; } int getAdvertiseTypes(vector& value) const { if (AdvertiseTypes_isNULL==true) return NOT_FOUND; value = AdvertiseTypes; return OK; } int setAdvertiseTypes(const vector& newValue) { AdvertiseTypes = newValue; AdvertiseTypes_isNULL = false; return OK; } int getAdvertiseTypeDescriptions(vector& value) const { if (AdvertiseTypeDescriptions_isNULL==true) return NOT_FOUND; value = AdvertiseTypeDescriptions; return OK; } int setAdvertiseTypeDescriptions(const vector& newValue) { AdvertiseTypeDescriptions = newValue; AdvertiseTypeDescriptions_isNULL = false; return OK; } }; #endif /*OPENDRIM_REGISTEREDPOWERSUPPLYPROFILE_H_*/ ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_RegisteredPowerSupplyProfile/cmpiOpenDRIM_RegisteredPowerSupplyProfile.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_RegisteredPowerSupplyProfile/cmpiOpenDRIM_RegisteredPowe0000644000175000017500000000447611401064722034651 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef CMPIOPENDRIM_REGISTEREDPOWERSUPPLYPROFILE_H_ #define CMPIOPENDRIM_REGISTEREDPOWERSUPPLYPROFILE_H_ #include "OpenDRIM_RegisteredPowerSupplyProfile.h" CMPIObjectPath* PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_RegisteredPowerSupplyProfile& instance); CMPIInstance* PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_RegisteredPowerSupplyProfile& instance); void PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_RegisteredPowerSupplyProfile& instance); void PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_RegisteredPowerSupplyProfile& instance); #endif /*CMPIOPENDRIM_REGISTEREDPOWERSUPPLYPROFILE_H_*/ ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_RegisteredPowerSupplyProfile/OpenDRIM_RegisteredPowerSupplyProfileAccess.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_RegisteredPowerSupplyProfile/OpenDRIM_RegisteredPowerSup0000644000175000017500000000774611401064722034655 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "OpenDRIM_RegisteredPowerSupplyProfileAccess.h" const string InstanceID="OpenDRIM:PowerSupply:1.1.0"; int PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_load(const CMPIBroker* broker, string& errorMessage) { _E_; // TODO _L_; return OK; } int PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; OpenDRIM_RegisteredPowerSupplyProfile instance; instance.setInstanceID(InstanceID); if(discriminant=="ei") CF_assert(PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_populate(instance,errorMessage)); result.push_back(instance); _L_; return OK; } int PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_RegisteredPowerSupplyProfile& instance, const char** properties, string& errorMessage) { _E_; if (instance.InstanceID!=InstanceID) { errorMessage = "No instance"; return NOT_FOUND; } CF_assert(PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_populate(instance,errorMessage)); _L_; return OK; } int PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredPowerSupplyProfile& newInstance, const OpenDRIM_RegisteredPowerSupplyProfile& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredPowerSupplyProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredPowerSupplyProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_RegisteredPowerSupplyProfile_populate(OpenDRIM_RegisteredPowerSupplyProfile& instance, string& errorMessage) { _E_; vector AdvertiseTypes; instance.setRegisteredName("Power Supply"); instance.setRegisteredVersion("1.1.0"); instance.setRegisteredOrganization(2); // DMTF AdvertiseTypes.push_back(2); // Not Advertised instance.setAdvertiseTypes(AdvertiseTypes); _L_; return OK; } opendrim-lmp-powersupply-1.0.0~ppa/mof/0000755000175000017500000000000011401064722020731 5ustar guillaumeguillaumeopendrim-lmp-powersupply-1.0.0~ppa/mof/OpenDRIM_PowerSupplyCapabilities.mof0000644000175000017500000000316511401064722027721 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ [Association, Provider("cmpi:cmpiPowerSupply_OpenDRIM_PowerSupplyCapabilitiesProvider")] class OpenDRIM_PowerSupplyCapabilities:CIM_ElementCapabilities { }; opendrim-lmp-powersupply-1.0.0~ppa/mof/OpenDRIM_MemberOfPowerSupplyCollection.mof0000644000175000017500000000320011401064722031026 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ [Association, Provider("cmpi:cmpiPowerSupply_OpenDRIM_MemberOfPowerSupplyCollectionProvider")] class OpenDRIM_MemberOfPowerSupplyCollection:CIM_MemberOfCollection { }; opendrim-lmp-powersupply-1.0.0~ppa/mof/OpenDRIM_PowerSupply.mof0000644000175000017500000000310711401064722025403 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ [Provider("cmpi:cmpiPowerSupply_OpenDRIM_PowerSupplyProvider")] class OpenDRIM_PowerSupply:CIM_PowerSupply { }; opendrim-lmp-powersupply-1.0.0~ppa/mof/OpenDRIM_PowerSupplyRedundancySet.mof0000644000175000017500000000314311401064722030074 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ [Provider("cmpi:cmpiPowerSupply_OpenDRIM_PowerSupplyRedundancySetProvider")] class OpenDRIM_PowerSupplyRedundancySet:CIM_RedundancySet { }; opendrim-lmp-powersupply-1.0.0~ppa/mof/OpenDRIM_PowerSupplyConformsToProfile.mof0000644000175000017500000000320411401064722030734 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ [Association, Provider("cmpi:cmpiPowerSupply_OpenDRIM_PowerSupplyConformsToProfileProvider")] class OpenDRIM_PowerSupplyConformsToProfile:CIM_ElementConformsToProfile { }; opendrim-lmp-powersupply-1.0.0~ppa/mof/OpenDRIM_PowerSupplyIsSpare.mof0000644000175000017500000000313711401064722026675 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ [Association, Provider("cmpi:cmpiPowerSupply_OpenDRIM_PowerSupplyIsSpareProvider")] class OpenDRIM_PowerSupplyIsSpare:CIM_IsSpare { }; opendrim-lmp-powersupply-1.0.0~ppa/mof/OpenDRIM_HostedPowerSupplyRedundancySet.mof0000644000175000017500000000320011401064722031235 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ [Association, Provider("cmpi:cmpiPowerSupply_OpenDRIM_HostedPowerSupplyRedundancySetProvider")] class OpenDRIM_HostedPowerSupplyRedundancySet:CIM_HostedCollection { }; opendrim-lmp-powersupply-1.0.0~ppa/mof/OpenDRIM_ComputerSystemPowerSupply.mof0000644000175000017500000000316211401064722030330 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ [Association, Provider("cmpi:cmpiPowerSupply_OpenDRIM_ComputerSystemPowerSupplyProvider")] class OpenDRIM_ComputerSystemPowerSupply:CIM_SystemDevice { }; opendrim-lmp-powersupply-1.0.0~ppa/mof/OpenDRIM_RegisteredPowerSupplyProfile.mof0000644000175000017500000000315711401064722030747 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ [Provider("cmpi:cmpiPowerSupply_OpenDRIM_RegisteredPowerSupplyProfileProvider")] class OpenDRIM_RegisteredPowerSupplyProfile:CIM_RegisteredProfile { }; opendrim-lmp-powersupply-1.0.0~ppa/mof/OpenDRIM_EnabledPowerSupplyCapabilities.mof0000644000175000017500000000320311401064722031165 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ [Provider("cmpi:cmpiPowerSupply_OpenDRIM_EnabledPowerSupplyCapabilitiesProvider")] class OpenDRIM_EnabledPowerSupplyCapabilities:CIM_EnabledLogicalElementCapabilities { }; opendrim-lmp-powersupply-1.0.0~ppa/mof/OpenDRIM_SuppliesPower.mof0000644000175000017500000000313311401064722025712 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ [Association, Provider("cmpi:cmpiPowerSupply_OpenDRIM_SuppliesPowerProvider")] class OpenDRIM_SuppliesPower:CIM_SuppliesPower { }; opendrim-lmp-powersupply-1.0.0~ppa/mof/OpenDRIM_OwningPowerSupplyRedundancySet.mof0000644000175000017500000000320711401064722031257 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ [Association, Provider("cmpi:cmpiPowerSupply_OpenDRIM_OwningPowerSupplyRedundancySetProvider")] class OpenDRIM_OwningPowerSupplyRedundancySet:CIM_OwningCollectionElement { }; opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyRedundancySet/0000755000175000017500000000000011401064722026607 5ustar guillaumeguillaumeopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyRedundancySet/Makefile.am0000644000175000017500000000415111401064722030644 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPowerSupply_OpenDRIM_PowerSupplyRedundancySetProvider.la libcmpiPowerSupply_OpenDRIM_PowerSupplyRedundancySetProvider_la_SOURCES = OpenDRIM_PowerSupplyRedundancySetAccess.cpp OpenDRIM_PowerSupplyRedundancySetProvider.cpp cmpiOpenDRIM_PowerSupplyRedundancySet.cpp libcmpiPowerSupply_OpenDRIM_PowerSupplyRedundancySetProvider_la_LIBADD = ../Common/libcmpiPowerSupply_Common.la libcmpiPowerSupply_OpenDRIM_PowerSupplyRedundancySetProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_PowerSupplyRedundancySet.h OpenDRIM_PowerSupplyRedundancySet.h OpenDRIM_PowerSupplyRedundancySetAccess.h ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyRedundancySet/OpenDRIM_PowerSupplyRedundancySet.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyRedundancySet/OpenDRIM_PowerSupplyRedundancyS0000644000175000017500000001654611401064722034654 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef OPENDRIM_POWERSUPPLYREDUNDANCYSET_H_ #define OPENDRIM_POWERSUPPLYREDUNDANCYSET_H_ #include const static char* OpenDRIM_PowerSupplyRedundancySet_classnames[] = {"OpenDRIM_PowerSupplyRedundancySet"}; static string OpenDRIM_PowerSupplyRedundancySet_NAMESPACE = _NAMESPACE; class OpenDRIM_PowerSupplyRedundancySet { public: string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string ElementName; bool ElementName_isNULL; string InstanceID; bool InstanceID_isNULL; unsigned short RedundancyStatus; bool RedundancyStatus_isNULL; vector TypeOfSet; bool TypeOfSet_isNULL; unsigned int MinNumberNeeded; bool MinNumberNeeded_isNULL; unsigned int MaxNumberSupported; bool MaxNumberSupported_isNULL; string VendorIdentifyingInfo; bool VendorIdentifyingInfo_isNULL; vector OtherTypeOfSet; bool OtherTypeOfSet_isNULL; unsigned short LoadBalanceAlgorithm; bool LoadBalanceAlgorithm_isNULL; string OtherLoadBalanceAlgorithm; bool OtherLoadBalanceAlgorithm_isNULL; OpenDRIM_PowerSupplyRedundancySet() { Caption_isNULL = true; Description_isNULL = true; ElementName_isNULL = true; InstanceID_isNULL = true; RedundancyStatus_isNULL = true; TypeOfSet_isNULL = true; MinNumberNeeded_isNULL = true; MaxNumberSupported_isNULL = true; VendorIdentifyingInfo_isNULL = true; OtherTypeOfSet_isNULL = true; LoadBalanceAlgorithm_isNULL = true; OtherLoadBalanceAlgorithm_isNULL = true; } ~OpenDRIM_PowerSupplyRedundancySet() {} string getKeys() const { return CF_toLowCase(".InstanceID=\"" + CF_quoteString(InstanceID) + "\""); } int getCaption(string& value) const { if (Caption_isNULL==true) return NOT_FOUND; value = Caption; return OK; } int setCaption(const string& newValue) { Caption = newValue; Caption_isNULL = false; return OK; } int getDescription(string& value) const { if (Description_isNULL==true) return NOT_FOUND; value = Description; return OK; } int setDescription(const string& newValue) { Description = newValue; Description_isNULL = false; return OK; } int getElementName(string& value) const { if (ElementName_isNULL==true) return NOT_FOUND; value = ElementName; return OK; } int setElementName(const string& newValue) { ElementName = newValue; ElementName_isNULL = false; return OK; } int getInstanceID(string& value) const { if (InstanceID_isNULL==true) return NOT_FOUND; value = InstanceID; return OK; } int setInstanceID(const string& newValue) { InstanceID = newValue; InstanceID_isNULL = false; return OK; } int getRedundancyStatus(unsigned short& value) const { if (RedundancyStatus_isNULL==true) return NOT_FOUND; value = RedundancyStatus; return OK; } int setRedundancyStatus(const unsigned short& newValue) { RedundancyStatus = newValue; RedundancyStatus_isNULL = false; return OK; } int getTypeOfSet(vector& value) const { if (TypeOfSet_isNULL==true) return NOT_FOUND; value = TypeOfSet; return OK; } int setTypeOfSet(const vector& newValue) { TypeOfSet = newValue; TypeOfSet_isNULL = false; return OK; } int getMinNumberNeeded(unsigned int& value) const { if (MinNumberNeeded_isNULL==true) return NOT_FOUND; value = MinNumberNeeded; return OK; } int setMinNumberNeeded(const unsigned int& newValue) { MinNumberNeeded = newValue; MinNumberNeeded_isNULL = false; return OK; } int getMaxNumberSupported(unsigned int& value) const { if (MaxNumberSupported_isNULL==true) return NOT_FOUND; value = MaxNumberSupported; return OK; } int setMaxNumberSupported(const unsigned int& newValue) { MaxNumberSupported = newValue; MaxNumberSupported_isNULL = false; return OK; } int getVendorIdentifyingInfo(string& value) const { if (VendorIdentifyingInfo_isNULL==true) return NOT_FOUND; value = VendorIdentifyingInfo; return OK; } int setVendorIdentifyingInfo(const string& newValue) { VendorIdentifyingInfo = newValue; VendorIdentifyingInfo_isNULL = false; return OK; } int getOtherTypeOfSet(vector& value) const { if (OtherTypeOfSet_isNULL==true) return NOT_FOUND; value = OtherTypeOfSet; return OK; } int setOtherTypeOfSet(const vector& newValue) { OtherTypeOfSet = newValue; OtherTypeOfSet_isNULL = false; return OK; } int getLoadBalanceAlgorithm(unsigned short& value) const { if (LoadBalanceAlgorithm_isNULL==true) return NOT_FOUND; value = LoadBalanceAlgorithm; return OK; } int setLoadBalanceAlgorithm(const unsigned short& newValue) { LoadBalanceAlgorithm = newValue; LoadBalanceAlgorithm_isNULL = false; return OK; } int getOtherLoadBalanceAlgorithm(string& value) const { if (OtherLoadBalanceAlgorithm_isNULL==true) return NOT_FOUND; value = OtherLoadBalanceAlgorithm; return OK; } int setOtherLoadBalanceAlgorithm(const string& newValue) { OtherLoadBalanceAlgorithm = newValue; OtherLoadBalanceAlgorithm_isNULL = false; return OK; } }; class OpenDRIM_PowerSupplyRedundancySet_Failover_In { public: Objectpath FailoverFrom; bool FailoverFrom_isNULL; Objectpath FailoverTo; bool FailoverTo_isNULL; OpenDRIM_PowerSupplyRedundancySet_Failover_In() { FailoverFrom_isNULL = true; FailoverTo_isNULL = true; } ~OpenDRIM_PowerSupplyRedundancySet_Failover_In() {} int getFailoverFrom(Objectpath& value) const { if (FailoverFrom_isNULL == true) return NOT_FOUND; value = FailoverFrom; return OK; } int setFailoverFrom(const Objectpath& newValue) { FailoverFrom = newValue; FailoverFrom_isNULL = false; return OK; } int getFailoverTo(Objectpath& value) const { if (FailoverTo_isNULL == true) return NOT_FOUND; value = FailoverTo; return OK; } int setFailoverTo(const Objectpath& newValue) { FailoverTo = newValue; FailoverTo_isNULL = false; return OK; } }; #endif /*OPENDRIM_POWERSUPPLYREDUNDANCYSET_H_*/ ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyRedundancySet/OpenDRIM_PowerSupplyRedundancySetAccess.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyRedundancySet/OpenDRIM_PowerSupplyRedundancyS0000644000175000017500000000652211401064722034645 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef OPENDRIM_POWERSUPPLYREDUNDANCYSETACCESS_H_ #define OPENDRIM_POWERSUPPLYREDUNDANCYSETACCESS_H_ #include "PowerSupply_Common.h" #include "OpenDRIM_PowerSupplyRedundancySet.h" int PowerSupply_OpenDRIM_PowerSupplyRedundancySet_load(const CMPIBroker* broker, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyRedundancySet_unload(string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyRedundancySet_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_PowerSupplyRedundancySet_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_PowerSupplyRedundancySet& instance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyRedundancySet_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupplyRedundancySet& newInstance, const OpenDRIM_PowerSupplyRedundancySet& oldInstance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyRedundancySet_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupplyRedundancySet& instance, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyRedundancySet_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupplyRedundancySet& instance, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyRedundancySet_Failover(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupplyRedundancySet& instance, unsigned int& returnValue, const OpenDRIM_PowerSupplyRedundancySet_Failover_In& in, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyRedundancySet_populate(OpenDRIM_PowerSupplyRedundancySet& instance, string& errorMessage); #endif /*OPENDRIM_POWERSUPPLYREDUNDANCYSETACCESS_H_*/ ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyRedundancySet/OpenDRIM_PowerSupplyRedundancySetProvider.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyRedundancySet/OpenDRIM_PowerSupplyRedundancyS0000644000175000017500000003412511401064722034645 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_PowerSupplyRedundancySet.h" #include "OpenDRIM_PowerSupplyRedundancySetAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PowerSupply_OpenDRIM_PowerSupplyRedundancySetProviderSetInstance PowerSupply_OpenDRIM_PowerSupplyRedundancySetProviderModifyInstance #endif int PowerSupply_OpenDRIM_PowerSupplyRedundancySet_init(const CMPIBroker* broker); int PowerSupply_OpenDRIM_PowerSupplyRedundancySet_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PowerSupply_OpenDRIM_PowerSupplyRedundancySetProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PowerSupply_OpenDRIM_PowerSupplyRedundancySet_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyRedundancySetProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyRedundancySet_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PowerSupply_OpenDRIM_PowerSupplyRedundancySet_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyRedundancySetProviderEnumInstances(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyRedundancySet_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PowerSupply_OpenDRIM_PowerSupplyRedundancySet_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyRedundancySetProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PowerSupplyRedundancySet instance; PowerSupply_OpenDRIM_PowerSupplyRedundancySet_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyRedundancySet_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PowerSupply_OpenDRIM_PowerSupplyRedundancySet_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyRedundancySetProviderSetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PowerSupplyRedundancySet newInstance, oldInstance; PowerSupply_OpenDRIM_PowerSupplyRedundancySet_toCPP(_broker, ci, newInstance); PowerSupply_OpenDRIM_PowerSupplyRedundancySet_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyRedundancySet_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_PowerSupplyRedundancySet_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyRedundancySetProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PowerSupplyRedundancySet instance; PowerSupply_OpenDRIM_PowerSupplyRedundancySet_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyRedundancySet_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_PowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_PowerSupplyRedundancySet_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_PowerSupplyRedundancySet_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PowerSupply_OpenDRIM_PowerSupplyRedundancySet_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyRedundancySetProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PowerSupplyRedundancySet instance; PowerSupply_OpenDRIM_PowerSupplyRedundancySet_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyRedundancySet_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_PowerSupplyRedundancySet_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyRedundancySetProviderExecQuery(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* lang, const char* query) { _E_; CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } /* ---------------------------------------------------------------------------*/ /* End of Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Method Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PowerSupply_OpenDRIM_PowerSupplyRedundancySetProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = PowerSupply_OpenDRIM_PowerSupplyRedundancySet_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyRedundancySetProviderInvokeMethod(CMPIMethodMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* methodName, const CMPIArgs* in, CMPIArgs* out) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PowerSupplyRedundancySet instance; PowerSupply_OpenDRIM_PowerSupplyRedundancySet_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"InstanceID"}; int errorCode = PowerSupply_OpenDRIM_PowerSupplyRedundancySet_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="Failover") { unsigned int returnValue; OpenDRIM_PowerSupplyRedundancySet_Failover_In inArgs; PowerSupply_OpenDRIM_PowerSupplyRedundancySet_toCPP(_broker, in, inArgs); errorCode = PowerSupply_OpenDRIM_PowerSupplyRedundancySet_Failover(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else { errorMessage = (string) OpenDRIM_PowerSupplyRedundancySet_classnames[0] + ": " + "The requested method (" + (string) methodName +") was not found."; CMSetStatusWithChars(_broker, &rc, (CMPIrc) NOT_SUPPORTED, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; CMReturn(CMPI_RC_OK); } /* ---------------------------------------------------------------------------*/ /* End of Method Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int PowerSupply_OpenDRIM_PowerSupplyRedundancySet_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyRedundancySet_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PowerSupply_OpenDRIM_PowerSupplyRedundancySet_init FAILED: " + (string) OpenDRIM_PowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyRedundancySet_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyRedundancySet_unload(errorMessage); if (errorCode != OK) { errorMessage += "PowerSupply_OpenDRIM_PowerSupplyRedundancySet_unload FAILED: " + (string) OpenDRIM_PowerSupplyRedundancySet_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PowerSupply_OpenDRIM_PowerSupplyRedundancySet_INIT if (PowerSupply_OpenDRIM_PowerSupplyRedundancySet_init(_broker) < 0) return NULL CMInstanceMIStub(PowerSupply_OpenDRIM_PowerSupplyRedundancySetProvider, PowerSupply_OpenDRIM_PowerSupplyRedundancySetProvider, _broker, PowerSupply_OpenDRIM_PowerSupplyRedundancySet_INIT); CMMethodMIStub(PowerSupply_OpenDRIM_PowerSupplyRedundancySetProvider, PowerSupply_OpenDRIM_PowerSupplyRedundancySetProvider, _broker, PowerSupply_OpenDRIM_PowerSupplyRedundancySet_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyRedundancySet/OpenDRIM_PowerSupplyRedundancySetAccess.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyRedundancySet/OpenDRIM_PowerSupplyRedundancyS0000644000175000017500000000675211401064722034652 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "OpenDRIM_PowerSupplyRedundancySetAccess.h" int PowerSupply_OpenDRIM_PowerSupplyRedundancySet_load(const CMPIBroker* broker, string& errorMessage) { _E_; // TODO _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyRedundancySet_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyRedundancySet_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyRedundancySet_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_PowerSupplyRedundancySet& instance, const char** properties, string& errorMessage) { _E_; _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyRedundancySet_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupplyRedundancySet& newInstance, const OpenDRIM_PowerSupplyRedundancySet& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_PowerSupplyRedundancySet_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupplyRedundancySet& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_PowerSupplyRedundancySet_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupplyRedundancySet& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_PowerSupplyRedundancySet_Failover(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupplyRedundancySet& instance, unsigned int& returnValue, const OpenDRIM_PowerSupplyRedundancySet_Failover_In& in, string& errorMessage) { _E_; // TODO _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyRedundancySet_populate(OpenDRIM_PowerSupplyRedundancySet& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyRedundancySet/cmpiOpenDRIM_PowerSupplyRedundancySet.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyRedundancySet/cmpiOpenDRIM_PowerSupplyRedunda0000644000175000017500000000465411401064722034665 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef CMPIOPENDRIM_POWERSUPPLYREDUNDANCYSET_H_ #define CMPIOPENDRIM_POWERSUPPLYREDUNDANCYSET_H_ #include "OpenDRIM_PowerSupplyRedundancySet.h" CMPIObjectPath* PowerSupply_OpenDRIM_PowerSupplyRedundancySet_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PowerSupplyRedundancySet& instance); CMPIInstance* PowerSupply_OpenDRIM_PowerSupplyRedundancySet_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PowerSupplyRedundancySet& instance); void PowerSupply_OpenDRIM_PowerSupplyRedundancySet_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PowerSupplyRedundancySet& instance); void PowerSupply_OpenDRIM_PowerSupplyRedundancySet_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PowerSupplyRedundancySet& instance); void PowerSupply_OpenDRIM_PowerSupplyRedundancySet_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PowerSupplyRedundancySet_Failover_In& args); #endif /*CMPIOPENDRIM_POWERSUPPLYREDUNDANCYSET_H_*/ ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyRedundancySet/cmpiOpenDRIM_PowerSupplyRedundancySet.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyRedundancySet/cmpiOpenDRIM_PowerSupplyRedunda0000644000175000017500000001341011401064722034653 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_PowerSupplyRedundancySet.h" CMPIObjectPath* PowerSupply_OpenDRIM_PowerSupplyRedundancySet_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PowerSupplyRedundancySet& instance) { _E_; Objectpath op(broker, OpenDRIM_PowerSupplyRedundancySet_classnames[0], OpenDRIM_PowerSupplyRedundancySet_NAMESPACE); if (!instance.InstanceID_isNULL) op.addKey("InstanceID", instance.InstanceID); _L_; return op.getHdl(); } CMPIInstance* PowerSupply_OpenDRIM_PowerSupplyRedundancySet_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PowerSupplyRedundancySet& instance) { _E_; Objectpath op(broker, PowerSupply_OpenDRIM_PowerSupplyRedundancySet_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.Caption_isNULL) ci.setProperty("Caption", instance.Caption); if (!instance.Description_isNULL) ci.setProperty("Description", instance.Description); if (!instance.ElementName_isNULL) ci.setProperty("ElementName", instance.ElementName); if (!instance.RedundancyStatus_isNULL) ci.setProperty("RedundancyStatus", instance.RedundancyStatus); if (!instance.TypeOfSet_isNULL) ci.setProperty("TypeOfSet", instance.TypeOfSet); if (!instance.MinNumberNeeded_isNULL) ci.setProperty("MinNumberNeeded", instance.MinNumberNeeded); if (!instance.MaxNumberSupported_isNULL) ci.setProperty("MaxNumberSupported", instance.MaxNumberSupported); if (!instance.VendorIdentifyingInfo_isNULL) ci.setProperty("VendorIdentifyingInfo", instance.VendorIdentifyingInfo); if (!instance.OtherTypeOfSet_isNULL) ci.setProperty("OtherTypeOfSet", instance.OtherTypeOfSet); if (!instance.LoadBalanceAlgorithm_isNULL) ci.setProperty("LoadBalanceAlgorithm", instance.LoadBalanceAlgorithm); if (!instance.OtherLoadBalanceAlgorithm_isNULL) ci.setProperty("OtherLoadBalanceAlgorithm", instance.OtherLoadBalanceAlgorithm); _L_; return ci.getHdl(); } void PowerSupply_OpenDRIM_PowerSupplyRedundancySet_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PowerSupplyRedundancySet& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; _L_; } void PowerSupply_OpenDRIM_PowerSupplyRedundancySet_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PowerSupplyRedundancySet& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("Caption", instance.Caption) == OK) instance.Caption_isNULL = false; if (inst.getProperty("Description", instance.Description) == OK) instance.Description_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getProperty("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; if (inst.getProperty("RedundancyStatus", instance.RedundancyStatus) == OK) instance.RedundancyStatus_isNULL = false; if (inst.getProperty("TypeOfSet", instance.TypeOfSet) == OK) instance.TypeOfSet_isNULL = false; if (inst.getProperty("MinNumberNeeded", instance.MinNumberNeeded) == OK) instance.MinNumberNeeded_isNULL = false; if (inst.getProperty("MaxNumberSupported", instance.MaxNumberSupported) == OK) instance.MaxNumberSupported_isNULL = false; if (inst.getProperty("VendorIdentifyingInfo", instance.VendorIdentifyingInfo) == OK) instance.VendorIdentifyingInfo_isNULL = false; if (inst.getProperty("OtherTypeOfSet", instance.OtherTypeOfSet) == OK) instance.OtherTypeOfSet_isNULL = false; if (inst.getProperty("LoadBalanceAlgorithm", instance.LoadBalanceAlgorithm) == OK) instance.LoadBalanceAlgorithm_isNULL = false; if (inst.getProperty("OtherLoadBalanceAlgorithm", instance.OtherLoadBalanceAlgorithm) == OK) instance.OtherLoadBalanceAlgorithm_isNULL = false; _L_; } void PowerSupply_OpenDRIM_PowerSupplyRedundancySet_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PowerSupplyRedundancySet_Failover_In& args) { _E_; CMPIStatus rc; CMPIData data; Objectpath FailoverFrom; data = in->ft->getArg(in, "FailoverFrom", &rc); if (rc.rc == OK) { CT_ToC(broker, data, FailoverFrom); args.setFailoverFrom(FailoverFrom); } Objectpath FailoverTo; data = in->ft->getArg(in, "FailoverTo", &rc); if (rc.rc == OK) { CT_ToC(broker, data, FailoverTo); args.setFailoverTo(FailoverTo); } _L_; } opendrim-lmp-powersupply-1.0.0~ppa/COPYING0000644000175000017500000004310311401064722021204 0ustar guillaumeguillaume GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_SuppliesPower/0000755000175000017500000000000011401064722024426 5ustar guillaumeguillaumeopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_SuppliesPower/assocOpenDRIM_SuppliesPower.h0000644000175000017500000000610211401064722032105 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef ASSOCOPENDRIM_SUPPLIESPOWER_H_ #define ASSOCOPENDRIM_SUPPLIESPOWER_H_ #include "OpenDRIM_SuppliesPowerAccess.h" int PowerSupply_OpenDRIM_SuppliesPower_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage); int PowerSupply_OpenDRIM_SuppliesPower_associator(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties, vector& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant); int PowerSupply_OpenDRIM_SuppliesPower_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PowerSupply_OpenDRIM_SuppliesPower_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_SuppliesPower_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PowerSupply_OpenDRIM_SuppliesPower_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_SUPPLIESPOWER_H_*/ opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_SuppliesPower/OpenDRIM_SuppliesPowerAccess.cpp0000644000175000017500000002375311401064722032544 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "OpenDRIM_SuppliesPowerAccess.h" int PowerSupply_OpenDRIM_SuppliesPower_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PowerSupply_CIM_PowerSupply_load(broker, errorMessage)); CF_assert(PowerSupply_CIM_ManagedSystemElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int PowerSupply_OpenDRIM_SuppliesPower_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PowerSupply_CIM_PowerSupply_unload(errorMessage)); CF_assert(PowerSupply_CIM_ManagedSystemElement_unload(errorMessage)); */ // TODO _L_; return OK; } int PowerSupply_OpenDRIM_SuppliesPower_isAssociated(const Instance& Antecedent, const Instance& Dependent, bool& isAssociated, string& errorMessage) { _E_; // TODO Determine if the association can be established or not isAssociated=true; _L_; return OK; } int PowerSupply_OpenDRIM_SuppliesPower_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector subjects; // Only get the instance names CF_assert(PowerSupply_OpenDRIM_SuppliesPower_enumerateAntecedents(broker, ctx, subjects, NULL, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PowerSupply_OpenDRIM_SuppliesPower_enumerateAntecedents(broker, ctx, subjects, NULL, false, errorMessage)); vector::iterator c = subjects.begin(); vector::iterator end = subjects.end(); for (; c != end; ++c) { bool leftToRight = true; vector associatedInstances; PowerSupply_OpenDRIM_SuppliesPower_associator(broker, ctx, (*c).getObjectpath().getHdl(), (*c), Antecedent_classnames[0], Dependent_classnames[0], Antecedent_role.c_str(), Dependent_role.c_str(), NULL, associatedInstances, leftToRight, errorMessage, "an"); string ref_discriminant = discriminant == "ein" ? "rn" : "r"; CF_assert(PowerSupply_OpenDRIM_SuppliesPower_referenceAntecedentToDependent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int PowerSupply_OpenDRIM_SuppliesPower_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SuppliesPower& instance, const char** properties, string& errorMessage) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ Objectpath Antecedent_objectpath; instance.getAntecedent(Antecedent_objectpath); Instance Antecedent_instance; CF_assert(PowerSupply_OpenDRIM_SuppliesPower_getAntecedent(broker, ctx, Antecedent_objectpath, Antecedent_instance, NULL, errorMessage)); Objectpath Dependent_objectpath; instance.getDependent(Dependent_objectpath); Instance Dependent_instance; CF_assert(PowerSupply_OpenDRIM_SuppliesPower_getDependent(broker, ctx, Dependent_objectpath, Dependent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(PowerSupply_OpenDRIM_SuppliesPower_isAssociated(Antecedent_instance, Dependent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int PowerSupply_OpenDRIM_SuppliesPower_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SuppliesPower& newInstance, const OpenDRIM_SuppliesPower& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_SuppliesPower_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SuppliesPower& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_SuppliesPower_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SuppliesPower& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_SuppliesPower_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector Dependent_instances; if (discriminant=="a") CF_assert(PowerSupply_OpenDRIM_SuppliesPower_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PowerSupply_OpenDRIM_SuppliesPower_enumerateDependents(broker, ctx, Dependent_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PowerSupply_OpenDRIM_SuppliesPower_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Antecedent_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector Antecedent_instances; if (discriminant=="a") CF_assert(PowerSupply_OpenDRIM_SuppliesPower_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PowerSupply_OpenDRIM_SuppliesPower_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PowerSupply_OpenDRIM_SuppliesPower_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Dependent_instances, vector& OpenDRIM_SuppliesPower_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < Dependent_instances.size(); i++) { OpenDRIM_SuppliesPower instance; instance.setAntecedent(((Instance) Antecedent_instance).getObjectpath()); instance.setDependent(((Instance) Dependent_instances[i]).getObjectpath()); OpenDRIM_SuppliesPower_instances.push_back(instance); } _L_; return OK; } int PowerSupply_OpenDRIM_SuppliesPower_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_SuppliesPower_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < Antecedent_instances.size(); i++) { OpenDRIM_SuppliesPower instance; instance.setAntecedent(((Instance) Antecedent_instances[i]).getObjectpath()); instance.setDependent(((Instance) Dependent_instance).getObjectpath()); OpenDRIM_SuppliesPower_instances.push_back(instance); } _L_; return OK; } int PowerSupply_OpenDRIM_SuppliesPower_populate(OpenDRIM_SuppliesPower& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_SuppliesPower/OpenDRIM_SuppliesPowerAccess.h0000644000175000017500000001021011401064722032171 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef OPENDRIM_SUPPLIESPOWERACCESS_H_ #define OPENDRIM_SUPPLIESPOWERACCESS_H_ #include "PowerSupply_Common.h" #include "OpenDRIM_SuppliesPower.h" #include "assocOpenDRIM_SuppliesPower.h" int PowerSupply_OpenDRIM_SuppliesPower_load(const CMPIBroker* broker, string& errorMessage); int PowerSupply_OpenDRIM_SuppliesPower_unload(string& errorMessage); int PowerSupply_OpenDRIM_SuppliesPower_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_SuppliesPower_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_SuppliesPower& instance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_SuppliesPower_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SuppliesPower& newInstance, const OpenDRIM_SuppliesPower& oldInstance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_SuppliesPower_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SuppliesPower& instance, string& errorMessage); int PowerSupply_OpenDRIM_SuppliesPower_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_SuppliesPower& instance, string& errorMessage); int PowerSupply_OpenDRIM_SuppliesPower_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_SuppliesPower_associatorDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const char** properties, vector& Antecedent_associatedInstances, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_SuppliesPower_referenceAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const vector& Dependent_instances, vector& OpenDRIM_SuppliesPower_instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_SuppliesPower_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_SuppliesPower_instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_SuppliesPower_populate(OpenDRIM_SuppliesPower& instance, string& errorMessage); #endif /*OPENDRIM_SUPPLIESPOWERACCESS_H_*/ opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_SuppliesPower/Makefile.am0000644000175000017500000000462711401064722026473 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPowerSupply_OpenDRIM_SuppliesPowerProvider.la libcmpiPowerSupply_OpenDRIM_SuppliesPowerProvider_la_SOURCES = OpenDRIM_SuppliesPowerAccess.cpp OpenDRIM_SuppliesPowerProvider.cpp cmpiOpenDRIM_SuppliesPower.cpp assocOpenDRIM_SuppliesPower.cpp # May have to be adjusted for direct invocation libcmpiPowerSupply_OpenDRIM_SuppliesPowerProvider_la_CPPFLAGS = -I../CIM_PowerSupply -I../CIM_ManagedSystemElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiPowerSupply_OpenDRIM_SuppliesPowerProvider_la_LIBADD = ../Common/libcmpiPowerSupply_Common.la #../CIM_PowerSupply/libcmpiPowerSupply_CIM_PowerSupplyProvider.la ../CIM_ManagedSystemElement/libcmpiPowerSupply_CIM_ManagedSystemElementProvider.la libcmpiPowerSupply_OpenDRIM_SuppliesPowerProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_SuppliesPower.h OpenDRIM_SuppliesPower.h OpenDRIM_SuppliesPowerAccess.h opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_SuppliesPower/cmpiOpenDRIM_SuppliesPower.cpp0000644000175000017500000000574011401064722032267 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_SuppliesPower.h" CMPIObjectPath* PowerSupply_OpenDRIM_SuppliesPower_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SuppliesPower& instance) { _E_; Objectpath op(broker, OpenDRIM_SuppliesPower_classnames[0], OpenDRIM_SuppliesPower_NAMESPACE); if (!instance.Antecedent_isNULL) op.addKey("Antecedent", instance.Antecedent); if (!instance.Dependent_isNULL) op.addKey("Dependent", instance.Dependent); _L_; return op.getHdl(); } CMPIInstance* PowerSupply_OpenDRIM_SuppliesPower_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SuppliesPower& instance) { _E_; Objectpath op(broker, PowerSupply_OpenDRIM_SuppliesPower_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void PowerSupply_OpenDRIM_SuppliesPower_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SuppliesPower& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("Antecedent", instance.Antecedent) == OK) instance.Antecedent_isNULL = false; if (op.getKey("Dependent", instance.Dependent) == OK) instance.Dependent_isNULL = false; _L_; } void PowerSupply_OpenDRIM_SuppliesPower_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SuppliesPower& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("Antecedent", instance.Antecedent) == OK) instance.Antecedent_isNULL = false; if (inst.getProperty("Dependent", instance.Dependent) == OK) instance.Dependent_isNULL = false; _L_; } opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_SuppliesPower/OpenDRIM_SuppliesPowerProvider.cpp0000644000175000017500000004127711401064722033136 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_SuppliesPower.h" #include "OpenDRIM_SuppliesPowerAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PowerSupply_OpenDRIM_SuppliesPowerProviderSetInstance PowerSupply_OpenDRIM_SuppliesPowerProviderModifyInstance #endif int PowerSupply_OpenDRIM_SuppliesPower_init(const CMPIBroker* broker); int PowerSupply_OpenDRIM_SuppliesPower_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PowerSupply_OpenDRIM_SuppliesPowerProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PowerSupply_OpenDRIM_SuppliesPower_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_SuppliesPowerProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PowerSupply_OpenDRIM_SuppliesPower_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SuppliesPower_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PowerSupply_OpenDRIM_SuppliesPower_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_SuppliesPowerProviderEnumInstances(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PowerSupply_OpenDRIM_SuppliesPower_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SuppliesPower_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PowerSupply_OpenDRIM_SuppliesPower_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_SuppliesPowerProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SuppliesPower instance; PowerSupply_OpenDRIM_SuppliesPower_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_SuppliesPower_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SuppliesPower_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PowerSupply_OpenDRIM_SuppliesPower_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_SuppliesPowerProviderSetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SuppliesPower newInstance, oldInstance; PowerSupply_OpenDRIM_SuppliesPower_toCPP(_broker, ci, newInstance); PowerSupply_OpenDRIM_SuppliesPower_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_SuppliesPower_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SuppliesPower_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_SuppliesPower_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SuppliesPower_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_SuppliesPowerProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SuppliesPower instance; PowerSupply_OpenDRIM_SuppliesPower_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_SuppliesPower_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_SuppliesPower_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_SuppliesPower_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SuppliesPower_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_SuppliesPower_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SuppliesPower_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PowerSupply_OpenDRIM_SuppliesPower_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_SuppliesPowerProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_SuppliesPower instance; PowerSupply_OpenDRIM_SuppliesPower_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_SuppliesPower_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SuppliesPower_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_SuppliesPower_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SuppliesPower_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_SuppliesPowerProviderExecQuery(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* lang, const char* query) { _E_; CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } /* ---------------------------------------------------------------------------*/ /* End of Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Association Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PowerSupply_OpenDRIM_SuppliesPowerProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PowerSupply_OpenDRIM_SuppliesPower_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_SuppliesPowerProviderAssociatorNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_SuppliesPower_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SuppliesPower_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnObjectPath(rslt, associatedInstances[i].getObjectpath().getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_SuppliesPowerProviderAssociators(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_SuppliesPower_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SuppliesPower_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnInstance(rslt, associatedInstances[i].getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_SuppliesPowerProviderReferenceNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_SuppliesPower_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SuppliesPower_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PowerSupply_OpenDRIM_SuppliesPower_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = PowerSupply_OpenDRIM_SuppliesPower_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SuppliesPower_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = PowerSupply_OpenDRIM_SuppliesPower_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_SuppliesPowerProviderReferences(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_SuppliesPower_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SuppliesPower_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PowerSupply_OpenDRIM_SuppliesPower_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = PowerSupply_OpenDRIM_SuppliesPower_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_SuppliesPower_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = PowerSupply_OpenDRIM_SuppliesPower_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int PowerSupply_OpenDRIM_SuppliesPower_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PowerSupply_OpenDRIM_SuppliesPower_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PowerSupply_OpenDRIM_SuppliesPower_init FAILED: " + (string) OpenDRIM_SuppliesPower_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PowerSupply_OpenDRIM_SuppliesPower_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PowerSupply_OpenDRIM_SuppliesPower_unload(errorMessage); if (errorCode != OK) { errorMessage += "PowerSupply_OpenDRIM_SuppliesPower_unload FAILED: " + (string) OpenDRIM_SuppliesPower_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PowerSupply_OpenDRIM_SuppliesPower_INIT if (PowerSupply_OpenDRIM_SuppliesPower_init(_broker) < 0) return NULL CMInstanceMIStub(PowerSupply_OpenDRIM_SuppliesPowerProvider, PowerSupply_OpenDRIM_SuppliesPowerProvider, _broker, PowerSupply_OpenDRIM_SuppliesPower_INIT); CMAssociationMIStub(PowerSupply_OpenDRIM_SuppliesPowerProvider, PowerSupply_OpenDRIM_SuppliesPowerProvider, _broker, PowerSupply_OpenDRIM_SuppliesPower_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_SuppliesPower/cmpiOpenDRIM_SuppliesPower.h0000644000175000017500000000421211401064722031725 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef CMPIOPENDRIM_SUPPLIESPOWER_H_ #define CMPIOPENDRIM_SUPPLIESPOWER_H_ #include "OpenDRIM_SuppliesPower.h" CMPIObjectPath* PowerSupply_OpenDRIM_SuppliesPower_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_SuppliesPower& instance); CMPIInstance* PowerSupply_OpenDRIM_SuppliesPower_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_SuppliesPower& instance); void PowerSupply_OpenDRIM_SuppliesPower_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_SuppliesPower& instance); void PowerSupply_OpenDRIM_SuppliesPower_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_SuppliesPower& instance); #endif /*CMPIOPENDRIM_SUPPLIESPOWER_H_*/ opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_SuppliesPower/OpenDRIM_SuppliesPower.h0000644000175000017500000000650611401064722031064 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef OPENDRIM_SUPPLIESPOWER_H_ #define OPENDRIM_SUPPLIESPOWER_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_PowerSupply.h" #include "CIM_PowerSupplyAccess.h" #include "cmpiCIM_ManagedSystemElement.h" #include "CIM_ManagedSystemElementAccess.h" */ const static char* OpenDRIM_SuppliesPower_classnames[] = {"OpenDRIM_SuppliesPower"}; static string OpenDRIM_SuppliesPower_NAMESPACE = _NAMESPACE; const static string Antecedent_role = "Antecedent"; const static char* Antecedent_classnames[] = {"OpenDRIM_PowerSupply"}; const static string Antecedent_NAMESPACE = _NAMESPACE; const static string Dependent_role = "Dependent"; const static char* Dependent_classnames[] = {"CIM_ManagedSystemElement"}; const static string Dependent_NAMESPACE = _NAMESPACE; class OpenDRIM_SuppliesPower { public: Objectpath Antecedent; bool Antecedent_isNULL; Objectpath Dependent; bool Dependent_isNULL; OpenDRIM_SuppliesPower() { Antecedent_isNULL = true; Dependent_isNULL = true; } ~OpenDRIM_SuppliesPower() {} string getKeys() const { return CF_toLowCase(".Antecedent=\"" + CF_quoteString(Antecedent.toString()) + "\""".Dependent=\"" + CF_quoteString(Dependent.toString()) + "\""); } int getAntecedent(Objectpath& value) const { if (Antecedent_isNULL==true) return NOT_FOUND; value = Antecedent; return OK; } int setAntecedent(const Objectpath& newValue) { Antecedent = newValue; Antecedent.setNamespace(Antecedent_NAMESPACE); Antecedent_isNULL = false; return OK; } int getDependent(Objectpath& value) const { if (Dependent_isNULL==true) return NOT_FOUND; value = Dependent; return OK; } int setDependent(const Objectpath& newValue) { Dependent = newValue; Dependent.setNamespace(Dependent_NAMESPACE); Dependent_isNULL = false; return OK; } }; #endif /*OPENDRIM_SUPPLIESPOWER_H_*/ opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_SuppliesPower/assocOpenDRIM_SuppliesPower.cpp0000644000175000017500000002076211401064722032450 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "assocOpenDRIM_SuppliesPower.h" int PowerSupply_OpenDRIM_SuppliesPower_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage) { _E_; string _assocClass, _resultClass, _resultRole, _role; assocClass == NULL ? _assocClass = "null" : _assocClass = assocClass; resultClass == NULL ? _resultClass = "null" : _resultClass = resultClass; resultRole == NULL ? _resultRole = "null" : _resultRole = resultRole; role == NULL ? _role = "null" : _role = role; for (unsigned int i=0; i& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant) { _E_; int errorCode = PowerSupply_OpenDRIM_SuppliesPower_associatorFilter(broker, ctx, cop, knownInstance, assocClass, resultClass, role, resultRole, leftToRight, errorMessage); if (errorCode == -1) return OK; if (errorCode != OK) return errorCode; if (leftToRight) { if (role != NULL && strcasecmp(role, "Antecedent") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "Dependent") != 0) return OK; CF_assert(PowerSupply_OpenDRIM_SuppliesPower_associatorAntecedentToDependent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } else { if (role != NULL && strcasecmp(role, "Dependent") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "Antecedent") != 0) return OK; CF_assert(PowerSupply_OpenDRIM_SuppliesPower_associatorDependentToAntecedent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int PowerSupply_OpenDRIM_SuppliesPower_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, Antecedent_NAMESPACE, Antecedent_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(PowerSupply_CIM_PowerSupply_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PowerSupply_CIM_PowerSupply_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PowerSupply_CIM_PowerSupply_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PowerSupply_OpenDRIM_SuppliesPower_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Antecedent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Antecedent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_PowerSupply _instance; PowerSupply_CIM_PowerSupply_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PowerSupply_CIM_PowerSupply_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PowerSupply_CIM_PowerSupply_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int PowerSupply_OpenDRIM_SuppliesPower_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, Dependent_NAMESPACE, Dependent_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(PowerSupply_CIM_ManagedSystemElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PowerSupply_CIM_ManagedSystemElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PowerSupply_CIM_ManagedSystemElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PowerSupply_OpenDRIM_SuppliesPower_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), Dependent_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), Dependent_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_ManagedSystemElement _instance; PowerSupply_CIM_ManagedSystemElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PowerSupply_CIM_ManagedSystemElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PowerSupply_CIM_ManagedSystemElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-powersupply-1.0.0~ppa/NEWS0000644000175000017500000000017511401064722020652 0ustar guillaumeguillaumeInitial Release 1.0.0 ========================= // TODO Changes in Major.Minor.Revision ========================= // TODO opendrim-lmp-powersupply-1.0.0~ppa/LICENSE0000644000175000017500000000272311401064722021161 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupply/0000755000175000017500000000000011401064722024116 5ustar guillaumeguillaumeopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupply/OpenDRIM_PowerSupply.h0000644000175000017500000006240011401064722030237 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef OPENDRIM_POWERSUPPLY_H_ #define OPENDRIM_POWERSUPPLY_H_ #include const static char* OpenDRIM_PowerSupply_classnames[] = {"OpenDRIM_PowerSupply"}; static string OpenDRIM_PowerSupply_NAMESPACE = _NAMESPACE; class OpenDRIM_PowerSupply { public: string InstanceID; bool InstanceID_isNULL; string Caption; bool Caption_isNULL; string Description; bool Description_isNULL; string ElementName; bool ElementName_isNULL; string InstallDate; bool InstallDate_isNULL; string Name; bool Name_isNULL; vector OperationalStatus; bool OperationalStatus_isNULL; vector StatusDescriptions; bool StatusDescriptions_isNULL; string Status; bool Status_isNULL; unsigned short HealthState; bool HealthState_isNULL; unsigned short CommunicationStatus; bool CommunicationStatus_isNULL; unsigned short DetailedStatus; bool DetailedStatus_isNULL; unsigned short OperatingStatus; bool OperatingStatus_isNULL; unsigned short PrimaryStatus; bool PrimaryStatus_isNULL; unsigned short EnabledState; bool EnabledState_isNULL; string OtherEnabledState; bool OtherEnabledState_isNULL; unsigned short RequestedState; bool RequestedState_isNULL; unsigned short EnabledDefault; bool EnabledDefault_isNULL; string TimeOfLastStateChange; bool TimeOfLastStateChange_isNULL; vector AvailableRequestedStates; bool AvailableRequestedStates_isNULL; unsigned short TransitioningToState; bool TransitioningToState_isNULL; string SystemCreationClassName; bool SystemCreationClassName_isNULL; string SystemName; bool SystemName_isNULL; string CreationClassName; bool CreationClassName_isNULL; string DeviceID; bool DeviceID_isNULL; bool PowerManagementSupported; bool PowerManagementSupported_isNULL; vector PowerManagementCapabilities; bool PowerManagementCapabilities_isNULL; unsigned short Availability; bool Availability_isNULL; unsigned short StatusInfo; bool StatusInfo_isNULL; unsigned int LastErrorCode; bool LastErrorCode_isNULL; string ErrorDescription; bool ErrorDescription_isNULL; bool ErrorCleared; bool ErrorCleared_isNULL; vector OtherIdentifyingInfo; bool OtherIdentifyingInfo_isNULL; unsigned long long PowerOnHours; bool PowerOnHours_isNULL; unsigned long long TotalPowerOnHours; bool TotalPowerOnHours_isNULL; vector IdentifyingDescriptions; bool IdentifyingDescriptions_isNULL; vector AdditionalAvailability; bool AdditionalAvailability_isNULL; unsigned long long MaxQuiesceTime; bool MaxQuiesceTime_isNULL; bool IsSwitchingSupply; bool IsSwitchingSupply_isNULL; unsigned int Range1InputVoltageLow; bool Range1InputVoltageLow_isNULL; unsigned int Range1InputVoltageHigh; bool Range1InputVoltageHigh_isNULL; unsigned int Range1InputFrequencyLow; bool Range1InputFrequencyLow_isNULL; unsigned int Range1InputFrequencyHigh; bool Range1InputFrequencyHigh_isNULL; unsigned int Range2InputVoltageLow; bool Range2InputVoltageLow_isNULL; unsigned int Range2InputVoltageHigh; bool Range2InputVoltageHigh_isNULL; unsigned int Range2InputFrequencyLow; bool Range2InputFrequencyLow_isNULL; unsigned int Range2InputFrequencyHigh; bool Range2InputFrequencyHigh_isNULL; unsigned short ActiveInputVoltage; bool ActiveInputVoltage_isNULL; unsigned short TypeOfRangeSwitching; bool TypeOfRangeSwitching_isNULL; unsigned int TotalOutputPower; bool TotalOutputPower_isNULL; OpenDRIM_PowerSupply() { InstanceID_isNULL = true; Caption_isNULL = true; Description_isNULL = true; ElementName_isNULL = true; InstallDate_isNULL = true; Name_isNULL = true; OperationalStatus_isNULL = true; StatusDescriptions_isNULL = true; Status_isNULL = true; HealthState_isNULL = true; CommunicationStatus_isNULL = true; DetailedStatus_isNULL = true; OperatingStatus_isNULL = true; PrimaryStatus_isNULL = true; EnabledState_isNULL = true; OtherEnabledState_isNULL = true; RequestedState_isNULL = true; EnabledDefault_isNULL = true; TimeOfLastStateChange_isNULL = true; AvailableRequestedStates_isNULL = true; TransitioningToState_isNULL = true; SystemCreationClassName_isNULL = true; SystemName_isNULL = true; CreationClassName_isNULL = true; DeviceID_isNULL = true; PowerManagementSupported_isNULL = true; PowerManagementCapabilities_isNULL = true; Availability_isNULL = true; StatusInfo_isNULL = true; LastErrorCode_isNULL = true; ErrorDescription_isNULL = true; ErrorCleared_isNULL = true; OtherIdentifyingInfo_isNULL = true; PowerOnHours_isNULL = true; TotalPowerOnHours_isNULL = true; IdentifyingDescriptions_isNULL = true; AdditionalAvailability_isNULL = true; MaxQuiesceTime_isNULL = true; IsSwitchingSupply_isNULL = true; Range1InputVoltageLow_isNULL = true; Range1InputVoltageHigh_isNULL = true; Range1InputFrequencyLow_isNULL = true; Range1InputFrequencyHigh_isNULL = true; Range2InputVoltageLow_isNULL = true; Range2InputVoltageHigh_isNULL = true; Range2InputFrequencyLow_isNULL = true; Range2InputFrequencyHigh_isNULL = true; ActiveInputVoltage_isNULL = true; TypeOfRangeSwitching_isNULL = true; TotalOutputPower_isNULL = true; } ~OpenDRIM_PowerSupply() {} string getKeys() const { return CF_toLowCase(".SystemCreationClassName=\"" + CF_quoteString(SystemCreationClassName) + "\""".SystemName=\"" + CF_quoteString(SystemName) + "\""".CreationClassName=\"" + CF_quoteString(CreationClassName) + "\""".DeviceID=\"" + CF_quoteString(DeviceID) + "\""); } int getInstanceID(string& value) const { if (InstanceID_isNULL==true) return NOT_FOUND; value = InstanceID; return OK; } int setInstanceID(const string& newValue) { InstanceID = newValue; InstanceID_isNULL = false; return OK; } int getCaption(string& value) const { if (Caption_isNULL==true) return NOT_FOUND; value = Caption; return OK; } int setCaption(const string& newValue) { Caption = newValue; Caption_isNULL = false; return OK; } int getDescription(string& value) const { if (Description_isNULL==true) return NOT_FOUND; value = Description; return OK; } int setDescription(const string& newValue) { Description = newValue; Description_isNULL = false; return OK; } int getElementName(string& value) const { if (ElementName_isNULL==true) return NOT_FOUND; value = ElementName; return OK; } int setElementName(const string& newValue) { ElementName = newValue; ElementName_isNULL = false; return OK; } int getInstallDate(string& value) const { if (InstallDate_isNULL==true) return NOT_FOUND; value = InstallDate; return OK; } int setInstallDate(const string& newValue) { InstallDate = newValue; InstallDate_isNULL = false; return OK; } int getName(string& value) const { if (Name_isNULL==true) return NOT_FOUND; value = Name; return OK; } int setName(const string& newValue) { Name = newValue; Name_isNULL = false; return OK; } int getOperationalStatus(vector& value) const { if (OperationalStatus_isNULL==true) return NOT_FOUND; value = OperationalStatus; return OK; } int setOperationalStatus(const vector& newValue) { OperationalStatus = newValue; OperationalStatus_isNULL = false; return OK; } int getStatusDescriptions(vector& value) const { if (StatusDescriptions_isNULL==true) return NOT_FOUND; value = StatusDescriptions; return OK; } int setStatusDescriptions(const vector& newValue) { StatusDescriptions = newValue; StatusDescriptions_isNULL = false; return OK; } int getStatus(string& value) const { if (Status_isNULL==true) return NOT_FOUND; value = Status; return OK; } int setStatus(const string& newValue) { Status = newValue; Status_isNULL = false; return OK; } int getHealthState(unsigned short& value) const { if (HealthState_isNULL==true) return NOT_FOUND; value = HealthState; return OK; } int setHealthState(const unsigned short& newValue) { HealthState = newValue; HealthState_isNULL = false; return OK; } int getCommunicationStatus(unsigned short& value) const { if (CommunicationStatus_isNULL==true) return NOT_FOUND; value = CommunicationStatus; return OK; } int setCommunicationStatus(const unsigned short& newValue) { CommunicationStatus = newValue; CommunicationStatus_isNULL = false; return OK; } int getDetailedStatus(unsigned short& value) const { if (DetailedStatus_isNULL==true) return NOT_FOUND; value = DetailedStatus; return OK; } int setDetailedStatus(const unsigned short& newValue) { DetailedStatus = newValue; DetailedStatus_isNULL = false; return OK; } int getOperatingStatus(unsigned short& value) const { if (OperatingStatus_isNULL==true) return NOT_FOUND; value = OperatingStatus; return OK; } int setOperatingStatus(const unsigned short& newValue) { OperatingStatus = newValue; OperatingStatus_isNULL = false; return OK; } int getPrimaryStatus(unsigned short& value) const { if (PrimaryStatus_isNULL==true) return NOT_FOUND; value = PrimaryStatus; return OK; } int setPrimaryStatus(const unsigned short& newValue) { PrimaryStatus = newValue; PrimaryStatus_isNULL = false; return OK; } int getEnabledState(unsigned short& value) const { if (EnabledState_isNULL==true) return NOT_FOUND; value = EnabledState; return OK; } int setEnabledState(const unsigned short& newValue) { EnabledState = newValue; EnabledState_isNULL = false; return OK; } int getOtherEnabledState(string& value) const { if (OtherEnabledState_isNULL==true) return NOT_FOUND; value = OtherEnabledState; return OK; } int setOtherEnabledState(const string& newValue) { OtherEnabledState = newValue; OtherEnabledState_isNULL = false; return OK; } int getRequestedState(unsigned short& value) const { if (RequestedState_isNULL==true) return NOT_FOUND; value = RequestedState; return OK; } int setRequestedState(const unsigned short& newValue) { RequestedState = newValue; RequestedState_isNULL = false; return OK; } int getEnabledDefault(unsigned short& value) const { if (EnabledDefault_isNULL==true) return NOT_FOUND; value = EnabledDefault; return OK; } int setEnabledDefault(const unsigned short& newValue) { EnabledDefault = newValue; EnabledDefault_isNULL = false; return OK; } int getTimeOfLastStateChange(string& value) const { if (TimeOfLastStateChange_isNULL==true) return NOT_FOUND; value = TimeOfLastStateChange; return OK; } int setTimeOfLastStateChange(const string& newValue) { TimeOfLastStateChange = newValue; TimeOfLastStateChange_isNULL = false; return OK; } int getAvailableRequestedStates(vector& value) const { if (AvailableRequestedStates_isNULL==true) return NOT_FOUND; value = AvailableRequestedStates; return OK; } int setAvailableRequestedStates(const vector& newValue) { AvailableRequestedStates = newValue; AvailableRequestedStates_isNULL = false; return OK; } int getTransitioningToState(unsigned short& value) const { if (TransitioningToState_isNULL==true) return NOT_FOUND; value = TransitioningToState; return OK; } int setTransitioningToState(const unsigned short& newValue) { TransitioningToState = newValue; TransitioningToState_isNULL = false; return OK; } int getSystemCreationClassName(string& value) const { if (SystemCreationClassName_isNULL==true) return NOT_FOUND; value = SystemCreationClassName; return OK; } int setSystemCreationClassName(const string& newValue) { SystemCreationClassName = newValue; SystemCreationClassName_isNULL = false; return OK; } int getSystemName(string& value) const { if (SystemName_isNULL==true) return NOT_FOUND; value = SystemName; return OK; } int setSystemName(const string& newValue) { SystemName = newValue; SystemName_isNULL = false; return OK; } int getCreationClassName(string& value) const { if (CreationClassName_isNULL==true) return NOT_FOUND; value = CreationClassName; return OK; } int setCreationClassName(const string& newValue) { CreationClassName = newValue; CreationClassName_isNULL = false; return OK; } int getDeviceID(string& value) const { if (DeviceID_isNULL==true) return NOT_FOUND; value = DeviceID; return OK; } int setDeviceID(const string& newValue) { DeviceID = newValue; DeviceID_isNULL = false; return OK; } int getPowerManagementSupported(bool& value) const { if (PowerManagementSupported_isNULL==true) return NOT_FOUND; value = PowerManagementSupported; return OK; } int setPowerManagementSupported(const bool& newValue) { PowerManagementSupported = newValue; PowerManagementSupported_isNULL = false; return OK; } int getPowerManagementCapabilities(vector& value) const { if (PowerManagementCapabilities_isNULL==true) return NOT_FOUND; value = PowerManagementCapabilities; return OK; } int setPowerManagementCapabilities(const vector& newValue) { PowerManagementCapabilities = newValue; PowerManagementCapabilities_isNULL = false; return OK; } int getAvailability(unsigned short& value) const { if (Availability_isNULL==true) return NOT_FOUND; value = Availability; return OK; } int setAvailability(const unsigned short& newValue) { Availability = newValue; Availability_isNULL = false; return OK; } int getStatusInfo(unsigned short& value) const { if (StatusInfo_isNULL==true) return NOT_FOUND; value = StatusInfo; return OK; } int setStatusInfo(const unsigned short& newValue) { StatusInfo = newValue; StatusInfo_isNULL = false; return OK; } int getLastErrorCode(unsigned int& value) const { if (LastErrorCode_isNULL==true) return NOT_FOUND; value = LastErrorCode; return OK; } int setLastErrorCode(const unsigned int& newValue) { LastErrorCode = newValue; LastErrorCode_isNULL = false; return OK; } int getErrorDescription(string& value) const { if (ErrorDescription_isNULL==true) return NOT_FOUND; value = ErrorDescription; return OK; } int setErrorDescription(const string& newValue) { ErrorDescription = newValue; ErrorDescription_isNULL = false; return OK; } int getErrorCleared(bool& value) const { if (ErrorCleared_isNULL==true) return NOT_FOUND; value = ErrorCleared; return OK; } int setErrorCleared(const bool& newValue) { ErrorCleared = newValue; ErrorCleared_isNULL = false; return OK; } int getOtherIdentifyingInfo(vector& value) const { if (OtherIdentifyingInfo_isNULL==true) return NOT_FOUND; value = OtherIdentifyingInfo; return OK; } int setOtherIdentifyingInfo(const vector& newValue) { OtherIdentifyingInfo = newValue; OtherIdentifyingInfo_isNULL = false; return OK; } int getPowerOnHours(unsigned long long& value) const { if (PowerOnHours_isNULL==true) return NOT_FOUND; value = PowerOnHours; return OK; } int setPowerOnHours(const unsigned long long& newValue) { PowerOnHours = newValue; PowerOnHours_isNULL = false; return OK; } int getTotalPowerOnHours(unsigned long long& value) const { if (TotalPowerOnHours_isNULL==true) return NOT_FOUND; value = TotalPowerOnHours; return OK; } int setTotalPowerOnHours(const unsigned long long& newValue) { TotalPowerOnHours = newValue; TotalPowerOnHours_isNULL = false; return OK; } int getIdentifyingDescriptions(vector& value) const { if (IdentifyingDescriptions_isNULL==true) return NOT_FOUND; value = IdentifyingDescriptions; return OK; } int setIdentifyingDescriptions(const vector& newValue) { IdentifyingDescriptions = newValue; IdentifyingDescriptions_isNULL = false; return OK; } int getAdditionalAvailability(vector& value) const { if (AdditionalAvailability_isNULL==true) return NOT_FOUND; value = AdditionalAvailability; return OK; } int setAdditionalAvailability(const vector& newValue) { AdditionalAvailability = newValue; AdditionalAvailability_isNULL = false; return OK; } int getMaxQuiesceTime(unsigned long long& value) const { if (MaxQuiesceTime_isNULL==true) return NOT_FOUND; value = MaxQuiesceTime; return OK; } int setMaxQuiesceTime(const unsigned long long& newValue) { MaxQuiesceTime = newValue; MaxQuiesceTime_isNULL = false; return OK; } int getIsSwitchingSupply(bool& value) const { if (IsSwitchingSupply_isNULL==true) return NOT_FOUND; value = IsSwitchingSupply; return OK; } int setIsSwitchingSupply(const bool& newValue) { IsSwitchingSupply = newValue; IsSwitchingSupply_isNULL = false; return OK; } int getRange1InputVoltageLow(unsigned int& value) const { if (Range1InputVoltageLow_isNULL==true) return NOT_FOUND; value = Range1InputVoltageLow; return OK; } int setRange1InputVoltageLow(const unsigned int& newValue) { Range1InputVoltageLow = newValue; Range1InputVoltageLow_isNULL = false; return OK; } int getRange1InputVoltageHigh(unsigned int& value) const { if (Range1InputVoltageHigh_isNULL==true) return NOT_FOUND; value = Range1InputVoltageHigh; return OK; } int setRange1InputVoltageHigh(const unsigned int& newValue) { Range1InputVoltageHigh = newValue; Range1InputVoltageHigh_isNULL = false; return OK; } int getRange1InputFrequencyLow(unsigned int& value) const { if (Range1InputFrequencyLow_isNULL==true) return NOT_FOUND; value = Range1InputFrequencyLow; return OK; } int setRange1InputFrequencyLow(const unsigned int& newValue) { Range1InputFrequencyLow = newValue; Range1InputFrequencyLow_isNULL = false; return OK; } int getRange1InputFrequencyHigh(unsigned int& value) const { if (Range1InputFrequencyHigh_isNULL==true) return NOT_FOUND; value = Range1InputFrequencyHigh; return OK; } int setRange1InputFrequencyHigh(const unsigned int& newValue) { Range1InputFrequencyHigh = newValue; Range1InputFrequencyHigh_isNULL = false; return OK; } int getRange2InputVoltageLow(unsigned int& value) const { if (Range2InputVoltageLow_isNULL==true) return NOT_FOUND; value = Range2InputVoltageLow; return OK; } int setRange2InputVoltageLow(const unsigned int& newValue) { Range2InputVoltageLow = newValue; Range2InputVoltageLow_isNULL = false; return OK; } int getRange2InputVoltageHigh(unsigned int& value) const { if (Range2InputVoltageHigh_isNULL==true) return NOT_FOUND; value = Range2InputVoltageHigh; return OK; } int setRange2InputVoltageHigh(const unsigned int& newValue) { Range2InputVoltageHigh = newValue; Range2InputVoltageHigh_isNULL = false; return OK; } int getRange2InputFrequencyLow(unsigned int& value) const { if (Range2InputFrequencyLow_isNULL==true) return NOT_FOUND; value = Range2InputFrequencyLow; return OK; } int setRange2InputFrequencyLow(const unsigned int& newValue) { Range2InputFrequencyLow = newValue; Range2InputFrequencyLow_isNULL = false; return OK; } int getRange2InputFrequencyHigh(unsigned int& value) const { if (Range2InputFrequencyHigh_isNULL==true) return NOT_FOUND; value = Range2InputFrequencyHigh; return OK; } int setRange2InputFrequencyHigh(const unsigned int& newValue) { Range2InputFrequencyHigh = newValue; Range2InputFrequencyHigh_isNULL = false; return OK; } int getActiveInputVoltage(unsigned short& value) const { if (ActiveInputVoltage_isNULL==true) return NOT_FOUND; value = ActiveInputVoltage; return OK; } int setActiveInputVoltage(const unsigned short& newValue) { ActiveInputVoltage = newValue; ActiveInputVoltage_isNULL = false; return OK; } int getTypeOfRangeSwitching(unsigned short& value) const { if (TypeOfRangeSwitching_isNULL==true) return NOT_FOUND; value = TypeOfRangeSwitching; return OK; } int setTypeOfRangeSwitching(const unsigned short& newValue) { TypeOfRangeSwitching = newValue; TypeOfRangeSwitching_isNULL = false; return OK; } int getTotalOutputPower(unsigned int& value) const { if (TotalOutputPower_isNULL==true) return NOT_FOUND; value = TotalOutputPower; return OK; } int setTotalOutputPower(const unsigned int& newValue) { TotalOutputPower = newValue; TotalOutputPower_isNULL = false; return OK; } }; class OpenDRIM_PowerSupply_RequestStateChange_In { public: unsigned short RequestedState; bool RequestedState_isNULL; Objectpath Job; bool Job_isNULL; string TimeoutPeriod; bool TimeoutPeriod_isNULL; OpenDRIM_PowerSupply_RequestStateChange_In() { RequestedState_isNULL = true; Job_isNULL = true; TimeoutPeriod_isNULL = true; } ~OpenDRIM_PowerSupply_RequestStateChange_In() {} int getRequestedState(unsigned short& value) const { if (RequestedState_isNULL == true) return NOT_FOUND; value = RequestedState; return OK; } int setRequestedState(const unsigned short& newValue) { RequestedState = newValue; RequestedState_isNULL = false; return OK; } int getJob(Objectpath& value) const { if (Job_isNULL == true) return NOT_FOUND; value = Job; return OK; } int setJob(const Objectpath& newValue) { Job = newValue; Job_isNULL = false; return OK; } int getTimeoutPeriod(string& value) const { if (TimeoutPeriod_isNULL == true) return NOT_FOUND; value = TimeoutPeriod; return OK; } int setTimeoutPeriod(const string& newValue) { TimeoutPeriod = newValue; TimeoutPeriod_isNULL = false; return OK; } }; class OpenDRIM_PowerSupply_RequestStateChange_Out { public: Objectpath Job; bool Job_isNULL; OpenDRIM_PowerSupply_RequestStateChange_Out() { Job_isNULL = true; } ~OpenDRIM_PowerSupply_RequestStateChange_Out() {} int getJob(Objectpath& value) const { if (Job_isNULL == true) return NOT_FOUND; value = Job; return OK; } int setJob(const Objectpath& newValue) { Job = newValue; Job_isNULL = false; return OK; } }; class OpenDRIM_PowerSupply_SetPowerState_In { public: unsigned short PowerState; bool PowerState_isNULL; string Time; bool Time_isNULL; OpenDRIM_PowerSupply_SetPowerState_In() { PowerState_isNULL = true; Time_isNULL = true; } ~OpenDRIM_PowerSupply_SetPowerState_In() {} int getPowerState(unsigned short& value) const { if (PowerState_isNULL == true) return NOT_FOUND; value = PowerState; return OK; } int setPowerState(const unsigned short& newValue) { PowerState = newValue; PowerState_isNULL = false; return OK; } int getTime(string& value) const { if (Time_isNULL == true) return NOT_FOUND; value = Time; return OK; } int setTime(const string& newValue) { Time = newValue; Time_isNULL = false; return OK; } }; class OpenDRIM_PowerSupply_EnableDevice_In { public: bool Enabled; bool Enabled_isNULL; OpenDRIM_PowerSupply_EnableDevice_In() { Enabled_isNULL = true; } ~OpenDRIM_PowerSupply_EnableDevice_In() {} int getEnabled(bool& value) const { if (Enabled_isNULL == true) return NOT_FOUND; value = Enabled; return OK; } int setEnabled(const bool& newValue) { Enabled = newValue; Enabled_isNULL = false; return OK; } }; class OpenDRIM_PowerSupply_OnlineDevice_In { public: bool Online; bool Online_isNULL; OpenDRIM_PowerSupply_OnlineDevice_In() { Online_isNULL = true; } ~OpenDRIM_PowerSupply_OnlineDevice_In() {} int getOnline(bool& value) const { if (Online_isNULL == true) return NOT_FOUND; value = Online; return OK; } int setOnline(const bool& newValue) { Online = newValue; Online_isNULL = false; return OK; } }; class OpenDRIM_PowerSupply_QuiesceDevice_In { public: bool Quiesce; bool Quiesce_isNULL; OpenDRIM_PowerSupply_QuiesceDevice_In() { Quiesce_isNULL = true; } ~OpenDRIM_PowerSupply_QuiesceDevice_In() {} int getQuiesce(bool& value) const { if (Quiesce_isNULL == true) return NOT_FOUND; value = Quiesce; return OK; } int setQuiesce(const bool& newValue) { Quiesce = newValue; Quiesce_isNULL = false; return OK; } }; #endif /*OPENDRIM_POWERSUPPLY_H_*/ opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupply/Makefile.am0000644000175000017500000000374711401064722026165 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPowerSupply_OpenDRIM_PowerSupplyProvider.la libcmpiPowerSupply_OpenDRIM_PowerSupplyProvider_la_SOURCES = OpenDRIM_PowerSupplyAccess.cpp OpenDRIM_PowerSupplyProvider.cpp cmpiOpenDRIM_PowerSupply.cpp libcmpiPowerSupply_OpenDRIM_PowerSupplyProvider_la_LIBADD = ../Common/libcmpiPowerSupply_Common.la libcmpiPowerSupply_OpenDRIM_PowerSupplyProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_PowerSupply.h OpenDRIM_PowerSupply.h OpenDRIM_PowerSupplyAccess.h opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupply/OpenDRIM_PowerSupplyProvider.cpp0000644000175000017500000004232611401064722032312 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_PowerSupply.h" #include "OpenDRIM_PowerSupplyAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PowerSupply_OpenDRIM_PowerSupplyProviderSetInstance PowerSupply_OpenDRIM_PowerSupplyProviderModifyInstance #endif int PowerSupply_OpenDRIM_PowerSupply_init(const CMPIBroker* broker); int PowerSupply_OpenDRIM_PowerSupply_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PowerSupply_OpenDRIM_PowerSupplyProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PowerSupply_OpenDRIM_PowerSupply_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupply_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PowerSupply_OpenDRIM_PowerSupply_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyProviderEnumInstances(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupply_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PowerSupply_OpenDRIM_PowerSupply_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PowerSupply instance; PowerSupply_OpenDRIM_PowerSupply_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupply_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PowerSupply_OpenDRIM_PowerSupply_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyProviderSetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PowerSupply newInstance, oldInstance; PowerSupply_OpenDRIM_PowerSupply_toCPP(_broker, ci, newInstance); PowerSupply_OpenDRIM_PowerSupply_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupply_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_PowerSupply_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PowerSupply instance; PowerSupply_OpenDRIM_PowerSupply_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupply_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_PowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_PowerSupply_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_PowerSupply_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PowerSupply_OpenDRIM_PowerSupply_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PowerSupply instance; PowerSupply_OpenDRIM_PowerSupply_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupply_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_PowerSupply_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyProviderExecQuery(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* lang, const char* query) { _E_; CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } /* ---------------------------------------------------------------------------*/ /* End of Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Method Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PowerSupply_OpenDRIM_PowerSupplyProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = PowerSupply_OpenDRIM_PowerSupply_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyProviderInvokeMethod(CMPIMethodMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* methodName, const CMPIArgs* in, CMPIArgs* out) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PowerSupply instance; PowerSupply_OpenDRIM_PowerSupply_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"DeviceID", "SystemCreationClassName", "SystemName", "CreationClassName"}; int errorCode = PowerSupply_OpenDRIM_PowerSupply_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="RequestStateChange") { unsigned int returnValue; OpenDRIM_PowerSupply_RequestStateChange_In inArgs; PowerSupply_OpenDRIM_PowerSupply_toCPP(_broker, in, inArgs); OpenDRIM_PowerSupply_RequestStateChange_Out outArgs; errorCode = PowerSupply_OpenDRIM_PowerSupply_RequestStateChange(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } PowerSupply_OpenDRIM_PowerSupply_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="SetPowerState") { unsigned int returnValue; OpenDRIM_PowerSupply_SetPowerState_In inArgs; PowerSupply_OpenDRIM_PowerSupply_toCPP(_broker, in, inArgs); errorCode = PowerSupply_OpenDRIM_PowerSupply_SetPowerState(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="Reset") { unsigned int returnValue; errorCode = PowerSupply_OpenDRIM_PowerSupply_Reset(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="EnableDevice") { unsigned int returnValue; OpenDRIM_PowerSupply_EnableDevice_In inArgs; PowerSupply_OpenDRIM_PowerSupply_toCPP(_broker, in, inArgs); errorCode = PowerSupply_OpenDRIM_PowerSupply_EnableDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="OnlineDevice") { unsigned int returnValue; OpenDRIM_PowerSupply_OnlineDevice_In inArgs; PowerSupply_OpenDRIM_PowerSupply_toCPP(_broker, in, inArgs); errorCode = PowerSupply_OpenDRIM_PowerSupply_OnlineDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="QuiesceDevice") { unsigned int returnValue; OpenDRIM_PowerSupply_QuiesceDevice_In inArgs; PowerSupply_OpenDRIM_PowerSupply_toCPP(_broker, in, inArgs); errorCode = PowerSupply_OpenDRIM_PowerSupply_QuiesceDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="SaveProperties") { unsigned int returnValue; errorCode = PowerSupply_OpenDRIM_PowerSupply_SaveProperties(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="RestoreProperties") { unsigned int returnValue; errorCode = PowerSupply_OpenDRIM_PowerSupply_RestoreProperties(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupply_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else { errorMessage = (string) OpenDRIM_PowerSupply_classnames[0] + ": " + "The requested method (" + (string) methodName +") was not found."; CMSetStatusWithChars(_broker, &rc, (CMPIrc) NOT_SUPPORTED, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; CMReturn(CMPI_RC_OK); } /* ---------------------------------------------------------------------------*/ /* End of Method Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int PowerSupply_OpenDRIM_PowerSupply_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupply_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PowerSupply_OpenDRIM_PowerSupply_init FAILED: " + (string) OpenDRIM_PowerSupply_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupply_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupply_unload(errorMessage); if (errorCode != OK) { errorMessage += "PowerSupply_OpenDRIM_PowerSupply_unload FAILED: " + (string) OpenDRIM_PowerSupply_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PowerSupply_OpenDRIM_PowerSupply_INIT if (PowerSupply_OpenDRIM_PowerSupply_init(_broker) < 0) return NULL CMInstanceMIStub(PowerSupply_OpenDRIM_PowerSupplyProvider, PowerSupply_OpenDRIM_PowerSupplyProvider, _broker, PowerSupply_OpenDRIM_PowerSupply_INIT); CMMethodMIStub(PowerSupply_OpenDRIM_PowerSupplyProvider, PowerSupply_OpenDRIM_PowerSupplyProvider, _broker, PowerSupply_OpenDRIM_PowerSupply_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupply/cmpiOpenDRIM_PowerSupply.h0000644000175000017500000000566611401064722031123 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef CMPIOPENDRIM_POWERSUPPLY_H_ #define CMPIOPENDRIM_POWERSUPPLY_H_ #include "OpenDRIM_PowerSupply.h" CMPIObjectPath* PowerSupply_OpenDRIM_PowerSupply_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PowerSupply& instance); CMPIInstance* PowerSupply_OpenDRIM_PowerSupply_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PowerSupply& instance); void PowerSupply_OpenDRIM_PowerSupply_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PowerSupply& instance); void PowerSupply_OpenDRIM_PowerSupply_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PowerSupply& instance); void PowerSupply_OpenDRIM_PowerSupply_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PowerSupply_RequestStateChange_In& args); void PowerSupply_OpenDRIM_PowerSupply_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_PowerSupply_RequestStateChange_Out& args); void PowerSupply_OpenDRIM_PowerSupply_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PowerSupply_SetPowerState_In& args); void PowerSupply_OpenDRIM_PowerSupply_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PowerSupply_EnableDevice_In& args); void PowerSupply_OpenDRIM_PowerSupply_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PowerSupply_OnlineDevice_In& args); void PowerSupply_OpenDRIM_PowerSupply_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PowerSupply_QuiesceDevice_In& args); #endif /*CMPIOPENDRIM_POWERSUPPLY_H_*/ opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupply/OpenDRIM_PowerSupplyAccess.h0000644000175000017500000001116211401064722031360 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef OPENDRIM_POWERSUPPLYACCESS_H_ #define OPENDRIM_POWERSUPPLYACCESS_H_ #include "PowerSupply_Common.h" #include "OpenDRIM_PowerSupply.h" int PowerSupply_OpenDRIM_PowerSupply_load(const CMPIBroker* broker, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupply_unload(string& errorMessage); int PowerSupply_OpenDRIM_PowerSupply_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_PowerSupply_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_PowerSupply& instance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupply_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupply& newInstance, const OpenDRIM_PowerSupply& oldInstance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupply_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupply& instance, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupply_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupply& instance, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupply_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupply& instance, unsigned int& returnValue, const OpenDRIM_PowerSupply_RequestStateChange_In& in, OpenDRIM_PowerSupply_RequestStateChange_Out& out, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupply_SetPowerState(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupply& instance, unsigned int& returnValue, const OpenDRIM_PowerSupply_SetPowerState_In& in, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupply_Reset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupply& instance, unsigned int& returnValue, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupply_EnableDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupply& instance, unsigned int& returnValue, const OpenDRIM_PowerSupply_EnableDevice_In& in, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupply_OnlineDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupply& instance, unsigned int& returnValue, const OpenDRIM_PowerSupply_OnlineDevice_In& in, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupply_QuiesceDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupply& instance, unsigned int& returnValue, const OpenDRIM_PowerSupply_QuiesceDevice_In& in, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupply_SaveProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupply& instance, unsigned int& returnValue, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupply_RestoreProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupply& instance, unsigned int& returnValue, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupply_populate(OpenDRIM_PowerSupply& instance, int num, string& errorMessage); #endif /*OPENDRIM_POWERSUPPLYACCESS_H_*/ opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupply/cmpiOpenDRIM_PowerSupply.cpp0000644000175000017500000004076011401064722031450 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_PowerSupply.h" CMPIObjectPath* PowerSupply_OpenDRIM_PowerSupply_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PowerSupply& instance) { _E_; Objectpath op(broker, OpenDRIM_PowerSupply_classnames[0], OpenDRIM_PowerSupply_NAMESPACE); if (!instance.SystemCreationClassName_isNULL) op.addKey("SystemCreationClassName", instance.SystemCreationClassName); if (!instance.SystemName_isNULL) op.addKey("SystemName", instance.SystemName); if (!instance.CreationClassName_isNULL) op.addKey("CreationClassName", instance.CreationClassName); if (!instance.DeviceID_isNULL) op.addKey("DeviceID", instance.DeviceID); _L_; return op.getHdl(); } CMPIInstance* PowerSupply_OpenDRIM_PowerSupply_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PowerSupply& instance) { _E_; Objectpath op(broker, PowerSupply_OpenDRIM_PowerSupply_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.InstanceID_isNULL) ci.setProperty("InstanceID", instance.InstanceID); if (!instance.Caption_isNULL) ci.setProperty("Caption", instance.Caption); if (!instance.Description_isNULL) ci.setProperty("Description", instance.Description); if (!instance.ElementName_isNULL) ci.setProperty("ElementName", instance.ElementName); if (!instance.InstallDate_isNULL) ci.setPropertyDatetime("InstallDate", instance.InstallDate); if (!instance.Name_isNULL) ci.setProperty("Name", instance.Name); if (!instance.OperationalStatus_isNULL) ci.setProperty("OperationalStatus", instance.OperationalStatus); if (!instance.StatusDescriptions_isNULL) ci.setProperty("StatusDescriptions", instance.StatusDescriptions); if (!instance.Status_isNULL) ci.setProperty("Status", instance.Status); if (!instance.HealthState_isNULL) ci.setProperty("HealthState", instance.HealthState); if (!instance.CommunicationStatus_isNULL) ci.setProperty("CommunicationStatus", instance.CommunicationStatus); if (!instance.DetailedStatus_isNULL) ci.setProperty("DetailedStatus", instance.DetailedStatus); if (!instance.OperatingStatus_isNULL) ci.setProperty("OperatingStatus", instance.OperatingStatus); if (!instance.PrimaryStatus_isNULL) ci.setProperty("PrimaryStatus", instance.PrimaryStatus); if (!instance.EnabledState_isNULL) ci.setProperty("EnabledState", instance.EnabledState); if (!instance.OtherEnabledState_isNULL) ci.setProperty("OtherEnabledState", instance.OtherEnabledState); if (!instance.RequestedState_isNULL) ci.setProperty("RequestedState", instance.RequestedState); if (!instance.EnabledDefault_isNULL) ci.setProperty("EnabledDefault", instance.EnabledDefault); if (!instance.TimeOfLastStateChange_isNULL) ci.setPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange); if (!instance.AvailableRequestedStates_isNULL) ci.setProperty("AvailableRequestedStates", instance.AvailableRequestedStates); if (!instance.TransitioningToState_isNULL) ci.setProperty("TransitioningToState", instance.TransitioningToState); if (!instance.PowerManagementSupported_isNULL) ci.setProperty("PowerManagementSupported", instance.PowerManagementSupported); if (!instance.PowerManagementCapabilities_isNULL) ci.setProperty("PowerManagementCapabilities", instance.PowerManagementCapabilities); if (!instance.Availability_isNULL) ci.setProperty("Availability", instance.Availability); if (!instance.StatusInfo_isNULL) ci.setProperty("StatusInfo", instance.StatusInfo); if (!instance.LastErrorCode_isNULL) ci.setProperty("LastErrorCode", instance.LastErrorCode); if (!instance.ErrorDescription_isNULL) ci.setProperty("ErrorDescription", instance.ErrorDescription); if (!instance.ErrorCleared_isNULL) ci.setProperty("ErrorCleared", instance.ErrorCleared); if (!instance.OtherIdentifyingInfo_isNULL) ci.setProperty("OtherIdentifyingInfo", instance.OtherIdentifyingInfo); if (!instance.PowerOnHours_isNULL) ci.setProperty("PowerOnHours", instance.PowerOnHours); if (!instance.TotalPowerOnHours_isNULL) ci.setProperty("TotalPowerOnHours", instance.TotalPowerOnHours); if (!instance.IdentifyingDescriptions_isNULL) ci.setProperty("IdentifyingDescriptions", instance.IdentifyingDescriptions); if (!instance.AdditionalAvailability_isNULL) ci.setProperty("AdditionalAvailability", instance.AdditionalAvailability); if (!instance.MaxQuiesceTime_isNULL) ci.setProperty("MaxQuiesceTime", instance.MaxQuiesceTime); if (!instance.IsSwitchingSupply_isNULL) ci.setProperty("IsSwitchingSupply", instance.IsSwitchingSupply); if (!instance.Range1InputVoltageLow_isNULL) ci.setProperty("Range1InputVoltageLow", instance.Range1InputVoltageLow); if (!instance.Range1InputVoltageHigh_isNULL) ci.setProperty("Range1InputVoltageHigh", instance.Range1InputVoltageHigh); if (!instance.Range1InputFrequencyLow_isNULL) ci.setProperty("Range1InputFrequencyLow", instance.Range1InputFrequencyLow); if (!instance.Range1InputFrequencyHigh_isNULL) ci.setProperty("Range1InputFrequencyHigh", instance.Range1InputFrequencyHigh); if (!instance.Range2InputVoltageLow_isNULL) ci.setProperty("Range2InputVoltageLow", instance.Range2InputVoltageLow); if (!instance.Range2InputVoltageHigh_isNULL) ci.setProperty("Range2InputVoltageHigh", instance.Range2InputVoltageHigh); if (!instance.Range2InputFrequencyLow_isNULL) ci.setProperty("Range2InputFrequencyLow", instance.Range2InputFrequencyLow); if (!instance.Range2InputFrequencyHigh_isNULL) ci.setProperty("Range2InputFrequencyHigh", instance.Range2InputFrequencyHigh); if (!instance.ActiveInputVoltage_isNULL) ci.setProperty("ActiveInputVoltage", instance.ActiveInputVoltage); if (!instance.TypeOfRangeSwitching_isNULL) ci.setProperty("TypeOfRangeSwitching", instance.TypeOfRangeSwitching); if (!instance.TotalOutputPower_isNULL) ci.setProperty("TotalOutputPower", instance.TotalOutputPower); _L_; return ci.getHdl(); } void PowerSupply_OpenDRIM_PowerSupply_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PowerSupply& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("DeviceID", instance.DeviceID) == OK) instance.DeviceID_isNULL = false; if (op.getKey("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (op.getKey("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (op.getKey("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; _L_; } void PowerSupply_OpenDRIM_PowerSupply_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PowerSupply& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; if (inst.getProperty("Caption", instance.Caption) == OK) instance.Caption_isNULL = false; if (inst.getProperty("Description", instance.Description) == OK) instance.Description_isNULL = false; if (inst.getProperty("ElementName", instance.ElementName) == OK) instance.ElementName_isNULL = false; if (inst.getPropertyDatetime("InstallDate", instance.InstallDate) == OK) instance.InstallDate_isNULL = false; if (inst.getProperty("Name", instance.Name) == OK) instance.Name_isNULL = false; if (inst.getProperty("OperationalStatus", instance.OperationalStatus) == OK) instance.OperationalStatus_isNULL = false; if (inst.getProperty("StatusDescriptions", instance.StatusDescriptions) == OK) instance.StatusDescriptions_isNULL = false; if (inst.getProperty("Status", instance.Status) == OK) instance.Status_isNULL = false; if (inst.getProperty("HealthState", instance.HealthState) == OK) instance.HealthState_isNULL = false; if (inst.getProperty("CommunicationStatus", instance.CommunicationStatus) == OK) instance.CommunicationStatus_isNULL = false; if (inst.getProperty("DetailedStatus", instance.DetailedStatus) == OK) instance.DetailedStatus_isNULL = false; if (inst.getProperty("OperatingStatus", instance.OperatingStatus) == OK) instance.OperatingStatus_isNULL = false; if (inst.getProperty("PrimaryStatus", instance.PrimaryStatus) == OK) instance.PrimaryStatus_isNULL = false; if (inst.getProperty("EnabledState", instance.EnabledState) == OK) instance.EnabledState_isNULL = false; if (inst.getProperty("OtherEnabledState", instance.OtherEnabledState) == OK) instance.OtherEnabledState_isNULL = false; if (inst.getProperty("RequestedState", instance.RequestedState) == OK) instance.RequestedState_isNULL = false; if (inst.getProperty("EnabledDefault", instance.EnabledDefault) == OK) instance.EnabledDefault_isNULL = false; if (inst.getPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange) == OK) instance.TimeOfLastStateChange_isNULL = false; if (inst.getProperty("AvailableRequestedStates", instance.AvailableRequestedStates) == OK) instance.AvailableRequestedStates_isNULL = false; if (inst.getProperty("TransitioningToState", instance.TransitioningToState) == OK) instance.TransitioningToState_isNULL = false; if (inst.getProperty("SystemCreationClassName", instance.SystemCreationClassName) == OK) instance.SystemCreationClassName_isNULL = false; if (inst.getProperty("SystemName", instance.SystemName) == OK) instance.SystemName_isNULL = false; if (inst.getProperty("CreationClassName", instance.CreationClassName) == OK) instance.CreationClassName_isNULL = false; if (inst.getProperty("DeviceID", instance.DeviceID) == OK) instance.DeviceID_isNULL = false; if (inst.getProperty("PowerManagementSupported", instance.PowerManagementSupported) == OK) instance.PowerManagementSupported_isNULL = false; if (inst.getProperty("PowerManagementCapabilities", instance.PowerManagementCapabilities) == OK) instance.PowerManagementCapabilities_isNULL = false; if (inst.getProperty("Availability", instance.Availability) == OK) instance.Availability_isNULL = false; if (inst.getProperty("StatusInfo", instance.StatusInfo) == OK) instance.StatusInfo_isNULL = false; if (inst.getProperty("LastErrorCode", instance.LastErrorCode) == OK) instance.LastErrorCode_isNULL = false; if (inst.getProperty("ErrorDescription", instance.ErrorDescription) == OK) instance.ErrorDescription_isNULL = false; if (inst.getProperty("ErrorCleared", instance.ErrorCleared) == OK) instance.ErrorCleared_isNULL = false; if (inst.getProperty("OtherIdentifyingInfo", instance.OtherIdentifyingInfo) == OK) instance.OtherIdentifyingInfo_isNULL = false; if (inst.getProperty("PowerOnHours", instance.PowerOnHours) == OK) instance.PowerOnHours_isNULL = false; if (inst.getProperty("TotalPowerOnHours", instance.TotalPowerOnHours) == OK) instance.TotalPowerOnHours_isNULL = false; if (inst.getProperty("IdentifyingDescriptions", instance.IdentifyingDescriptions) == OK) instance.IdentifyingDescriptions_isNULL = false; if (inst.getProperty("AdditionalAvailability", instance.AdditionalAvailability) == OK) instance.AdditionalAvailability_isNULL = false; if (inst.getProperty("MaxQuiesceTime", instance.MaxQuiesceTime) == OK) instance.MaxQuiesceTime_isNULL = false; if (inst.getProperty("IsSwitchingSupply", instance.IsSwitchingSupply) == OK) instance.IsSwitchingSupply_isNULL = false; if (inst.getProperty("Range1InputVoltageLow", instance.Range1InputVoltageLow) == OK) instance.Range1InputVoltageLow_isNULL = false; if (inst.getProperty("Range1InputVoltageHigh", instance.Range1InputVoltageHigh) == OK) instance.Range1InputVoltageHigh_isNULL = false; if (inst.getProperty("Range1InputFrequencyLow", instance.Range1InputFrequencyLow) == OK) instance.Range1InputFrequencyLow_isNULL = false; if (inst.getProperty("Range1InputFrequencyHigh", instance.Range1InputFrequencyHigh) == OK) instance.Range1InputFrequencyHigh_isNULL = false; if (inst.getProperty("Range2InputVoltageLow", instance.Range2InputVoltageLow) == OK) instance.Range2InputVoltageLow_isNULL = false; if (inst.getProperty("Range2InputVoltageHigh", instance.Range2InputVoltageHigh) == OK) instance.Range2InputVoltageHigh_isNULL = false; if (inst.getProperty("Range2InputFrequencyLow", instance.Range2InputFrequencyLow) == OK) instance.Range2InputFrequencyLow_isNULL = false; if (inst.getProperty("Range2InputFrequencyHigh", instance.Range2InputFrequencyHigh) == OK) instance.Range2InputFrequencyHigh_isNULL = false; if (inst.getProperty("ActiveInputVoltage", instance.ActiveInputVoltage) == OK) instance.ActiveInputVoltage_isNULL = false; if (inst.getProperty("TypeOfRangeSwitching", instance.TypeOfRangeSwitching) == OK) instance.TypeOfRangeSwitching_isNULL = false; if (inst.getProperty("TotalOutputPower", instance.TotalOutputPower) == OK) instance.TotalOutputPower_isNULL = false; _L_; } void PowerSupply_OpenDRIM_PowerSupply_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PowerSupply_RequestStateChange_In& args) { _E_; CMPIStatus rc; CMPIData data; unsigned short RequestedState; data = in->ft->getArg(in, "RequestedState", &rc); if (rc.rc == OK) { CT_ToC(data, RequestedState); args.setRequestedState(RequestedState); } Objectpath Job; data = in->ft->getArg(in, "Job", &rc); if (rc.rc == OK) { CT_ToC(broker, data, Job); args.setJob(Job); } string TimeoutPeriod; data = in->ft->getArg(in, "TimeoutPeriod", &rc); if (rc.rc == OK) { CT_ToCDatetime(data, TimeoutPeriod); args.setTimeoutPeriod(TimeoutPeriod); } _L_; } void PowerSupply_OpenDRIM_PowerSupply_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_PowerSupply_RequestStateChange_Out& args) { _E_; CMPIValue value; int errorMessage; Objectpath Job; errorMessage = args.getJob(Job); if (errorMessage == OK) { value = CT_toCMPI(Job); out->ft->addArg(out, "Job", &value, CMPI_ref); } _L_; } void PowerSupply_OpenDRIM_PowerSupply_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PowerSupply_SetPowerState_In& args) { _E_; CMPIStatus rc; CMPIData data; unsigned short PowerState; data = in->ft->getArg(in, "PowerState", &rc); if (rc.rc == OK) { CT_ToC(data, PowerState); args.setPowerState(PowerState); } string Time; data = in->ft->getArg(in, "Time", &rc); if (rc.rc == OK) { CT_ToCDatetime(data, Time); args.setTime(Time); } _L_; } void PowerSupply_OpenDRIM_PowerSupply_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PowerSupply_EnableDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Enabled; data = in->ft->getArg(in, "Enabled", &rc); if (rc.rc == OK) { CT_ToC(data, Enabled); args.setEnabled(Enabled); } _L_; } void PowerSupply_OpenDRIM_PowerSupply_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PowerSupply_OnlineDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Online; data = in->ft->getArg(in, "Online", &rc); if (rc.rc == OK) { CT_ToC(data, Online); args.setOnline(Online); } _L_; } void PowerSupply_OpenDRIM_PowerSupply_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_PowerSupply_QuiesceDevice_In& args) { _E_; CMPIStatus rc; CMPIData data; bool Quiesce; data = in->ft->getArg(in, "Quiesce", &rc); if (rc.rc == OK) { CT_ToC(data, Quiesce); args.setQuiesce(Quiesce); } _L_; } opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupply/OpenDRIM_PowerSupplyAccess.cpp0000644000175000017500000002047011401064722031715 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "OpenDRIM_PowerSupplyAccess.h" const string systemCreationClassName = "OpenDRIM_ComputerSystem"; const string creationClassName = "OpenDRIM_PowerSupply"; string systemName; vector power; vector< vector > dmi_strings; int PowerSupply_OpenDRIM_PowerSupply_load(const CMPIBroker* broker, string& errorMessage) { _E_; CF_assert(CF_getSystemName(systemName, errorMessage)); CF_assert(SMBIOS_getPowerSupplyInformation(power, dmi_strings, errorMessage)); _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupply_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupply_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; for(unsigned int i=0;i operationalStatus; u8 healthState=((power[num].power_supply_characteristics&0x380)>>7); if(!dmi_strings[num][power[num].manufacturer].empty()) elementName << dmi_strings[num][power[num].manufacturer] << " "; elementName << instance.DeviceID; if(!dmi_strings[num][power[num].location].empty()) elementName << " " << dmi_strings[num][power[num].location]; instance.setElementName(elementName.str()); if(power[num].max_power_capacity==0x8000) instance.setTotalOutputPower(0); // 0 - couln't find else instance.setTotalOutputPower(power[num].max_power_capacity); switch(healthState) { case 3: // 011b - OK instance.setHealthState(5); // OK operationalStatus.push_back(2); // OK break; case 4: // 100b - Non-critical instance.setHealthState(10); // Degraded/Warning operationalStatus.push_back(3); // Degraded break; case 5: // 101b - Critical, power supply has failed and has been taken off-line instance.setHealthState(25); // Critical failure operationalStatus.push_back(5); // Predictive Failure break; case 1: // 001b - Other operationalStatus.push_back(1); // Other case 2: // 010b - Unknown operationalStatus.push_back(0); // Unknown default: instance.setHealthState(0); // Unknown if(operationalStatus.empty()) operationalStatus.push_back(0); // Unknown break; } instance.setOperationalStatus(operationalStatus); //we don't support state Management instance.setEnabledState(5); // Not applicable instance.setRequestedState(12); // Not applicable _L_; return OK; } opendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyConformsToProfile/0000755000175000017500000000000011401064722027451 5ustar guillaumeguillaumeopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyConformsToProfile/Makefile.am0000644000175000017500000000511311401064722031505 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiPowerSupply_OpenDRIM_PowerSupplyConformsToProfileProvider.la libcmpiPowerSupply_OpenDRIM_PowerSupplyConformsToProfileProvider_la_SOURCES = OpenDRIM_PowerSupplyConformsToProfileAccess.cpp OpenDRIM_PowerSupplyConformsToProfileProvider.cpp cmpiOpenDRIM_PowerSupplyConformsToProfile.cpp assocOpenDRIM_PowerSupplyConformsToProfile.cpp # May have to be adjusted for direct invocation libcmpiPowerSupply_OpenDRIM_PowerSupplyConformsToProfileProvider_la_CPPFLAGS = -I../CIM_RegisteredProfile -I../CIM_ManagedElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiPowerSupply_OpenDRIM_PowerSupplyConformsToProfileProvider_la_LIBADD = ../Common/libcmpiPowerSupply_Common.la #../CIM_RegisteredProfile/libcmpiPowerSupply_CIM_RegisteredProfileProvider.la ../CIM_ManagedElement/libcmpiPowerSupply_CIM_ManagedElementProvider.la libcmpiPowerSupply_OpenDRIM_PowerSupplyConformsToProfileProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_PowerSupplyConformsToProfile.h OpenDRIM_PowerSupplyConformsToProfile.h OpenDRIM_PowerSupplyConformsToProfileAccess.h ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyConformsToProfile/OpenDRIM_PowerSupplyConformsToProfile.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyConformsToProfile/OpenDRIM_PowerSupplyConform0000644000175000017500000000730711401064722034675 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef OPENDRIM_POWERSUPPLYCONFORMSTOPROFILE_H_ #define OPENDRIM_POWERSUPPLYCONFORMSTOPROFILE_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_RegisteredProfile.h" #include "CIM_RegisteredProfileAccess.h" #include "cmpiCIM_ManagedElement.h" #include "CIM_ManagedElementAccess.h" */ const static char* OpenDRIM_PowerSupplyConformsToProfile_classnames[] = {"OpenDRIM_PowerSupplyConformsToProfile"}; static string OpenDRIM_PowerSupplyConformsToProfile_NAMESPACE = _INTEROP_NAMESPACE; const static string ConformantStandard_role = "ConformantStandard"; const static char* ConformantStandard_classnames[] = {"OpenDRIM_RegisteredPowerSupplyProfile"}; const static string ConformantStandard_NAMESPACE = _INTEROP_NAMESPACE; const static string ManagedElement_role = "ManagedElement"; const static char* ManagedElement_classnames[] = {"OpenDRIM_PowerSupply"}; const static string ManagedElement_NAMESPACE = _NAMESPACE; class OpenDRIM_PowerSupplyConformsToProfile { public: Objectpath ConformantStandard; bool ConformantStandard_isNULL; Objectpath ManagedElement; bool ManagedElement_isNULL; OpenDRIM_PowerSupplyConformsToProfile() { ConformantStandard_isNULL = true; ManagedElement_isNULL = true; } ~OpenDRIM_PowerSupplyConformsToProfile() {} string getKeys() const { return CF_toLowCase(".ConformantStandard=\"" + CF_quoteString(ConformantStandard.toString()) + "\""".ManagedElement=\"" + CF_quoteString(ManagedElement.toString()) + "\""); } int getConformantStandard(Objectpath& value) const { if (ConformantStandard_isNULL==true) return NOT_FOUND; value = ConformantStandard; return OK; } int setConformantStandard(const Objectpath& newValue) { ConformantStandard = newValue; ConformantStandard.setNamespace(ConformantStandard_NAMESPACE); ConformantStandard_isNULL = false; return OK; } int getManagedElement(Objectpath& value) const { if (ManagedElement_isNULL==true) return NOT_FOUND; value = ManagedElement; return OK; } int setManagedElement(const Objectpath& newValue) { ManagedElement = newValue; ManagedElement.setNamespace(ManagedElement_NAMESPACE); ManagedElement_isNULL = false; return OK; } }; #endif /*OPENDRIM_POWERSUPPLYCONFORMSTOPROFILE_H_*/ ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyConformsToProfile/assocOpenDRIM_PowerSupplyConformsToProfile.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyConformsToProfile/assocOpenDRIM_PowerSupplyCo0000644000175000017500000000636211401064722034664 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef ASSOCOPENDRIM_POWERSUPPLYCONFORMSTOPROFILE_H_ #define ASSOCOPENDRIM_POWERSUPPLYCONFORMSTOPROFILE_H_ #include "OpenDRIM_PowerSupplyConformsToProfileAccess.h" int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_associator(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties, vector& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant); int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_enumerateConformantStandards(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_getConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_enumerateManagedElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_getManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_POWERSUPPLYCONFORMSTOPROFILE_H_*/ ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyConformsToProfile/cmpiOpenDRIM_PowerSupplyConformsToProfile.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyConformsToProfile/cmpiOpenDRIM_PowerSupplyCon0000644000175000017500000000447611401064722034666 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef CMPIOPENDRIM_POWERSUPPLYCONFORMSTOPROFILE_H_ #define CMPIOPENDRIM_POWERSUPPLYCONFORMSTOPROFILE_H_ #include "OpenDRIM_PowerSupplyConformsToProfile.h" CMPIObjectPath* PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PowerSupplyConformsToProfile& instance); CMPIInstance* PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PowerSupplyConformsToProfile& instance); void PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PowerSupplyConformsToProfile& instance); void PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PowerSupplyConformsToProfile& instance); #endif /*CMPIOPENDRIM_POWERSUPPLYCONFORMSTOPROFILE_H_*/ ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyConformsToProfile/cmpiOpenDRIM_PowerSupplyConformsToProfile.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyConformsToProfile/cmpiOpenDRIM_PowerSupplyCon0000644000175000017500000000641111401064722034655 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_PowerSupplyConformsToProfile.h" CMPIObjectPath* PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_PowerSupplyConformsToProfile& instance) { _E_; Objectpath op(broker, OpenDRIM_PowerSupplyConformsToProfile_classnames[0], OpenDRIM_PowerSupplyConformsToProfile_NAMESPACE); if (!instance.ConformantStandard_isNULL) op.addKey("ConformantStandard", instance.ConformantStandard); if (!instance.ManagedElement_isNULL) op.addKey("ManagedElement", instance.ManagedElement); _L_; return op.getHdl(); } CMPIInstance* PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_PowerSupplyConformsToProfile& instance) { _E_; Objectpath op(broker, PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_PowerSupplyConformsToProfile& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("ConformantStandard", instance.ConformantStandard) == OK) instance.ConformantStandard_isNULL = false; if (op.getKey("ManagedElement", instance.ManagedElement) == OK) instance.ManagedElement_isNULL = false; _L_; } void PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_PowerSupplyConformsToProfile& instance) { _E_; Instance inst(broker, (CMPIInstance*) ci); if (inst.getProperty("ConformantStandard", instance.ConformantStandard) == OK) instance.ConformantStandard_isNULL = false; if (inst.getProperty("ManagedElement", instance.ManagedElement) == OK) instance.ManagedElement_isNULL = false; _L_; } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyConformsToProfile/OpenDRIM_PowerSupplyConformsToProfileAccess.hopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyConformsToProfile/OpenDRIM_PowerSupplyConform0000644000175000017500000001122411401064722034666 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #ifndef OPENDRIM_POWERSUPPLYCONFORMSTOPROFILEACCESS_H_ #define OPENDRIM_POWERSUPPLYCONFORMSTOPROFILEACCESS_H_ #include "PowerSupply_Common.h" #include "OpenDRIM_PowerSupplyConformsToProfile.h" #include "assocOpenDRIM_PowerSupplyConformsToProfile.h" int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_load(const CMPIBroker* broker, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_unload(string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_PowerSupplyConformsToProfile& instance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupplyConformsToProfile& newInstance, const OpenDRIM_PowerSupplyConformsToProfile& oldInstance, const char** properties, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupplyConformsToProfile& instance, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupplyConformsToProfile& instance, string& errorMessage); int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_associatorConformantStandardToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ConformantStandard_instance, const char** properties, vector& ManagedElement_associatedInstances, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_associatorManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const char** properties, vector& ConformantStandard_associatedInstances, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_referenceConformantStandardToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ConformantStandard_instance, const vector& ManagedElement_instances, vector& OpenDRIM_PowerSupplyConformsToProfile_instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_referenceManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& ConformantStandard_instances, vector& OpenDRIM_PowerSupplyConformsToProfile_instances, const char** properties, string& errorMessage, const string& discriminant); int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_populate(OpenDRIM_PowerSupplyConformsToProfile& instance, string& errorMessage); #endif /*OPENDRIM_POWERSUPPLYCONFORMSTOPROFILEACCESS_H_*/ ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyConformsToProfile/assocOpenDRIM_PowerSupplyConformsToProfile.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyConformsToProfile/assocOpenDRIM_PowerSupplyCo0000644000175000017500000002166211401064722034664 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "assocOpenDRIM_PowerSupplyConformsToProfile.h" int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_associatorFilter(const CMPIBroker* broker, const CMPIContext* ctx, const CMPIObjectPath* cop, Instance& knownInstance, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, bool& leftToRight, string& errorMessage) { _E_; string _assocClass, _resultClass, _resultRole, _role; assocClass == NULL ? _assocClass = "null" : _assocClass = assocClass; resultClass == NULL ? _resultClass = "null" : _resultClass = resultClass; resultRole == NULL ? _resultRole = "null" : _resultRole = resultRole; role == NULL ? _role = "null" : _role = role; for (unsigned int i=0; i& associatedInstances, bool& leftToRight, string& errorMessage, const string& dicriminant) { _E_; int errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_associatorFilter(broker, ctx, cop, knownInstance, assocClass, resultClass, role, resultRole, leftToRight, errorMessage); if (errorCode == -1) return OK; if (errorCode != OK) return errorCode; if (leftToRight) { if (role != NULL && strcasecmp(role, "ConformantStandard") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "ManagedElement") != 0) return OK; CF_assert(PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_associatorConformantStandardToManagedElement(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } else { if (role != NULL && strcasecmp(role, "ManagedElement") != 0) return OK; if (resultRole != NULL && strcasecmp(resultRole, "ConformantStandard") != 0) return OK; CF_assert(PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_associatorManagedElementToConformantStandard(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_enumerateConformantStandards(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, ConformantStandard_NAMESPACE, ConformantStandard_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(PowerSupply_CIM_RegisteredProfile_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PowerSupply_CIM_RegisteredProfile_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PowerSupply_CIM_RegisteredProfile_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_getConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), ConformantStandard_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), ConformantStandard_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_RegisteredProfile _instance; PowerSupply_CIM_RegisteredProfile_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PowerSupply_CIM_RegisteredProfile_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PowerSupply_CIM_RegisteredProfile_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_enumerateManagedElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage) { _E_; /* * CMPI broker version */ if (onlyNames) { vector objectpaths; CF_assert(CB_enumerateInstanceNames(broker, ctx, ManagedElement_NAMESPACE, ManagedElement_classnames[0], objectpaths, errorMessage)); for (size_t i=0; i _instances; if (onlyNames) { CF_assert(PowerSupply_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(PowerSupply_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, PowerSupply_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_getManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage) { _E_; if (!CF_strCmpNoCase(objectpath.getClassname(), ManagedElement_classnames[0])) return INVALID_CLASS; //if (!CF_strCmpNoCase(objectpath.getNamespace(), ManagedElement_NAMESPACE)) // return INVALID_NAMESPACE; /* * CMPI broker version */ CF_assert(CB_getInstance(broker, ctx, objectpath, properties, instance, errorMessage)); /* * Direct Invocation version */ /* CIM_ManagedElement _instance; PowerSupply_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(PowerSupply_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, PowerSupply_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyConformsToProfile/OpenDRIM_PowerSupplyConformsToProfileProvider.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyConformsToProfile/OpenDRIM_PowerSupplyConform0000644000175000017500000004407111401064722034674 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "cmpiOpenDRIM_PowerSupplyConformsToProfile.h" #include "OpenDRIM_PowerSupplyConformsToProfileAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define PowerSupply_OpenDRIM_PowerSupplyConformsToProfileProviderSetInstance PowerSupply_OpenDRIM_PowerSupplyConformsToProfileProviderModifyInstance #endif int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_init(const CMPIBroker* broker); int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PowerSupply_OpenDRIM_PowerSupplyConformsToProfileProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyConformsToProfileProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyConformsToProfileProviderEnumInstances(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyConformsToProfileProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PowerSupplyConformsToProfile instance; PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyConformsToProfileProviderSetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PowerSupplyConformsToProfile newInstance, oldInstance; PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_toCPP(_broker, ci, newInstance); PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyConformsToProfileProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PowerSupplyConformsToProfile instance; PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_toCPP(_broker, ci, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_PowerSupplyConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyConformsToProfileProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_PowerSupplyConformsToProfile instance; PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyConformsToProfileProviderExecQuery(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref, const char* lang, const char* query) { _E_; CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } /* ---------------------------------------------------------------------------*/ /* End of Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Association Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus PowerSupply_OpenDRIM_PowerSupplyConformsToProfileProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyConformsToProfileProviderAssociatorNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnObjectPath(rslt, associatedInstances[i].getObjectpath().getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyConformsToProfileProviderAssociators(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associatedInstances.size(); i++) CMReturnInstance(rslt, associatedInstances[i].getHdl()); CMReturnDone(rslt); _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyConformsToProfileProviderReferenceNames(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_referenceConformantStandardToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_referenceManagedElementToConformantStandard(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus PowerSupply_OpenDRIM_PowerSupplyConformsToProfileProviderReferences(CMPIAssociationMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char* assocClass, const char* role, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; string errorMessage; bool leftToRight; vector associatedInstances; Instance known; int errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_referenceConformantStandardToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_referenceManagedElementToConformantStandard(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_PowerSupplyConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_init FAILED: " + (string) OpenDRIM_PowerSupplyConformsToProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_unload(errorMessage); if (errorCode != OK) { errorMessage += "PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_unload FAILED: " + (string) OpenDRIM_PowerSupplyConformsToProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_INIT if (PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_init(_broker) < 0) return NULL CMInstanceMIStub(PowerSupply_OpenDRIM_PowerSupplyConformsToProfileProvider, PowerSupply_OpenDRIM_PowerSupplyConformsToProfileProvider, _broker, PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_INIT); CMAssociationMIStub(PowerSupply_OpenDRIM_PowerSupplyConformsToProfileProvider, PowerSupply_OpenDRIM_PowerSupplyConformsToProfileProvider, _broker, PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyConformsToProfile/OpenDRIM_PowerSupplyConformsToProfileAccess.cppopendrim-lmp-powersupply-1.0.0~ppa/OpenDRIM_PowerSupplyConformsToProfile/OpenDRIM_PowerSupplyConform0000644000175000017500000002616011401064722034673 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Power Supply provider package # Copyright (C) 2009 Shakhrom RUSTAMOV, TUIT # # This program is being developed under the "OpenDRIM" project. # The "OpenDRIM" project web page: http://opendrim.sourceforge.net # The "OpenDRIM" project mailing list: opendrim@googlegroups.com # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ################################################################################# ################################################################################# # To contributors, please leave your contact information in this section # AND comment your changes in the source code. # # Modified by , , ###############################################################################*/ #include "OpenDRIM_PowerSupplyConformsToProfileAccess.h" int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PowerSupply_CIM_RegisteredProfile_load(broker, errorMessage)); CF_assert(PowerSupply_CIM_ManagedElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(PowerSupply_CIM_RegisteredProfile_unload(errorMessage)); CF_assert(PowerSupply_CIM_ManagedElement_unload(errorMessage)); */ // TODO _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_isAssociated(const Instance& ConformantStandard, const Instance& ManagedElement, bool& isAssociated, string& errorMessage) { _E_; // TODO Determine if the association can be established or not isAssociated=true; _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector subjects; // Only get the instance names CF_assert(PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_enumerateConformantStandards(broker, ctx, subjects, NULL, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_enumerateConformantStandards(broker, ctx, subjects, NULL, false, errorMessage)); vector::iterator c = subjects.begin(); vector::iterator end = subjects.end(); for (; c != end; ++c) { bool leftToRight = true; vector associatedInstances; PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_associator(broker, ctx, (*c).getObjectpath().getHdl(), (*c), ConformantStandard_classnames[0], ManagedElement_classnames[0], ConformantStandard_role.c_str(), ManagedElement_role.c_str(), NULL, associatedInstances, leftToRight, errorMessage, "an"); string ref_discriminant = discriminant == "ein" ? "rn" : "r"; CF_assert(PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_referenceConformantStandardToManagedElement(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_PowerSupplyConformsToProfile& instance, const char** properties, string& errorMessage) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ Objectpath ConformantStandard_objectpath; instance.getConformantStandard(ConformantStandard_objectpath); Instance ConformantStandard_instance; CF_assert(PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_getConformantStandard(broker, ctx, ConformantStandard_objectpath, ConformantStandard_instance, NULL, errorMessage)); Objectpath ManagedElement_objectpath; instance.getManagedElement(ManagedElement_objectpath); Instance ManagedElement_instance; CF_assert(PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_getManagedElement(broker, ctx, ManagedElement_objectpath, ManagedElement_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_isAssociated(ConformantStandard_instance, ManagedElement_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupplyConformsToProfile& newInstance, const OpenDRIM_PowerSupplyConformsToProfile& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupplyConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_PowerSupplyConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_associatorConformantStandardToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ConformantStandard_instance, const char** properties, vector& ManagedElement_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector ManagedElement_instances; if (discriminant=="a") CF_assert(PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); } for (size_t i=0; i& ConformantStandard_associatedInstances, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ vector ConformantStandard_instances; if (discriminant=="a") CF_assert(PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_enumerateConformantStandards(broker, ctx, ConformantStandard_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_enumerateConformantStandards(broker, ctx, ConformantStandard_instances, properties, true, errorMessage)); // OR get the full instances IF we need the content of the instance to evaluate the association condition OR to set the reference properties // CF_assert(PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_enumerateConformantStandards(broker, ctx, ConformantStandard_instances, properties, false, errorMessage)); } for (size_t i=0; i& ManagedElement_instances, vector& OpenDRIM_PowerSupplyConformsToProfile_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < ManagedElement_instances.size(); i++) { OpenDRIM_PowerSupplyConformsToProfile instance; instance.setConformantStandard(((Instance) ConformantStandard_instance).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instances[i]).getObjectpath()); OpenDRIM_PowerSupplyConformsToProfile_instances.push_back(instance); } _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_referenceManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& ConformantStandard_instances, vector& OpenDRIM_PowerSupplyConformsToProfile_instances, const char** properties, string& errorMessage, const string& discriminant) { _E_; /* * The following code has been generated for your convenience. * Feel free to modify/delete. */ for (size_t i=0; i < ConformantStandard_instances.size(); i++) { OpenDRIM_PowerSupplyConformsToProfile instance; instance.setConformantStandard(((Instance) ConformantStandard_instances[i]).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instance).getObjectpath()); OpenDRIM_PowerSupplyConformsToProfile_instances.push_back(instance); } _L_; return OK; } int PowerSupply_OpenDRIM_PowerSupplyConformsToProfile_populate(OpenDRIM_PowerSupplyConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-powersupply-1.0.0~ppa/README0000644000175000017500000000103311401064722021025 0ustar guillaumeguillaume--------------------------------------------------------- REQUIREMENTS --------------------------------------------------------- For compliling: * gcc >= 3.2.0 * cmpi header files >= ver 86 * autoconf >= 2.57 * automake >= 1.5 * libtool (preferably >= 1.8.5) * OpenDRIM Common Library >= 1.1.1 For running: * OpenPegasus >= 2.5.2 OR SBLIM sfcb >= 1.2.0 OR OpenWBEM >= 3.2.2 * Interop package (for sfcb and OpenPegasus only) * In the case of pegasus installed from sources, the PEGASUS_HOME and PEGASUS_ROOT variable MUST be defined!