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>
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 2009 Khahramon NURIDDINOV, TUIT <qahramon0786@gmail.com>
29
# Modified by 2009 Guillaume BOTTEX, ETRI <guillaumebottex@etri.re.kr>
30
################################################################################*/
32
#include "cmpiOpenDRIM_AccountManagementCapabilities.h"
33
#include "OpenDRIM_AccountManagementCapabilitiesAccess.h"
37
#define ToString(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value; os << endl
38
#define ToStringInt(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << (long) instance.value; os << endl
39
#define ToStringRef(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value.toString(); os << endl
40
#define ToStringArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl
41
#define ToStringArrayInt(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << (long) instance.value[i]; if (i < instance.value.size()-1) os << ","; } os << "]" << endl
42
#define ToStringRefArray(name, value, condition) os << (string) " " + name + (string) "=["; for (size_t i = 0; i < instance.value.size(); i++) { os << instance.value[i].toString(); if (i < instance.value.size()-1) os << ","; } os << "]" << endl
44
ostream& operator<<(ostream& os, OpenDRIM_AccountManagementCapabilities& instance) {
45
os << " [OpenDRIM_AccountManagementCapabilities]" << endl;
46
ToString("Caption", Caption, Caption_isNULL);
47
ToString("Description", Description, Description_isNULL);
48
ToString("InstanceID", InstanceID, InstanceID_isNULL);
49
ToString("ElementName", ElementName, ElementName_isNULL);
50
ToStringInt("MaxElementNameLen", MaxElementNameLen, MaxElementNameLen_isNULL);
51
ToStringArrayInt("RequestedStatesSupported", RequestedStatesSupported, RequestedStatesSupported_isNULL);
52
ToString("ElementNameMask", ElementNameMask, ElementNameMask_isNULL);
53
ToStringArrayInt("StateAwareness", StateAwareness, StateAwareness_isNULL);
54
ToStringArrayInt("RequestedStateSupported", RequestedStateSupported, RequestedStateSupported_isNULL);
55
ToString("ElementNameEditSupported", ElementNameEditSupported, ElementNameEditSupported_isNULL);
56
ToStringArrayInt("OperationsSupported", OperationsSupported, OperationsSupported_isNULL);
57
os << " [\\OpenDRIM_AccountManagementCapabilities]" << endl;
65
int errorCode = Simple_Identity_Management_OpenDRIM_AccountManagementCapabilities_load(NULL, errorMessage);
66
if (errorCode != OK) {
67
cout << "ERROR " << errorCode << ": " << errorMessage << endl;
71
cout << endl << "[enumInstances]" << endl;
72
vector<OpenDRIM_AccountManagementCapabilities> instances;
74
errorCode = Simple_Identity_Management_OpenDRIM_AccountManagementCapabilities_retrieve(NULL, NULL, instances, NULL, errorMessage, "ei");
75
if (errorCode != OK) {
76
cout << "ERROR " << errorCode << ": " << errorMessage << endl;
80
vector<OpenDRIM_AccountManagementCapabilities>::iterator it = instances.begin();
81
for (; it != instances.end(); ++it) {
85
cout << "[\\enumInstances]" << endl;
86
cout << endl << "[enumInstanceNames & getInstance]" << endl;
89
errorCode = Simple_Identity_Management_OpenDRIM_AccountManagementCapabilities_retrieve(NULL, NULL, instances, NULL, errorMessage, "ein");
90
if (errorCode != OK) {
91
cout << "ERROR " << errorCode << ": " << errorMessage << endl;
95
it = instances.begin();
96
for (; it != instances.end(); ++it) {
97
errorCode = Simple_Identity_Management_OpenDRIM_AccountManagementCapabilities_getInstance(NULL, NULL, *it, NULL, errorMessage);
98
if (errorCode != OK) {
99
cout << "ERROR " << errorCode << ": " << errorMessage << endl;
105
cout << "[\\enumInstanceNames & getInstance]" << endl;
108
errorCode = Simple_Identity_Management_OpenDRIM_AccountManagementCapabilities_unload(errorMessage);
109
if (errorCode != OK) {
110
cout << "ERROR " << errorCode << ": " << errorMessage << endl;