1
/*###############################################################################
2
# Linux Management Providers (LMP), SSH provider package
3
# Copyright (C) 2010 Feng Zhanlei, REDFLAG <fengzhanlei@redflag-linux.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 Guillaume BOTTEX <guillaumebottex@uxsystem.net>, UXSystem, 2010
29
###############################################################################*/
31
#include "cmpiOpenDRIM_SSHSessionSettingData.h"
32
#include "OpenDRIM_SSHSessionSettingDataAccess.h"
36
#define ToString(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value; os << endl
37
#define ToStringInt(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << (long) instance.value; os << endl
38
#define ToStringRef(name, value, condition) os << (string) " " + name + (string) "="; instance.condition ? os << "NULL" : os << instance.value.toString(); os << endl
39
#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
40
#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
41
#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
43
ostream& operator<<(ostream& os, OpenDRIM_SSHSessionSettingData& instance) {
44
os << " [OpenDRIM_SSHSessionSettingData]" << endl;
45
ToStringRef("ManagedElement", ManagedElement, ManagedElement_isNULL);
46
ToStringRef("SettingData", SettingData, SettingData_isNULL);
47
ToStringInt("IsDefault", IsDefault, IsDefault_isNULL);
48
ToStringInt("IsCurrent", IsCurrent, IsCurrent_isNULL);
49
ToStringInt("IsNext", IsNext, IsNext_isNULL);
50
ToStringInt("IsMinimum", IsMinimum, IsMinimum_isNULL);
51
ToStringInt("IsMaximum", IsMaximum, IsMaximum_isNULL);
52
ToStringInt("IsPending", IsPending, IsPending_isNULL);
53
os << " [\\OpenDRIM_SSHSessionSettingData]" << endl;
61
int errorCode = SSH_OpenDRIM_SSHSessionSettingData_load(NULL, errorMessage);
62
if (errorCode != OK) {
63
cout << "ERROR " << errorCode << ": " << errorMessage << endl;
67
cout << endl << "[enumInstances]" << endl;
68
vector<OpenDRIM_SSHSessionSettingData> instances;
70
errorCode = SSH_OpenDRIM_SSHSessionSettingData_retrieve(NULL, NULL, instances, NULL, errorMessage, "ei");
71
if (errorCode != OK) {
72
cout << "ERROR " << errorCode << ": " << errorMessage << endl;
76
vector<OpenDRIM_SSHSessionSettingData>::iterator it = instances.begin();
77
for (; it != instances.end(); ++it) {
81
cout << "[\\enumInstances]" << endl;
82
cout << endl << "[enumInstanceNames & getInstance]" << endl;
85
errorCode = SSH_OpenDRIM_SSHSessionSettingData_retrieve(NULL, NULL, instances, NULL, errorMessage, "ein");
86
if (errorCode != OK) {
87
cout << "ERROR " << errorCode << ": " << errorMessage << endl;
91
it = instances.begin();
92
for (; it != instances.end(); ++it) {
93
errorCode = SSH_OpenDRIM_SSHSessionSettingData_getInstance(NULL, NULL, *it, NULL, errorMessage);
94
if (errorCode != OK) {
95
cout << "ERROR " << errorCode << ": " << errorMessage << endl;
101
cout << "[\\enumInstanceNames & getInstance]" << endl;
104
errorCode = SSH_OpenDRIM_SSHSessionSettingData_unload(errorMessage);
105
if (errorCode != OK) {
106
cout << "ERROR " << errorCode << ": " << errorMessage << endl;