summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Minar <miminar@redhat.com>2014-06-24 15:10:52 +0200
committerMichal Minar <miminar@redhat.com>2014-07-01 10:06:27 +0200
commit6009f6fd26243f73a71a5015d06f3f9480d875eb (patch)
tree7eafea9c2bd9d9a4acef41350231cd6919d395dd
parent919242a33fb0d7c8e8894beb079fda27249db1db (diff)
downloadopenlmi-providers-6009f6fd26243f73a71a5015d06f3f9480d875eb.tar.gz
openlmi-providers-6009f6fd26243f73a71a5015d06f3f9480d875eb.tar.xz
openlmi-providers-6009f6fd26243f73a71a5015d06f3f9480d875eb.zip
software-dbus: implemented LMI_SoftwareInstModificationProvider
-rw-r--r--src/software-dbus/LMI_SoftwareInstModificationProvider.c46
1 files changed, 40 insertions, 6 deletions
diff --git a/src/software-dbus/LMI_SoftwareInstModificationProvider.c b/src/software-dbus/LMI_SoftwareInstModificationProvider.c
index c98f449..ce232aa 100644
--- a/src/software-dbus/LMI_SoftwareInstModificationProvider.c
+++ b/src/software-dbus/LMI_SoftwareInstModificationProvider.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_SoftwareInstModification.h"
+#include "LMI_SoftwareInstallationJob.h"
+#include "sw-utils.h"
static const CMPIBroker* _cb = NULL;
-static void LMI_SoftwareInstModificationInitialize()
+static void LMI_SoftwareInstModificationInitialize(const CMPIContext *ctx)
{
+ software_init(provider_name, _cb, ctx, provider_config_defaults);
}
static CMPIStatus LMI_SoftwareInstModificationIndicationCleanup(
@@ -12,7 +36,7 @@ static CMPIStatus LMI_SoftwareInstModificationIndicationCleanup(
const CMPIContext* cc,
CMPIBoolean term)
{
- CMReturn(CMPI_RC_OK);
+ return software_cleanup();
}
static CMPIStatus LMI_SoftwareInstModificationAuthorizeFilter(
@@ -23,7 +47,13 @@ static CMPIStatus LMI_SoftwareInstModificationAuthorizeFilter(
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_SoftwareInstModificationMustPoll(
@@ -44,7 +74,8 @@ static CMPIStatus LMI_SoftwareInstModificationActivateFilter(
const CMPIObjectPath* op,
CMPIBoolean firstActivation)
{
- CMReturn(CMPI_RC_OK);
+ return ind_sender_activate_filter(
+ se, LMI_SoftwareInstallationJob_ClassName, op, firstActivation);
}
static CMPIStatus LMI_SoftwareInstModificationDeActivateFilter(
@@ -55,13 +86,15 @@ static CMPIStatus LMI_SoftwareInstModificationDeActivateFilter(
const CMPIObjectPath* op,
CMPIBoolean lastActivation)
{
- CMReturn(CMPI_RC_OK);
+ return ind_sender_deactivate_filter(
+ se, LMI_SoftwareInstallationJob_ClassName, op, lastActivation);
}
static CMPIStatus LMI_SoftwareInstModificationEnableIndications(
CMPIIndicationMI* mi,
const CMPIContext* cc)
{
+ enable_indications();
CMReturn(CMPI_RC_OK);
}
@@ -69,6 +102,7 @@ static CMPIStatus LMI_SoftwareInstModificationDisableIndications(
CMPIIndicationMI* mi,
const CMPIContext* cc)
{
+ disable_indications();
CMReturn(CMPI_RC_OK);
}
@@ -76,7 +110,7 @@ CMIndicationMIStub(
LMI_SoftwareInstModification,
LMI_SoftwareInstModification,
_cb,
- LMI_SoftwareInstModificationInitialize())
+ LMI_SoftwareInstModificationInitialize(ctx))
KONKRET_REGISTRATION(
"root/cimv2",