1
/*###############################################################################
2
# Linux Management Providers (LMP), OpenDRIM_RecordLogPackage provider package
3
# Copyright (C) 2007 Ilsoo Byun, ETRI <widepis@etri.re.kr, widepis@empal.com>
5
# This program is being developed under the "OpenDRIM" project.
6
# The "OpenDRIM" project web page: http://opendrim.sourceforge.net
7
# The "OpenDRIM" project mailing list: opendrim@googlegroups.com
9
# This program is free software; you can redistribute it and/or
10
# modify it under the terms of the GNU General Public License
11
# as published by the Free Software Foundation; version 2
14
# This program is distributed in the hope that it will be useful,
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
# GNU General Public License for more details.
19
# You should have received a copy of the GNU General Public License
20
# along with this program; if not, write to the Free Software
21
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22
#################################################################################
24
#################################################################################
25
# To contributors, please leave your contact information in this section
26
# AND comment your changes in the source code.
28
# Modified by 2008 Guillaume BOTTEX, ETRI <guillaumebottex@etri.re.kr, guillaumebottex@gmail.com>
29
###############################################################################*/
31
#include "cmpiOpenDRIM_RecordLog.h"
33
CMPIObjectPath* OpenDRIM_RecordLogPackage_OpenDRIM_RecordLog_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_RecordLog& instance) {
35
Objectpath op(broker, OpenDRIM_RecordLog_classnames[0], OpenDRIM_RecordLog_NAMESPACE);
37
if (!instance.InstanceID_isNULL)
38
op.addKey("InstanceID", instance.InstanceID);
44
CMPIInstance* OpenDRIM_RecordLogPackage_OpenDRIM_RecordLog_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_RecordLog& instance) {
46
Objectpath op(broker, OpenDRIM_RecordLogPackage_OpenDRIM_RecordLog_toCMPIObjectPath(broker, instance));
47
Instance ci(broker, op);
49
if (!instance.Caption_isNULL)
50
ci.setProperty("Caption", instance.Caption);
52
if (!instance.Description_isNULL)
53
ci.setProperty("Description", instance.Description);
55
if (!instance.ElementName_isNULL)
56
ci.setProperty("ElementName", instance.ElementName);
58
if (!instance.InstallDate_isNULL)
59
ci.setPropertyDatetime("InstallDate", instance.InstallDate);
61
if (!instance.Name_isNULL)
62
ci.setProperty("Name", instance.Name);
64
if (!instance.OperationalStatus_isNULL)
65
ci.setProperty("OperationalStatus", instance.OperationalStatus);
67
if (!instance.StatusDescriptions_isNULL)
68
ci.setProperty("StatusDescriptions", instance.StatusDescriptions);
70
if (!instance.Status_isNULL)
71
ci.setProperty("Status", instance.Status);
73
if (!instance.HealthState_isNULL)
74
ci.setProperty("HealthState", instance.HealthState);
76
if (!instance.PrimaryStatus_isNULL)
77
ci.setProperty("PrimaryStatus", instance.PrimaryStatus);
79
if (!instance.DetailedStatus_isNULL)
80
ci.setProperty("DetailedStatus", instance.DetailedStatus);
82
if (!instance.OperatingStatus_isNULL)
83
ci.setProperty("OperatingStatus", instance.OperatingStatus);
85
if (!instance.CommunicationStatus_isNULL)
86
ci.setProperty("CommunicationStatus", instance.CommunicationStatus);
88
if (!instance.EnabledState_isNULL)
89
ci.setProperty("EnabledState", instance.EnabledState);
91
if (!instance.OtherEnabledState_isNULL)
92
ci.setProperty("OtherEnabledState", instance.OtherEnabledState);
94
if (!instance.RequestedState_isNULL)
95
ci.setProperty("RequestedState", instance.RequestedState);
97
if (!instance.EnabledDefault_isNULL)
98
ci.setProperty("EnabledDefault", instance.EnabledDefault);
100
if (!instance.TimeOfLastStateChange_isNULL)
101
ci.setPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange);
103
if (!instance.AvailableRequestedStates_isNULL)
104
ci.setProperty("AvailableRequestedStates", instance.AvailableRequestedStates);
106
if (!instance.TransitioningToState_isNULL)
107
ci.setProperty("TransitioningToState", instance.TransitioningToState);
109
if (!instance.MaxNumberOfRecords_isNULL)
110
ci.setProperty("MaxNumberOfRecords", instance.MaxNumberOfRecords);
112
if (!instance.CurrentNumberOfRecords_isNULL)
113
ci.setProperty("CurrentNumberOfRecords", instance.CurrentNumberOfRecords);
115
if (!instance.LogState_isNULL)
116
ci.setProperty("LogState", instance.LogState);
118
if (!instance.OverwritePolicy_isNULL)
119
ci.setProperty("OverwritePolicy", instance.OverwritePolicy);
121
if (!instance.Facility_isNULL)
122
ci.setProperty("Facility", instance.Facility);
124
if (!instance.Severity_isNULL)
125
ci.setProperty("Severity", instance.Severity);
131
void OpenDRIM_RecordLogPackage_OpenDRIM_RecordLog_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_RecordLog& instance) {
133
Objectpath op(broker, (CMPIObjectPath*) ref);
135
if (op.getKey("InstanceID", instance.InstanceID) == OK)
136
instance.InstanceID_isNULL = false;
141
void OpenDRIM_RecordLogPackage_OpenDRIM_RecordLog_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_RecordLog& instance) {
143
Instance inst(broker, (CMPIInstance*) ci);
145
if (inst.getProperty("Caption", instance.Caption) == OK)
146
instance.Caption_isNULL = false;
148
if (inst.getProperty("Description", instance.Description) == OK)
149
instance.Description_isNULL = false;
151
if (inst.getProperty("ElementName", instance.ElementName) == OK)
152
instance.ElementName_isNULL = false;
154
if (inst.getPropertyDatetime("InstallDate", instance.InstallDate) == OK)
155
instance.InstallDate_isNULL = false;
157
if (inst.getProperty("Name", instance.Name) == OK)
158
instance.Name_isNULL = false;
160
if (inst.getProperty("OperationalStatus", instance.OperationalStatus) == OK)
161
instance.OperationalStatus_isNULL = false;
163
if (inst.getProperty("StatusDescriptions", instance.StatusDescriptions) == OK)
164
instance.StatusDescriptions_isNULL = false;
166
if (inst.getProperty("Status", instance.Status) == OK)
167
instance.Status_isNULL = false;
169
if (inst.getProperty("HealthState", instance.HealthState) == OK)
170
instance.HealthState_isNULL = false;
172
if (inst.getProperty("PrimaryStatus", instance.PrimaryStatus) == OK)
173
instance.PrimaryStatus_isNULL = false;
175
if (inst.getProperty("DetailedStatus", instance.DetailedStatus) == OK)
176
instance.DetailedStatus_isNULL = false;
178
if (inst.getProperty("OperatingStatus", instance.OperatingStatus) == OK)
179
instance.OperatingStatus_isNULL = false;
181
if (inst.getProperty("CommunicationStatus", instance.CommunicationStatus) == OK)
182
instance.CommunicationStatus_isNULL = false;
184
if (inst.getProperty("EnabledState", instance.EnabledState) == OK)
185
instance.EnabledState_isNULL = false;
187
if (inst.getProperty("OtherEnabledState", instance.OtherEnabledState) == OK)
188
instance.OtherEnabledState_isNULL = false;
190
if (inst.getProperty("RequestedState", instance.RequestedState) == OK)
191
instance.RequestedState_isNULL = false;
193
if (inst.getProperty("EnabledDefault", instance.EnabledDefault) == OK)
194
instance.EnabledDefault_isNULL = false;
196
if (inst.getPropertyDatetime("TimeOfLastStateChange", instance.TimeOfLastStateChange) == OK)
197
instance.TimeOfLastStateChange_isNULL = false;
199
if (inst.getProperty("AvailableRequestedStates", instance.AvailableRequestedStates) == OK)
200
instance.AvailableRequestedStates_isNULL = false;
202
if (inst.getProperty("TransitioningToState", instance.TransitioningToState) == OK)
203
instance.TransitioningToState_isNULL = false;
205
if (inst.getProperty("MaxNumberOfRecords", instance.MaxNumberOfRecords) == OK)
206
instance.MaxNumberOfRecords_isNULL = false;
208
if (inst.getProperty("CurrentNumberOfRecords", instance.CurrentNumberOfRecords) == OK)
209
instance.CurrentNumberOfRecords_isNULL = false;
211
if (inst.getProperty("LogState", instance.LogState) == OK)
212
instance.LogState_isNULL = false;
214
if (inst.getProperty("OverwritePolicy", instance.OverwritePolicy) == OK)
215
instance.OverwritePolicy_isNULL = false;
217
if (inst.getProperty("InstanceID", instance.InstanceID) == OK)
218
instance.InstanceID_isNULL = false;
220
if (inst.getProperty("Facility", instance.Facility) == OK)
221
instance.Facility_isNULL = false;
223
if (inst.getProperty("Severity", instance.Severity) == OK)
224
instance.Severity_isNULL = false;
229
void OpenDRIM_RecordLogPackage_OpenDRIM_RecordLog_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_RecordLog_RequestStateChange_In& args) {
234
unsigned short RequestedState;
235
data = in->ft->getArg(in, "RequestedState", &rc);
237
CT_ToC(data, RequestedState);
238
args.setRequestedState(RequestedState);
242
data = in->ft->getArg(in, "Job", &rc);
244
CT_ToC(broker, data, Job);
248
string TimeoutPeriod;
249
data = in->ft->getArg(in, "TimeoutPeriod", &rc);
251
CT_ToCDatetime(data, TimeoutPeriod);
252
args.setTimeoutPeriod(TimeoutPeriod);
258
void OpenDRIM_RecordLogPackage_OpenDRIM_RecordLog_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_RecordLog_RequestStateChange_Out& args) {
264
errorMessage = args.getJob(Job);
265
if (errorMessage == OK) {
266
value = CT_toCMPI(Job);
267
out->ft->addArg(out, "Job", &value, CMPI_ref);