summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Minar <miminar@redhat.com>2014-06-24 15:10:31 +0200
committerMichal Minar <miminar@redhat.com>2014-07-01 10:06:27 +0200
commit919242a33fb0d7c8e8894beb079fda27249db1db (patch)
tree695a7dcf57cf126eeda8334931c6c12402a3efc8
parent8a9547e3bf5ebbfe84f80d4f4e97606a579d8990 (diff)
downloadopenlmi-providers-919242a33fb0d7c8e8894beb079fda27249db1db.tar.gz
openlmi-providers-919242a33fb0d7c8e8894beb079fda27249db1db.tar.xz
openlmi-providers-919242a33fb0d7c8e8894beb079fda27249db1db.zip
software-dbus: implemented LMI_SoftwareInstCreationProvider
-rw-r--r--src/software-dbus/LMI_SoftwareInstCreationProvider.c46
1 files changed, 40 insertions, 6 deletions
diff --git a/src/software-dbus/LMI_SoftwareInstCreationProvider.c b/src/software-dbus/LMI_SoftwareInstCreationProvider.c
index 3ec79d1..f1a1852 100644
--- a/src/software-dbus/LMI_SoftwareInstCreationProvider.c
+++ b/src/software-dbus/LMI_SoftwareInstCreationProvider.c
@@ -1,10 +1,34 @@
+/*
+ * Copyright (C) 2013-2014 Red Hat, Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Authors: Michal Minar <miminar@redhat.com>
+ */
+
#include <konkret/konkret.h>
+#include "ind_sender.h"
#include "LMI_SoftwareInstCreation.h"
+#include "LMI_SoftwareInstallationJob.h"
+#include "sw-utils.h"
static const CMPIBroker* _cb = NULL;
-static void LMI_SoftwareInstCreationInitialize()
+static void LMI_SoftwareInstCreationInitialize(const CMPIContext *ctx)
{
+ software_init(provider_name, _cb, ctx, provider_config_defaults);
}
static CMPIStatus LMI_SoftwareInstCreationIndicationCleanup(
@@ -12,7 +36,7 @@ static CMPIStatus LMI_SoftwareInstCreationIndicationCleanup(
const CMPIContext* cc,
CMPIBoolean term)
{
- CMReturn(CMPI_RC_OK);
+ return software_cleanup();
}
static CMPIStatus LMI_SoftwareInstCreationAuthorizeFilter(
@@ -23,7 +47,13 @@ static CMPIStatus LMI_SoftwareInstCreationAuthorizeFilter(
const CMPIObjectPath* op,
const char* user)
{
- CMReturn(CMPI_RC_OK);
+ CMPIStatus status = {CMPI_RC_OK, NULL};
+
+ if (!ind_sender_authorize_filter(
+ se, LMI_SoftwareInstallationJob_ClassName, op, user))
+ KSetStatus2(_cb, &status, ERR_FAILED,
+ "Failed to authorize filter!");
+ return status;
}
static CMPIStatus LMI_SoftwareInstCreationMustPoll(
@@ -44,7 +74,8 @@ static CMPIStatus LMI_SoftwareInstCreationActivateFilter(
const CMPIObjectPath* op,
CMPIBoolean firstActivation)
{
- CMReturn(CMPI_RC_OK);
+ return ind_sender_activate_filter(
+ se, LMI_SoftwareInstallationJob_ClassName, op, firstActivation);
}
static CMPIStatus LMI_SoftwareInstCreationDeActivateFilter(
@@ -55,13 +86,15 @@ static CMPIStatus LMI_SoftwareInstCreationDeActivateFilter(
const CMPIObjectPath* op,
CMPIBoolean lastActivation)
{
- CMReturn(CMPI_RC_OK);
+ return ind_sender_deactivate_filter(
+ se, LMI_SoftwareInstallationJob_ClassName, op, lastActivation);
}
static CMPIStatus LMI_SoftwareInstCreationEnableIndications(
CMPIIndicationMI* mi,
const CMPIContext* cc)
{
+ enable_indications();
CMReturn(CMPI_RC_OK);
}
@@ -69,6 +102,7 @@ static CMPIStatus LMI_SoftwareInstCreationDisableIndications(
CMPIIndicationMI* mi,
const CMPIContext* cc)
{
+ disable_indications();
CMReturn(CMPI_RC_OK);
}
@@ -76,7 +110,7 @@ CMIndicationMIStub(
LMI_SoftwareInstCreation,
LMI_SoftwareInstCreation,
_cb,
- LMI_SoftwareInstCreationInitialize())
+ LMI_SoftwareInstCreationInitialize(ctx))
KONKRET_REGISTRATION(
"root/cimv2",