ref: refs/heads/master
commit 3cdc6f976547241507d365810c350abfc51e530b
Author: Michael Calmer
Date: Tue Feb 3 17:19:26 2009 +0100
add typ method to SUSE_SoftwareInstallationService
---
mof/SUSE_SoftwareInstallationService.sfcb.reg | 2 +-
src/SUSE_SoftwareInstallationServiceProvider.cc | 37 +++++++++++++++++++++++
src/SUSE_SoftwareInstallationServiceProvider.h | 11 ++++++-
3 files changed, 48 insertions(+), 2 deletions(-)
diff --git a/mof/SUSE_SoftwareInstallationService.sfcb.reg b/mof/SUSE_SoftwareInstallationService.sfcb.reg
index d5c1928..4838137 100644
--- a/mof/SUSE_SoftwareInstallationService.sfcb.reg
+++ b/mof/SUSE_SoftwareInstallationService.sfcb.reg
@@ -1,5 +1,5 @@
[SUSE_SoftwareInstallationService]
provider: SUSE_SoftwareInstallationServiceProvider
location: cmpi-zypp
- type: instance
+ type: instance method
namespace: root/cimv2
diff --git a/src/SUSE_SoftwareInstallationServiceProvider.cc b/src/SUSE_SoftwareInstallationServiceProvider.cc
index d1912c1..a70e461 100644
--- a/src/SUSE_SoftwareInstallationServiceProvider.cc
+++ b/src/SUSE_SoftwareInstallationServiceProvider.cc
@@ -30,6 +30,7 @@ namespace cmpizypp
SUSE_SoftwareInstallationServiceProviderClass::SUSE_SoftwareInstallationServiceProviderClass( const CmpiBroker & mbp, const CmpiContext & ctx )
: CmpiBaseMI( mbp, ctx )
, CmpiInstanceMI( mbp, ctx )
+ , CmpiMethodMI( mbp, ctx )
{
}
@@ -120,8 +121,44 @@ CmpiStatus SUSE_SoftwareInstallationServiceProviderClass::getInstance( const Cmp
return CmpiStatus(CMPI_RC_OK);
}
+CmpiStatus SUSE_SoftwareInstallationServiceProviderClass::invokeMethod (const CmpiContext &ctx, CmpiResult &rslt,
+ const CmpiObjectPath &ref, const char *methodName,
+ const CmpiArgs &in, CmpiArgs &out)
+{
+ _CMPIZYPP_TRACE(1,("--- %s CMPI invokeMethod() called with method: %s",_ClassName, methodName));
+
+ if( ::strcasecmp( ref.getClassName().charPtr(), _ClassName) != 0 )
+ {
+ return CmpiStatus(CMPI_RC_ERR_NOT_SUPPORTED, "invalid classname");
+ }
+ CmpiStatus st(CMPI_RC_ERR_NOT_SUPPORTED);
+
+ if( ::strcasecmp( methodName, "InstallFromSoftwareIdentity" ) == 0)
+ {
+ st = this->installFromSoftwareIdentity(ctx, rslt, ref, in, out);
+ }
+
+ _CMPIZYPP_TRACE(1,("--- %s CMPI invokeMethod() exited",_ClassName));
+ return st;
+}
+
+/* ========================= private ================================== */
+CmpiStatus SUSE_SoftwareInstallationServiceProviderClass::installFromSoftwareIdentity(const CmpiContext &ctx,
+ CmpiResult &rslt,
+ const CmpiObjectPath &ref,
+ const CmpiArgs &in, CmpiArgs &out)
+{
+ CmpiStatus st(CMPI_RC_ERR_NOT_SUPPORTED);
+ _CMPIZYPP_TRACE(1,("--- %s CMPI installFromSoftwareIdentity() called.",_ClassName));
+
+
+ _CMPIZYPP_TRACE(1,("--- %s CMPI installFromSoftwareIdentity() exited.",_ClassName));
+ return st;
+}
+
} // namespace cmpizypp
CMProviderBase( SUSE_SoftwareInstallationServiceProvider );
CMInstanceMIFactory( cmpizypp::SUSE_SoftwareInstallationServiceProviderClass, SUSE_SoftwareInstallationServiceProvider );
+CMMethodMIFactory( cmpizypp::SUSE_SoftwareInstallationServiceProviderClass, SUSE_SoftwareInstallationServiceProvider );
diff --git a/src/SUSE_SoftwareInstallationServiceProvider.h b/src/SUSE_SoftwareInstallationServiceProvider.h
index 4d8714f..ced16da 100644
--- a/src/SUSE_SoftwareInstallationServiceProvider.h
+++ b/src/SUSE_SoftwareInstallationServiceProvider.h
@@ -2,12 +2,13 @@
#define SUSE_SOFTWAREINSTALLATIONSERVICEPROVIDER_H
#include
+#include
namespace cmpizypp
{
/**
*/
- class SUSE_SoftwareInstallationServiceProviderClass : public CmpiInstanceMI
+ class SUSE_SoftwareInstallationServiceProviderClass : public CmpiInstanceMI, public CmpiMethodMI
{
public:
SUSE_SoftwareInstallationServiceProviderClass( const CmpiBroker & mbp, const CmpiContext & ctx );
@@ -15,6 +16,14 @@ namespace cmpizypp
virtual CmpiStatus enumInstanceNames( const CmpiContext& ctx, CmpiResult& rslt, const CmpiObjectPath & cop );
virtual CmpiStatus enumInstances( const CmpiContext & ctx, CmpiResult & rslt, const CmpiObjectPath & cop, const char** properties );
virtual CmpiStatus getInstance( const CmpiContext &ctx, CmpiResult &rslt, const CmpiObjectPath &cop, const char **properties );
+
+ virtual CmpiStatus invokeMethod (const CmpiContext &ctx, CmpiResult &rslt,
+ const CmpiObjectPath &ref, const char *methodName,
+ const CmpiArgs &in, CmpiArgs &out);
+
+ private:
+ CmpiStatus installFromSoftwareIdentity(const CmpiContext &ctx, CmpiResult &rslt,
+ const CmpiObjectPath &ref, const CmpiArgs &in, CmpiArgs &out);
};
} // namespace cmpizypp
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org