#include #include #include "Linux_HostedService.h" #include "globals.h" static const CMPIBroker* _cb; static void Linux_HostedServiceInitialize() { } static CMPIStatus Linux_HostedServiceCleanup( CMPIInstanceMI* mi, const CMPIContext* cc, CMPIBoolean term) { CMReturn(CMPI_RC_OK); } static CMPIStatus Linux_HostedServiceEnumInstanceNames( CMPIInstanceMI* mi, const CMPIContext* cc, const CMPIResult* cr, const CMPIObjectPath* cop) { return KDefaultEnumerateInstanceNames( _cb, mi, cc, cr, cop); } static CMPIStatus Linux_HostedServiceEnumInstances( CMPIInstanceMI* mi, const CMPIContext* cc, const CMPIResult* cr, const CMPIObjectPath* cop, const char** properties) { CMPIStatus rc; const char *ns = KNameSpace(cop); Linux_HostedService w; Linux_HostedService_Init(&w, _cb, ns); CIM_ComputerSystemRef computerSystemRef; CIM_ComputerSystemRef_Init(&computerSystemRef, _cb, ns); CIM_ComputerSystemRef_Set_Name(&computerSystemRef, get_system_name()); CIM_ComputerSystemRef_Set_CreationClassName(&computerSystemRef, get_system_creation_class_name()); CMPIObjectPath *computerSystemOP = CIM_ComputerSystemRef_ToObjectPath(&computerSystemRef, &rc); computerSystemOP->ft->setClassName(computerSystemOP, get_system_creation_class_name()); Linux_HostedService_SetObjectPath_Antecedent(&w, computerSystemOP); Linux_PowerManagementServiceRef powerManagementServiceRef; Linux_PowerManagementServiceRef_Init(&powerManagementServiceRef, _cb, ns); Linux_PowerManagementServiceRef_Set_Name(&powerManagementServiceRef, get_system_name()); Linux_PowerManagementServiceRef_Set_SystemName(&powerManagementServiceRef, get_system_name()); Linux_PowerManagementServiceRef_Set_CreationClassName(&powerManagementServiceRef, "Linux_PowerManagementService"); Linux_PowerManagementServiceRef_Set_SystemCreationClassName(&powerManagementServiceRef, get_system_creation_class_name()); Linux_HostedService_Set_Dependent(&w, &powerManagementServiceRef); KReturnInstance(cr, w); CMReturn(CMPI_RC_OK); } static CMPIStatus Linux_HostedServiceGetInstance( CMPIInstanceMI* mi, const CMPIContext* cc, const CMPIResult* cr, const CMPIObjectPath* cop, const char** properties) { return KDefaultGetInstance( _cb, mi, cc, cr, cop, properties); } static CMPIStatus Linux_HostedServiceCreateInstance( CMPIInstanceMI* mi, const CMPIContext* cc, const CMPIResult* cr, const CMPIObjectPath* cop, const CMPIInstance* ci) { CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } static CMPIStatus Linux_HostedServiceModifyInstance( CMPIInstanceMI* mi, const CMPIContext* cc, const CMPIResult* cr, const CMPIObjectPath* cop, const CMPIInstance* ci, const char**properties) { CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } static CMPIStatus Linux_HostedServiceDeleteInstance( CMPIInstanceMI* mi, const CMPIContext* cc, const CMPIResult* cr, const CMPIObjectPath* cop) { CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } static CMPIStatus Linux_HostedServiceExecQuery( CMPIInstanceMI* mi, const CMPIContext* cc, const CMPIResult* cr, const CMPIObjectPath* cop, const char* lang, const char* query) { CMReturn(CMPI_RC_ERR_NOT_SUPPORTED); } static CMPIStatus Linux_HostedServiceAssociationCleanup( CMPIAssociationMI* mi, const CMPIContext* cc, CMPIBoolean term) { CMReturn(CMPI_RC_OK); } static CMPIStatus Linux_HostedServiceAssociators( CMPIAssociationMI* mi, const CMPIContext* cc, const CMPIResult* cr, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole, const char** properties) { return KDefaultAssociators( _cb, mi, cc, cr, cop, Linux_HostedService_ClassName, assocClass, resultClass, role, resultRole, properties); } static CMPIStatus Linux_HostedServiceAssociatorNames( CMPIAssociationMI* mi, const CMPIContext* cc, const CMPIResult* cr, const CMPIObjectPath* cop, const char* assocClass, const char* resultClass, const char* role, const char* resultRole) { return KDefaultAssociatorNames( _cb, mi, cc, cr, cop, Linux_HostedService_ClassName, assocClass, resultClass, role, resultRole); } static CMPIStatus Linux_HostedServiceReferences( CMPIAssociationMI* mi, const CMPIContext* cc, const CMPIResult* cr, const CMPIObjectPath* cop, const char* assocClass, const char* role, const char** properties) { return KDefaultReferences( _cb, mi, cc, cr, cop, Linux_HostedService_ClassName, assocClass, role, properties); } static CMPIStatus Linux_HostedServiceReferenceNames( CMPIAssociationMI* mi, const CMPIContext* cc, const CMPIResult* cr, const CMPIObjectPath* cop, const char* assocClass, const char* role) { return KDefaultReferenceNames( _cb, mi, cc, cr, cop, Linux_HostedService_ClassName, assocClass, role); } CMInstanceMIStub( Linux_HostedService, Linux_HostedService, _cb, Linux_HostedServiceInitialize()) CMAssociationMIStub( Linux_HostedService, Linux_HostedService, _cb, Linux_HostedServiceInitialize()) KONKRET_REGISTRATION( "root/cimv2", "Linux_HostedService", "Linux_HostedService", "instance association")