~ubuntu-branches/ubuntu/saucy/opendrim-lmp-simpleidentitymanagement/saucy

« back to all changes in this revision

Viewing changes to OpenDRIM_AccountManagementCapabilities/cmpiOpenDRIM_AccountManagementCapabilities.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Guillaume BOTTEX
  • Date: 2010-06-21 15:54:00 UTC
  • Revision ID: james.westby@ubuntu.com-20100621155400-myesv5hd2f3s8x9y
Tags: upstream-1.0.0
ImportĀ upstreamĀ versionĀ 1.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*################################################################################
 
2
# Linux Management Providers (LMP), Simple Identity Management provider package
 
3
# Copyright (C) 2007 Frederic Desmons, ETRI <desmons@etri.re.kr, desmons_frederic@yahoo.fr>
 
4
 
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
 
8
 
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
 
12
# of the License.
 
13
 
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.
 
18
 
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
#################################################################################
 
23
 
 
24
#################################################################################
 
25
# To contributors, please leave your contact information in this section
 
26
# AND comment your changes in the source code.
 
27
 
28
# Modified by 2009 Khahramon NURIDDINOV, TUIT <qahramon0786@gmail.com>
 
29
# Modified by 2009 Guillaume BOTTEX, ETRI <guillaumebottex@etri.re.kr>
 
30
################################################################################*/
 
31
 
 
32
#include "cmpiOpenDRIM_AccountManagementCapabilities.h"
 
33
 
 
34
CMPIObjectPath* Simple_Identity_Management_OpenDRIM_AccountManagementCapabilities_toCMPIObjectPath(const CMPIBroker* broker, const OpenDRIM_AccountManagementCapabilities& instance) {
 
35
        _E_;
 
36
        Objectpath op(broker, OpenDRIM_AccountManagementCapabilities_classnames[0], OpenDRIM_AccountManagementCapabilities_NAMESPACE);
 
37
 
 
38
        if (!instance.InstanceID_isNULL)
 
39
                op.addKey("InstanceID", instance.InstanceID);
 
40
 
 
41
        _L_;
 
42
        return op.getHdl();
 
43
}
 
44
 
 
45
CMPIInstance* Simple_Identity_Management_OpenDRIM_AccountManagementCapabilities_toCMPIInstance(const CMPIBroker* broker, const OpenDRIM_AccountManagementCapabilities& instance) {
 
46
        _E_;
 
47
        Objectpath op(broker, Simple_Identity_Management_OpenDRIM_AccountManagementCapabilities_toCMPIObjectPath(broker, instance));
 
48
        Instance ci(broker, op);
 
49
 
 
50
        if (!instance.Caption_isNULL)
 
51
                ci.setProperty("Caption", instance.Caption);
 
52
 
 
53
        if (!instance.Description_isNULL)
 
54
                ci.setProperty("Description", instance.Description);
 
55
 
 
56
        if (!instance.ElementName_isNULL)
 
57
                ci.setProperty("ElementName", instance.ElementName);
 
58
 
 
59
        if (!instance.MaxElementNameLen_isNULL)
 
60
                ci.setProperty("MaxElementNameLen", instance.MaxElementNameLen);
 
61
 
 
62
        if (!instance.RequestedStatesSupported_isNULL)
 
63
                ci.setProperty("RequestedStatesSupported", instance.RequestedStatesSupported);
 
64
 
 
65
        if (!instance.ElementNameMask_isNULL)
 
66
                ci.setProperty("ElementNameMask", instance.ElementNameMask);
 
67
 
 
68
        if (!instance.StateAwareness_isNULL)
 
69
                ci.setProperty("StateAwareness", instance.StateAwareness);
 
70
 
 
71
        if (!instance.RequestedStateSupported_isNULL)
 
72
                ci.setProperty("RequestedStateSupported", instance.RequestedStateSupported);
 
73
 
 
74
        if (!instance.ElementNameEditSupported_isNULL)
 
75
                ci.setProperty("ElementNameEditSupported", instance.ElementNameEditSupported);
 
76
 
 
77
        if (!instance.OperationsSupported_isNULL)
 
78
                ci.setProperty("OperationsSupported", instance.OperationsSupported);
 
79
 
 
80
        _L_;
 
81
        return ci.getHdl();
 
82
}
 
83
 
 
84
void Simple_Identity_Management_OpenDRIM_AccountManagementCapabilities_toCPP(const CMPIBroker* broker, const CMPIObjectPath* ref, OpenDRIM_AccountManagementCapabilities& instance) {
 
85
        _E_;
 
86
        Objectpath op(broker, (CMPIObjectPath*) ref);
 
87
 
 
88
        if (op.getKey("InstanceID", instance.InstanceID) == OK)
 
89
                instance.InstanceID_isNULL = false;
 
90
 
 
91
        _L_;
 
92
}
 
93
 
 
94
void Simple_Identity_Management_OpenDRIM_AccountManagementCapabilities_toCPP(const CMPIBroker* broker, const CMPIInstance* ci, OpenDRIM_AccountManagementCapabilities& instance) {
 
95
        _E_;
 
96
        Instance inst(broker, (CMPIInstance*) ci);
 
97
 
 
98
        if (inst.getProperty("Caption", instance.Caption) == OK)
 
99
                instance.Caption_isNULL = false;
 
100
 
 
101
        if (inst.getProperty("Description", instance.Description) == OK)
 
102
                instance.Description_isNULL = false;
 
103
 
 
104
        if (inst.getProperty("InstanceID", instance.InstanceID) == OK)
 
105
                instance.InstanceID_isNULL = false;
 
106
 
 
107
        if (inst.getProperty("ElementName", instance.ElementName) == OK)
 
108
                instance.ElementName_isNULL = false;
 
109
 
 
110
        if (inst.getProperty("MaxElementNameLen", instance.MaxElementNameLen) == OK)
 
111
                instance.MaxElementNameLen_isNULL = false;
 
112
 
 
113
        if (inst.getProperty("RequestedStatesSupported", instance.RequestedStatesSupported) == OK)
 
114
                instance.RequestedStatesSupported_isNULL = false;
 
115
 
 
116
        if (inst.getProperty("ElementNameMask", instance.ElementNameMask) == OK)
 
117
                instance.ElementNameMask_isNULL = false;
 
118
 
 
119
        if (inst.getProperty("StateAwareness", instance.StateAwareness) == OK)
 
120
                instance.StateAwareness_isNULL = false;
 
121
 
 
122
        if (inst.getProperty("RequestedStateSupported", instance.RequestedStateSupported) == OK)
 
123
                instance.RequestedStateSupported_isNULL = false;
 
124
 
 
125
        if (inst.getProperty("ElementNameEditSupported", instance.ElementNameEditSupported) == OK)
 
126
                instance.ElementNameEditSupported_isNULL = false;
 
127
 
 
128
        if (inst.getProperty("OperationsSupported", instance.OperationsSupported) == OK)
 
129
                instance.OperationsSupported_isNULL = false;
 
130
 
 
131
        _L_;
 
132
}
 
133
 
 
134
void Simple_Identity_Management_OpenDRIM_AccountManagementCapabilities_toCPP(const CMPIBroker* broker, const CMPIArgs* in, OpenDRIM_AccountManagementCapabilities_CreateGoalSettings_In& args) {
 
135
        _E_;
 
136
        CMPIStatus rc;
 
137
        CMPIData data;
 
138
 
 
139
        vector<string> TemplateGoalSettings;
 
140
        data = in->ft->getArg(in, "TemplateGoalSettings", &rc);
 
141
        if (rc.rc == OK) {
 
142
                CT_ToC(data, TemplateGoalSettings);     
 
143
                args.setTemplateGoalSettings(TemplateGoalSettings);
 
144
        }                       
 
145
 
 
146
        vector<string> SupportedGoalSettings;
 
147
        data = in->ft->getArg(in, "SupportedGoalSettings", &rc);
 
148
        if (rc.rc == OK) {
 
149
                CT_ToC(data, SupportedGoalSettings);    
 
150
                args.setSupportedGoalSettings(SupportedGoalSettings);
 
151
        }                       
 
152
 
 
153
        _L_;
 
154
}
 
155
 
 
156
void Simple_Identity_Management_OpenDRIM_AccountManagementCapabilities_toCMPIArg(const CMPIBroker* broker, CMPIArgs* out, const OpenDRIM_AccountManagementCapabilities_CreateGoalSettings_Out& args) {
 
157
        _E_;
 
158
        CMPIValue value;
 
159
        int errorMessage;
 
160
 
 
161
        vector<string> SupportedGoalSettings;
 
162
        errorMessage = args.getSupportedGoalSettings(SupportedGoalSettings);
 
163
        if (errorMessage == OK) {
 
164
                value = CT_toCMPI(broker, SupportedGoalSettings);
 
165
                out->ft->addArg(out, "SupportedGoalSettings", &value, CMPI_stringA);
 
166
        }
 
167
 
 
168
        _L_;
 
169
}