opendrim-lmp-battery-1.0.0~ppa/0000755000175000017500000000000011401067215017211 5ustar guillaumeguillaumeopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_EnabledBatteryCapabilities/0000755000175000017500000000000011401067215026045 5ustar guillaumeguillaume././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_EnabledBatteryCapabilities/OpenDRIM_EnabledBatteryCapabilitiesAccess.hopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_EnabledBatteryCapabilities/OpenDRIM_EnabledBatteryCapabiliti0000644000175000017500000000667611401067215034313 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_ENABLEDBATTERYCAPABILITIESACCESS_H_ #define OPENDRIM_ENABLEDBATTERYCAPABILITIESACCESS_H_ #include "Battery_Common.h" #include "OpenDRIM_EnabledBatteryCapabilities.h" int Battery_OpenDRIM_EnabledBatteryCapabilities_load(const CMPIBroker* broker, string& errorMessage); int Battery_OpenDRIM_EnabledBatteryCapabilities_unload(string& errorMessage); int Battery_OpenDRIM_EnabledBatteryCapabilities_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int Battery_OpenDRIM_EnabledBatteryCapabilities_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_EnabledBatteryCapabilities& instance, const char** properties, string& errorMessage); int Battery_OpenDRIM_EnabledBatteryCapabilities_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledBatteryCapabilities& newInstance, const OpenDRIM_EnabledBatteryCapabilities& oldInstance, const char** properties, string& errorMessage); int Battery_OpenDRIM_EnabledBatteryCapabilities_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledBatteryCapabilities& instance, string& errorMessage); int Battery_OpenDRIM_EnabledBatteryCapabilities_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledBatteryCapabilities& instance, string& errorMessage); int Battery_OpenDRIM_EnabledBatteryCapabilities_CreateGoalSettings(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledBatteryCapabilities& instance, unsigned short& returnValue, const OpenDRIM_EnabledBatteryCapabilities_CreateGoalSettings_In& in, OpenDRIM_EnabledBatteryCapabilities_CreateGoalSettings_Out& out, string& errorMessage); int Battery_OpenDRIM_EnabledBatteryCapabilities_populate(OpenDRIM_EnabledBatteryCapabilities& instance, string& errorMessage); #endif /*OPENDRIM_ENABLEDBATTERYCAPABILITIESACCESS_H_*/ opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_EnabledBatteryCapabilities/Makefile.am0000644000175000017500000000417211401067215030105 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiBattery_OpenDRIM_EnabledBatteryCapabilitiesProvider.la libcmpiBattery_OpenDRIM_EnabledBatteryCapabilitiesProvider_la_SOURCES = OpenDRIM_EnabledBatteryCapabilitiesAccess.cpp OpenDRIM_EnabledBatteryCapabilitiesProvider.cpp cmpiOpenDRIM_EnabledBatteryCapabilities.cpp libcmpiBattery_OpenDRIM_EnabledBatteryCapabilitiesProvider_la_LIBADD = ../Common/libcmpiBattery_Common.la libcmpiBattery_OpenDRIM_EnabledBatteryCapabilitiesProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_EnabledBatteryCapabilities.h OpenDRIM_EnabledBatteryCapabilities.h OpenDRIM_EnabledBatteryCapabilitiesAccess.h ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_EnabledBatteryCapabilities/cmpiOpenDRIM_EnabledBatteryCapabilities.cppopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_EnabledBatteryCapabilities/cmpiOpenDRIM_EnabledBatteryCapabi0000644000175000017500000001332611401067215034270 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_EnabledBatteryCapabilities.h" CMPIObjectPath* Battery_OpenDRIM_EnabledBatteryCapabilities_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_EnabledBatteryCapabilities& instance) { _E_; Objectpath op(broker, OpenDRIM_EnabledBatteryCapabilities_classnames[0], OpenDRIM_EnabledBatteryCapabilities_NAMESPACE); if (!instance.InstanceID_isNULL) op.addKey("InstanceID", instance.InstanceID); _L_; return op.getHdl(); } CMPIInstance* Battery_OpenDRIM_EnabledBatteryCapabilities_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_EnabledBatteryCapabilities& instance) { _E_; Objectpath op(broker, Battery_OpenDRIM_EnabledBatteryCapabilities_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); if (!instance.StateAwareness_isNULL) ci.setProperty("StateAwareness", instance.StateAwareness); _L_; return ci.getHdl(); } void Battery_OpenDRIM_EnabledBatteryCapabilities_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_EnabledBatteryCapabilities& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; _L_; } void Battery_OpenDRIM_EnabledBatteryCapabilities_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_EnabledBatteryCapabilities& 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; if (inst.getProperty("StateAwareness", instance.StateAwareness) == OK) instance.StateAwareness_isNULL = false; _L_; } void Battery_OpenDRIM_EnabledBatteryCapabilities_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_EnabledBatteryCapabilities_CreateGoalSettings_In& args) { _E_; CMPIStatus rc; CMPIData data; vector TemplateGoalSettings; data = in->ft->getArg(in, "TemplateGoalSettings", &rc); if (rc.rc == OK) { CT_ToC(data, TemplateGoalSettings); args.setTemplateGoalSettings(TemplateGoalSettings); } vector SupportedGoalSettings; data = in->ft->getArg(in, "SupportedGoalSettings", &rc); if (rc.rc == OK) { CT_ToC(data, SupportedGoalSettings); args.setSupportedGoalSettings(SupportedGoalSettings); } _L_; } void Battery_OpenDRIM_EnabledBatteryCapabilities_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_EnabledBatteryCapabilities_CreateGoalSettings_Out& args) { _E_; CMPIValue value; int errorMessage; vector SupportedGoalSettings; errorMessage = args.getSupportedGoalSettings(SupportedGoalSettings); if (errorMessage == OK) { value = CT_toCMPI(broker, SupportedGoalSettings); out->ft->addArg(out, "SupportedGoalSettings", &value, CMPI_stringA); } _L_; } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_EnabledBatteryCapabilities/OpenDRIM_EnabledBatteryCapabilitiesAccess.cppopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_EnabledBatteryCapabilities/OpenDRIM_EnabledBatteryCapabiliti0000644000175000017500000000712411401067215034300 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_EnabledBatteryCapabilitiesAccess.h" int Battery_OpenDRIM_EnabledBatteryCapabilities_load(const CMPIBroker* broker, string& errorMessage) { _E_; // TODO _L_; return OK; } int Battery_OpenDRIM_EnabledBatteryCapabilities_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int Battery_OpenDRIM_EnabledBatteryCapabilities_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; _L_; return OK; } int Battery_OpenDRIM_EnabledBatteryCapabilities_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_EnabledBatteryCapabilities& instance, const char** properties, string& errorMessage) { _E_; _L_; return OK; } int Battery_OpenDRIM_EnabledBatteryCapabilities_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledBatteryCapabilities& newInstance, const OpenDRIM_EnabledBatteryCapabilities& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_EnabledBatteryCapabilities_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledBatteryCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_EnabledBatteryCapabilities_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledBatteryCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_EnabledBatteryCapabilities_CreateGoalSettings(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_EnabledBatteryCapabilities& instance, unsigned short& returnValue, const OpenDRIM_EnabledBatteryCapabilities_CreateGoalSettings_In& in, OpenDRIM_EnabledBatteryCapabilities_CreateGoalSettings_Out& out, string& errorMessage) { _E_; // TODO _L_; return OK; } int Battery_OpenDRIM_EnabledBatteryCapabilities_populate(OpenDRIM_EnabledBatteryCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_EnabledBatteryCapabilities/OpenDRIM_EnabledBatteryCapabilitiesProvider.cppopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_EnabledBatteryCapabilities/OpenDRIM_EnabledBatteryCapabiliti0000644000175000017500000003435511401067215034306 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_EnabledBatteryCapabilities.h" #include "OpenDRIM_EnabledBatteryCapabilitiesAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define Battery_OpenDRIM_EnabledBatteryCapabilitiesProviderSetInstance Battery_OpenDRIM_EnabledBatteryCapabilitiesProviderModifyInstance #endif int Battery_OpenDRIM_EnabledBatteryCapabilities_init(const CMPIBroker* broker); int Battery_OpenDRIM_EnabledBatteryCapabilities_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus Battery_OpenDRIM_EnabledBatteryCapabilitiesProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Battery_OpenDRIM_EnabledBatteryCapabilities_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Battery_OpenDRIM_EnabledBatteryCapabilitiesProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = Battery_OpenDRIM_EnabledBatteryCapabilities_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledBatteryCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = Battery_OpenDRIM_EnabledBatteryCapabilities_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_EnabledBatteryCapabilitiesProviderEnumInstances(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 = Battery_OpenDRIM_EnabledBatteryCapabilities_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledBatteryCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = Battery_OpenDRIM_EnabledBatteryCapabilities_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_EnabledBatteryCapabilitiesProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_EnabledBatteryCapabilities instance; Battery_OpenDRIM_EnabledBatteryCapabilities_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Battery_OpenDRIM_EnabledBatteryCapabilities_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledBatteryCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = Battery_OpenDRIM_EnabledBatteryCapabilities_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_EnabledBatteryCapabilitiesProviderSetInstance(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_EnabledBatteryCapabilities newInstance, oldInstance; Battery_OpenDRIM_EnabledBatteryCapabilities_toCPP(_broker, ci, newInstance); Battery_OpenDRIM_EnabledBatteryCapabilities_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = Battery_OpenDRIM_EnabledBatteryCapabilities_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledBatteryCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_EnabledBatteryCapabilities_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledBatteryCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_EnabledBatteryCapabilitiesProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_EnabledBatteryCapabilities instance; Battery_OpenDRIM_EnabledBatteryCapabilities_toCPP(_broker, ci, instance); string errorMessage; int errorCode = Battery_OpenDRIM_EnabledBatteryCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_EnabledBatteryCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_EnabledBatteryCapabilities_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledBatteryCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_EnabledBatteryCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledBatteryCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = Battery_OpenDRIM_EnabledBatteryCapabilities_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_EnabledBatteryCapabilitiesProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_EnabledBatteryCapabilities instance; Battery_OpenDRIM_EnabledBatteryCapabilities_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Battery_OpenDRIM_EnabledBatteryCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledBatteryCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_EnabledBatteryCapabilities_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledBatteryCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_EnabledBatteryCapabilitiesProviderExecQuery(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 Battery_OpenDRIM_EnabledBatteryCapabilitiesProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = Battery_OpenDRIM_EnabledBatteryCapabilities_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Battery_OpenDRIM_EnabledBatteryCapabilitiesProviderInvokeMethod(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_EnabledBatteryCapabilities instance; Battery_OpenDRIM_EnabledBatteryCapabilities_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"InstanceID"}; int errorCode = Battery_OpenDRIM_EnabledBatteryCapabilities_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledBatteryCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="CreateGoalSettings") { unsigned short returnValue; OpenDRIM_EnabledBatteryCapabilities_CreateGoalSettings_In inArgs; Battery_OpenDRIM_EnabledBatteryCapabilities_toCPP(_broker, in, inArgs); OpenDRIM_EnabledBatteryCapabilities_CreateGoalSettings_Out outArgs; errorCode = Battery_OpenDRIM_EnabledBatteryCapabilities_CreateGoalSettings(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_EnabledBatteryCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } Battery_OpenDRIM_EnabledBatteryCapabilities_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint16, CMPI_uint16); } else { errorMessage = (string) OpenDRIM_EnabledBatteryCapabilities_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 Battery_OpenDRIM_EnabledBatteryCapabilities_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = Battery_OpenDRIM_EnabledBatteryCapabilities_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "Battery_OpenDRIM_EnabledBatteryCapabilities_init FAILED: " + (string) OpenDRIM_EnabledBatteryCapabilities_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int Battery_OpenDRIM_EnabledBatteryCapabilities_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = Battery_OpenDRIM_EnabledBatteryCapabilities_unload(errorMessage); if (errorCode != OK) { errorMessage += "Battery_OpenDRIM_EnabledBatteryCapabilities_unload FAILED: " + (string) OpenDRIM_EnabledBatteryCapabilities_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define Battery_OpenDRIM_EnabledBatteryCapabilities_INIT if (Battery_OpenDRIM_EnabledBatteryCapabilities_init(_broker) < 0) return NULL CMInstanceMIStub(Battery_OpenDRIM_EnabledBatteryCapabilitiesProvider, Battery_OpenDRIM_EnabledBatteryCapabilitiesProvider, _broker, Battery_OpenDRIM_EnabledBatteryCapabilities_INIT); CMMethodMIStub(Battery_OpenDRIM_EnabledBatteryCapabilitiesProvider, Battery_OpenDRIM_EnabledBatteryCapabilitiesProvider, _broker, Battery_OpenDRIM_EnabledBatteryCapabilities_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_EnabledBatteryCapabilities/OpenDRIM_EnabledBatteryCapabilities.hopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_EnabledBatteryCapabilities/OpenDRIM_EnabledBatteryCapabiliti0000644000175000017500000001622111401067215034276 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_ENABLEDBATTERYCAPABILITIES_H_ #define OPENDRIM_ENABLEDBATTERYCAPABILITIES_H_ #include const static char* OpenDRIM_EnabledBatteryCapabilities_classnames[] = {"OpenDRIM_EnabledBatteryCapabilities"}; static string OpenDRIM_EnabledBatteryCapabilities_NAMESPACE = _NAMESPACE; class OpenDRIM_EnabledBatteryCapabilities { 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; vector StateAwareness; bool StateAwareness_isNULL; OpenDRIM_EnabledBatteryCapabilities() { Caption_isNULL = true; Description_isNULL = true; InstanceID_isNULL = true; ElementName_isNULL = true; ElementNameEditSupported_isNULL = true; MaxElementNameLen_isNULL = true; RequestedStatesSupported_isNULL = true; ElementNameMask_isNULL = true; StateAwareness_isNULL = true; } ~OpenDRIM_EnabledBatteryCapabilities() {} 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; } int getStateAwareness(vector& value) const { if (StateAwareness_isNULL==true) return NOT_FOUND; value = StateAwareness; return OK; } int setStateAwareness(const vector& newValue) { StateAwareness = newValue; StateAwareness_isNULL = false; return OK; } }; class OpenDRIM_EnabledBatteryCapabilities_CreateGoalSettings_In { public: vector TemplateGoalSettings; bool TemplateGoalSettings_isNULL; vector SupportedGoalSettings; bool SupportedGoalSettings_isNULL; OpenDRIM_EnabledBatteryCapabilities_CreateGoalSettings_In() { TemplateGoalSettings_isNULL = true; SupportedGoalSettings_isNULL = true; } ~OpenDRIM_EnabledBatteryCapabilities_CreateGoalSettings_In() {} int getTemplateGoalSettings(vector& value) const { if (TemplateGoalSettings_isNULL == true) return NOT_FOUND; value = TemplateGoalSettings; return OK; } int setTemplateGoalSettings(const vector& newValue) { TemplateGoalSettings = newValue; TemplateGoalSettings_isNULL = false; return OK; } int getSupportedGoalSettings(vector& value) const { if (SupportedGoalSettings_isNULL == true) return NOT_FOUND; value = SupportedGoalSettings; return OK; } int setSupportedGoalSettings(const vector& newValue) { SupportedGoalSettings = newValue; SupportedGoalSettings_isNULL = false; return OK; } }; class OpenDRIM_EnabledBatteryCapabilities_CreateGoalSettings_Out { public: vector SupportedGoalSettings; bool SupportedGoalSettings_isNULL; OpenDRIM_EnabledBatteryCapabilities_CreateGoalSettings_Out() { SupportedGoalSettings_isNULL = true; } ~OpenDRIM_EnabledBatteryCapabilities_CreateGoalSettings_Out() {} int getSupportedGoalSettings(vector& value) const { if (SupportedGoalSettings_isNULL == true) return NOT_FOUND; value = SupportedGoalSettings; return OK; } int setSupportedGoalSettings(const vector& newValue) { SupportedGoalSettings = newValue; SupportedGoalSettings_isNULL = false; return OK; } }; #endif /*OPENDRIM_ENABLEDBATTERYCAPABILITIES_H_*/ ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_EnabledBatteryCapabilities/cmpiOpenDRIM_EnabledBatteryCapabilities.hopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_EnabledBatteryCapabilities/cmpiOpenDRIM_EnabledBatteryCapabi0000644000175000017500000000517511401067215034273 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_ENABLEDBATTERYCAPABILITIES_H_ #define CMPIOPENDRIM_ENABLEDBATTERYCAPABILITIES_H_ #include "OpenDRIM_EnabledBatteryCapabilities.h" CMPIObjectPath* Battery_OpenDRIM_EnabledBatteryCapabilities_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_EnabledBatteryCapabilities& instance); CMPIInstance* Battery_OpenDRIM_EnabledBatteryCapabilities_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_EnabledBatteryCapabilities& instance); void Battery_OpenDRIM_EnabledBatteryCapabilities_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_EnabledBatteryCapabilities& instance); void Battery_OpenDRIM_EnabledBatteryCapabilities_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_EnabledBatteryCapabilities& instance); void Battery_OpenDRIM_EnabledBatteryCapabilities_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_EnabledBatteryCapabilities_CreateGoalSettings_In& args); void Battery_OpenDRIM_EnabledBatteryCapabilities_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_EnabledBatteryCapabilities_CreateGoalSettings_Out& args); #endif /*CMPIOPENDRIM_ENABLEDBATTERYCAPABILITIES_H_*/ opendrim-lmp-battery-1.0.0~ppa/Makefile.am0000644000175000017500000000772611401067215021261 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### VENDOR = OpenDRIM VERSION = $(shell cat ./VERSION) APP_NAME = opendrim-lmp-battery RPM_PACKAGE_DIR = packaging PLATFORM = $(shell rpm --eval %_target_cpu) WORKING_DIR = $(shell pwd) SUBDIRS = Common OpenDRIM_RegisteredBatteryProfile OpenDRIM_ComputerSystemBattery OpenDRIM_Battery OpenDRIM_EnabledBatteryCapabilities OpenDRIM_BatteryCapabilities OpenDRIM_AssociatedBattery OpenDRIM_BatteryConformsToProfile test postinstall: registration/Battery.sh @CIMNAMESPACE@ $(VENDOR) @CIMSERVER@ @INTEROPNAMESPACE@ $(VERSION) . preuninstall: registration/Battery-remove.sh @CIMNAMESPACE@ @CIMSERVER@ @INTEROPNAMESPACE@ . test-OpenDRIM_RegisteredBatteryProfile: all make -C test test-OpenDRIM_RegisteredBatteryProfile test-OpenDRIM_ComputerSystemBattery: all make -C test test-OpenDRIM_ComputerSystemBattery test-OpenDRIM_BatteryCapabilities: all make -C test test-OpenDRIM_BatteryCapabilities test-OpenDRIM_Battery: all make -C test test-OpenDRIM_Battery test-OpenDRIM_AssociatedBattery: all make -C test test-OpenDRIM_AssociatedBattery test-OpenDRIM_BatteryConformsToProfile: all make -C test test-OpenDRIM_BatteryConformsToProfile test-OpenDRIM_EnabledBatteryCapabilities: all make -C test test-OpenDRIM_EnabledBatteryCapabilities 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-battery-1.0.0~ppa/registration/0000755000175000017500000000000011401067215021723 5ustar guillaumeguillaumeopendrim-lmp-battery-1.0.0~ppa/registration/OpenDRIM_BatteryConformsToProfile-remove.sh0000755000175000017500000001030711401067215032160 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### if test "$2" = pegasus then cimprovider -d -m Battery_OpenDRIM_BatteryConformsToProfileModule cimprovider -r -m Battery_OpenDRIM_BatteryConformsToProfileModule 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_BatteryConformsToProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE owmofc -u http://localhost/$3 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-battery-1.0.0~ppa/registration/OpenDRIM_ComputerSystemBattery.sh0000755000175000017500000000646511401067215030270 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_ComputerSystemBattery.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_ComputerSystemBattery provider module"; Name = "Battery_OpenDRIM_ComputerSystemBatteryModule"; Location = "cmpiBattery_OpenDRIM_ComputerSystemBatteryProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_ComputerSystemBattery provider"; Name = "Battery_OpenDRIM_ComputerSystemBatteryProvider"; ProviderModuleName = "Battery_OpenDRIM_ComputerSystemBatteryModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_ComputerSystemBattery provider capabilities"; ProviderModuleName = "Battery_OpenDRIM_ComputerSystemBatteryModule"; ProviderName = "Battery_OpenDRIM_ComputerSystemBatteryProvider"; ClassName = "OpenDRIM_ComputerSystemBattery"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"GroupComponent", "PartComponent"}; CapabilityID = "Battery_OpenDRIM_ComputerSystemBattery"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_ComputerSystemBattery.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-battery-1.0.0~ppa/registration/OpenDRIM_Battery.sh0000755000175000017500000001041711401067215025334 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_Battery.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_Battery provider module"; Name = "Battery_OpenDRIM_BatteryModule"; Location = "cmpiBattery_OpenDRIM_BatteryProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_Battery provider"; Name = "Battery_OpenDRIM_BatteryProvider"; ProviderModuleName = "Battery_OpenDRIM_BatteryModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_Battery provider capabilities"; ProviderModuleName = "Battery_OpenDRIM_BatteryModule"; ProviderName = "Battery_OpenDRIM_BatteryProvider"; ClassName = "OpenDRIM_Battery"; ProviderType = {2, 5}; Namespaces = {"$1"}; SupportedProperties = {"Caption", "Description", "ElementName", "InstallDate", "Name", "OperationalStatus", "StatusDescriptions", "Status", "HealthState", "PrimaryStatus", "DetailedStatus", "OperatingStatus", "CommunicationStatus", "EnabledState", "OtherEnabledState", "RequestedState", "EnabledDefault", "TimeOfLastStateChange", "AvailableRequestedStates", "TransitioningToState", "SystemCreationClassName", "SystemName", "CreationClassName", "DeviceID", "PowerManagementSupported", "PowerManagementCapabilities", "Availability", "StatusInfo", "LastErrorCode", "ErrorDescription", "ErrorCleared", "OtherIdentifyingInfo", "PowerOnHours", "TotalPowerOnHours", "IdentifyingDescriptions", "AdditionalAvailability", "MaxQuiesceTime", "LocationIndicator", "MaxPowerProduced", "MaxPowerProducedUnits", "MaxPowerConsumed", "MaxPowerConsumedUnits", "BatteryStatus", "TimeOnBattery", "EstimatedRunTime", "EstimatedChargeRemaining", "Chemistry", "DesignCapacity", "FullChargeCapacity", "DesignVoltage", "SmartBatteryVersion", "TimeToFullCharge", "ExpectedLife", "MaxRechargeTime", "RechargeCount", "MaxRechargeCount", "RemainingCapacity", "RemainingCapacityMaxError"}; SupportedMethods = {"RequestStateChange", "SetPowerState", "Reset", "EnableDevice", "OnlineDevice", "QuiesceDevice", "SaveProperties", "RestoreProperties"}; CapabilityID = "Battery_OpenDRIM_Battery"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_Battery.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-battery-1.0.0~ppa/registration/OpenDRIM_ComputerSystemBattery-remove.sh0000755000175000017500000000633311401067215031555 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### if test "$2" = pegasus then cimprovider -d -m Battery_OpenDRIM_ComputerSystemBatteryModule cimprovider -r -m Battery_OpenDRIM_ComputerSystemBatteryModule 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_ComputerSystemBattery.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-battery-1.0.0~ppa/registration/OpenDRIM_EnabledBatteryCapabilities.sh0000755000175000017500000000710011401067215031114 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_EnabledBatteryCapabilities.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_EnabledBatteryCapabilities provider module"; Name = "Battery_OpenDRIM_EnabledBatteryCapabilitiesModule"; Location = "cmpiBattery_OpenDRIM_EnabledBatteryCapabilitiesProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_EnabledBatteryCapabilities provider"; Name = "Battery_OpenDRIM_EnabledBatteryCapabilitiesProvider"; ProviderModuleName = "Battery_OpenDRIM_EnabledBatteryCapabilitiesModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_EnabledBatteryCapabilities provider capabilities"; ProviderModuleName = "Battery_OpenDRIM_EnabledBatteryCapabilitiesModule"; ProviderName = "Battery_OpenDRIM_EnabledBatteryCapabilitiesProvider"; ClassName = "OpenDRIM_EnabledBatteryCapabilities"; ProviderType = {2, 5}; Namespaces = {"$1"}; SupportedProperties = {"Caption", "Description", "InstanceID", "ElementName", "ElementNameEditSupported", "MaxElementNameLen", "RequestedStatesSupported", "ElementNameMask", "StateAwareness"}; SupportedMethods = {"CreateGoalSettings"}; CapabilityID = "Battery_OpenDRIM_EnabledBatteryCapabilities"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_EnabledBatteryCapabilities.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-battery-1.0.0~ppa/registration/OpenDRIM_BatteryConformsToProfile.sh0000755000175000017500000000705511401067215030673 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_BatteryConformsToProfile.mof cimmof -aE -n $4 $6/mof/OpenDRIM_BatteryConformsToProfile.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_BatteryConformsToProfile provider module"; Name = "Battery_OpenDRIM_BatteryConformsToProfileModule"; Location = "cmpiBattery_OpenDRIM_BatteryConformsToProfileProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_BatteryConformsToProfile provider"; Name = "Battery_OpenDRIM_BatteryConformsToProfileProvider"; ProviderModuleName = "Battery_OpenDRIM_BatteryConformsToProfileModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_BatteryConformsToProfile provider capabilities"; ProviderModuleName = "Battery_OpenDRIM_BatteryConformsToProfileModule"; ProviderName = "Battery_OpenDRIM_BatteryConformsToProfileProvider"; ClassName = "OpenDRIM_BatteryConformsToProfile"; ProviderType = {2, 3}; Namespaces = {"$1", "$4"}; SupportedProperties = {"ConformantStandard", "ManagedElement"}; CapabilityID = "Battery_OpenDRIM_BatteryConformsToProfile"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_BatteryConformsToProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE owmofc -u http://localhost/$4 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-battery-1.0.0~ppa/registration/OpenDRIM_BatteryCapabilities-remove.sh0000755000175000017500000000630711401067215031144 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### if test "$2" = pegasus then cimprovider -d -m Battery_OpenDRIM_BatteryCapabilitiesModule cimprovider -r -m Battery_OpenDRIM_BatteryCapabilitiesModule 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_BatteryCapabilities.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-battery-1.0.0~ppa/registration/OpenDRIM_AssociatedBattery-remove.sh0000755000175000017500000000626311401067215030633 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### if test "$2" = pegasus then cimprovider -d -m Battery_OpenDRIM_AssociatedBatteryModule cimprovider -r -m Battery_OpenDRIM_AssociatedBatteryModule 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_AssociatedBattery.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-battery-1.0.0~ppa/registration/OpenDRIM_EnabledBatteryCapabilities-remove.sh0000755000175000017500000000641011401067215032412 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### if test "$2" = pegasus then cimprovider -d -m Battery_OpenDRIM_EnabledBatteryCapabilitiesModule cimprovider -r -m Battery_OpenDRIM_EnabledBatteryCapabilitiesModule 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_EnabledBatteryCapabilities.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-battery-1.0.0~ppa/registration/OpenDRIM_RegisteredBatteryProfile.sh0000755000175000017500000000700111401067215030666 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### if test "$3" = pegasus then cimmof -aE -n $4 $6/mof/OpenDRIM_RegisteredBatteryProfile.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_RegisteredBatteryProfile provider module"; Name = "Battery_OpenDRIM_RegisteredBatteryProfileModule"; Location = "cmpiBattery_OpenDRIM_RegisteredBatteryProfileProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_RegisteredBatteryProfile provider"; Name = "Battery_OpenDRIM_RegisteredBatteryProfileProvider"; ProviderModuleName = "Battery_OpenDRIM_RegisteredBatteryProfileModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_RegisteredBatteryProfile provider capabilities"; ProviderModuleName = "Battery_OpenDRIM_RegisteredBatteryProfileModule"; ProviderName = "Battery_OpenDRIM_RegisteredBatteryProfileProvider"; ClassName = "OpenDRIM_RegisteredBatteryProfile"; ProviderType = {2}; Namespaces = {"$4"}; SupportedProperties = {"Caption", "Description", "ElementName", "InstanceID", "RegisteredOrganization", "OtherRegisteredOrganization", "RegisteredName", "RegisteredVersion", "AdvertiseTypes", "AdvertiseTypeDescriptions"}; CapabilityID = "Battery_OpenDRIM_RegisteredBatteryProfile"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_RegisteredBatteryProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$4 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-battery-1.0.0~ppa/registration/OpenDRIM_AssociatedBattery.sh0000755000175000017500000000634111401067215027335 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_AssociatedBattery.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_AssociatedBattery provider module"; Name = "Battery_OpenDRIM_AssociatedBatteryModule"; Location = "cmpiBattery_OpenDRIM_AssociatedBatteryProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_AssociatedBattery provider"; Name = "Battery_OpenDRIM_AssociatedBatteryProvider"; ProviderModuleName = "Battery_OpenDRIM_AssociatedBatteryModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_AssociatedBattery provider capabilities"; ProviderModuleName = "Battery_OpenDRIM_AssociatedBatteryModule"; ProviderName = "Battery_OpenDRIM_AssociatedBatteryProvider"; ClassName = "OpenDRIM_AssociatedBattery"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"Antecedent", "Dependent"}; CapabilityID = "Battery_OpenDRIM_AssociatedBattery"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_AssociatedBattery.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-battery-1.0.0~ppa/registration/OpenDRIM_Battery-remove.sh0000755000175000017500000000611211401067215026624 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### if test "$2" = pegasus then cimprovider -d -m Battery_OpenDRIM_BatteryModule cimprovider -r -m Battery_OpenDRIM_BatteryModule 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_Battery.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-battery-1.0.0~ppa/registration/Battery.sh0000755000175000017500000000451511401067215023701 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### 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_RegisteredBatteryProfile.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_ComputerSystemBattery.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_BatteryCapabilities.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_Battery.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_AssociatedBattery.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_BatteryConformsToProfile.sh $1 $2 $3 $4 $5 $6 $6/registration/OpenDRIM_EnabledBatteryCapabilities.sh $1 $2 $3 $4 $5 $6 if test "$3" = sfcb then /etc/init.d/sfcb start fi opendrim-lmp-battery-1.0.0~ppa/registration/Battery-remove.sh0000755000175000017500000000452511401067215025175 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### 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_EnabledBatteryCapabilities-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_BatteryConformsToProfile-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_AssociatedBattery-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_Battery-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_BatteryCapabilities-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_ComputerSystemBattery-remove.sh $1 $2 $3 $4 $4/registration/OpenDRIM_RegisteredBatteryProfile-remove.sh $1 $2 $3 $4 if test "$2" = sfcb then /etc/init.d/sfcb start fi opendrim-lmp-battery-1.0.0~ppa/registration/OpenDRIM_BatteryCapabilities.sh0000755000175000017500000000644111401067215027650 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### if test "$3" = pegasus then cimmof -aE -n $1 $6/mof/OpenDRIM_BatteryCapabilities.mof OUTFILE=./TEMP_REGISTRATION cat >> $OUTFILE << EOFC instance of PG_ProviderModule { Caption = "OpenDRIM_BatteryCapabilities provider module"; Name = "Battery_OpenDRIM_BatteryCapabilitiesModule"; Location = "cmpiBattery_OpenDRIM_BatteryCapabilitiesProvider"; Vendor = "$2"; Version = "$5"; InterfaceType = "CMPI"; InterfaceVersion = "2.0.0"; }; instance of PG_Provider { Caption = "OpenDRIM_BatteryCapabilities provider"; Name = "Battery_OpenDRIM_BatteryCapabilitiesProvider"; ProviderModuleName = "Battery_OpenDRIM_BatteryCapabilitiesModule"; }; instance of PG_ProviderCapabilities { Caption = "OpenDRIM_BatteryCapabilities provider capabilities"; ProviderModuleName = "Battery_OpenDRIM_BatteryCapabilitiesModule"; ProviderName = "Battery_OpenDRIM_BatteryCapabilitiesProvider"; ClassName = "OpenDRIM_BatteryCapabilities"; ProviderType = {2, 3}; Namespaces = {"$1"}; SupportedProperties = {"ManagedElement", "Capabilities", "Characteristics"}; CapabilityID = "Battery_OpenDRIM_BatteryCapabilities"; }; EOFC cimmof -n root/PG_InterOp $OUTFILE rm -f $OUTFILE fi if test "$3" = sfcb then OUTFILE=./OpenDRIM_BatteryCapabilities.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$1 $OUTFILE rm -f $OUTFILE fi opendrim-lmp-battery-1.0.0~ppa/registration/OpenDRIM_RegisteredBatteryProfile-remove.sh0000755000175000017500000000635511401067215032174 0ustar guillaumeguillaume#!/bin/bash ############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### if test "$2" = pegasus then cimprovider -d -m Battery_OpenDRIM_RegisteredBatteryProfileModule cimprovider -r -m Battery_OpenDRIM_RegisteredBatteryProfileModule 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_RegisteredBatteryProfile.reg cat >> $OUTFILE <> $OUTFILE owmofc -u http://localhost/$3 -r $OUTFILE rm -f $OUTFILE fi opendrim-lmp-battery-1.0.0~ppa/VERSION0000644000175000017500000000000611401067215020255 0ustar guillaumeguillaume1.0.0 opendrim-lmp-battery-1.0.0~ppa/test/0000755000175000017500000000000011401067215020170 5ustar guillaumeguillaumeopendrim-lmp-battery-1.0.0~ppa/test/testOpenDRIM_EnabledBatteryCapabilities.cpp0000644000175000017500000001234511401067215030435 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_EnabledBatteryCapabilities.h" #include "OpenDRIM_EnabledBatteryCapabilitiesAccess.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_EnabledBatteryCapabilities& instance) { os << " [OpenDRIM_EnabledBatteryCapabilities]" << 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); ToStringArrayInt("StateAwareness", StateAwareness, StateAwareness_isNULL); os << " [\\OpenDRIM_EnabledBatteryCapabilities]" << endl; return os; } int main() { string errorMessage; int errorCode = Battery_OpenDRIM_EnabledBatteryCapabilities_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = Battery_OpenDRIM_EnabledBatteryCapabilities_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 = Battery_OpenDRIM_EnabledBatteryCapabilities_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 = Battery_OpenDRIM_EnabledBatteryCapabilities_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 = Battery_OpenDRIM_EnabledBatteryCapabilities_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-battery-1.0.0~ppa/test/Makefile.am0000644000175000017500000001126311401067215022227 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### noinst_PROGRAMS = testOpenDRIM_RegisteredBatteryProfile testOpenDRIM_ComputerSystemBattery testOpenDRIM_BatteryCapabilities testOpenDRIM_Battery testOpenDRIM_AssociatedBattery testOpenDRIM_BatteryConformsToProfile testOpenDRIM_EnabledBatteryCapabilities testOpenDRIM_RegisteredBatteryProfile_CPPFLAGS = -I../OpenDRIM_RegisteredBatteryProfile/ testOpenDRIM_RegisteredBatteryProfile_SOURCES = testOpenDRIM_RegisteredBatteryProfile.cpp testOpenDRIM_RegisteredBatteryProfile_LDADD = ../OpenDRIM_RegisteredBatteryProfile/libcmpiBattery_OpenDRIM_RegisteredBatteryProfileProvider.la test-OpenDRIM_RegisteredBatteryProfile: testOpenDRIM_RegisteredBatteryProfile ./testOpenDRIM_RegisteredBatteryProfile testOpenDRIM_ComputerSystemBattery_CPPFLAGS = -I../OpenDRIM_ComputerSystemBattery/ testOpenDRIM_ComputerSystemBattery_SOURCES = testOpenDRIM_ComputerSystemBattery.cpp testOpenDRIM_ComputerSystemBattery_LDADD = ../OpenDRIM_ComputerSystemBattery/libcmpiBattery_OpenDRIM_ComputerSystemBatteryProvider.la test-OpenDRIM_ComputerSystemBattery: testOpenDRIM_ComputerSystemBattery ./testOpenDRIM_ComputerSystemBattery # May have to be adjusted for direct invocation testOpenDRIM_BatteryCapabilities_CPPFLAGS = -I../OpenDRIM_BatteryCapabilities/ -I../null/ -I../null/ testOpenDRIM_BatteryCapabilities_SOURCES = testOpenDRIM_BatteryCapabilities.cpp testOpenDRIM_BatteryCapabilities_LDADD = ../OpenDRIM_BatteryCapabilities/libcmpiBattery_OpenDRIM_BatteryCapabilitiesProvider.la test-OpenDRIM_BatteryCapabilities: testOpenDRIM_BatteryCapabilities ./testOpenDRIM_BatteryCapabilities testOpenDRIM_Battery_CPPFLAGS = -I../OpenDRIM_Battery/ testOpenDRIM_Battery_SOURCES = testOpenDRIM_Battery.cpp testOpenDRIM_Battery_LDADD = ../OpenDRIM_Battery/libcmpiBattery_OpenDRIM_BatteryProvider.la test-OpenDRIM_Battery: testOpenDRIM_Battery ./testOpenDRIM_Battery # May have to be adjusted for direct invocation testOpenDRIM_AssociatedBattery_CPPFLAGS = -I../OpenDRIM_AssociatedBattery/ -I../null/ -I../null/ testOpenDRIM_AssociatedBattery_SOURCES = testOpenDRIM_AssociatedBattery.cpp testOpenDRIM_AssociatedBattery_LDADD = ../OpenDRIM_AssociatedBattery/libcmpiBattery_OpenDRIM_AssociatedBatteryProvider.la test-OpenDRIM_AssociatedBattery: testOpenDRIM_AssociatedBattery ./testOpenDRIM_AssociatedBattery # May have to be adjusted for direct invocation testOpenDRIM_BatteryConformsToProfile_CPPFLAGS = -I../OpenDRIM_BatteryConformsToProfile/ -I../null/ -I../null/ testOpenDRIM_BatteryConformsToProfile_SOURCES = testOpenDRIM_BatteryConformsToProfile.cpp testOpenDRIM_BatteryConformsToProfile_LDADD = ../OpenDRIM_BatteryConformsToProfile/libcmpiBattery_OpenDRIM_BatteryConformsToProfileProvider.la test-OpenDRIM_BatteryConformsToProfile: testOpenDRIM_BatteryConformsToProfile ./testOpenDRIM_BatteryConformsToProfile testOpenDRIM_EnabledBatteryCapabilities_CPPFLAGS = -I../OpenDRIM_EnabledBatteryCapabilities/ testOpenDRIM_EnabledBatteryCapabilities_SOURCES = testOpenDRIM_EnabledBatteryCapabilities.cpp testOpenDRIM_EnabledBatteryCapabilities_LDADD = ../OpenDRIM_EnabledBatteryCapabilities/libcmpiBattery_OpenDRIM_EnabledBatteryCapabilitiesProvider.la test-OpenDRIM_EnabledBatteryCapabilities: testOpenDRIM_EnabledBatteryCapabilities ./testOpenDRIM_EnabledBatteryCapabilities opendrim-lmp-battery-1.0.0~ppa/test/testOpenDRIM_BatteryCapabilities.cpp0000644000175000017500000001133411401067215027157 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_BatteryCapabilities.h" #include "OpenDRIM_BatteryCapabilitiesAccess.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_BatteryCapabilities& instance) { os << " [OpenDRIM_BatteryCapabilities]" << endl; ToStringRef("ManagedElement", ManagedElement, ManagedElement_isNULL); ToStringRef("Capabilities", Capabilities, Capabilities_isNULL); ToStringArrayInt("Characteristics", Characteristics, Characteristics_isNULL); os << " [\\OpenDRIM_BatteryCapabilities]" << endl; return os; } int main() { string errorMessage; int errorCode = Battery_OpenDRIM_BatteryCapabilities_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = Battery_OpenDRIM_BatteryCapabilities_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 = Battery_OpenDRIM_BatteryCapabilities_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 = Battery_OpenDRIM_BatteryCapabilities_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 = Battery_OpenDRIM_BatteryCapabilities_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-battery-1.0.0~ppa/test/testOpenDRIM_AssociatedBattery.cpp0000644000175000017500000001114011401067215026640 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_AssociatedBattery.h" #include "OpenDRIM_AssociatedBatteryAccess.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_AssociatedBattery& instance) { os << " [OpenDRIM_AssociatedBattery]" << endl; ToStringRef("Antecedent", Antecedent, Antecedent_isNULL); ToStringRef("Dependent", Dependent, Dependent_isNULL); os << " [\\OpenDRIM_AssociatedBattery]" << endl; return os; } int main() { string errorMessage; int errorCode = Battery_OpenDRIM_AssociatedBattery_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = Battery_OpenDRIM_AssociatedBattery_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 = Battery_OpenDRIM_AssociatedBattery_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 = Battery_OpenDRIM_AssociatedBattery_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 = Battery_OpenDRIM_AssociatedBattery_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-battery-1.0.0~ppa/test/testOpenDRIM_BatteryConformsToProfile.cpp0000644000175000017500000001133311401067215030177 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_BatteryConformsToProfile.h" #include "OpenDRIM_BatteryConformsToProfileAccess.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_BatteryConformsToProfile& instance) { os << " [OpenDRIM_BatteryConformsToProfile]" << endl; ToStringRef("ConformantStandard", ConformantStandard, ConformantStandard_isNULL); ToStringRef("ManagedElement", ManagedElement, ManagedElement_isNULL); os << " [\\OpenDRIM_BatteryConformsToProfile]" << endl; return os; } int main() { string errorMessage; int errorCode = Battery_OpenDRIM_BatteryConformsToProfile_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = Battery_OpenDRIM_BatteryConformsToProfile_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 = Battery_OpenDRIM_BatteryConformsToProfile_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 = Battery_OpenDRIM_BatteryConformsToProfile_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 = Battery_OpenDRIM_BatteryConformsToProfile_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-battery-1.0.0~ppa/test/testOpenDRIM_Battery.cpp0000644000175000017500000002111511401067215024643 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_Battery.h" #include "OpenDRIM_BatteryAccess.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_Battery& instance) { os << " [OpenDRIM_Battery]" << endl; 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("PrimaryStatus", PrimaryStatus, PrimaryStatus_isNULL); ToStringInt("DetailedStatus", DetailedStatus, DetailedStatus_isNULL); ToStringInt("OperatingStatus", OperatingStatus, OperatingStatus_isNULL); ToStringInt("CommunicationStatus", CommunicationStatus, CommunicationStatus_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); ToStringInt("LocationIndicator", LocationIndicator, LocationIndicator_isNULL); ToString("MaxPowerProduced", MaxPowerProduced, MaxPowerProduced_isNULL); ToString("MaxPowerProducedUnits", MaxPowerProducedUnits, MaxPowerProducedUnits_isNULL); ToString("MaxPowerConsumed", MaxPowerConsumed, MaxPowerConsumed_isNULL); ToString("MaxPowerConsumedUnits", MaxPowerConsumedUnits, MaxPowerConsumedUnits_isNULL); ToStringInt("BatteryStatus", BatteryStatus, BatteryStatus_isNULL); ToString("TimeOnBattery", TimeOnBattery, TimeOnBattery_isNULL); ToString("EstimatedRunTime", EstimatedRunTime, EstimatedRunTime_isNULL); ToStringInt("EstimatedChargeRemaining", EstimatedChargeRemaining, EstimatedChargeRemaining_isNULL); ToStringInt("Chemistry", Chemistry, Chemistry_isNULL); ToString("DesignCapacity", DesignCapacity, DesignCapacity_isNULL); ToString("FullChargeCapacity", FullChargeCapacity, FullChargeCapacity_isNULL); ToString("DesignVoltage", DesignVoltage, DesignVoltage_isNULL); ToString("SmartBatteryVersion", SmartBatteryVersion, SmartBatteryVersion_isNULL); ToString("TimeToFullCharge", TimeToFullCharge, TimeToFullCharge_isNULL); ToString("ExpectedLife", ExpectedLife, ExpectedLife_isNULL); ToString("MaxRechargeTime", MaxRechargeTime, MaxRechargeTime_isNULL); ToString("RechargeCount", RechargeCount, RechargeCount_isNULL); ToString("MaxRechargeCount", MaxRechargeCount, MaxRechargeCount_isNULL); ToString("RemainingCapacity", RemainingCapacity, RemainingCapacity_isNULL); ToStringInt("RemainingCapacityMaxError", RemainingCapacityMaxError, RemainingCapacityMaxError_isNULL); os << " [\\OpenDRIM_Battery]" << endl; return os; } int main() { string errorMessage; int errorCode = Battery_OpenDRIM_Battery_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = Battery_OpenDRIM_Battery_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 = Battery_OpenDRIM_Battery_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 = Battery_OpenDRIM_Battery_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 = Battery_OpenDRIM_Battery_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-battery-1.0.0~ppa/test/testOpenDRIM_ComputerSystemBattery.cpp0000644000175000017500000001125011401067215027566 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ComputerSystemBattery.h" #include "OpenDRIM_ComputerSystemBatteryAccess.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_ComputerSystemBattery& instance) { os << " [OpenDRIM_ComputerSystemBattery]" << endl; ToStringRef("GroupComponent", GroupComponent, GroupComponent_isNULL); ToStringRef("PartComponent", PartComponent, PartComponent_isNULL); os << " [\\OpenDRIM_ComputerSystemBattery]" << endl; return os; } int main() { string errorMessage; int errorCode = Battery_OpenDRIM_ComputerSystemBattery_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = Battery_OpenDRIM_ComputerSystemBattery_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 = Battery_OpenDRIM_ComputerSystemBattery_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 = Battery_OpenDRIM_ComputerSystemBattery_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 = Battery_OpenDRIM_ComputerSystemBattery_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-battery-1.0.0~ppa/test/testOpenDRIM_RegisteredBatteryProfile.cpp0000644000175000017500000001245711401067215030213 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_RegisteredBatteryProfile.h" #include "OpenDRIM_RegisteredBatteryProfileAccess.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_RegisteredBatteryProfile& instance) { os << " [OpenDRIM_RegisteredBatteryProfile]" << 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_RegisteredBatteryProfile]" << endl; return os; } int main() { string errorMessage; int errorCode = Battery_OpenDRIM_RegisteredBatteryProfile_load(NULL, errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } cout << endl << "[enumInstances]" << endl; vector instances; errorCode = Battery_OpenDRIM_RegisteredBatteryProfile_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 = Battery_OpenDRIM_RegisteredBatteryProfile_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 = Battery_OpenDRIM_RegisteredBatteryProfile_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 = Battery_OpenDRIM_RegisteredBatteryProfile_unload(errorMessage); if (errorCode != OK) { cout << "ERROR " << errorCode << ": " << errorMessage << endl; return -1; } return 0; } opendrim-lmp-battery-1.0.0~ppa/acinclude.m40000644000175000017500000002104311401067215021402 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### AC_DEFUN([SHOW_COPYRIGHT], [ echo "################################################################################# # Linux Management Providers (LMP), Battery 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-battery-1.0.0~ppa/Common/0000755000175000017500000000000011401067215020441 5ustar guillaumeguillaumeopendrim-lmp-battery-1.0.0~ppa/Common/Makefile.am0000644000175000017500000000335711401067215022505 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### commonlibdir = @COMMONLIBDIR@ commonlib_LTLIBRARIES = libcmpiBattery_Common.la libcmpiBattery_Common_la_SOURCES = Battery_Common.cpp libcmpiBattery_Common_la_LDFLAGS = -avoid-version libcmpiBattery_Common_la_LIBADD = -lopendrim noinst_HEADERS = Battery_Common.h opendrim-lmp-battery-1.0.0~ppa/Common/Battery_Common.h0000644000175000017500000000311711401067215023536 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef BATTERY_COMMON_H_ #define BATTERY_COMMON_H_ #include #endif /*BATTERY_COMMON_H_*/ opendrim-lmp-battery-1.0.0~ppa/Common/Battery_Common.cpp0000644000175000017500000000300411401067215024064 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "Battery_Common.h" opendrim-lmp-battery-1.0.0~ppa/configure.ac0000644000175000017500000001242511401067215021503 0ustar guillaumeguillaume# Process this file with autoconf to produce a configure script. ############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### 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), Battery 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(Battery 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_RegisteredBatteryProfile/Makefile OpenDRIM_ComputerSystemBattery/Makefile OpenDRIM_BatteryCapabilities/Makefile OpenDRIM_Battery/Makefile OpenDRIM_AssociatedBattery/Makefile OpenDRIM_BatteryConformsToProfile/Makefile OpenDRIM_EnabledBatteryCapabilities/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-battery-1.0.0~ppa/TODO0000644000175000017500000000010111401067215017671 0ustar guillaumeguillaumeTODO for Major.Minor.Revision ========================= // TODO opendrim-lmp-battery-1.0.0~ppa/INSTALL0000644000175000017500000000370211401067215020244 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-battery-1.0.0~ppa/AUTHORS0000644000175000017500000000012711401067215020261 0ustar guillaumeguillaumeShakhrom RUSTAMOV Guillaume BOTTEX opendrim-lmp-battery-1.0.0~ppa/packaging/0000755000175000017500000000000011401067215021135 5ustar guillaumeguillaumeopendrim-lmp-battery-1.0.0~ppa/packaging/opendrim-lmp-battery.spec0000644000175000017500000000517411401067215026073 0ustar guillaumeguillaume#%///////////////////////////////////////////////////////////////////////////// # # Battery RPM spec file # #%///////////////////////////////////////////////////////////////////////////// %define packageVersion 1 Version: %{version} Release: %{packageVersion}%{?dist} Vendor: OpenDRIM Summary: OpenDRIM Battery Provider Name: opendrim-lmp-battery 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 Battery %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-battery-1.0.0~ppa/packaging/debian/0000755000175000017500000000000011404346074022365 5ustar guillaumeguillaumeopendrim-lmp-battery-1.0.0~ppa/packaging/debian/postrm0000644000175000017500000000257611404346044023643 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_RegisteredBatteryProfile rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_ComputerSystemBattery rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_BatteryCapabilities rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_Battery rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_AssociatedBattery rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_BatteryConformsToProfile rm -rf /var/lib/OpenDRIM/root/cimv2/OpenDRIM_EnabledBatteryCapabilities ;; 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-battery-1.0.0~ppa/packaging/debian/source/0000755000175000017500000000000011401067215023657 5ustar guillaumeguillaumeopendrim-lmp-battery-1.0.0~ppa/packaging/debian/source/format0000644000175000017500000000001411401067215025065 0ustar guillaumeguillaume3.0 (quilt) opendrim-lmp-battery-1.0.0~ppa/packaging/debian/copyright0000644000175000017500000000276111401067215024320 0ustar guillaumeguillaumeThis package was debianized by Guillaume BOTTEX on Wed, 4 Nov 2009 12:29:45 +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), Battery 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-battery-1.0.0~ppa/packaging/debian/control0000644000175000017500000000124511404346035023767 0ustar guillaumeguillaumeSource: opendrim-lmp-battery 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-battery Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, sfcb, libopendrim0 (>= 1.1.3) Description: OpenDRIM Battery provider Provides information about the computer system battery capabilities. . Compliant with the DMTF Battery Profile v1.0.0 (DSP1030). opendrim-lmp-battery-1.0.0~ppa/packaging/debian/prerm0000644000175000017500000000242111401067215023426 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-battery VERSION=`cat /usr/share/doc/opendrim-lmp-battery/VERSION` OPENDRIM_REG_DIR=/usr/share/OpenDRIM PROVIDER_SCRIPT_POST=Battery $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-battery-1.0.0~ppa/packaging/debian/changelog0000644000175000017500000000024511404346074024240 0ustar guillaumeguillaumeopendrim-lmp-battery (1.0.0-0ubuntu1) lucid; urgency=low * Initial release -- Guillaume BOTTEX Fri, 11 Jun 2010 14:40:00 +0900 opendrim-lmp-battery-1.0.0~ppa/packaging/debian/postinst0000644000175000017500000000257611401067215024177 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-battery VERSION=`cat /usr/share/doc/opendrim-lmp-battery/VERSION` OPENDRIM_REG_DIR=/usr/share/OpenDRIM PROVIDER_SCRIPT_POST=Battery $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-battery-1.0.0~ppa/packaging/debian/install0000644000175000017500000000004711401067215023751 0ustar guillaumeguillaumeusr/lib/cmpi/*.so usr/share/OpenDRIM/* opendrim-lmp-battery-1.0.0~ppa/packaging/debian/rules0000755000175000017500000000354711401067215023450 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-battery 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-battery.sgml > opendrim-lmp-battery.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-battery-1.0.0~ppa/packaging/debian/docs0000644000175000017500000000003111401067215023224 0ustar guillaumeguillaumeNEWS README TODO VERSION opendrim-lmp-battery-1.0.0~ppa/packaging/debian/compat0000644000175000017500000000000211401067215023555 0ustar guillaumeguillaume5 opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_RegisteredBatteryProfile/0000755000175000017500000000000011401067215025617 5ustar guillaumeguillaume././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_RegisteredBatteryProfile/OpenDRIM_RegisteredBatteryProfileAccess.hopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_RegisteredBatteryProfile/OpenDRIM_RegisteredBatteryProfileAc0000644000175000017500000000606311401067215034421 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_REGISTEREDBATTERYPROFILEACCESS_H_ #define OPENDRIM_REGISTEREDBATTERYPROFILEACCESS_H_ #include "Battery_Common.h" #include "OpenDRIM_RegisteredBatteryProfile.h" int Battery_OpenDRIM_RegisteredBatteryProfile_load(const CMPIBroker* broker, string& errorMessage); int Battery_OpenDRIM_RegisteredBatteryProfile_unload(string& errorMessage); int Battery_OpenDRIM_RegisteredBatteryProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int Battery_OpenDRIM_RegisteredBatteryProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_RegisteredBatteryProfile& instance, const char** properties, string& errorMessage); int Battery_OpenDRIM_RegisteredBatteryProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredBatteryProfile& newInstance, const OpenDRIM_RegisteredBatteryProfile& oldInstance, const char** properties, string& errorMessage); int Battery_OpenDRIM_RegisteredBatteryProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredBatteryProfile& instance, string& errorMessage); int Battery_OpenDRIM_RegisteredBatteryProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredBatteryProfile& instance, string& errorMessage); int Battery_OpenDRIM_RegisteredBatteryProfile_populate(OpenDRIM_RegisteredBatteryProfile& instance, string& errorMessage); #endif /*OPENDRIM_REGISTEREDBATTERYPROFILEACCESS_H_*/ ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_RegisteredBatteryProfile/OpenDRIM_RegisteredBatteryProfileProvider.cppopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_RegisteredBatteryProfile/OpenDRIM_RegisteredBatteryProfilePr0000644000175000017500000002637011401067215034462 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_RegisteredBatteryProfile.h" #include "OpenDRIM_RegisteredBatteryProfileAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define Battery_OpenDRIM_RegisteredBatteryProfileProviderSetInstance Battery_OpenDRIM_RegisteredBatteryProfileProviderModifyInstance #endif int Battery_OpenDRIM_RegisteredBatteryProfile_init(const CMPIBroker* broker); int Battery_OpenDRIM_RegisteredBatteryProfile_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus Battery_OpenDRIM_RegisteredBatteryProfileProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Battery_OpenDRIM_RegisteredBatteryProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Battery_OpenDRIM_RegisteredBatteryProfileProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = Battery_OpenDRIM_RegisteredBatteryProfile_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredBatteryProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = Battery_OpenDRIM_RegisteredBatteryProfile_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_RegisteredBatteryProfileProviderEnumInstances(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 = Battery_OpenDRIM_RegisteredBatteryProfile_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredBatteryProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = Battery_OpenDRIM_RegisteredBatteryProfile_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_RegisteredBatteryProfileProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredBatteryProfile instance; Battery_OpenDRIM_RegisteredBatteryProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Battery_OpenDRIM_RegisteredBatteryProfile_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredBatteryProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = Battery_OpenDRIM_RegisteredBatteryProfile_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_RegisteredBatteryProfileProviderSetInstance(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_RegisteredBatteryProfile newInstance, oldInstance; Battery_OpenDRIM_RegisteredBatteryProfile_toCPP(_broker, ci, newInstance); Battery_OpenDRIM_RegisteredBatteryProfile_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = Battery_OpenDRIM_RegisteredBatteryProfile_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredBatteryProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_RegisteredBatteryProfile_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredBatteryProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_RegisteredBatteryProfileProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredBatteryProfile instance; Battery_OpenDRIM_RegisteredBatteryProfile_toCPP(_broker, ci, instance); string errorMessage; int errorCode = Battery_OpenDRIM_RegisteredBatteryProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_RegisteredBatteryProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_RegisteredBatteryProfile_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredBatteryProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_RegisteredBatteryProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredBatteryProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = Battery_OpenDRIM_RegisteredBatteryProfile_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_RegisteredBatteryProfileProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_RegisteredBatteryProfile instance; Battery_OpenDRIM_RegisteredBatteryProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Battery_OpenDRIM_RegisteredBatteryProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredBatteryProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_RegisteredBatteryProfile_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_RegisteredBatteryProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_RegisteredBatteryProfileProviderExecQuery(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 Battery_OpenDRIM_RegisteredBatteryProfile_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = Battery_OpenDRIM_RegisteredBatteryProfile_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "Battery_OpenDRIM_RegisteredBatteryProfile_init FAILED: " + (string) OpenDRIM_RegisteredBatteryProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int Battery_OpenDRIM_RegisteredBatteryProfile_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = Battery_OpenDRIM_RegisteredBatteryProfile_unload(errorMessage); if (errorCode != OK) { errorMessage += "Battery_OpenDRIM_RegisteredBatteryProfile_unload FAILED: " + (string) OpenDRIM_RegisteredBatteryProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define Battery_OpenDRIM_RegisteredBatteryProfile_INIT if (Battery_OpenDRIM_RegisteredBatteryProfile_init(_broker) < 0) return NULL CMInstanceMIStub(Battery_OpenDRIM_RegisteredBatteryProfileProvider, Battery_OpenDRIM_RegisteredBatteryProfileProvider, _broker, Battery_OpenDRIM_RegisteredBatteryProfile_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_RegisteredBatteryProfile/Makefile.am0000644000175000017500000000414611401067215027660 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiBattery_OpenDRIM_RegisteredBatteryProfileProvider.la libcmpiBattery_OpenDRIM_RegisteredBatteryProfileProvider_la_SOURCES = OpenDRIM_RegisteredBatteryProfileAccess.cpp OpenDRIM_RegisteredBatteryProfileProvider.cpp cmpiOpenDRIM_RegisteredBatteryProfile.cpp libcmpiBattery_OpenDRIM_RegisteredBatteryProfileProvider_la_LIBADD = ../Common/libcmpiBattery_Common.la libcmpiBattery_OpenDRIM_RegisteredBatteryProfileProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_RegisteredBatteryProfile.h OpenDRIM_RegisteredBatteryProfile.h OpenDRIM_RegisteredBatteryProfileAccess.h ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_RegisteredBatteryProfile/cmpiOpenDRIM_RegisteredBatteryProfile.cppopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_RegisteredBatteryProfile/cmpiOpenDRIM_RegisteredBatteryProfi0000644000175000017500000001154311401067215034504 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_RegisteredBatteryProfile.h" CMPIObjectPath* Battery_OpenDRIM_RegisteredBatteryProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_RegisteredBatteryProfile& instance) { _E_; Objectpath op(broker, OpenDRIM_RegisteredBatteryProfile_classnames[0], OpenDRIM_RegisteredBatteryProfile_NAMESPACE); if (!instance.InstanceID_isNULL) op.addKey("InstanceID", instance.InstanceID); _L_; return op.getHdl(); } CMPIInstance* Battery_OpenDRIM_RegisteredBatteryProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_RegisteredBatteryProfile& instance) { _E_; Objectpath op(broker, Battery_OpenDRIM_RegisteredBatteryProfile_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 Battery_OpenDRIM_RegisteredBatteryProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_RegisteredBatteryProfile& instance) { _E_; Objectpath op(broker, (CMPIObjectPath*) ref); if (op.getKey("InstanceID", instance.InstanceID) == OK) instance.InstanceID_isNULL = false; _L_; } void Battery_OpenDRIM_RegisteredBatteryProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_RegisteredBatteryProfile& 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_; } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_RegisteredBatteryProfile/OpenDRIM_RegisteredBatteryProfileAccess.cppopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_RegisteredBatteryProfile/OpenDRIM_RegisteredBatteryProfileAc0000644000175000017500000000760011401067215034417 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_RegisteredBatteryProfileAccess.h" const string InstanceID="OpenDRIM:Battery:1.0.0"; int Battery_OpenDRIM_RegisteredBatteryProfile_load(const CMPIBroker* broker, string& errorMessage) { _E_; // TODO _L_; return OK; } int Battery_OpenDRIM_RegisteredBatteryProfile_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int Battery_OpenDRIM_RegisteredBatteryProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; OpenDRIM_RegisteredBatteryProfile instance; instance.setInstanceID(InstanceID); if(discriminant=="ei") CF_assert(Battery_OpenDRIM_RegisteredBatteryProfile_populate(instance,errorMessage)); result.push_back(instance); _L_; return OK; } int Battery_OpenDRIM_RegisteredBatteryProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_RegisteredBatteryProfile& instance, const char** properties, string& errorMessage) { _E_; if (instance.InstanceID!=InstanceID) { errorMessage = "No instance"; return NOT_FOUND; } CF_assert(Battery_OpenDRIM_RegisteredBatteryProfile_populate(instance,errorMessage)); _L_; return OK; } int Battery_OpenDRIM_RegisteredBatteryProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredBatteryProfile& newInstance, const OpenDRIM_RegisteredBatteryProfile& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_RegisteredBatteryProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredBatteryProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_RegisteredBatteryProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_RegisteredBatteryProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_RegisteredBatteryProfile_populate(OpenDRIM_RegisteredBatteryProfile& instance, string& errorMessage) { _E_; vector AdvertiseTypes; instance.setRegisteredName("Battery"); instance.setRegisteredVersion("1.0.0"); instance.setRegisteredOrganization(2); // DMTF AdvertiseTypes.push_back(2); // Not Advertised instance.setAdvertiseTypes(AdvertiseTypes); _L_; return OK; } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_RegisteredBatteryProfile/cmpiOpenDRIM_RegisteredBatteryProfile.hopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_RegisteredBatteryProfile/cmpiOpenDRIM_RegisteredBatteryProfi0000644000175000017500000000441711401067215034506 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_REGISTEREDBATTERYPROFILE_H_ #define CMPIOPENDRIM_REGISTEREDBATTERYPROFILE_H_ #include "OpenDRIM_RegisteredBatteryProfile.h" CMPIObjectPath* Battery_OpenDRIM_RegisteredBatteryProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_RegisteredBatteryProfile& instance); CMPIInstance* Battery_OpenDRIM_RegisteredBatteryProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_RegisteredBatteryProfile& instance); void Battery_OpenDRIM_RegisteredBatteryProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_RegisteredBatteryProfile& instance); void Battery_OpenDRIM_RegisteredBatteryProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_RegisteredBatteryProfile& instance); #endif /*CMPIOPENDRIM_REGISTEREDBATTERYPROFILE_H_*/ ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_RegisteredBatteryProfile/OpenDRIM_RegisteredBatteryProfile.hopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_RegisteredBatteryProfile/OpenDRIM_RegisteredBatteryProfile.h0000644000175000017500000001353511401067215034405 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_REGISTEREDBATTERYPROFILE_H_ #define OPENDRIM_REGISTEREDBATTERYPROFILE_H_ #include const static char* OpenDRIM_RegisteredBatteryProfile_classnames[] = {"OpenDRIM_RegisteredBatteryProfile"}; static string OpenDRIM_RegisteredBatteryProfile_NAMESPACE = _INTEROP_NAMESPACE; class OpenDRIM_RegisteredBatteryProfile { 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_RegisteredBatteryProfile() { 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_RegisteredBatteryProfile() {} 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_REGISTEREDBATTERYPROFILE_H_*/ opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryCapabilities/0000755000175000017500000000000011401067215024572 5ustar guillaumeguillaumeopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryCapabilities/OpenDRIM_BatteryCapabilities.h0000644000175000017500000000764311401067215032336 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_BATTERYCAPABILITIES_H_ #define OPENDRIM_BATTERYCAPABILITIES_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_BatteryCapabilities_classnames[] = {"OpenDRIM_BatteryCapabilities"}; static string OpenDRIM_BatteryCapabilities_NAMESPACE = _NAMESPACE; const static string Capabilities_role = "Capabilities"; const static char* Capabilities_classnames[] = {"OpenDRIM_EnabledBatteryCapabilities"}; const static string Capabilities_NAMESPACE = _NAMESPACE; const static string ManagedElement_role = "ManagedElement"; const static char* ManagedElement_classnames[] = {"OpenDRIM_Battery"}; const static string ManagedElement_NAMESPACE = _NAMESPACE; class OpenDRIM_BatteryCapabilities { public: Objectpath ManagedElement; bool ManagedElement_isNULL; Objectpath Capabilities; bool Capabilities_isNULL; vector Characteristics; bool Characteristics_isNULL; OpenDRIM_BatteryCapabilities() { ManagedElement_isNULL = true; Capabilities_isNULL = true; Characteristics_isNULL = true; } ~OpenDRIM_BatteryCapabilities() {} 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_BATTERYCAPABILITIES_H_*/ opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryCapabilities/assocOpenDRIM_BatteryCapabilities.cpp0000644000175000017500000002111711401067215033712 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_BatteryCapabilities.h" int Battery_OpenDRIM_BatteryCapabilities_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 = Battery_OpenDRIM_BatteryCapabilities_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(Battery_OpenDRIM_BatteryCapabilities_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(Battery_OpenDRIM_BatteryCapabilities_associatorManagedElementToCapabilities(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int Battery_OpenDRIM_BatteryCapabilities_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(Battery_CIM_Capabilities_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(Battery_CIM_Capabilities_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, Battery_CIM_Capabilities_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int Battery_OpenDRIM_BatteryCapabilities_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; Battery_CIM_Capabilities_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(Battery_CIM_Capabilities_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, Battery_CIM_Capabilities_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int Battery_OpenDRIM_BatteryCapabilities_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(Battery_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(Battery_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, Battery_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int Battery_OpenDRIM_BatteryCapabilities_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; Battery_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(Battery_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, Battery_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryCapabilities/Makefile.am0000644000175000017500000000470111401067215026630 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiBattery_OpenDRIM_BatteryCapabilitiesProvider.la libcmpiBattery_OpenDRIM_BatteryCapabilitiesProvider_la_SOURCES = OpenDRIM_BatteryCapabilitiesAccess.cpp OpenDRIM_BatteryCapabilitiesProvider.cpp cmpiOpenDRIM_BatteryCapabilities.cpp assocOpenDRIM_BatteryCapabilities.cpp # May have to be adjusted for direct invocation libcmpiBattery_OpenDRIM_BatteryCapabilitiesProvider_la_CPPFLAGS = -I../CIM_Capabilities -I../CIM_ManagedElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiBattery_OpenDRIM_BatteryCapabilitiesProvider_la_LIBADD = ../Common/libcmpiBattery_Common.la #../CIM_Capabilities/libcmpiBattery_CIM_CapabilitiesProvider.la ../CIM_ManagedElement/libcmpiBattery_CIM_ManagedElementProvider.la libcmpiBattery_OpenDRIM_BatteryCapabilitiesProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_BatteryCapabilities.h OpenDRIM_BatteryCapabilities.h OpenDRIM_BatteryCapabilitiesAccess.h ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryCapabilities/OpenDRIM_BatteryCapabilitiesProvider.cppopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryCapabilities/OpenDRIM_BatteryCapabilitiesProvider.cpp0000644000175000017500000004202011401067215034370 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_BatteryCapabilities.h" #include "OpenDRIM_BatteryCapabilitiesAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define Battery_OpenDRIM_BatteryCapabilitiesProviderSetInstance Battery_OpenDRIM_BatteryCapabilitiesProviderModifyInstance #endif int Battery_OpenDRIM_BatteryCapabilities_init(const CMPIBroker* broker); int Battery_OpenDRIM_BatteryCapabilities_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus Battery_OpenDRIM_BatteryCapabilitiesProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Battery_OpenDRIM_BatteryCapabilities_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Battery_OpenDRIM_BatteryCapabilitiesProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = Battery_OpenDRIM_BatteryCapabilities_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = Battery_OpenDRIM_BatteryCapabilities_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_BatteryCapabilitiesProviderEnumInstances(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 = Battery_OpenDRIM_BatteryCapabilities_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = Battery_OpenDRIM_BatteryCapabilities_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_BatteryCapabilitiesProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_BatteryCapabilities instance; Battery_OpenDRIM_BatteryCapabilities_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Battery_OpenDRIM_BatteryCapabilities_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = Battery_OpenDRIM_BatteryCapabilities_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_BatteryCapabilitiesProviderSetInstance(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_BatteryCapabilities newInstance, oldInstance; Battery_OpenDRIM_BatteryCapabilities_toCPP(_broker, ci, newInstance); Battery_OpenDRIM_BatteryCapabilities_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = Battery_OpenDRIM_BatteryCapabilities_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_BatteryCapabilities_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_BatteryCapabilitiesProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_BatteryCapabilities instance; Battery_OpenDRIM_BatteryCapabilities_toCPP(_broker, ci, instance); string errorMessage; int errorCode = Battery_OpenDRIM_BatteryCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_BatteryCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_BatteryCapabilities_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_BatteryCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = Battery_OpenDRIM_BatteryCapabilities_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_BatteryCapabilitiesProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_BatteryCapabilities instance; Battery_OpenDRIM_BatteryCapabilities_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Battery_OpenDRIM_BatteryCapabilities_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_BatteryCapabilities_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_BatteryCapabilitiesProviderExecQuery(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 Battery_OpenDRIM_BatteryCapabilitiesProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Battery_OpenDRIM_BatteryCapabilities_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Battery_OpenDRIM_BatteryCapabilitiesProviderAssociatorNames(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 = Battery_OpenDRIM_BatteryCapabilities_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryCapabilities_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 Battery_OpenDRIM_BatteryCapabilitiesProviderAssociators(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 = Battery_OpenDRIM_BatteryCapabilities_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryCapabilities_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 Battery_OpenDRIM_BatteryCapabilitiesProviderReferenceNames(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 = Battery_OpenDRIM_BatteryCapabilities_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = Battery_OpenDRIM_BatteryCapabilities_referenceCapabilitiesToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = Battery_OpenDRIM_BatteryCapabilities_referenceManagedElementToCapabilities(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = Battery_OpenDRIM_BatteryCapabilities_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus Battery_OpenDRIM_BatteryCapabilitiesProviderReferences(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 = Battery_OpenDRIM_BatteryCapabilities_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = Battery_OpenDRIM_BatteryCapabilities_referenceCapabilitiesToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = Battery_OpenDRIM_BatteryCapabilities_referenceManagedElementToCapabilities(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryCapabilities_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = Battery_OpenDRIM_BatteryCapabilities_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int Battery_OpenDRIM_BatteryCapabilities_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = Battery_OpenDRIM_BatteryCapabilities_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "Battery_OpenDRIM_BatteryCapabilities_init FAILED: " + (string) OpenDRIM_BatteryCapabilities_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int Battery_OpenDRIM_BatteryCapabilities_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = Battery_OpenDRIM_BatteryCapabilities_unload(errorMessage); if (errorCode != OK) { errorMessage += "Battery_OpenDRIM_BatteryCapabilities_unload FAILED: " + (string) OpenDRIM_BatteryCapabilities_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define Battery_OpenDRIM_BatteryCapabilities_INIT if (Battery_OpenDRIM_BatteryCapabilities_init(_broker) < 0) return NULL CMInstanceMIStub(Battery_OpenDRIM_BatteryCapabilitiesProvider, Battery_OpenDRIM_BatteryCapabilitiesProvider, _broker, Battery_OpenDRIM_BatteryCapabilities_INIT); CMAssociationMIStub(Battery_OpenDRIM_BatteryCapabilitiesProvider, Battery_OpenDRIM_BatteryCapabilitiesProvider, _broker, Battery_OpenDRIM_BatteryCapabilities_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryCapabilities/OpenDRIM_BatteryCapabilitiesAccess.cpp0000644000175000017500000002531011401067215034002 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_BatteryCapabilitiesAccess.h" int Battery_OpenDRIM_BatteryCapabilities_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(Battery_CIM_Capabilities_load(broker, errorMessage)); CF_assert(Battery_CIM_ManagedElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int Battery_OpenDRIM_BatteryCapabilities_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(Battery_CIM_Capabilities_unload(errorMessage)); CF_assert(Battery_CIM_ManagedElement_unload(errorMessage)); */ // TODO _L_; return OK; } int Battery_OpenDRIM_BatteryCapabilities_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 Battery_OpenDRIM_BatteryCapabilities_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(Battery_OpenDRIM_BatteryCapabilities_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(Battery_OpenDRIM_BatteryCapabilities_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; Battery_OpenDRIM_BatteryCapabilities_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(Battery_OpenDRIM_BatteryCapabilities_referenceCapabilitiesToManagedElement(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int Battery_OpenDRIM_BatteryCapabilities_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_BatteryCapabilities& 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(Battery_OpenDRIM_BatteryCapabilities_getCapabilities(broker, ctx, Capabilities_objectpath, Capabilities_instance, NULL, errorMessage)); Objectpath ManagedElement_objectpath; instance.getManagedElement(ManagedElement_objectpath); Instance ManagedElement_instance; CF_assert(Battery_OpenDRIM_BatteryCapabilities_getManagedElement(broker, ctx, ManagedElement_objectpath, ManagedElement_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(Battery_OpenDRIM_BatteryCapabilities_isAssociated(Capabilities_instance, ManagedElement_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } CF_assert(Battery_OpenDRIM_BatteryCapabilities_populate(instance, errorMessage)); _L_; return OK; } int Battery_OpenDRIM_BatteryCapabilities_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryCapabilities& newInstance, const OpenDRIM_BatteryCapabilities& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_BatteryCapabilities_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_BatteryCapabilities_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_BatteryCapabilities_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(Battery_OpenDRIM_BatteryCapabilities_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(Battery_OpenDRIM_BatteryCapabilities_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(Battery_OpenDRIM_BatteryCapabilities_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(Battery_OpenDRIM_BatteryCapabilities_enumerateCapabilitiess(broker, ctx, Capabilities_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(Battery_OpenDRIM_BatteryCapabilities_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(Battery_OpenDRIM_BatteryCapabilities_enumerateCapabilitiess(broker, ctx, Capabilities_instances, properties, false, errorMessage)); } for (size_t i=0; i& ManagedElement_instances, vector& OpenDRIM_BatteryCapabilities_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_BatteryCapabilities instance; instance.setCapabilities(((Instance) Capabilities_instance).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instances[i]).getObjectpath()); if (discriminant == "r") { CF_assert(Battery_OpenDRIM_BatteryCapabilities_populate(instance, errorMessage)); } OpenDRIM_BatteryCapabilities_instances.push_back(instance); } _L_; return OK; } int Battery_OpenDRIM_BatteryCapabilities_referenceManagedElementToCapabilities(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& Capabilities_instances, vector& OpenDRIM_BatteryCapabilities_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_BatteryCapabilities instance; instance.setCapabilities(((Instance) Capabilities_instances[i]).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instance).getObjectpath()); if (discriminant == "r") { CF_assert(Battery_OpenDRIM_BatteryCapabilities_populate(instance, errorMessage)); } OpenDRIM_BatteryCapabilities_instances.push_back(instance); } _L_; return OK; } int Battery_OpenDRIM_BatteryCapabilities_populate(OpenDRIM_BatteryCapabilities& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryCapabilities/assocOpenDRIM_BatteryCapabilities.h0000644000175000017500000000620511401067215033360 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_BATTERYCAPABILITIES_H_ #define ASSOCOPENDRIM_BATTERYCAPABILITIES_H_ #include "OpenDRIM_BatteryCapabilitiesAccess.h" int Battery_OpenDRIM_BatteryCapabilities_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 Battery_OpenDRIM_BatteryCapabilities_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 Battery_OpenDRIM_BatteryCapabilities_enumerateCapabilitiess(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int Battery_OpenDRIM_BatteryCapabilities_getCapabilities(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int Battery_OpenDRIM_BatteryCapabilities_enumerateManagedElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int Battery_OpenDRIM_BatteryCapabilities_getManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_BATTERYCAPABILITIES_H_*/ opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryCapabilities/cmpiOpenDRIM_BatteryCapabilities.cpp0000644000175000017500000000650111401067215033532 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_BatteryCapabilities.h" CMPIObjectPath* Battery_OpenDRIM_BatteryCapabilities_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_BatteryCapabilities& instance) { _E_; Objectpath op(broker, OpenDRIM_BatteryCapabilities_classnames[0], OpenDRIM_BatteryCapabilities_NAMESPACE); if (!instance.ManagedElement_isNULL) op.addKey("ManagedElement", instance.ManagedElement); if (!instance.Capabilities_isNULL) op.addKey("Capabilities", instance.Capabilities); _L_; return op.getHdl(); } CMPIInstance* Battery_OpenDRIM_BatteryCapabilities_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_BatteryCapabilities& instance) { _E_; Objectpath op(broker, Battery_OpenDRIM_BatteryCapabilities_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); if (!instance.Characteristics_isNULL) ci.setProperty("Characteristics", instance.Characteristics); _L_; return ci.getHdl(); } void Battery_OpenDRIM_BatteryCapabilities_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_BatteryCapabilities& 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 Battery_OpenDRIM_BatteryCapabilities_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_BatteryCapabilities& 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_; } opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryCapabilities/cmpiOpenDRIM_BatteryCapabilities.h0000644000175000017500000000432311401067215033177 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_BATTERYCAPABILITIES_H_ #define CMPIOPENDRIM_BATTERYCAPABILITIES_H_ #include "OpenDRIM_BatteryCapabilities.h" CMPIObjectPath* Battery_OpenDRIM_BatteryCapabilities_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_BatteryCapabilities& instance); CMPIInstance* Battery_OpenDRIM_BatteryCapabilities_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_BatteryCapabilities& instance); void Battery_OpenDRIM_BatteryCapabilities_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_BatteryCapabilities& instance); void Battery_OpenDRIM_BatteryCapabilities_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_BatteryCapabilities& instance); #endif /*CMPIOPENDRIM_BATTERYCAPABILITIES_H_*/ opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryCapabilities/OpenDRIM_BatteryCapabilitiesAccess.h0000644000175000017500000001050511401067215033447 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_BATTERYCAPABILITIESACCESS_H_ #define OPENDRIM_BATTERYCAPABILITIESACCESS_H_ #include "Battery_Common.h" #include "OpenDRIM_BatteryCapabilities.h" #include "assocOpenDRIM_BatteryCapabilities.h" int Battery_OpenDRIM_BatteryCapabilities_load(const CMPIBroker* broker, string& errorMessage); int Battery_OpenDRIM_BatteryCapabilities_unload(string& errorMessage); int Battery_OpenDRIM_BatteryCapabilities_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int Battery_OpenDRIM_BatteryCapabilities_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_BatteryCapabilities& instance, const char** properties, string& errorMessage); int Battery_OpenDRIM_BatteryCapabilities_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryCapabilities& newInstance, const OpenDRIM_BatteryCapabilities& oldInstance, const char** properties, string& errorMessage); int Battery_OpenDRIM_BatteryCapabilities_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryCapabilities& instance, string& errorMessage); int Battery_OpenDRIM_BatteryCapabilities_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryCapabilities& instance, string& errorMessage); int Battery_OpenDRIM_BatteryCapabilities_associatorCapabilitiesToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Capabilities_instance, const char** properties, vector& ManagedElement_associatedInstances, string& errorMessage, const string& discriminant); int Battery_OpenDRIM_BatteryCapabilities_associatorManagedElementToCapabilities(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const char** properties, vector& Capabilities_associatedInstances, string& errorMessage, const string& discriminant); int Battery_OpenDRIM_BatteryCapabilities_referenceCapabilitiesToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Capabilities_instance, const vector& ManagedElement_instances, vector& OpenDRIM_BatteryCapabilities_instances, const char** properties, string& errorMessage, const string& discriminant); int Battery_OpenDRIM_BatteryCapabilities_referenceManagedElementToCapabilities(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& Capabilities_instances, vector& OpenDRIM_BatteryCapabilities_instances, const char** properties, string& errorMessage, const string& discriminant); int Battery_OpenDRIM_BatteryCapabilities_populate(OpenDRIM_BatteryCapabilities& instance, string& errorMessage); #endif /*OPENDRIM_BATTERYCAPABILITIESACCESS_H_*/ opendrim-lmp-battery-1.0.0~ppa/mof/0000755000175000017500000000000011401067215017772 5ustar guillaumeguillaumeopendrim-lmp-battery-1.0.0~ppa/mof/OpenDRIM_ComputerSystemBattery.mof0000644000175000017500000000320611401067215026471 0ustar guillaumeguillaume// ############################################################################### // Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI // ############################################################################## [Provider("cmpi:cmpiBattery_OpenDRIM_ComputerSystemBatteryProvider")] class OpenDRIM_ComputerSystemBattery:CIM_SystemDevice { }; opendrim-lmp-battery-1.0.0~ppa/mof/OpenDRIM_BatteryConformsToProfile.mof0000644000175000017500000000324611401067215027104 0ustar guillaumeguillaume// ############################################################################### // Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI // ############################################################################## [Association, Provider("cmpi:cmpiBattery_OpenDRIM_BatteryConformsToProfileProvider")] class OpenDRIM_BatteryConformsToProfile:CIM_ElementConformsToProfile { }; opendrim-lmp-battery-1.0.0~ppa/mof/OpenDRIM_AssociatedBattery.mof0000644000175000017500000000322111401067215025542 0ustar guillaumeguillaume// ############################################################################### // Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI // ############################################################################## [Association, Provider("cmpi:cmpiBattery_OpenDRIM_AssociatedBatteryProvider")] class OpenDRIM_AssociatedBattery:CIM_AssociatedBattery { }; opendrim-lmp-battery-1.0.0~ppa/mof/OpenDRIM_Battery.mof0000644000175000017500000000314511401067215023547 0ustar guillaumeguillaume// ############################################################################### // Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI // ############################################################################## [Provider("cmpi:cmpiBattery_OpenDRIM_BatteryProvider")] class OpenDRIM_Battery:CIM_Battery { }; opendrim-lmp-battery-1.0.0~ppa/mof/OpenDRIM_RegisteredBatteryProfile.mof0000644000175000017500000000322111401067215027101 0ustar guillaumeguillaume// ############################################################################### // Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI // ############################################################################## [Provider("cmpi:cmpiBattery_OpenDRIM_RegisteredBatteryProfileProvider")] class OpenDRIM_RegisteredBatteryProfile:CIM_RegisteredProfile { }; opendrim-lmp-battery-1.0.0~ppa/mof/OpenDRIM_EnabledBatteryCapabilities.mof0000644000175000017500000000324511401067215027335 0ustar guillaumeguillaume// ############################################################################### // Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI // ############################################################################## [Provider("cmpi:cmpiBattery_OpenDRIM_EnabledBatteryCapabilitiesProvider")] class OpenDRIM_EnabledBatteryCapabilities:CIM_EnabledLogicalElementCapabilities { }; opendrim-lmp-battery-1.0.0~ppa/mof/OpenDRIM_BatteryCapabilities.mof0000644000175000017500000000322711401067215026062 0ustar guillaumeguillaume// ############################################################################### // Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI // ############################################################################## [Association, Provider("cmpi:cmpiBattery_OpenDRIM_BatteryCapabilitiesProvider")] class OpenDRIM_BatteryCapabilities:CIM_ElementCapabilities { }; opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_AssociatedBattery/0000755000175000017500000000000011401067215024260 5ustar guillaumeguillaumeopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_AssociatedBattery/Makefile.am0000644000175000017500000000465411401067215026325 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiBattery_OpenDRIM_AssociatedBatteryProvider.la libcmpiBattery_OpenDRIM_AssociatedBatteryProvider_la_SOURCES = OpenDRIM_AssociatedBatteryAccess.cpp OpenDRIM_AssociatedBatteryProvider.cpp cmpiOpenDRIM_AssociatedBattery.cpp assocOpenDRIM_AssociatedBattery.cpp # May have to be adjusted for direct invocation libcmpiBattery_OpenDRIM_AssociatedBatteryProvider_la_CPPFLAGS = -I../CIM_Battery -I../CIM_ManagedSystemElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiBattery_OpenDRIM_AssociatedBatteryProvider_la_LIBADD = ../Common/libcmpiBattery_Common.la #../CIM_Battery/libcmpiBattery_CIM_BatteryProvider.la ../CIM_ManagedSystemElement/libcmpiBattery_CIM_ManagedSystemElementProvider.la libcmpiBattery_OpenDRIM_AssociatedBatteryProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_AssociatedBattery.h OpenDRIM_AssociatedBattery.h OpenDRIM_AssociatedBatteryAccess.h opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_AssociatedBattery/cmpiOpenDRIM_AssociatedBattery.cpp0000644000175000017500000000601511401067215032706 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_AssociatedBattery.h" CMPIObjectPath* Battery_OpenDRIM_AssociatedBattery_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_AssociatedBattery& instance) { _E_; Objectpath op(broker, OpenDRIM_AssociatedBattery_classnames[0], OpenDRIM_AssociatedBattery_NAMESPACE); if (!instance.Antecedent_isNULL) op.addKey("Antecedent", instance.Antecedent); if (!instance.Dependent_isNULL) op.addKey("Dependent", instance.Dependent); _L_; return op.getHdl(); } CMPIInstance* Battery_OpenDRIM_AssociatedBattery_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_AssociatedBattery& instance) { _E_; Objectpath op(broker, Battery_OpenDRIM_AssociatedBattery_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void Battery_OpenDRIM_AssociatedBattery_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_AssociatedBattery& 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 Battery_OpenDRIM_AssociatedBattery_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_AssociatedBattery& 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-battery-1.0.0~ppa/OpenDRIM_AssociatedBattery/OpenDRIM_AssociatedBatteryAccess.cpp0000644000175000017500000002404411401067215033161 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_AssociatedBatteryAccess.h" int Battery_OpenDRIM_AssociatedBattery_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(Battery_CIM_Battery_load(broker, errorMessage)); CF_assert(Battery_CIM_ManagedSystemElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int Battery_OpenDRIM_AssociatedBattery_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(Battery_CIM_Battery_unload(errorMessage)); CF_assert(Battery_CIM_ManagedSystemElement_unload(errorMessage)); */ // TODO _L_; return OK; } int Battery_OpenDRIM_AssociatedBattery_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 Battery_OpenDRIM_AssociatedBattery_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(Battery_OpenDRIM_AssociatedBattery_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(Battery_OpenDRIM_AssociatedBattery_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; Battery_OpenDRIM_AssociatedBattery_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(Battery_OpenDRIM_AssociatedBattery_referenceAntecedentToDependent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int Battery_OpenDRIM_AssociatedBattery_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_AssociatedBattery& 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(Battery_OpenDRIM_AssociatedBattery_getAntecedent(broker, ctx, Antecedent_objectpath, Antecedent_instance, NULL, errorMessage)); Objectpath Dependent_objectpath; instance.getDependent(Dependent_objectpath); Instance Dependent_instance; CF_assert(Battery_OpenDRIM_AssociatedBattery_getDependent(broker, ctx, Dependent_objectpath, Dependent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(Battery_OpenDRIM_AssociatedBattery_isAssociated(Antecedent_instance, Dependent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int Battery_OpenDRIM_AssociatedBattery_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedBattery& newInstance, const OpenDRIM_AssociatedBattery& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_AssociatedBattery_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedBattery& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_AssociatedBattery_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedBattery& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_AssociatedBattery_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(Battery_OpenDRIM_AssociatedBattery_enumerateDependents(broker, ctx, Dependent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(Battery_OpenDRIM_AssociatedBattery_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(Battery_OpenDRIM_AssociatedBattery_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(Battery_OpenDRIM_AssociatedBattery_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(Battery_OpenDRIM_AssociatedBattery_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(Battery_OpenDRIM_AssociatedBattery_enumerateAntecedents(broker, ctx, Antecedent_instances, properties, false, errorMessage)); } for (size_t i=0; i& Dependent_instances, vector& OpenDRIM_AssociatedBattery_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_AssociatedBattery instance; instance.setAntecedent(((Instance) Antecedent_instance).getObjectpath()); instance.setDependent(((Instance) Dependent_instances[i]).getObjectpath()); OpenDRIM_AssociatedBattery_instances.push_back(instance); } _L_; return OK; } int Battery_OpenDRIM_AssociatedBattery_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_AssociatedBattery_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_AssociatedBattery instance; instance.setAntecedent(((Instance) Antecedent_instances[i]).getObjectpath()); instance.setDependent(((Instance) Dependent_instance).getObjectpath()); OpenDRIM_AssociatedBattery_instances.push_back(instance); } _L_; return OK; } int Battery_OpenDRIM_AssociatedBattery_populate(OpenDRIM_AssociatedBattery& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_AssociatedBattery/assocOpenDRIM_AssociatedBattery.cpp0000644000175000017500000002070711401067215033072 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_AssociatedBattery.h" int Battery_OpenDRIM_AssociatedBattery_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 = Battery_OpenDRIM_AssociatedBattery_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(Battery_OpenDRIM_AssociatedBattery_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(Battery_OpenDRIM_AssociatedBattery_associatorDependentToAntecedent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int Battery_OpenDRIM_AssociatedBattery_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(Battery_CIM_Battery_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(Battery_CIM_Battery_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, Battery_CIM_Battery_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int Battery_OpenDRIM_AssociatedBattery_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_Battery _instance; Battery_CIM_Battery_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(Battery_CIM_Battery_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, Battery_CIM_Battery_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int Battery_OpenDRIM_AssociatedBattery_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(Battery_CIM_ManagedSystemElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(Battery_CIM_ManagedSystemElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, Battery_CIM_ManagedSystemElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int Battery_OpenDRIM_AssociatedBattery_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; Battery_CIM_ManagedSystemElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(Battery_CIM_ManagedSystemElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, Battery_CIM_ManagedSystemElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_AssociatedBattery/OpenDRIM_AssociatedBatteryAccess.h0000644000175000017500000001032511401067215032623 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_ASSOCIATEDBATTERYACCESS_H_ #define OPENDRIM_ASSOCIATEDBATTERYACCESS_H_ #include "Battery_Common.h" #include "OpenDRIM_AssociatedBattery.h" #include "assocOpenDRIM_AssociatedBattery.h" int Battery_OpenDRIM_AssociatedBattery_load(const CMPIBroker* broker, string& errorMessage); int Battery_OpenDRIM_AssociatedBattery_unload(string& errorMessage); int Battery_OpenDRIM_AssociatedBattery_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int Battery_OpenDRIM_AssociatedBattery_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_AssociatedBattery& instance, const char** properties, string& errorMessage); int Battery_OpenDRIM_AssociatedBattery_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedBattery& newInstance, const OpenDRIM_AssociatedBattery& oldInstance, const char** properties, string& errorMessage); int Battery_OpenDRIM_AssociatedBattery_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedBattery& instance, string& errorMessage); int Battery_OpenDRIM_AssociatedBattery_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_AssociatedBattery& instance, string& errorMessage); int Battery_OpenDRIM_AssociatedBattery_associatorAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const char** properties, vector& Dependent_associatedInstances, string& errorMessage, const string& discriminant); int Battery_OpenDRIM_AssociatedBattery_associatorDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const char** properties, vector& Antecedent_associatedInstances, string& errorMessage, const string& discriminant); int Battery_OpenDRIM_AssociatedBattery_referenceAntecedentToDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Antecedent_instance, const vector& Dependent_instances, vector& OpenDRIM_AssociatedBattery_instances, const char** properties, string& errorMessage, const string& discriminant); int Battery_OpenDRIM_AssociatedBattery_referenceDependentToAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& Dependent_instance, const vector& Antecedent_instances, vector& OpenDRIM_AssociatedBattery_instances, const char** properties, string& errorMessage, const string& discriminant); int Battery_OpenDRIM_AssociatedBattery_populate(OpenDRIM_AssociatedBattery& instance, string& errorMessage); #endif /*OPENDRIM_ASSOCIATEDBATTERYACCESS_H_*/ opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_AssociatedBattery/OpenDRIM_AssociatedBatteryProvider.cpp0000644000175000017500000004150011401067215033546 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_AssociatedBattery.h" #include "OpenDRIM_AssociatedBatteryAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define Battery_OpenDRIM_AssociatedBatteryProviderSetInstance Battery_OpenDRIM_AssociatedBatteryProviderModifyInstance #endif int Battery_OpenDRIM_AssociatedBattery_init(const CMPIBroker* broker); int Battery_OpenDRIM_AssociatedBattery_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus Battery_OpenDRIM_AssociatedBatteryProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Battery_OpenDRIM_AssociatedBattery_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Battery_OpenDRIM_AssociatedBatteryProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = Battery_OpenDRIM_AssociatedBattery_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = Battery_OpenDRIM_AssociatedBattery_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_AssociatedBatteryProviderEnumInstances(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 = Battery_OpenDRIM_AssociatedBattery_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = Battery_OpenDRIM_AssociatedBattery_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_AssociatedBatteryProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_AssociatedBattery instance; Battery_OpenDRIM_AssociatedBattery_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Battery_OpenDRIM_AssociatedBattery_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = Battery_OpenDRIM_AssociatedBattery_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_AssociatedBatteryProviderSetInstance(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_AssociatedBattery newInstance, oldInstance; Battery_OpenDRIM_AssociatedBattery_toCPP(_broker, ci, newInstance); Battery_OpenDRIM_AssociatedBattery_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = Battery_OpenDRIM_AssociatedBattery_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_AssociatedBattery_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_AssociatedBatteryProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_AssociatedBattery instance; Battery_OpenDRIM_AssociatedBattery_toCPP(_broker, ci, instance); string errorMessage; int errorCode = Battery_OpenDRIM_AssociatedBattery_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_AssociatedBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_AssociatedBattery_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_AssociatedBattery_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = Battery_OpenDRIM_AssociatedBattery_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_AssociatedBatteryProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_AssociatedBattery instance; Battery_OpenDRIM_AssociatedBattery_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Battery_OpenDRIM_AssociatedBattery_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_AssociatedBattery_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_AssociatedBatteryProviderExecQuery(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 Battery_OpenDRIM_AssociatedBatteryProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Battery_OpenDRIM_AssociatedBattery_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Battery_OpenDRIM_AssociatedBatteryProviderAssociatorNames(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 = Battery_OpenDRIM_AssociatedBattery_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBattery_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 Battery_OpenDRIM_AssociatedBatteryProviderAssociators(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 = Battery_OpenDRIM_AssociatedBattery_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBattery_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 Battery_OpenDRIM_AssociatedBatteryProviderReferenceNames(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 = Battery_OpenDRIM_AssociatedBattery_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = Battery_OpenDRIM_AssociatedBattery_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = Battery_OpenDRIM_AssociatedBattery_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = Battery_OpenDRIM_AssociatedBattery_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus Battery_OpenDRIM_AssociatedBatteryProviderReferences(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 = Battery_OpenDRIM_AssociatedBattery_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = Battery_OpenDRIM_AssociatedBattery_referenceAntecedentToDependent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = Battery_OpenDRIM_AssociatedBattery_referenceDependentToAntecedent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_AssociatedBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = Battery_OpenDRIM_AssociatedBattery_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int Battery_OpenDRIM_AssociatedBattery_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = Battery_OpenDRIM_AssociatedBattery_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "Battery_OpenDRIM_AssociatedBattery_init FAILED: " + (string) OpenDRIM_AssociatedBattery_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int Battery_OpenDRIM_AssociatedBattery_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = Battery_OpenDRIM_AssociatedBattery_unload(errorMessage); if (errorCode != OK) { errorMessage += "Battery_OpenDRIM_AssociatedBattery_unload FAILED: " + (string) OpenDRIM_AssociatedBattery_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define Battery_OpenDRIM_AssociatedBattery_INIT if (Battery_OpenDRIM_AssociatedBattery_init(_broker) < 0) return NULL CMInstanceMIStub(Battery_OpenDRIM_AssociatedBatteryProvider, Battery_OpenDRIM_AssociatedBatteryProvider, _broker, Battery_OpenDRIM_AssociatedBattery_INIT); CMAssociationMIStub(Battery_OpenDRIM_AssociatedBatteryProvider, Battery_OpenDRIM_AssociatedBatteryProvider, _broker, Battery_OpenDRIM_AssociatedBattery_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_AssociatedBattery/cmpiOpenDRIM_AssociatedBattery.h0000644000175000017500000000427311401067215032357 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_ASSOCIATEDBATTERY_H_ #define CMPIOPENDRIM_ASSOCIATEDBATTERY_H_ #include "OpenDRIM_AssociatedBattery.h" CMPIObjectPath* Battery_OpenDRIM_AssociatedBattery_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_AssociatedBattery& instance); CMPIInstance* Battery_OpenDRIM_AssociatedBattery_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_AssociatedBattery& instance); void Battery_OpenDRIM_AssociatedBattery_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_AssociatedBattery& instance); void Battery_OpenDRIM_AssociatedBattery_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_AssociatedBattery& instance); #endif /*CMPIOPENDRIM_ASSOCIATEDBATTERY_H_*/ opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_AssociatedBattery/assocOpenDRIM_AssociatedBattery.h0000644000175000017500000000614311401067215032535 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_ASSOCIATEDBATTERY_H_ #define ASSOCOPENDRIM_ASSOCIATEDBATTERY_H_ #include "OpenDRIM_AssociatedBatteryAccess.h" int Battery_OpenDRIM_AssociatedBattery_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 Battery_OpenDRIM_AssociatedBattery_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 Battery_OpenDRIM_AssociatedBattery_enumerateAntecedents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int Battery_OpenDRIM_AssociatedBattery_getAntecedent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int Battery_OpenDRIM_AssociatedBattery_enumerateDependents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int Battery_OpenDRIM_AssociatedBattery_getDependent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_ASSOCIATEDBATTERY_H_*/ opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_AssociatedBattery/OpenDRIM_AssociatedBattery.h0000644000175000017500000000655711401067215031515 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_ASSOCIATEDBATTERY_H_ #define OPENDRIM_ASSOCIATEDBATTERY_H_ #include // Direct Invocation includes, may have to be adjusted /* #include "cmpiCIM_Battery.h" #include "CIM_BatteryAccess.h" #include "cmpiCIM_ManagedSystemElement.h" #include "CIM_ManagedSystemElementAccess.h" */ const static char* OpenDRIM_AssociatedBattery_classnames[] = {"OpenDRIM_AssociatedBattery"}; static string OpenDRIM_AssociatedBattery_NAMESPACE = _NAMESPACE; const static string Antecedent_role = "Antecedent"; const static char* Antecedent_classnames[] = {"OpenDRIM_Battery"}; 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_AssociatedBattery { public: Objectpath Antecedent; bool Antecedent_isNULL; Objectpath Dependent; bool Dependent_isNULL; OpenDRIM_AssociatedBattery() { Antecedent_isNULL = true; Dependent_isNULL = true; } ~OpenDRIM_AssociatedBattery() {} 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_ASSOCIATEDBATTERY_H_*/ opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_Battery/0000755000175000017500000000000011401067215022260 5ustar guillaumeguillaumeopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_Battery/Makefile.am0000644000175000017500000000367411401067215024326 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiBattery_OpenDRIM_BatteryProvider.la libcmpiBattery_OpenDRIM_BatteryProvider_la_SOURCES = OpenDRIM_BatteryAccess.cpp OpenDRIM_BatteryProvider.cpp cmpiOpenDRIM_Battery.cpp libcmpiBattery_OpenDRIM_BatteryProvider_la_LIBADD = ../Common/libcmpiBattery_Common.la libcmpiBattery_OpenDRIM_BatteryProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_Battery.h OpenDRIM_Battery.h OpenDRIM_BatteryAccess.h opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_Battery/OpenDRIM_BatteryAccess.cpp0000644000175000017500000001707011401067215027162 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_BatteryAccess.h" const string systemCreationClassName = "OpenDRIM_ComputerSystem"; const string creationClassName = "OpenDRIM_Battery"; string systemName; int Battery_OpenDRIM_Battery_load(const CMPIBroker* broker, string& errorMessage) { _E_; CF_assert(CF_getSystemName(systemName, errorMessage)); _L_; return OK; } int Battery_OpenDRIM_Battery_unload(string& errorMessage) { _E_; // TODO _L_; return OK; } int Battery_OpenDRIM_Battery_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& result, const char** properties, string& errorMessage, const string& discriminant) { _E_; //Initialize an instance OpenDRIM_Battery instance; instance.setSystemCreationClassName(systemCreationClassName); instance.setSystemName(systemName); instance.setCreationClassName(creationClassName); vector batteries; CF_assert(CF_runCommandToLines("ls -1 /proc/acpi/battery", batteries, 0, errorMessage)); for (size_t i = 0; i < batteries.size()-1; i++) { instance.setDeviceID(batteries[i]); if (discriminant == "ei") CF_assert(Battery_OpenDRIM_Battery_populate(instance, errorMessage)); result.push_back(instance); } _L_; return OK; } int Battery_OpenDRIM_Battery_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_Battery& instance, const char** properties, string& errorMessage) { _E_; vector batteries; vector::size_type index; CF_assert(CF_runCommandToLines("ls -1 /proc/acpi/battery", batteries, 0, errorMessage)); if(instance.SystemCreationClassName != systemCreationClassName || instance.CreationClassName != creationClassName || instance.SystemName != systemName || !CF_foundInList(instance.DeviceID,batteries,index)) { errorMessage = "No instance"; return NOT_FOUND; } CF_assert(Battery_OpenDRIM_Battery_populate(instance, errorMessage)); _L_; return OK; } int Battery_OpenDRIM_Battery_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Battery& newInstance, const OpenDRIM_Battery& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_Battery_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Battery& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_Battery_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Battery& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_Battery_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Battery& instance, unsigned int& returnValue, const OpenDRIM_Battery_RequestStateChange_In& in, OpenDRIM_Battery_RequestStateChange_Out& out, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_Battery_SetPowerState(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Battery& instance, unsigned int& returnValue, const OpenDRIM_Battery_SetPowerState_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_Battery_Reset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Battery& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_Battery_EnableDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Battery& instance, unsigned int& returnValue, const OpenDRIM_Battery_EnableDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_Battery_OnlineDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Battery& instance, unsigned int& returnValue, const OpenDRIM_Battery_OnlineDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_Battery_QuiesceDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Battery& instance, unsigned int& returnValue, const OpenDRIM_Battery_QuiesceDevice_In& in, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_Battery_SaveProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Battery& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_Battery_RestoreProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Battery& instance, unsigned int& returnValue, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_Battery_populate(OpenDRIM_Battery& instance, string& errorMessage) { _E_; /* * Properties to fill from profile * + Mandatory: * [X] SystemCreationClassName [KEY] * [X] SystemName [KEY] * [X] CreationClassName [KEY] * [X] DeviceID [KEY] * [X] BatteryStatus * [X] OperationalStatus * [X] HealthState * [X] EnabledState * [X] RequestedState * [X] ElementName */ vector battstate, battstate_line; string status; unsigned short batteryStatus; vector operationalStatus; CF_assert(CF_readTextFileToLines("/proc/acpi/battery/" + instance.DeviceID + "/state", battstate, 0, errorMessage)); CF_splitTextBySpace(battstate_line, battstate[2]); status = battstate_line[2]; if (status == "fully") //fully charged batteryStatus = 3; else if (status == "low") batteryStatus = 4; else if (status == "critical") batteryStatus = 5; else if (status == "charging") batteryStatus = 6; else if (status == "undefined") batteryStatus = 10; else if (status == "learning") batteryStatus = 12; else if (status == "overcharged") batteryStatus = 13; else batteryStatus =2; //unknown instance.setBatteryStatus(batteryStatus); operationalStatus.push_back(2); // OK instance.setOperationalStatus(operationalStatus); instance.setHealthState(5); instance.setEnabledState(5); // Not supported instance.setRequestedState(12); // Not supported instance.setElementName("Battery "+instance.DeviceID.substr(instance.DeviceID.size()-1)); _L_; return OK; } opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_Battery/OpenDRIM_Battery.h0000644000175000017500000006761511401067215025517 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_BATTERY_H_ #define OPENDRIM_BATTERY_H_ #include const static char* OpenDRIM_Battery_classnames[] = {"OpenDRIM_Battery"}; static string OpenDRIM_Battery_NAMESPACE = _NAMESPACE; class OpenDRIM_Battery { public: 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 PrimaryStatus; bool PrimaryStatus_isNULL; unsigned short DetailedStatus; bool DetailedStatus_isNULL; unsigned short OperatingStatus; bool OperatingStatus_isNULL; unsigned short CommunicationStatus; bool CommunicationStatus_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; unsigned short LocationIndicator; bool LocationIndicator_isNULL; unsigned int MaxPowerProduced; bool MaxPowerProduced_isNULL; string MaxPowerProducedUnits; bool MaxPowerProducedUnits_isNULL; unsigned int MaxPowerConsumed; bool MaxPowerConsumed_isNULL; string MaxPowerConsumedUnits; bool MaxPowerConsumedUnits_isNULL; unsigned short BatteryStatus; bool BatteryStatus_isNULL; unsigned int TimeOnBattery; bool TimeOnBattery_isNULL; unsigned int EstimatedRunTime; bool EstimatedRunTime_isNULL; unsigned short EstimatedChargeRemaining; bool EstimatedChargeRemaining_isNULL; unsigned short Chemistry; bool Chemistry_isNULL; unsigned int DesignCapacity; bool DesignCapacity_isNULL; unsigned int FullChargeCapacity; bool FullChargeCapacity_isNULL; unsigned long long DesignVoltage; bool DesignVoltage_isNULL; string SmartBatteryVersion; bool SmartBatteryVersion_isNULL; unsigned int TimeToFullCharge; bool TimeToFullCharge_isNULL; unsigned int ExpectedLife; bool ExpectedLife_isNULL; unsigned int MaxRechargeTime; bool MaxRechargeTime_isNULL; unsigned int RechargeCount; bool RechargeCount_isNULL; unsigned int MaxRechargeCount; bool MaxRechargeCount_isNULL; unsigned int RemainingCapacity; bool RemainingCapacity_isNULL; unsigned char RemainingCapacityMaxError; bool RemainingCapacityMaxError_isNULL; OpenDRIM_Battery() { 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; PrimaryStatus_isNULL = true; DetailedStatus_isNULL = true; OperatingStatus_isNULL = true; CommunicationStatus_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; LocationIndicator_isNULL = true; MaxPowerProduced_isNULL = true; MaxPowerProducedUnits_isNULL = true; MaxPowerConsumed_isNULL = true; MaxPowerConsumedUnits_isNULL = true; BatteryStatus_isNULL = true; TimeOnBattery_isNULL = true; EstimatedRunTime_isNULL = true; EstimatedChargeRemaining_isNULL = true; Chemistry_isNULL = true; DesignCapacity_isNULL = true; FullChargeCapacity_isNULL = true; DesignVoltage_isNULL = true; SmartBatteryVersion_isNULL = true; TimeToFullCharge_isNULL = true; ExpectedLife_isNULL = true; MaxRechargeTime_isNULL = true; RechargeCount_isNULL = true; MaxRechargeCount_isNULL = true; RemainingCapacity_isNULL = true; RemainingCapacityMaxError_isNULL = true; } ~OpenDRIM_Battery() {} string getKeys() const { return CF_toLowCase(".SystemCreationClassName=\"" + CF_quoteString(SystemCreationClassName) + "\""".SystemName=\"" + CF_quoteString(SystemName) + "\""".CreationClassName=\"" + CF_quoteString(CreationClassName) + "\""".DeviceID=\"" + CF_quoteString(DeviceID) + "\""); } 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 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 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 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 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 getLocationIndicator(unsigned short& value) const { if (LocationIndicator_isNULL==true) return NOT_FOUND; value = LocationIndicator; return OK; } int setLocationIndicator(const unsigned short& newValue) { LocationIndicator = newValue; LocationIndicator_isNULL = false; return OK; } int getMaxPowerProduced(unsigned int& value) const { if (MaxPowerProduced_isNULL==true) return NOT_FOUND; value = MaxPowerProduced; return OK; } int setMaxPowerProduced(const unsigned int& newValue) { MaxPowerProduced = newValue; MaxPowerProduced_isNULL = false; return OK; } int getMaxPowerProducedUnits(string& value) const { if (MaxPowerProducedUnits_isNULL==true) return NOT_FOUND; value = MaxPowerProducedUnits; return OK; } int setMaxPowerProducedUnits(const string& newValue) { MaxPowerProducedUnits = newValue; MaxPowerProducedUnits_isNULL = false; return OK; } int getMaxPowerConsumed(unsigned int& value) const { if (MaxPowerConsumed_isNULL==true) return NOT_FOUND; value = MaxPowerConsumed; return OK; } int setMaxPowerConsumed(const unsigned int& newValue) { MaxPowerConsumed = newValue; MaxPowerConsumed_isNULL = false; return OK; } int getMaxPowerConsumedUnits(string& value) const { if (MaxPowerConsumedUnits_isNULL==true) return NOT_FOUND; value = MaxPowerConsumedUnits; return OK; } int setMaxPowerConsumedUnits(const string& newValue) { MaxPowerConsumedUnits = newValue; MaxPowerConsumedUnits_isNULL = false; return OK; } int getBatteryStatus(unsigned short& value) const { if (BatteryStatus_isNULL==true) return NOT_FOUND; value = BatteryStatus; return OK; } int setBatteryStatus(const unsigned short& newValue) { BatteryStatus = newValue; BatteryStatus_isNULL = false; return OK; } int getTimeOnBattery(unsigned int& value) const { if (TimeOnBattery_isNULL==true) return NOT_FOUND; value = TimeOnBattery; return OK; } int setTimeOnBattery(const unsigned int& newValue) { TimeOnBattery = newValue; TimeOnBattery_isNULL = false; return OK; } int getEstimatedRunTime(unsigned int& value) const { if (EstimatedRunTime_isNULL==true) return NOT_FOUND; value = EstimatedRunTime; return OK; } int setEstimatedRunTime(const unsigned int& newValue) { EstimatedRunTime = newValue; EstimatedRunTime_isNULL = false; return OK; } int getEstimatedChargeRemaining(unsigned short& value) const { if (EstimatedChargeRemaining_isNULL==true) return NOT_FOUND; value = EstimatedChargeRemaining; return OK; } int setEstimatedChargeRemaining(const unsigned short& newValue) { EstimatedChargeRemaining = newValue; EstimatedChargeRemaining_isNULL = false; return OK; } int getChemistry(unsigned short& value) const { if (Chemistry_isNULL==true) return NOT_FOUND; value = Chemistry; return OK; } int setChemistry(const unsigned short& newValue) { Chemistry = newValue; Chemistry_isNULL = false; return OK; } int getDesignCapacity(unsigned int& value) const { if (DesignCapacity_isNULL==true) return NOT_FOUND; value = DesignCapacity; return OK; } int setDesignCapacity(const unsigned int& newValue) { DesignCapacity = newValue; DesignCapacity_isNULL = false; return OK; } int getFullChargeCapacity(unsigned int& value) const { if (FullChargeCapacity_isNULL==true) return NOT_FOUND; value = FullChargeCapacity; return OK; } int setFullChargeCapacity(const unsigned int& newValue) { FullChargeCapacity = newValue; FullChargeCapacity_isNULL = false; return OK; } int getDesignVoltage(unsigned long long& value) const { if (DesignVoltage_isNULL==true) return NOT_FOUND; value = DesignVoltage; return OK; } int setDesignVoltage(const unsigned long long& newValue) { DesignVoltage = newValue; DesignVoltage_isNULL = false; return OK; } int getSmartBatteryVersion(string& value) const { if (SmartBatteryVersion_isNULL==true) return NOT_FOUND; value = SmartBatteryVersion; return OK; } int setSmartBatteryVersion(const string& newValue) { SmartBatteryVersion = newValue; SmartBatteryVersion_isNULL = false; return OK; } int getTimeToFullCharge(unsigned int& value) const { if (TimeToFullCharge_isNULL==true) return NOT_FOUND; value = TimeToFullCharge; return OK; } int setTimeToFullCharge(const unsigned int& newValue) { TimeToFullCharge = newValue; TimeToFullCharge_isNULL = false; return OK; } int getExpectedLife(unsigned int& value) const { if (ExpectedLife_isNULL==true) return NOT_FOUND; value = ExpectedLife; return OK; } int setExpectedLife(const unsigned int& newValue) { ExpectedLife = newValue; ExpectedLife_isNULL = false; return OK; } int getMaxRechargeTime(unsigned int& value) const { if (MaxRechargeTime_isNULL==true) return NOT_FOUND; value = MaxRechargeTime; return OK; } int setMaxRechargeTime(const unsigned int& newValue) { MaxRechargeTime = newValue; MaxRechargeTime_isNULL = false; return OK; } int getRechargeCount(unsigned int& value) const { if (RechargeCount_isNULL==true) return NOT_FOUND; value = RechargeCount; return OK; } int setRechargeCount(const unsigned int& newValue) { RechargeCount = newValue; RechargeCount_isNULL = false; return OK; } int getMaxRechargeCount(unsigned int& value) const { if (MaxRechargeCount_isNULL==true) return NOT_FOUND; value = MaxRechargeCount; return OK; } int setMaxRechargeCount(const unsigned int& newValue) { MaxRechargeCount = newValue; MaxRechargeCount_isNULL = false; return OK; } int getRemainingCapacity(unsigned int& value) const { if (RemainingCapacity_isNULL==true) return NOT_FOUND; value = RemainingCapacity; return OK; } int setRemainingCapacity(const unsigned int& newValue) { RemainingCapacity = newValue; RemainingCapacity_isNULL = false; return OK; } int getRemainingCapacityMaxError(unsigned char& value) const { if (RemainingCapacityMaxError_isNULL==true) return NOT_FOUND; value = RemainingCapacityMaxError; return OK; } int setRemainingCapacityMaxError(const unsigned char& newValue) { RemainingCapacityMaxError = newValue; RemainingCapacityMaxError_isNULL = false; return OK; } }; class OpenDRIM_Battery_RequestStateChange_In { public: unsigned short RequestedState; bool RequestedState_isNULL; Objectpath Job; bool Job_isNULL; string TimeoutPeriod; bool TimeoutPeriod_isNULL; OpenDRIM_Battery_RequestStateChange_In() { RequestedState_isNULL = true; Job_isNULL = true; TimeoutPeriod_isNULL = true; } ~OpenDRIM_Battery_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_Battery_RequestStateChange_Out { public: Objectpath Job; bool Job_isNULL; OpenDRIM_Battery_RequestStateChange_Out() { Job_isNULL = true; } ~OpenDRIM_Battery_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_Battery_SetPowerState_In { public: unsigned short PowerState; bool PowerState_isNULL; string Time; bool Time_isNULL; OpenDRIM_Battery_SetPowerState_In() { PowerState_isNULL = true; Time_isNULL = true; } ~OpenDRIM_Battery_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_Battery_EnableDevice_In { public: bool Enabled; bool Enabled_isNULL; OpenDRIM_Battery_EnableDevice_In() { Enabled_isNULL = true; } ~OpenDRIM_Battery_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_Battery_OnlineDevice_In { public: bool Online; bool Online_isNULL; OpenDRIM_Battery_OnlineDevice_In() { Online_isNULL = true; } ~OpenDRIM_Battery_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_Battery_QuiesceDevice_In { public: bool Quiesce; bool Quiesce_isNULL; OpenDRIM_Battery_QuiesceDevice_In() { Quiesce_isNULL = true; } ~OpenDRIM_Battery_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_BATTERY_H_*/ opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_Battery/cmpiOpenDRIM_Battery.cpp0000644000175000017500000004357711401067215026724 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_Battery.h" CMPIObjectPath* Battery_OpenDRIM_Battery_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_Battery& instance) { _E_; Objectpath op(broker, OpenDRIM_Battery_classnames[0], OpenDRIM_Battery_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* Battery_OpenDRIM_Battery_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_Battery& instance) { _E_; Objectpath op(broker, Battery_OpenDRIM_Battery_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.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.PrimaryStatus_isNULL) ci.setProperty("PrimaryStatus", instance.PrimaryStatus); if (!instance.DetailedStatus_isNULL) ci.setProperty("DetailedStatus", instance.DetailedStatus); if (!instance.OperatingStatus_isNULL) ci.setProperty("OperatingStatus", instance.OperatingStatus); if (!instance.CommunicationStatus_isNULL) ci.setProperty("CommunicationStatus", instance.CommunicationStatus); 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.LocationIndicator_isNULL) ci.setProperty("LocationIndicator", instance.LocationIndicator); if (!instance.MaxPowerProduced_isNULL) ci.setProperty("MaxPowerProduced", instance.MaxPowerProduced); if (!instance.MaxPowerProducedUnits_isNULL) ci.setProperty("MaxPowerProducedUnits", instance.MaxPowerProducedUnits); if (!instance.MaxPowerConsumed_isNULL) ci.setProperty("MaxPowerConsumed", instance.MaxPowerConsumed); if (!instance.MaxPowerConsumedUnits_isNULL) ci.setProperty("MaxPowerConsumedUnits", instance.MaxPowerConsumedUnits); if (!instance.BatteryStatus_isNULL) ci.setProperty("BatteryStatus", instance.BatteryStatus); if (!instance.TimeOnBattery_isNULL) ci.setProperty("TimeOnBattery", instance.TimeOnBattery); if (!instance.EstimatedRunTime_isNULL) ci.setProperty("EstimatedRunTime", instance.EstimatedRunTime); if (!instance.EstimatedChargeRemaining_isNULL) ci.setProperty("EstimatedChargeRemaining", instance.EstimatedChargeRemaining); if (!instance.Chemistry_isNULL) ci.setProperty("Chemistry", instance.Chemistry); if (!instance.DesignCapacity_isNULL) ci.setProperty("DesignCapacity", instance.DesignCapacity); if (!instance.FullChargeCapacity_isNULL) ci.setProperty("FullChargeCapacity", instance.FullChargeCapacity); if (!instance.DesignVoltage_isNULL) ci.setProperty("DesignVoltage", instance.DesignVoltage); if (!instance.SmartBatteryVersion_isNULL) ci.setProperty("SmartBatteryVersion", instance.SmartBatteryVersion); if (!instance.TimeToFullCharge_isNULL) ci.setProperty("TimeToFullCharge", instance.TimeToFullCharge); if (!instance.ExpectedLife_isNULL) ci.setProperty("ExpectedLife", instance.ExpectedLife); if (!instance.MaxRechargeTime_isNULL) ci.setProperty("MaxRechargeTime", instance.MaxRechargeTime); if (!instance.RechargeCount_isNULL) ci.setProperty("RechargeCount", instance.RechargeCount); if (!instance.MaxRechargeCount_isNULL) ci.setProperty("MaxRechargeCount", instance.MaxRechargeCount); if (!instance.RemainingCapacity_isNULL) ci.setProperty("RemainingCapacity", instance.RemainingCapacity); if (!instance.RemainingCapacityMaxError_isNULL) ci.setProperty("RemainingCapacityMaxError", instance.RemainingCapacityMaxError); _L_; return ci.getHdl(); } void Battery_OpenDRIM_Battery_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_Battery& 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 Battery_OpenDRIM_Battery_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_Battery& 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.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("PrimaryStatus", instance.PrimaryStatus) == OK) instance.PrimaryStatus_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("CommunicationStatus", instance.CommunicationStatus) == OK) instance.CommunicationStatus_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("LocationIndicator", instance.LocationIndicator) == OK) instance.LocationIndicator_isNULL = false; if (inst.getProperty("MaxPowerProduced", instance.MaxPowerProduced) == OK) instance.MaxPowerProduced_isNULL = false; if (inst.getProperty("MaxPowerProducedUnits", instance.MaxPowerProducedUnits) == OK) instance.MaxPowerProducedUnits_isNULL = false; if (inst.getProperty("MaxPowerConsumed", instance.MaxPowerConsumed) == OK) instance.MaxPowerConsumed_isNULL = false; if (inst.getProperty("MaxPowerConsumedUnits", instance.MaxPowerConsumedUnits) == OK) instance.MaxPowerConsumedUnits_isNULL = false; if (inst.getProperty("BatteryStatus", instance.BatteryStatus) == OK) instance.BatteryStatus_isNULL = false; if (inst.getProperty("TimeOnBattery", instance.TimeOnBattery) == OK) instance.TimeOnBattery_isNULL = false; if (inst.getProperty("EstimatedRunTime", instance.EstimatedRunTime) == OK) instance.EstimatedRunTime_isNULL = false; if (inst.getProperty("EstimatedChargeRemaining", instance.EstimatedChargeRemaining) == OK) instance.EstimatedChargeRemaining_isNULL = false; if (inst.getProperty("Chemistry", instance.Chemistry) == OK) instance.Chemistry_isNULL = false; if (inst.getProperty("DesignCapacity", instance.DesignCapacity) == OK) instance.DesignCapacity_isNULL = false; if (inst.getProperty("FullChargeCapacity", instance.FullChargeCapacity) == OK) instance.FullChargeCapacity_isNULL = false; if (inst.getProperty("DesignVoltage", instance.DesignVoltage) == OK) instance.DesignVoltage_isNULL = false; if (inst.getProperty("SmartBatteryVersion", instance.SmartBatteryVersion) == OK) instance.SmartBatteryVersion_isNULL = false; if (inst.getProperty("TimeToFullCharge", instance.TimeToFullCharge) == OK) instance.TimeToFullCharge_isNULL = false; if (inst.getProperty("ExpectedLife", instance.ExpectedLife) == OK) instance.ExpectedLife_isNULL = false; if (inst.getProperty("MaxRechargeTime", instance.MaxRechargeTime) == OK) instance.MaxRechargeTime_isNULL = false; if (inst.getProperty("RechargeCount", instance.RechargeCount) == OK) instance.RechargeCount_isNULL = false; if (inst.getProperty("MaxRechargeCount", instance.MaxRechargeCount) == OK) instance.MaxRechargeCount_isNULL = false; if (inst.getProperty("RemainingCapacity", instance.RemainingCapacity) == OK) instance.RemainingCapacity_isNULL = false; if (inst.getProperty("RemainingCapacityMaxError", instance.RemainingCapacityMaxError) == OK) instance.RemainingCapacityMaxError_isNULL = false; _L_; } void Battery_OpenDRIM_Battery_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Battery_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 Battery_OpenDRIM_Battery_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_Battery_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 Battery_OpenDRIM_Battery_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Battery_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 Battery_OpenDRIM_Battery_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Battery_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 Battery_OpenDRIM_Battery_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Battery_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 Battery_OpenDRIM_Battery_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Battery_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-battery-1.0.0~ppa/OpenDRIM_Battery/cmpiOpenDRIM_Battery.h0000644000175000017500000000547711401067215026366 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_BATTERY_H_ #define CMPIOPENDRIM_BATTERY_H_ #include "OpenDRIM_Battery.h" CMPIObjectPath* Battery_OpenDRIM_Battery_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_Battery& instance); CMPIInstance* Battery_OpenDRIM_Battery_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_Battery& instance); void Battery_OpenDRIM_Battery_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_Battery& instance); void Battery_OpenDRIM_Battery_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_Battery& instance); void Battery_OpenDRIM_Battery_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Battery_RequestStateChange_In& args); void Battery_OpenDRIM_Battery_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_Battery_RequestStateChange_Out& args); void Battery_OpenDRIM_Battery_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Battery_SetPowerState_In& args); void Battery_OpenDRIM_Battery_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Battery_EnableDevice_In& args); void Battery_OpenDRIM_Battery_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Battery_OnlineDevice_In& args); void Battery_OpenDRIM_Battery_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_Battery_QuiesceDevice_In& args); #endif /*CMPIOPENDRIM_BATTERY_H_*/ opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_Battery/OpenDRIM_BatteryAccess.h0000644000175000017500000001062211401067215026623 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_BATTERYACCESS_H_ #define OPENDRIM_BATTERYACCESS_H_ #include "Battery_Common.h" #include "OpenDRIM_Battery.h" int Battery_OpenDRIM_Battery_load(const CMPIBroker* broker, string& errorMessage); int Battery_OpenDRIM_Battery_unload(string& errorMessage); int Battery_OpenDRIM_Battery_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int Battery_OpenDRIM_Battery_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_Battery& instance, const char** properties, string& errorMessage); int Battery_OpenDRIM_Battery_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Battery& newInstance, const OpenDRIM_Battery& oldInstance, const char** properties, string& errorMessage); int Battery_OpenDRIM_Battery_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Battery& instance, string& errorMessage); int Battery_OpenDRIM_Battery_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Battery& instance, string& errorMessage); int Battery_OpenDRIM_Battery_RequestStateChange(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Battery& instance, unsigned int& returnValue, const OpenDRIM_Battery_RequestStateChange_In& in, OpenDRIM_Battery_RequestStateChange_Out& out, string& errorMessage); int Battery_OpenDRIM_Battery_SetPowerState(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Battery& instance, unsigned int& returnValue, const OpenDRIM_Battery_SetPowerState_In& in, string& errorMessage); int Battery_OpenDRIM_Battery_Reset(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Battery& instance, unsigned int& returnValue, string& errorMessage); int Battery_OpenDRIM_Battery_EnableDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Battery& instance, unsigned int& returnValue, const OpenDRIM_Battery_EnableDevice_In& in, string& errorMessage); int Battery_OpenDRIM_Battery_OnlineDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Battery& instance, unsigned int& returnValue, const OpenDRIM_Battery_OnlineDevice_In& in, string& errorMessage); int Battery_OpenDRIM_Battery_QuiesceDevice(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Battery& instance, unsigned int& returnValue, const OpenDRIM_Battery_QuiesceDevice_In& in, string& errorMessage); int Battery_OpenDRIM_Battery_SaveProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Battery& instance, unsigned int& returnValue, string& errorMessage); int Battery_OpenDRIM_Battery_RestoreProperties(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_Battery& instance, unsigned int& returnValue, string& errorMessage); int Battery_OpenDRIM_Battery_populate(OpenDRIM_Battery& instance, string& errorMessage); #endif /*OPENDRIM_BATTERYACCESS_H_*/ opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_Battery/OpenDRIM_BatteryProvider.cpp0000644000175000017500000004111311401067215027546 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_Battery.h" #include "OpenDRIM_BatteryAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define Battery_OpenDRIM_BatteryProviderSetInstance Battery_OpenDRIM_BatteryProviderModifyInstance #endif int Battery_OpenDRIM_Battery_init(const CMPIBroker* broker); int Battery_OpenDRIM_Battery_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus Battery_OpenDRIM_BatteryProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Battery_OpenDRIM_Battery_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Battery_OpenDRIM_BatteryProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = Battery_OpenDRIM_Battery_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Battery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = Battery_OpenDRIM_Battery_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_BatteryProviderEnumInstances(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 = Battery_OpenDRIM_Battery_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Battery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = Battery_OpenDRIM_Battery_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_BatteryProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_Battery instance; Battery_OpenDRIM_Battery_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Battery_OpenDRIM_Battery_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Battery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = Battery_OpenDRIM_Battery_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_BatteryProviderSetInstance(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_Battery newInstance, oldInstance; Battery_OpenDRIM_Battery_toCPP(_broker, ci, newInstance); Battery_OpenDRIM_Battery_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = Battery_OpenDRIM_Battery_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Battery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_Battery_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Battery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_BatteryProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_Battery instance; Battery_OpenDRIM_Battery_toCPP(_broker, ci, instance); string errorMessage; int errorCode = Battery_OpenDRIM_Battery_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_Battery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_Battery_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Battery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_Battery_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Battery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = Battery_OpenDRIM_Battery_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_BatteryProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_Battery instance; Battery_OpenDRIM_Battery_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Battery_OpenDRIM_Battery_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Battery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_Battery_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Battery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_BatteryProviderExecQuery(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 Battery_OpenDRIM_BatteryProviderMethodCleanup(CMPIMethodMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _E_; int errorCode = Battery_OpenDRIM_Battery_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Battery_OpenDRIM_BatteryProviderInvokeMethod(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_Battery instance; Battery_OpenDRIM_Battery_toCPP(_broker, ref, instance); string errorMessage; const char* properties[] = {"DeviceID", "SystemCreationClassName", "SystemName", "CreationClassName"}; int errorCode = Battery_OpenDRIM_Battery_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Battery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } if ((string) methodName =="RequestStateChange") { unsigned int returnValue; OpenDRIM_Battery_RequestStateChange_In inArgs; Battery_OpenDRIM_Battery_toCPP(_broker, in, inArgs); OpenDRIM_Battery_RequestStateChange_Out outArgs; errorCode = Battery_OpenDRIM_Battery_RequestStateChange(_broker, ctx, instance, returnValue, inArgs, outArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Battery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } Battery_OpenDRIM_Battery_toCMPIArg(_broker, out, outArgs); CMPIValue value = CT_toCMPI(returnValue); CMReturnData(rslt, &value.uint32, CMPI_uint32); } else if ((string) methodName =="SetPowerState") { unsigned int returnValue; OpenDRIM_Battery_SetPowerState_In inArgs; Battery_OpenDRIM_Battery_toCPP(_broker, in, inArgs); errorCode = Battery_OpenDRIM_Battery_SetPowerState(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Battery_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 = Battery_OpenDRIM_Battery_Reset(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Battery_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_Battery_EnableDevice_In inArgs; Battery_OpenDRIM_Battery_toCPP(_broker, in, inArgs); errorCode = Battery_OpenDRIM_Battery_EnableDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Battery_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_Battery_OnlineDevice_In inArgs; Battery_OpenDRIM_Battery_toCPP(_broker, in, inArgs); errorCode = Battery_OpenDRIM_Battery_OnlineDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Battery_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_Battery_QuiesceDevice_In inArgs; Battery_OpenDRIM_Battery_toCPP(_broker, in, inArgs); errorCode = Battery_OpenDRIM_Battery_QuiesceDevice(_broker, ctx, instance, returnValue, inArgs, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Battery_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 = Battery_OpenDRIM_Battery_SaveProperties(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Battery_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 = Battery_OpenDRIM_Battery_RestoreProperties(_broker, ctx, instance, returnValue, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_Battery_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_Battery_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 Battery_OpenDRIM_Battery_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = Battery_OpenDRIM_Battery_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "Battery_OpenDRIM_Battery_init FAILED: " + (string) OpenDRIM_Battery_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int Battery_OpenDRIM_Battery_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = Battery_OpenDRIM_Battery_unload(errorMessage); if (errorCode != OK) { errorMessage += "Battery_OpenDRIM_Battery_unload FAILED: " + (string) OpenDRIM_Battery_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define Battery_OpenDRIM_Battery_INIT if (Battery_OpenDRIM_Battery_init(_broker) < 0) return NULL CMInstanceMIStub(Battery_OpenDRIM_BatteryProvider, Battery_OpenDRIM_BatteryProvider, _broker, Battery_OpenDRIM_Battery_INIT); CMMethodMIStub(Battery_OpenDRIM_BatteryProvider, Battery_OpenDRIM_BatteryProvider, _broker, Battery_OpenDRIM_Battery_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ opendrim-lmp-battery-1.0.0~ppa/COPYING0000644000175000017500000004310311401067215020245 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-battery-1.0.0~ppa/OpenDRIM_BatteryConformsToProfile/0000755000175000017500000000000011401067215025613 5ustar guillaumeguillaume././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryConformsToProfile/OpenDRIM_BatteryConformsToProfileAccess.hopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryConformsToProfile/OpenDRIM_BatteryConformsToProfileAc0000644000175000017500000001100111401067215034375 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_BATTERYCONFORMSTOPROFILEACCESS_H_ #define OPENDRIM_BATTERYCONFORMSTOPROFILEACCESS_H_ #include "Battery_Common.h" #include "OpenDRIM_BatteryConformsToProfile.h" #include "assocOpenDRIM_BatteryConformsToProfile.h" int Battery_OpenDRIM_BatteryConformsToProfile_load(const CMPIBroker* broker, string& errorMessage); int Battery_OpenDRIM_BatteryConformsToProfile_unload(string& errorMessage); int Battery_OpenDRIM_BatteryConformsToProfile_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int Battery_OpenDRIM_BatteryConformsToProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_BatteryConformsToProfile& instance, const char** properties, string& errorMessage); int Battery_OpenDRIM_BatteryConformsToProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryConformsToProfile& newInstance, const OpenDRIM_BatteryConformsToProfile& oldInstance, const char** properties, string& errorMessage); int Battery_OpenDRIM_BatteryConformsToProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryConformsToProfile& instance, string& errorMessage); int Battery_OpenDRIM_BatteryConformsToProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryConformsToProfile& instance, string& errorMessage); int Battery_OpenDRIM_BatteryConformsToProfile_associatorConformantStandardToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ConformantStandard_instance, const char** properties, vector& ManagedElement_associatedInstances, string& errorMessage, const string& discriminant); int Battery_OpenDRIM_BatteryConformsToProfile_associatorManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const char** properties, vector& ConformantStandard_associatedInstances, string& errorMessage, const string& discriminant); int Battery_OpenDRIM_BatteryConformsToProfile_referenceConformantStandardToManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ConformantStandard_instance, const vector& ManagedElement_instances, vector& OpenDRIM_BatteryConformsToProfile_instances, const char** properties, string& errorMessage, const string& discriminant); int Battery_OpenDRIM_BatteryConformsToProfile_referenceManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& ConformantStandard_instances, vector& OpenDRIM_BatteryConformsToProfile_instances, const char** properties, string& errorMessage, const string& discriminant); int Battery_OpenDRIM_BatteryConformsToProfile_populate(OpenDRIM_BatteryConformsToProfile& instance, string& errorMessage); #endif /*OPENDRIM_BATTERYCONFORMSTOPROFILEACCESS_H_*/ opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryConformsToProfile/Makefile.am0000644000175000017500000000501411401067215027647 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiBattery_OpenDRIM_BatteryConformsToProfileProvider.la libcmpiBattery_OpenDRIM_BatteryConformsToProfileProvider_la_SOURCES = OpenDRIM_BatteryConformsToProfileAccess.cpp OpenDRIM_BatteryConformsToProfileProvider.cpp cmpiOpenDRIM_BatteryConformsToProfile.cpp assocOpenDRIM_BatteryConformsToProfile.cpp # May have to be adjusted for direct invocation libcmpiBattery_OpenDRIM_BatteryConformsToProfileProvider_la_CPPFLAGS = -I../CIM_RegisteredProfile -I../CIM_ManagedElement # Uncomment the end for direct invocation, may have to be adjusted libcmpiBattery_OpenDRIM_BatteryConformsToProfileProvider_la_LIBADD = ../Common/libcmpiBattery_Common.la #../CIM_RegisteredProfile/libcmpiBattery_CIM_RegisteredProfileProvider.la ../CIM_ManagedElement/libcmpiBattery_CIM_ManagedElementProvider.la libcmpiBattery_OpenDRIM_BatteryConformsToProfileProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_BatteryConformsToProfile.h OpenDRIM_BatteryConformsToProfile.h OpenDRIM_BatteryConformsToProfileAccess.h ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryConformsToProfile/assocOpenDRIM_BatteryConformsToProfile.hopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryConformsToProfile/assocOpenDRIM_BatteryConformsToProf0000644000175000017500000000630311401067215034501 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_BATTERYCONFORMSTOPROFILE_H_ #define ASSOCOPENDRIM_BATTERYCONFORMSTOPROFILE_H_ #include "OpenDRIM_BatteryConformsToProfileAccess.h" int Battery_OpenDRIM_BatteryConformsToProfile_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 Battery_OpenDRIM_BatteryConformsToProfile_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 Battery_OpenDRIM_BatteryConformsToProfile_enumerateConformantStandards(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int Battery_OpenDRIM_BatteryConformsToProfile_getConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int Battery_OpenDRIM_BatteryConformsToProfile_enumerateManagedElements(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int Battery_OpenDRIM_BatteryConformsToProfile_getManagedElement(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_BATTERYCONFORMSTOPROFILE_H_*/ ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryConformsToProfile/assocOpenDRIM_BatteryConformsToProfile.cppopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryConformsToProfile/assocOpenDRIM_BatteryConformsToProf0000644000175000017500000002144711401067215034507 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_BatteryConformsToProfile.h" int Battery_OpenDRIM_BatteryConformsToProfile_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 = Battery_OpenDRIM_BatteryConformsToProfile_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(Battery_OpenDRIM_BatteryConformsToProfile_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(Battery_OpenDRIM_BatteryConformsToProfile_associatorManagedElementToConformantStandard(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int Battery_OpenDRIM_BatteryConformsToProfile_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(Battery_CIM_RegisteredProfile_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(Battery_CIM_RegisteredProfile_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, Battery_CIM_RegisteredProfile_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int Battery_OpenDRIM_BatteryConformsToProfile_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; Battery_CIM_RegisteredProfile_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(Battery_CIM_RegisteredProfile_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, Battery_CIM_RegisteredProfile_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int Battery_OpenDRIM_BatteryConformsToProfile_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(Battery_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(Battery_CIM_ManagedElement_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, Battery_CIM_ManagedElement_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int Battery_OpenDRIM_BatteryConformsToProfile_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; Battery_CIM_ManagedElement_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(Battery_CIM_ManagedElement_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, Battery_CIM_ManagedElement_toCMPIInstance(broker, _instance)); */ _L_; return OK; } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryConformsToProfile/cmpiOpenDRIM_BatteryConformsToProfile.cppopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryConformsToProfile/cmpiOpenDRIM_BatteryConformsToProfi0000644000175000017500000000632611401067215034477 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_BatteryConformsToProfile.h" CMPIObjectPath* Battery_OpenDRIM_BatteryConformsToProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_BatteryConformsToProfile& instance) { _E_; Objectpath op(broker, OpenDRIM_BatteryConformsToProfile_classnames[0], OpenDRIM_BatteryConformsToProfile_NAMESPACE); if (!instance.ConformantStandard_isNULL) op.addKey("ConformantStandard", instance.ConformantStandard); if (!instance.ManagedElement_isNULL) op.addKey("ManagedElement", instance.ManagedElement); _L_; return op.getHdl(); } CMPIInstance* Battery_OpenDRIM_BatteryConformsToProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_BatteryConformsToProfile& instance) { _E_; Objectpath op(broker, Battery_OpenDRIM_BatteryConformsToProfile_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void Battery_OpenDRIM_BatteryConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_BatteryConformsToProfile& 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 Battery_OpenDRIM_BatteryConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_BatteryConformsToProfile& 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_; } ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryConformsToProfile/OpenDRIM_BatteryConformsToProfile.hopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryConformsToProfile/OpenDRIM_BatteryConformsToProfile.h0000644000175000017500000000725411401067215034376 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_BATTERYCONFORMSTOPROFILE_H_ #define OPENDRIM_BATTERYCONFORMSTOPROFILE_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_BatteryConformsToProfile_classnames[] = {"OpenDRIM_BatteryConformsToProfile"}; static string OpenDRIM_BatteryConformsToProfile_NAMESPACE = _INTEROP_NAMESPACE; const static string ConformantStandard_role = "ConformantStandard"; const static char* ConformantStandard_classnames[] = {"OpenDRIM_RegisteredBatteryProfile"}; const static string ConformantStandard_NAMESPACE = _INTEROP_NAMESPACE; const static string ManagedElement_role = "ManagedElement"; const static char* ManagedElement_classnames[] = {"OpenDRIM_Battery"}; const static string ManagedElement_NAMESPACE = _NAMESPACE; class OpenDRIM_BatteryConformsToProfile { public: Objectpath ConformantStandard; bool ConformantStandard_isNULL; Objectpath ManagedElement; bool ManagedElement_isNULL; OpenDRIM_BatteryConformsToProfile() { ConformantStandard_isNULL = true; ManagedElement_isNULL = true; } ~OpenDRIM_BatteryConformsToProfile() {} 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_BATTERYCONFORMSTOPROFILE_H_*/ ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryConformsToProfile/OpenDRIM_BatteryConformsToProfileProvider.cppopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryConformsToProfile/OpenDRIM_BatteryConformsToProfilePr0000644000175000017500000004275211401067215034454 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_BatteryConformsToProfile.h" #include "OpenDRIM_BatteryConformsToProfileAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define Battery_OpenDRIM_BatteryConformsToProfileProviderSetInstance Battery_OpenDRIM_BatteryConformsToProfileProviderModifyInstance #endif int Battery_OpenDRIM_BatteryConformsToProfile_init(const CMPIBroker* broker); int Battery_OpenDRIM_BatteryConformsToProfile_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus Battery_OpenDRIM_BatteryConformsToProfileProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Battery_OpenDRIM_BatteryConformsToProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Battery_OpenDRIM_BatteryConformsToProfileProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = Battery_OpenDRIM_BatteryConformsToProfile_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = Battery_OpenDRIM_BatteryConformsToProfile_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_BatteryConformsToProfileProviderEnumInstances(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 = Battery_OpenDRIM_BatteryConformsToProfile_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = Battery_OpenDRIM_BatteryConformsToProfile_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_BatteryConformsToProfileProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_BatteryConformsToProfile instance; Battery_OpenDRIM_BatteryConformsToProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Battery_OpenDRIM_BatteryConformsToProfile_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = Battery_OpenDRIM_BatteryConformsToProfile_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_BatteryConformsToProfileProviderSetInstance(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_BatteryConformsToProfile newInstance, oldInstance; Battery_OpenDRIM_BatteryConformsToProfile_toCPP(_broker, ci, newInstance); Battery_OpenDRIM_BatteryConformsToProfile_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = Battery_OpenDRIM_BatteryConformsToProfile_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_BatteryConformsToProfile_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_BatteryConformsToProfileProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_BatteryConformsToProfile instance; Battery_OpenDRIM_BatteryConformsToProfile_toCPP(_broker, ci, instance); string errorMessage; int errorCode = Battery_OpenDRIM_BatteryConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_BatteryConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_BatteryConformsToProfile_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_BatteryConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = Battery_OpenDRIM_BatteryConformsToProfile_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_BatteryConformsToProfileProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_BatteryConformsToProfile instance; Battery_OpenDRIM_BatteryConformsToProfile_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Battery_OpenDRIM_BatteryConformsToProfile_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_BatteryConformsToProfile_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_BatteryConformsToProfileProviderExecQuery(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 Battery_OpenDRIM_BatteryConformsToProfileProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Battery_OpenDRIM_BatteryConformsToProfile_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Battery_OpenDRIM_BatteryConformsToProfileProviderAssociatorNames(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 = Battery_OpenDRIM_BatteryConformsToProfile_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryConformsToProfile_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 Battery_OpenDRIM_BatteryConformsToProfileProviderAssociators(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 = Battery_OpenDRIM_BatteryConformsToProfile_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryConformsToProfile_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 Battery_OpenDRIM_BatteryConformsToProfileProviderReferenceNames(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 = Battery_OpenDRIM_BatteryConformsToProfile_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = Battery_OpenDRIM_BatteryConformsToProfile_referenceConformantStandardToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = Battery_OpenDRIM_BatteryConformsToProfile_referenceManagedElementToConformantStandard(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = Battery_OpenDRIM_BatteryConformsToProfile_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus Battery_OpenDRIM_BatteryConformsToProfileProviderReferences(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 = Battery_OpenDRIM_BatteryConformsToProfile_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = Battery_OpenDRIM_BatteryConformsToProfile_referenceConformantStandardToManagedElement(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = Battery_OpenDRIM_BatteryConformsToProfile_referenceManagedElementToConformantStandard(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_BatteryConformsToProfile_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = Battery_OpenDRIM_BatteryConformsToProfile_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int Battery_OpenDRIM_BatteryConformsToProfile_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = Battery_OpenDRIM_BatteryConformsToProfile_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "Battery_OpenDRIM_BatteryConformsToProfile_init FAILED: " + (string) OpenDRIM_BatteryConformsToProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int Battery_OpenDRIM_BatteryConformsToProfile_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = Battery_OpenDRIM_BatteryConformsToProfile_unload(errorMessage); if (errorCode != OK) { errorMessage += "Battery_OpenDRIM_BatteryConformsToProfile_unload FAILED: " + (string) OpenDRIM_BatteryConformsToProfile_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define Battery_OpenDRIM_BatteryConformsToProfile_INIT if (Battery_OpenDRIM_BatteryConformsToProfile_init(_broker) < 0) return NULL CMInstanceMIStub(Battery_OpenDRIM_BatteryConformsToProfileProvider, Battery_OpenDRIM_BatteryConformsToProfileProvider, _broker, Battery_OpenDRIM_BatteryConformsToProfile_INIT); CMAssociationMIStub(Battery_OpenDRIM_BatteryConformsToProfileProvider, Battery_OpenDRIM_BatteryConformsToProfileProvider, _broker, Battery_OpenDRIM_BatteryConformsToProfile_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryConformsToProfile/OpenDRIM_BatteryConformsToProfileAccess.cppopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryConformsToProfile/OpenDRIM_BatteryConformsToProfileAc0000644000175000017500000002552111401067215034411 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_BatteryConformsToProfileAccess.h" int Battery_OpenDRIM_BatteryConformsToProfile_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(Battery_CIM_RegisteredProfile_load(broker, errorMessage)); CF_assert(Battery_CIM_ManagedElement_load(broker, errorMessage)); */ // TODO _L_; return OK; } int Battery_OpenDRIM_BatteryConformsToProfile_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(Battery_CIM_RegisteredProfile_unload(errorMessage)); CF_assert(Battery_CIM_ManagedElement_unload(errorMessage)); */ // TODO _L_; return OK; } int Battery_OpenDRIM_BatteryConformsToProfile_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 Battery_OpenDRIM_BatteryConformsToProfile_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(Battery_OpenDRIM_BatteryConformsToProfile_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(Battery_OpenDRIM_BatteryConformsToProfile_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; Battery_OpenDRIM_BatteryConformsToProfile_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(Battery_OpenDRIM_BatteryConformsToProfile_referenceConformantStandardToManagedElement(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int Battery_OpenDRIM_BatteryConformsToProfile_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_BatteryConformsToProfile& 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(Battery_OpenDRIM_BatteryConformsToProfile_getConformantStandard(broker, ctx, ConformantStandard_objectpath, ConformantStandard_instance, NULL, errorMessage)); Objectpath ManagedElement_objectpath; instance.getManagedElement(ManagedElement_objectpath); Instance ManagedElement_instance; CF_assert(Battery_OpenDRIM_BatteryConformsToProfile_getManagedElement(broker, ctx, ManagedElement_objectpath, ManagedElement_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(Battery_OpenDRIM_BatteryConformsToProfile_isAssociated(ConformantStandard_instance, ManagedElement_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int Battery_OpenDRIM_BatteryConformsToProfile_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryConformsToProfile& newInstance, const OpenDRIM_BatteryConformsToProfile& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_BatteryConformsToProfile_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_BatteryConformsToProfile_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_BatteryConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_BatteryConformsToProfile_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(Battery_OpenDRIM_BatteryConformsToProfile_enumerateManagedElements(broker, ctx, ManagedElement_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(Battery_OpenDRIM_BatteryConformsToProfile_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(Battery_OpenDRIM_BatteryConformsToProfile_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(Battery_OpenDRIM_BatteryConformsToProfile_enumerateConformantStandards(broker, ctx, ConformantStandard_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(Battery_OpenDRIM_BatteryConformsToProfile_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(Battery_OpenDRIM_BatteryConformsToProfile_enumerateConformantStandards(broker, ctx, ConformantStandard_instances, properties, false, errorMessage)); } for (size_t i=0; i& ManagedElement_instances, vector& OpenDRIM_BatteryConformsToProfile_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_BatteryConformsToProfile instance; instance.setConformantStandard(((Instance) ConformantStandard_instance).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instances[i]).getObjectpath()); OpenDRIM_BatteryConformsToProfile_instances.push_back(instance); } _L_; return OK; } int Battery_OpenDRIM_BatteryConformsToProfile_referenceManagedElementToConformantStandard(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& ManagedElement_instance, const vector& ConformantStandard_instances, vector& OpenDRIM_BatteryConformsToProfile_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_BatteryConformsToProfile instance; instance.setConformantStandard(((Instance) ConformantStandard_instances[i]).getObjectpath()); instance.setManagedElement(((Instance) ManagedElement_instance).getObjectpath()); OpenDRIM_BatteryConformsToProfile_instances.push_back(instance); } _L_; return OK; } int Battery_OpenDRIM_BatteryConformsToProfile_populate(OpenDRIM_BatteryConformsToProfile& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryConformsToProfile/cmpiOpenDRIM_BatteryConformsToProfile.hopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_BatteryConformsToProfile/cmpiOpenDRIM_BatteryConformsToProfi0000644000175000017500000000441711401067215034476 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_BATTERYCONFORMSTOPROFILE_H_ #define CMPIOPENDRIM_BATTERYCONFORMSTOPROFILE_H_ #include "OpenDRIM_BatteryConformsToProfile.h" CMPIObjectPath* Battery_OpenDRIM_BatteryConformsToProfile_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_BatteryConformsToProfile& instance); CMPIInstance* Battery_OpenDRIM_BatteryConformsToProfile_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_BatteryConformsToProfile& instance); void Battery_OpenDRIM_BatteryConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_BatteryConformsToProfile& instance); void Battery_OpenDRIM_BatteryConformsToProfile_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_BatteryConformsToProfile& instance); #endif /*CMPIOPENDRIM_BATTERYCONFORMSTOPROFILE_H_*/ opendrim-lmp-battery-1.0.0~ppa/NEWS0000644000175000017500000000017511401067215017713 0ustar guillaumeguillaumeInitial Release 1.0.0 ========================= // TODO Changes in Major.Minor.Revision ========================= // TODO opendrim-lmp-battery-1.0.0~ppa/LICENSE0000644000175000017500000000274311401067215020224 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_ComputerSystemBattery/0000755000175000017500000000000011401067215025204 5ustar guillaumeguillaume././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_ComputerSystemBattery/OpenDRIM_ComputerSystemBatteryAccess.hopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_ComputerSystemBattery/OpenDRIM_ComputerSystemBatteryAccess.h0000644000175000017500000001060511401067215034474 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_COMPUTERSYSTEMBATTERYACCESS_H_ #define OPENDRIM_COMPUTERSYSTEMBATTERYACCESS_H_ #include "Battery_Common.h" #include "OpenDRIM_ComputerSystemBattery.h" #include "assocOpenDRIM_ComputerSystemBattery.h" int Battery_OpenDRIM_ComputerSystemBattery_load(const CMPIBroker* broker, string& errorMessage); int Battery_OpenDRIM_ComputerSystemBattery_unload(string& errorMessage); int Battery_OpenDRIM_ComputerSystemBattery_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, string& errorMessage, const string& discriminant); int Battery_OpenDRIM_ComputerSystemBattery_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_ComputerSystemBattery& instance, const char** properties, string& errorMessage); int Battery_OpenDRIM_ComputerSystemBattery_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemBattery& newInstance, const OpenDRIM_ComputerSystemBattery& oldInstance, const char** properties, string& errorMessage); int Battery_OpenDRIM_ComputerSystemBattery_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemBattery& instance, string& errorMessage); int Battery_OpenDRIM_ComputerSystemBattery_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemBattery& instance, string& errorMessage); int Battery_OpenDRIM_ComputerSystemBattery_associatorPartComponentToGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& PartComponent_instance, const char** properties, vector& GroupComponent_associatedInstances, string& errorMessage, const string& discriminant); int Battery_OpenDRIM_ComputerSystemBattery_associatorGroupComponentToPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& GroupComponent_instance, const char** properties, vector& PartComponent_associatedInstances, string& errorMessage, const string& discriminant); int Battery_OpenDRIM_ComputerSystemBattery_referencePartComponentToGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& PartComponent_instance, const vector& GroupComponent_instances, vector& OpenDRIM_ComputerSystemBattery_instances, const char** properties, string& errorMessage, const string& discriminant); int Battery_OpenDRIM_ComputerSystemBattery_referenceGroupComponentToPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& GroupComponent_instance, const vector& PartComponent_instances, vector& OpenDRIM_ComputerSystemBattery_instances, const char** properties, string& errorMessage, const string& discriminant); int Battery_OpenDRIM_ComputerSystemBattery_populate(OpenDRIM_ComputerSystemBattery& instance, string& errorMessage); #endif /*OPENDRIM_COMPUTERSYSTEMBATTERYACCESS_H_*/ opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_ComputerSystemBattery/Makefile.am0000644000175000017500000000470411401067215027245 0ustar guillaumeguillaume############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ############################################################################### providerdir = @PROVIDERDIR@ provider_LTLIBRARIES = libcmpiBattery_OpenDRIM_ComputerSystemBatteryProvider.la libcmpiBattery_OpenDRIM_ComputerSystemBatteryProvider_la_SOURCES = OpenDRIM_ComputerSystemBatteryAccess.cpp OpenDRIM_ComputerSystemBatteryProvider.cpp cmpiOpenDRIM_ComputerSystemBattery.cpp assocOpenDRIM_ComputerSystemBattery.cpp # May have to be adjusted for direct invocation libcmpiBattery_OpenDRIM_ComputerSystemBatteryProvider_la_CPPFLAGS = -I../CIM_LogicalDevice -I../CIM_System # Uncomment the end for direct invocation, may have to be adjusted libcmpiBattery_OpenDRIM_ComputerSystemBatteryProvider_la_LIBADD = ../Common/libcmpiBattery_Common.la #../CIM_LogicalDevice/libcmpiBattery_CIM_LogicalDeviceProvider.la ../CIM_System/libcmpiBattery_CIM_SystemProvider.la libcmpiBattery_OpenDRIM_ComputerSystemBatteryProvider_la_LDFLAGS = -avoid-version noinst_HEADERS = cmpiOpenDRIM_ComputerSystemBattery.h OpenDRIM_ComputerSystemBattery.h OpenDRIM_ComputerSystemBatteryAccess.h ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_ComputerSystemBattery/assocOpenDRIM_ComputerSystemBattery.cppopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_ComputerSystemBattery/assocOpenDRIM_ComputerSystemBattery.cp0000644000175000017500000002110711401067215034555 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "assocOpenDRIM_ComputerSystemBattery.h" int Battery_OpenDRIM_ComputerSystemBattery_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 = Battery_OpenDRIM_ComputerSystemBattery_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(Battery_OpenDRIM_ComputerSystemBattery_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(Battery_OpenDRIM_ComputerSystemBattery_associatorGroupComponentToPartComponent(broker, ctx, knownInstance, properties, associatedInstances, errorMessage, dicriminant)); } _L_; return OK; } int Battery_OpenDRIM_ComputerSystemBattery_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(Battery_CIM_LogicalDevice_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(Battery_CIM_LogicalDevice_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, Battery_CIM_LogicalDevice_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int Battery_OpenDRIM_ComputerSystemBattery_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; Battery_CIM_LogicalDevice_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(Battery_CIM_LogicalDevice_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, Battery_CIM_LogicalDevice_toCMPIInstance(broker, _instance)); */ _L_; return OK; } int Battery_OpenDRIM_ComputerSystemBattery_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(Battery_CIM_System_retrieve(broker, ctx, _instances, properties, errorMessage, "ein")); } else { CF_assert(Battery_CIM_System_retrieve(broker, ctx, _instances, properties, errorMessage, "ei")); } for (size_t i=0; i<_instances.size(); i++) instances.push_back(Instance(broker, Battery_CIM_System_toCMPIInstance(broker, _instances[i]))); */ _L_; return OK; } int Battery_OpenDRIM_ComputerSystemBattery_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; Battery_CIM_System_toCPP(broker, objectpath.getHdl(), _instance); CF_assert(Battery_CIM_System_getInstance(broker, ctx, _instance, properties, errorMessage)); instance = Instance(broker, Battery_CIM_System_toCMPIInstance(broker, _instance)); */ _L_; return OK; } opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_ComputerSystemBattery/cmpiOpenDRIM_ComputerSystemBattery.h0000644000175000017500000000435311401067215034226 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef CMPIOPENDRIM_COMPUTERSYSTEMBATTERY_H_ #define CMPIOPENDRIM_COMPUTERSYSTEMBATTERY_H_ #include "OpenDRIM_ComputerSystemBattery.h" CMPIObjectPath* Battery_OpenDRIM_ComputerSystemBattery_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_ComputerSystemBattery& instance); CMPIInstance* Battery_OpenDRIM_ComputerSystemBattery_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_ComputerSystemBattery& instance); void Battery_OpenDRIM_ComputerSystemBattery_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_ComputerSystemBattery& instance); void Battery_OpenDRIM_ComputerSystemBattery_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_ComputerSystemBattery& instance); #endif /*CMPIOPENDRIM_COMPUTERSYSTEMBATTERY_H_*/ opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_ComputerSystemBattery/assocOpenDRIM_ComputerSystemBattery.h0000644000175000017500000000623311401067215034405 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef ASSOCOPENDRIM_COMPUTERSYSTEMBATTERY_H_ #define ASSOCOPENDRIM_COMPUTERSYSTEMBATTERY_H_ #include "OpenDRIM_ComputerSystemBatteryAccess.h" int Battery_OpenDRIM_ComputerSystemBattery_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 Battery_OpenDRIM_ComputerSystemBattery_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 Battery_OpenDRIM_ComputerSystemBattery_enumeratePartComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int Battery_OpenDRIM_ComputerSystemBattery_getPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); int Battery_OpenDRIM_ComputerSystemBattery_enumerateGroupComponents(const CMPIBroker* broker, const CMPIContext* ctx, vector& instances, const char** properties, bool onlyNames, string& errorMessage); int Battery_OpenDRIM_ComputerSystemBattery_getGroupComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Objectpath& objectpath, Instance& instance, const char** properties, string& errorMessage); #endif /*ASSOCOPENDRIM_COMPUTERSYSTEMBATTERY_H_*/ opendrim-lmp-battery-1.0.0~ppa/OpenDRIM_ComputerSystemBattery/OpenDRIM_ComputerSystemBattery.h0000644000175000017500000000701211401067215033350 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #ifndef OPENDRIM_COMPUTERSYSTEMBATTERY_H_ #define OPENDRIM_COMPUTERSYSTEMBATTERY_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_ComputerSystemBattery_classnames[] = {"OpenDRIM_ComputerSystemBattery"}; static string OpenDRIM_ComputerSystemBattery_NAMESPACE = _NAMESPACE; const static string PartComponent_role = "PartComponent"; const static char* PartComponent_classnames[] = {"OpenDRIM_Battery"}; 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_ComputerSystemBattery { public: Objectpath GroupComponent; bool GroupComponent_isNULL; Objectpath PartComponent; bool PartComponent_isNULL; OpenDRIM_ComputerSystemBattery() { GroupComponent_isNULL = true; PartComponent_isNULL = true; } ~OpenDRIM_ComputerSystemBattery() {} 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_COMPUTERSYSTEMBATTERY_H_*/ ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_ComputerSystemBattery/OpenDRIM_ComputerSystemBatteryAccess.cppopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_ComputerSystemBattery/OpenDRIM_ComputerSystemBatteryAccess.c0000644000175000017500000002476211401067215034500 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "OpenDRIM_ComputerSystemBatteryAccess.h" int Battery_OpenDRIM_ComputerSystemBattery_load(const CMPIBroker* broker, string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(Battery_CIM_LogicalDevice_load(broker, errorMessage)); CF_assert(Battery_CIM_System_load(broker, errorMessage)); */ // TODO _L_; return OK; } int Battery_OpenDRIM_ComputerSystemBattery_unload(string& errorMessage) { _E_; /* * for Direct Invocation */ /* CF_assert(Battery_CIM_LogicalDevice_unload(errorMessage)); CF_assert(Battery_CIM_System_unload(errorMessage)); */ // TODO _L_; return OK; } int Battery_OpenDRIM_ComputerSystemBattery_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 Battery_OpenDRIM_ComputerSystemBattery_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(Battery_OpenDRIM_ComputerSystemBattery_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(Battery_OpenDRIM_ComputerSystemBattery_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; Battery_OpenDRIM_ComputerSystemBattery_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(Battery_OpenDRIM_ComputerSystemBattery_referencePartComponentToGroupComponent(broker, ctx, (*c), associatedInstances, result, NULL, errorMessage, ref_discriminant)); } _L_; return OK; } int Battery_OpenDRIM_ComputerSystemBattery_getInstance(const CMPIBroker* broker, const CMPIContext* ctx, OpenDRIM_ComputerSystemBattery& 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(Battery_OpenDRIM_ComputerSystemBattery_getPartComponent(broker, ctx, PartComponent_objectpath, PartComponent_instance, NULL, errorMessage)); Objectpath GroupComponent_objectpath; instance.getGroupComponent(GroupComponent_objectpath); Instance GroupComponent_instance; CF_assert(Battery_OpenDRIM_ComputerSystemBattery_getGroupComponent(broker, ctx, GroupComponent_objectpath, GroupComponent_instance, NULL, errorMessage)); bool isAssociated = false; CF_assert(Battery_OpenDRIM_ComputerSystemBattery_isAssociated(PartComponent_instance, GroupComponent_instance, isAssociated, errorMessage)); if (!isAssociated) { if(errorMessage.empty()) errorMessage = "No instance"; return NOT_FOUND; } _L_; return OK; } int Battery_OpenDRIM_ComputerSystemBattery_setInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemBattery& newInstance, const OpenDRIM_ComputerSystemBattery& oldInstance, const char** properties, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_ComputerSystemBattery_createInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemBattery& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_ComputerSystemBattery_deleteInstance(const CMPIBroker* broker, const CMPIContext* ctx, const OpenDRIM_ComputerSystemBattery& instance, string& errorMessage) { _E_; // TODO _L_; return NOT_SUPPORTED; } int Battery_OpenDRIM_ComputerSystemBattery_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(Battery_OpenDRIM_ComputerSystemBattery_enumerateGroupComponents(broker, ctx, GroupComponent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(Battery_OpenDRIM_ComputerSystemBattery_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(Battery_OpenDRIM_ComputerSystemBattery_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(Battery_OpenDRIM_ComputerSystemBattery_enumeratePartComponents(broker, ctx, PartComponent_instances, properties, false, errorMessage)); if (discriminant=="an") { // Only get the instance names CF_assert(Battery_OpenDRIM_ComputerSystemBattery_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(Battery_OpenDRIM_ComputerSystemBattery_enumeratePartComponents(broker, ctx, PartComponent_instances, properties, false, errorMessage)); } for (size_t i=0; i& GroupComponent_instances, vector& OpenDRIM_ComputerSystemBattery_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_ComputerSystemBattery instance; instance.setPartComponent(((Instance) PartComponent_instance).getObjectpath()); instance.setGroupComponent(((Instance) GroupComponent_instances[i]).getObjectpath()); OpenDRIM_ComputerSystemBattery_instances.push_back(instance); } _L_; return OK; } int Battery_OpenDRIM_ComputerSystemBattery_referenceGroupComponentToPartComponent(const CMPIBroker* broker, const CMPIContext* ctx, const Instance& GroupComponent_instance, const vector& PartComponent_instances, vector& OpenDRIM_ComputerSystemBattery_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_ComputerSystemBattery instance; instance.setPartComponent(((Instance) PartComponent_instances[i]).getObjectpath()); instance.setGroupComponent(((Instance) GroupComponent_instance).getObjectpath()); OpenDRIM_ComputerSystemBattery_instances.push_back(instance); } _L_; return OK; } int Battery_OpenDRIM_ComputerSystemBattery_populate(OpenDRIM_ComputerSystemBattery& instance, string& errorMessage) { _E_; // TODO _L_; return OK; } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_ComputerSystemBattery/OpenDRIM_ComputerSystemBatteryProvider.cppopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_ComputerSystemBattery/OpenDRIM_ComputerSystemBatteryProvider0000644000175000017500000004231011401067215034635 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ComputerSystemBattery.h" #include "OpenDRIM_ComputerSystemBatteryAccess.h" static const CMPIBroker * _broker; #ifdef CMPI_VER_100 #define Battery_OpenDRIM_ComputerSystemBatteryProviderSetInstance Battery_OpenDRIM_ComputerSystemBatteryProviderModifyInstance #endif int Battery_OpenDRIM_ComputerSystemBattery_init(const CMPIBroker* broker); int Battery_OpenDRIM_ComputerSystemBattery_finalize(); /* ---------------------------------------------------------------------------*/ /* Instance Provider Interface */ /* ---------------------------------------------------------------------------*/ CMPIStatus Battery_OpenDRIM_ComputerSystemBatteryProviderCleanup(CMPIInstanceMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Battery_OpenDRIM_ComputerSystemBattery_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Battery_OpenDRIM_ComputerSystemBatteryProviderEnumInstanceNames(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* ref) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; vector instances; string errorMessage; int errorCode = Battery_OpenDRIM_ComputerSystemBattery_retrieve(_broker, ctx, instances, NULL, errorMessage, "ein"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIObjectPath* op = Battery_OpenDRIM_ComputerSystemBattery_toCMPIObjectPath(_broker, instances[i]); CMReturnObjectPath(rslt, op); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_ComputerSystemBatteryProviderEnumInstances(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 = Battery_OpenDRIM_ComputerSystemBattery_retrieve(_broker, ctx, instances, properties, errorMessage, "ei"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < instances.size(); i++) { CMPIInstance* ci = Battery_OpenDRIM_ComputerSystemBattery_toCMPIInstance(_broker, instances[i]); CMReturnInstance(rslt, ci); } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_ComputerSystemBatteryProviderGetInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const char** properties) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ComputerSystemBattery instance; Battery_OpenDRIM_ComputerSystemBattery_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Battery_OpenDRIM_ComputerSystemBattery_getInstance(_broker, ctx, instance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIInstance* ci = Battery_OpenDRIM_ComputerSystemBattery_toCMPIInstance(_broker, instance); CMReturnInstance(rslt, ci); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_ComputerSystemBatteryProviderSetInstance(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_ComputerSystemBattery newInstance, oldInstance; Battery_OpenDRIM_ComputerSystemBattery_toCPP(_broker, ci, newInstance); Battery_OpenDRIM_ComputerSystemBattery_toCPP(_broker, cop, oldInstance); string errorMessage; int errorCode = Battery_OpenDRIM_ComputerSystemBattery_getInstance(_broker, ctx, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_ComputerSystemBattery_setInstance(_broker, ctx, newInstance, oldInstance, properties, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_ComputerSystemBatteryProviderCreateInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop, const CMPIInstance* ci) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ComputerSystemBattery instance; Battery_OpenDRIM_ComputerSystemBattery_toCPP(_broker, ci, instance); string errorMessage; int errorCode = Battery_OpenDRIM_ComputerSystemBattery_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != NOT_FOUND) { if (errorCode == OK) errorCode = ALREADY_EXISTS; errorMessage = (string) OpenDRIM_ComputerSystemBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_ComputerSystemBattery_createInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_ComputerSystemBattery_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMPIObjectPath* _cop = Battery_OpenDRIM_ComputerSystemBattery_toCMPIObjectPath(_broker, instance); CMReturnObjectPath(rslt, _cop); CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_ComputerSystemBatteryProviderDeleteInstance(CMPIInstanceMI* mi, const CMPIContext* ctx, const CMPIResult* rslt, const CMPIObjectPath* cop) { _E_; CMPIStatus rc = {CMPI_RC_OK, NULL}; OpenDRIM_ComputerSystemBattery instance; Battery_OpenDRIM_ComputerSystemBattery_toCPP(_broker, cop, instance); string errorMessage; int errorCode = Battery_OpenDRIM_ComputerSystemBattery_getInstance(_broker, ctx, instance, NULL, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } errorCode = Battery_OpenDRIM_ComputerSystemBattery_deleteInstance(_broker, ctx, instance, errorMessage); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } CMReturnDone(rslt); _L_; return rc; } CMPIStatus Battery_OpenDRIM_ComputerSystemBatteryProviderExecQuery(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 Battery_OpenDRIM_ComputerSystemBatteryProviderAssociationCleanup(CMPIAssociationMI * mi, const CMPIContext* ctx, CMPIBoolean terminate) { _E_; int errorCode = Battery_OpenDRIM_ComputerSystemBattery_finalize(); CMPIStatus rc; CMSetStatus(&rc, (CMPIrc) errorCode); _L_; return rc; } CMPIStatus Battery_OpenDRIM_ComputerSystemBatteryProviderAssociatorNames(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 = Battery_OpenDRIM_ComputerSystemBattery_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemBattery_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 Battery_OpenDRIM_ComputerSystemBatteryProviderAssociators(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 = Battery_OpenDRIM_ComputerSystemBattery_associator(_broker, ctx, cop, known, assocClass, resultClass, role, resultRole, properties, associatedInstances, leftToRight, errorMessage, "a"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemBattery_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 Battery_OpenDRIM_ComputerSystemBatteryProviderReferenceNames(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 = Battery_OpenDRIM_ComputerSystemBattery_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = Battery_OpenDRIM_ComputerSystemBattery_referencePartComponentToGroupComponent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); else errorCode = Battery_OpenDRIM_ComputerSystemBattery_referenceGroupComponentToPartComponent(_broker, ctx, known, associatedInstances, associationInstances, NULL, errorMessage, "rn"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIObjectPath* op = Battery_OpenDRIM_ComputerSystemBattery_toCMPIObjectPath(_broker, associationInstances[i]); CMReturnObjectPath(rslt, op); } _L_; return rc; } CMPIStatus Battery_OpenDRIM_ComputerSystemBatteryProviderReferences(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 = Battery_OpenDRIM_ComputerSystemBattery_associator(_broker, ctx, cop, known, assocClass, NULL, role, NULL, NULL, associatedInstances, leftToRight, errorMessage, "an"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } vector associationInstances; if (leftToRight) errorCode = Battery_OpenDRIM_ComputerSystemBattery_referencePartComponentToGroupComponent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); else errorCode = Battery_OpenDRIM_ComputerSystemBattery_referenceGroupComponentToPartComponent(_broker, ctx, known, associatedInstances, associationInstances, properties, errorMessage, "r"); if (errorCode != OK) { errorMessage = (string) OpenDRIM_ComputerSystemBattery_classnames[0] + ": " + errorMessage; CMSetStatusWithChars(_broker, &rc, (CMPIrc) errorCode, errorMessage.c_str()); return rc; } for (size_t i=0; i < associationInstances.size(); i++) { CMPIInstance* inst = Battery_OpenDRIM_ComputerSystemBattery_toCMPIInstance(_broker, associationInstances[i]); CMReturnInstance(rslt, inst); } _L_; return rc; } /* ---------------------------------------------------------------------------*/ /* End Of Association Provider Interface */ /* ---------------------------------------------------------------------------*/ /* ---------------------------------------------------------------------------*/ /* Provider Factory */ /* ---------------------------------------------------------------------------*/ int Battery_OpenDRIM_ComputerSystemBattery_init(const CMPIBroker* broker) { _E_; _broker = broker; static bool initialized = false; if (!initialized) { string errorMessage; int errorCode = Battery_OpenDRIM_ComputerSystemBattery_load(broker, errorMessage); if (errorCode != OK) { errorMessage += "Battery_OpenDRIM_ComputerSystemBattery_init FAILED: " + (string) OpenDRIM_ComputerSystemBattery_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return -1; } initialized = true; } _L_; return OK; } int Battery_OpenDRIM_ComputerSystemBattery_finalize() { _E_; static bool finalized = false; if (!finalized) { string errorMessage; int errorCode = Battery_OpenDRIM_ComputerSystemBattery_unload(errorMessage); if (errorCode != OK) { errorMessage += "Battery_OpenDRIM_ComputerSystemBattery_unload FAILED: " + (string) OpenDRIM_ComputerSystemBattery_classnames[0] + ": " + errorMessage; string cmd = "/bin/echo \"" + errorMessage + "\" >> cmpi_prov_debug.txt"; system(cmd.c_str()); return errorCode; } finalized = true; } _L_; return OK; } #define Battery_OpenDRIM_ComputerSystemBattery_INIT if (Battery_OpenDRIM_ComputerSystemBattery_init(_broker) < 0) return NULL CMInstanceMIStub(Battery_OpenDRIM_ComputerSystemBatteryProvider, Battery_OpenDRIM_ComputerSystemBatteryProvider, _broker, Battery_OpenDRIM_ComputerSystemBattery_INIT); CMAssociationMIStub(Battery_OpenDRIM_ComputerSystemBatteryProvider, Battery_OpenDRIM_ComputerSystemBatteryProvider, _broker, Battery_OpenDRIM_ComputerSystemBattery_INIT); /* ---------------------------------------------------------------------------*/ /* End of Provider Factory */ /* ---------------------------------------------------------------------------*/ ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_ComputerSystemBattery/cmpiOpenDRIM_ComputerSystemBattery.cppopendrim-lmp-battery-1.0.0~ppa/OpenDRIM_ComputerSystemBattery/cmpiOpenDRIM_ComputerSystemBattery.cpp0000644000175000017500000000620511401067215034557 0ustar guillaumeguillaume/*############################################################################### # Linux Management Providers (LMP), Battery 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 2009 Guillaume BOTTEX, ETRI ###############################################################################*/ #include "cmpiOpenDRIM_ComputerSystemBattery.h" CMPIObjectPath* Battery_OpenDRIM_ComputerSystemBattery_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_ComputerSystemBattery& instance) { _E_; Objectpath op(broker, OpenDRIM_ComputerSystemBattery_classnames[0], OpenDRIM_ComputerSystemBattery_NAMESPACE); if (!instance.GroupComponent_isNULL) op.addKey("GroupComponent", instance.GroupComponent); if (!instance.PartComponent_isNULL) op.addKey("PartComponent", instance.PartComponent); _L_; return op.getHdl(); } CMPIInstance* Battery_OpenDRIM_ComputerSystemBattery_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_ComputerSystemBattery& instance) { _E_; Objectpath op(broker, Battery_OpenDRIM_ComputerSystemBattery_toCMPIObjectPath(broker, instance)); Instance ci(broker, op); _L_; return ci.getHdl(); } void Battery_OpenDRIM_ComputerSystemBattery_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_ComputerSystemBattery& 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 Battery_OpenDRIM_ComputerSystemBattery_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_ComputerSystemBattery& 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_; } opendrim-lmp-battery-1.0.0~ppa/README0000644000175000017500000000103311401067215020066 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!