Changeset 1151
- Timestamp:
- 11/19/08 16:08:07 (2 months ago)
- Files:
-
- Linux_Management_Providers/Record_Log/trunk (modified) (1 prop)
- Linux_Management_Providers/Record_Log/trunk/Common/OpenDRIM_RecordLogPackage_Common.h (modified) (3 diffs)
- Linux_Management_Providers/Record_Log/trunk/Makefile.am (modified) (4 diffs)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_LogEntry/OpenDRIM_LogEntryAccess.cpp (modified) (9 diffs)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_LogEntry/OpenDRIM_LogEntryProvider.cpp (modified) (1 diff)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_LogManagesRecord/Makefile.am (modified) (1 diff)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_LogManagesRecord/OpenDRIM_LogManagesRecord.h (modified) (6 diffs)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_LogManagesRecord/OpenDRIM_LogManagesRecordProvider.cpp (modified) (1 diff)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_RecordLog/OpenDRIM_RecordLog.h (modified) (6 diffs)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_RecordLog/OpenDRIM_RecordLogAccess.cpp (modified) (16 diffs)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_RecordLog/OpenDRIM_RecordLogProvider.cpp (modified) (2 diffs)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_RecordLog/cmpiOpenDRIM_RecordLog.cpp (modified) (4 diffs)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_RecordLogCapabilities/OpenDRIM_RecordLogCapabilities.h (modified) (3 diffs)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_RecordLogCapabilities/OpenDRIM_RecordLogCapabilitiesAccess.cpp (modified) (5 diffs)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_RecordLogCapabilities/OpenDRIM_RecordLogCapabilitiesProvider.cpp (modified) (1 diff)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_RecordLogCapabilities/cmpiOpenDRIM_RecordLogCapabilities.cpp (modified) (2 diffs)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_RecordLogConformsToProfile/Makefile.am (modified) (1 diff)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_RecordLogConformsToProfile/OpenDRIM_RecordLogConformsToProfileProvider.cpp (modified) (1 diff)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_RecordLogConformsToProfile/assocOpenDRIM_RecordLogConformsToProfile.cpp (modified) (1 diff)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_RecordLogProfile/OpenDRIM_RecordLogProfileAccess.cpp (modified) (5 diffs)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_RecordLogProfile/OpenDRIM_RecordLogProfileProvider.cpp (modified) (1 diff)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_RecordLogToCapabilities/Makefile.am (modified) (1 diff)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_RecordLogToCapabilities/OpenDRIM_RecordLogToCapabilities.h (modified) (8 diffs)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_RecordLogToCapabilities/OpenDRIM_RecordLogToCapabilitiesProvider.cpp (modified) (1 diff)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_RecordLogToCapabilities/assocOpenDRIM_RecordLogToCapabilities.cpp (modified) (1 diff)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_UseOfLog (added)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_UseOfLog/Makefile.am (added)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_UseOfLog/OpenDRIM_UseOfLog.h (added)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_UseOfLog/OpenDRIM_UseOfLogAccess.cpp (added)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_UseOfLog/OpenDRIM_UseOfLogAccess.h (added)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_UseOfLog/OpenDRIM_UseOfLogProvider.cpp (added)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_UseOfLog/assocOpenDRIM_UseOfLog.cpp (added)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_UseOfLog/assocOpenDRIM_UseOfLog.h (added)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_UseOfLog/cmpiOpenDRIM_UseOfLog.cpp (added)
- Linux_Management_Providers/Record_Log/trunk/OpenDRIM_UseOfLog/cmpiOpenDRIM_UseOfLog.h (added)
- Linux_Management_Providers/Record_Log/trunk/VERSION (modified) (1 diff)
- Linux_Management_Providers/Record_Log/trunk/acinclude.m4 (modified) (4 diffs)
- Linux_Management_Providers/Record_Log/trunk/configure.ac (modified) (2 diffs)
- Linux_Management_Providers/Record_Log/trunk/mof/OpenDRIM_UseOfLog.mof (added)
- Linux_Management_Providers/Record_Log/trunk/packaging (added)
- Linux_Management_Providers/Record_Log/trunk/packaging/opendrim-lmp-opendrimrecordlogpackage.spec (added)
- Linux_Management_Providers/Record_Log/trunk/registration/OpenDRIM_LogEntry-remove.sh (modified) (1 diff)
- Linux_Management_Providers/Record_Log/trunk/registration/OpenDRIM_LogEntry.sh (modified) (1 diff)
- Linux_Management_Providers/Record_Log/trunk/registration/OpenDRIM_LogManagesRecord-remove.sh (modified) (1 diff)
- Linux_Management_Providers/Record_Log/trunk/registration/OpenDRIM_LogManagesRecord.sh (modified) (1 diff)
- Linux_Management_Providers/Record_Log/trunk/registration/OpenDRIM_RecordLog-remove.sh (modified) (1 diff)
- Linux_Management_Providers/Record_Log/trunk/registration/OpenDRIM_RecordLog.sh (modified) (2 diffs)
- Linux_Management_Providers/Record_Log/trunk/registration/OpenDRIM_RecordLogCapabilities-remove.sh (modified) (1 diff)
- Linux_Management_Providers/Record_Log/trunk/registration/OpenDRIM_RecordLogCapabilities.sh (modified) (2 diffs)
- Linux_Management_Providers/Record_Log/trunk/registration/OpenDRIM_RecordLogConformsToProfile-remove.sh (modified) (1 diff)
- Linux_Management_Providers/Record_Log/trunk/registration/OpenDRIM_RecordLogConformsToProfile.sh (modified) (1 diff)
- Linux_Management_Providers/Record_Log/trunk/registration/OpenDRIM_RecordLogPackage-remove.sh (modified) (2 diffs)
- Linux_Management_Providers/Record_Log/trunk/registration/OpenDRIM_RecordLogPackage.sh (modified) (2 diffs)
- Linux_Management_Providers/Record_Log/trunk/registration/OpenDRIM_RecordLogProfile-remove.sh (modified) (1 diff)
- Linux_Management_Providers/Record_Log/trunk/registration/OpenDRIM_RecordLogProfile.sh (modified) (1 diff)
- Linux_Management_Providers/Record_Log/trunk/registration/OpenDRIM_RecordLogToCapabilities-remove.sh (modified) (1 diff)
- Linux_Management_Providers/Record_Log/trunk/registration/OpenDRIM_RecordLogToCapabilities.sh (modified) (1 diff)
- Linux_Management_Providers/Record_Log/trunk/registration/OpenDRIM_UseOfLog-remove.sh (added)
- Linux_Management_Providers/Record_Log/trunk/registration/OpenDRIM_UseOfLog.sh (added)
- Linux_Management_Providers/Record_Log/trunk/test/Makefile.am (modified) (4 diffs)
- Linux_Management_Providers/Record_Log/trunk/test/testOpenDRIM_LogEntry.cpp (modified) (1 diff)
- Linux_Management_Providers/Record_Log/trunk/test/testOpenDRIM_RecordLog.cpp (modified) (2 diffs)
- Linux_Management_Providers/Record_Log/trunk/test/testOpenDRIM_RecordLogCapabilities.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Linux_Management_Providers/Record_Log/trunk
- Property svn:ignore changed from
autom4te.cache
aclocal.m4
config.h.in
configure
to
autom4te.cache
aclocal.m4
config.h.in
configure
config.h
config.guess
config.status
config.sub
depcomp
install-sh
libtool
ltmain.sh
Makefile
Makefile.in
missing
stamp-h1
- Property svn:ignore changed from
Linux_Management_Providers/Record_Log/trunk/Common/OpenDRIM_RecordLogPackage_Common.h
r1110 r1151 2 2 # Linux Management Providers (LMP), OpenDRIM_RecordLogPackage provider package 3 3 # Copyright (C) 2007 Ilsoo Byun <widepis@etri.re.kr> 4 # 4 # 5 5 # This program is being developed under the "OpenDRIM" project. 6 6 # The "OpenDRIM" project web page: www.opendrim.org 7 7 # The "OpenDRIM" project mailing list: opendrim@googlegroups.com 8 # 8 # 9 9 # This program is free software; you can redistribute it and/or 10 10 # modify it under the terms of the GNU General Public License 11 11 # as published by the Free Software Foundation; version 2 12 12 # of the License. 13 # 13 # 14 14 # This program is distributed in the hope that it will be useful, 15 15 # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 17 # GNU General Public License for more details. 18 # 18 # 19 19 # You should have received a copy of the GNU General Public License 20 20 # along with this program; if not, write to the Free Software … … 25 25 # To contributors, please leave your contact information in this section 26 26 # AND comment your changes in the source code. 27 # 27 # 28 28 # Modified by <Author(s)>, <Affiliation>, <Year> 29 29 ###############################################################################*/ … … 34 34 #include <Common.h> 35 35 36 // Define LogState Constants 37 #define LS_NOT_APPLICABLE 4 38 39 // Define EnabledState Constants 40 #define ES_NOT_APPLICABLE 5 41 42 // Define RequestedState Constants 43 #define RS_NOT_APPLICABLE 12 44 36 45 string CF_logTimeFormat(const string& ptime, struct tm* tp); 37 46 Linux_Management_Providers/Record_Log/trunk/Makefile.am
r836 r1151 31 31 VENDOR = OpenDRIM 32 32 33 VERSION = 1.0.033 VERSION = $(shell cat ./VERSION) 34 34 35 SUBDIRS = Common OpenDRIM_RecordLogCapabilities OpenDRIM_RecordLog OpenDRIM_RecordLogProfile OpenDRIM_LogEntry OpenDRIM_LogManagesRecord OpenDRIM_RecordLogConformsToProfile OpenDRIM_RecordLogToCapabilities test 35 APP_NAME = opendrim-lmp-opendrimrecordlogpackage 36 37 RPM_PACKAGE_DIR = packaging 38 39 PLATFORM = $(shell rpm --eval %_target_cpu) 40 41 WORKING_DIR = $(shell pwd) 42 43 SUBDIRS = Common OpenDRIM_RecordLogCapabilities OpenDRIM_RecordLog OpenDRIM_UseOfLog OpenDRIM_RecordLogProfile OpenDRIM_LogEntry OpenDRIM_LogManagesRecord OpenDRIM_RecordLogConformsToProfile OpenDRIM_RecordLogToCapabilities test 36 44 37 45 install-providerdir: … … 43 51 make -C Common install-strip 44 52 make -C OpenDRIM_RecordLogCapabilities install-strip 53 make -C OpenDRIM_RecordLog install-strip 45 54 make -C OpenDRIM_LogManagesRecord install-strip 46 make -C OpenDRIM_RecordLog install-strip 55 make -C OpenDRIM_UseOfLog install-strip 56 make -C OpenDRIM_RecordLogProfile install-strip 47 57 make -C OpenDRIM_RecordLogConformsToProfile install-strip 48 make -C OpenDRIM_RecordLogProfile install-strip49 58 make -C OpenDRIM_LogEntry install-strip 50 59 make -C OpenDRIM_RecordLogToCapabilities install-strip … … 59 68 make -C test test-OpenDRIM_RecordLogCapabilities 60 69 70 test-OpenDRIM_RecordLog: all 71 make -C test test-OpenDRIM_RecordLog 72 61 73 test-OpenDRIM_LogManagesRecord: all 62 74 make -C test test-OpenDRIM_LogManagesRecord 63 75 64 test-OpenDRIM_RecordLog: all 65 make -C test test-OpenDRIM_RecordLog 66 67 test-OpenDRIM_RecordLogConformsToProfile: all 68 make -C test test-OpenDRIM_RecordLogConformsToProfile 76 test-OpenDRIM_UseOfLog: all 77 make -C test test-OpenDRIM_UseOfLog 69 78 70 79 test-OpenDRIM_RecordLogProfile: all 71 80 make -C test test-OpenDRIM_RecordLogProfile 81 82 test-OpenDRIM_RecordLogConformsToProfile: all 83 make -C test test-OpenDRIM_RecordLogConformsToProfile 72 84 73 85 test-OpenDRIM_LogEntry: all … … 77 89 make -C test test-OpenDRIM_RecordLogToCapabilities 78 90 91 pkg-src: 92 rm -rf packaging/$(APP_NAME)-$(VERSION) 93 rm -rf .tmp 94 mkdir .tmp 95 cp -r ./* .tmp/ 96 rm -rf ./tmp/packaging/ 97 mv .tmp packaging/$(APP_NAME)-$(VERSION) 98 tar --directory packaging -zcf packaging/$(APP_NAME)-$(VERSION).tar.gz $(APP_NAME)-$(VERSION) 99 rm -rf packaging/$(APP_NAME)-$(VERSION) 100 101 pkg-rpm: pkg-src 102 mkdir -p $(RPM_PACKAGE_DIR)/rpm/RPMS/$(PLATFORM) 103 mkdir -p $(RPM_PACKAGE_DIR)/rpm/SRPMS 104 mkdir -p $(RPM_PACKAGE_DIR)/rpm/BUILD 105 mkdir -p $(RPM_PACKAGE_DIR)/rpm/SOURCES 106 mkdir -p $(RPM_PACKAGE_DIR)/rpm/tmp 107 - rm -r $(RPM_PACKAGE_DIR)/rpm/BUILD/$(APP_NAME)-root 108 - rm -r $(RPM_PACKAGE_DIR)/rpm/RPMS/$(APP_NAME)-* 109 - rm -r $(RPM_PACKAGE_DIR)/rpm/SRPMS/$(APP_NAME)-* 110 - rm -r $(RPM_PACKAGE_DIR)/rpm/SOURCES/$(APP_NAME)-* 111 mv packaging/$(APP_NAME)-$(VERSION).tar.gz $(RPM_PACKAGE_DIR)/rpm/SOURCES/ 112 rpmbuild --define="_topdir $(WORKING_DIR)/$(RPM_PACKAGE_DIR)/rpm" --define="version $(VERSION)" -ba $(RPM_PACKAGE_DIR)/$(APP_NAME).spec 113 Linux_Management_Providers/Record_Log/trunk/OpenDRIM_LogEntry/OpenDRIM_LogEntryAccess.cpp
r1110 r1151 2 2 # Linux Management Providers (LMP), OpenDRIM_RecordLogPackage provider package 3 3 # Copyright (C) 2007 Ilsoo Byun <widepis@etri.re.kr ,widepis@gmail.com> 4 # 4 # 5 5 # This program is being developed under the "OpenDRIM" project. 6 6 # The "OpenDRIM" project web page: www.opendrim.org 7 7 # The "OpenDRIM" project mailing list: opendrim@googlegroups.com 8 # 8 # 9 9 # This program is free software; you can redistribute it and/or 10 10 # modify it under the terms of the GNU General Public License 11 11 # as published by the Free Software Foundation; version 2 12 12 # of the License. 13 # 13 # 14 14 # This program is distributed in the hope that it will be useful, 15 15 # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 17 # GNU General Public License for more details. 18 # 18 # 19 19 # You should have received a copy of the GNU General Public License 20 20 # along with this program; if not, write to the Free Software … … 25 25 # To contributors, please leave your contact information in this section 26 26 # AND comment your changes in the source code. 27 # 27 # 28 28 # Modified by <Author(s)>, <Affiliation>, <Year> 29 29 ###############################################################################*/ … … 55 55 return FAILED; 56 56 } 57 58 time_t timep; 57 58 time_t timep; 59 59 time(&timep); 60 60 struct tm *tp = localtime(&timep); 61 61 62 62 OpenDRIM_LogEntry instance; 63 63 string line; … … 72 72 return OK; 73 73 } 74 74 75 75 76 76 int OpenDRIM_RecordLogPackage_OpenDRIM_LogEntry_retrieve(const CMPIBroker* broker, const CMPIContext* ctx, vector<OpenDRIM_LogEntry>& result, const char** properties, string& errorMessage, const string& discriminant) { … … 94 94 string subject_timestamp = instance.InstanceID.substr(instance.InstanceID.find(':')+1); 95 95 vector<OpenDRIM_LogEntry> result; 96 96 97 97 ifstream ifs(filename.c_str()); 98 98 if (ifs.bad()) { … … 101 101 return FAILED; 102 102 } 103 104 time_t timep; 103 104 time_t timep; 105 105 time(&timep); 106 106 struct tm *tp = localtime(&timep); 107 107 108 108 string line; 109 109 while (getline(ifs, line)) { … … 118 118 } 119 119 ifs.close(); 120 120 121 121 errorMessage = "No instance"; 122 return NOT_FOUND; 122 return NOT_FOUND; 123 123 } else { 124 124 errorMessage = "No key property"; … … 149 149 int OpenDRIM_RecordLogPackage_OpenDRIM_LogEntry_populate(OpenDRIM_LogEntry& instance, const string& filename, string& line, struct tm* tp, const string& discriminant, string& errorMessage) { 150 150 _E_; 151 152 /* 153 * Properties to fill from profile 154 * + Mandatory: 155 * [X] InstanceID [KEY] 156 * [X] RecordID 157 * [X] CreationTimestamp 158 * [X] ElementName 159 * + Optional: 160 * [X] LogInstanceID 161 * [X] LogName 162 * [X] RecordData 163 * [X] RecordFormat 164 */ 165 151 166 string timestamp = CF_logTimeFormat(line.substr(0, LOG_TIME_LIMIT), tp); 152 167 string id = filename+":"+timestamp; … … 172 187 return FAILED; 173 188 } 174 175 time_t timep; 189 190 time_t timep; 176 191 time(&timep); 177 192 struct tm *tp = localtime(&timep); 178 193 179 194 string line; 180 195 while (getline(ifs, line)) { Linux_Management_Providers/Record_Log/trunk/OpenDRIM_LogEntry/OpenDRIM_LogEntryProvider.cpp
r1110 r1151 170 170 return rc; 171 171 } 172 CMPI Instance* _ci = OpenDRIM_RecordLogPackage_OpenDRIM_LogEntry_toCMPIInstance(_broker, instance);173 CMReturn Instance(rslt, _ci);172 CMPIObjectPath* _cop = OpenDRIM_RecordLogPackage_OpenDRIM_LogEntry_toCMPIObjectPath(_broker, instance); 173 CMReturnObjectPath(rslt, _cop); 174 174 CMReturnDone(rslt); 175 175 _L_; Linux_Management_Providers/Record_Log/trunk/OpenDRIM_LogManagesRecord/Makefile.am
r836 r1151 45 45 46 46 # Override libtool installation, we don't need .la and .a 47 # We also strip the library to save some space48 47 install: all 48 $(INSTALL) .libs/libcmpiOpenDRIM_RecordLogPackage_OpenDRIM_LogManagesRecordProvider.so $(PROVIDERDIR) 49 50 install-strip: all 49 51 $(INSTALL) -s .libs/libcmpiOpenDRIM_RecordLogPackage_OpenDRIM_LogManagesRecordProvider.so $(PROVIDERDIR) 50 52 Linux_Management_Providers/Record_Log/trunk/OpenDRIM_LogManagesRecord/OpenDRIM_LogManagesRecord.h
r842 r1151 2 2 # Linux Management Providers (LMP), OpenDRIM_RecordLogPackage provider package 3 3 # Copyright (C) 2007 Ilsoo Byun <widepis@etri.re.kr> 4 # 4 # 5 5 # This program is being developed under the "OpenDRIM" project. 6 6 # The "OpenDRIM" project web page: www.opendrim.org 7 7 # The "OpenDRIM" project mailing list: opendrim@googlegroups.com 8 # 8 # 9 9 # This program is free software; you can redistribute it and/or 10 10 # modify it under the terms of the GNU General Public License 11 11 # as published by the Free Software Foundation; version 2 12 12 # of the License. 13 # 13 # 14 14 # This program is distributed in the hope that it will be useful, 15 15 # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 17 # GNU General Public License for more details. 18 # 18 # 19 19 # You should have received a copy of the GNU General Public License 20 20 # along with this program; if not, write to the Free Software … … 25 25 # To contributors, please leave your contact information in this section 26 26 # AND comment your changes in the source code. 27 # 27 # 28 28 # Modified by <Author(s)>, <Affiliation>, <Year> 29 29 ###############################################################################*/ … … 45 45 static string OpenDRIM_LogManagesRecord_NAMESPACE = _NAMESPACE; 46 46 const static string Record_role = "Record"; 47 const static char* Record_classnames[] = {"OpenDRIM_LogEntry" , "CIM_LogEntry", "CIM_RecordForLog"};47 const static char* Record_classnames[] = {"OpenDRIM_LogEntry"}; // CIM_LogEntry 48 48 const static string Record_NAMESPACE = _NAMESPACE; 49 49 50 50 const static string Log_role = "Log"; 51 const static char* Log_classnames[] = {"OpenDRIM_RecordLog" , "CIM_RecordLog", "CIM_Log"};51 const static char* Log_classnames[] = {"OpenDRIM_RecordLog"}; // CIM_RecordLog 52 52 const static string Log_NAMESPACE = _NAMESPACE; 53 53 … … 55 55 56 56 public: 57 57 58 58 Objectpath Log; 59 59 bool Log_isNULL; 60 60 61 61 Objectpath Record; 62 62 bool Record_isNULL; 63 63 64 64 OpenDRIM_LogManagesRecord() { 65 65 Log_isNULL = true; 66 66 Record_isNULL = true; 67 67 } 68 68 69 69 ~OpenDRIM_LogManagesRecord() {} 70 70 71 71 string getKeys() const { 72 72 return CF_toLowCase(".Log=\"" + CF_quoteString(Log.toString()) + "\""".Record=\"" + CF_quoteString(Record.toString()) + "\""); … … 79 79 return OK; 80 80 } 81 81 82 82 int setLog(const Objectpath& newValue) { 83 83 Log = newValue; … … 93 93 return OK; 94 94 } 95 95 96 96 int setRecord(const Objectpath& newValue) { 97 97 Record = newValue; Linux_Management_Providers/Record_Log/trunk/OpenDRIM_LogManagesRecord/OpenDRIM_LogManagesRecordProvider.cpp
r836 r1151 169 169 return rc; 170 170 } 171 CMPI Instance* _ci = OpenDRIM_RecordLogPackage_OpenDRIM_LogManagesRecord_toCMPIInstance(_broker, instance);172 CMReturn Instance(rslt, _ci);171 CMPIObjectPath* _cop = OpenDRIM_RecordLogPackage_OpenDRIM_LogManagesRecord_toCMPIObjectPath(_broker, instance); 172 CMReturnObjectPath(rslt, _cop); 173 173 CMReturnDone(rslt); 174 174 _L_; Linux_Management_Providers/Record_Log/trunk/OpenDRIM_RecordLog/OpenDRIM_RecordLog.h
r836 r1151 68 68 bool HealthState_isNULL; 69 69 70 unsigned short PrimaryStatus; 71 bool PrimaryStatus_isNULL; 72 73 unsigned short DetailedStatus; 74 bool DetailedStatus_isNULL; 75 76 unsigned short OperatingStatus; 77 bool OperatingStatus_isNULL; 78 79 unsigned short CommunicationStatus; 80 bool CommunicationStatus_isNULL; 81 70 82 unsigned short EnabledState; 71 83 bool EnabledState_isNULL; … … 82 94 string TimeOfLastStateChange; 83 95 bool TimeOfLastStateChange_isNULL; 96 97 vector<unsigned short> AvailableRequestedStates; 98 bool AvailableRequestedStates_isNULL; 99 100 unsigned short TransitioningToState; 101 bool TransitioningToState_isNULL; 84 102 85 103 unsigned long long MaxNumberOfRecords; … … 114 132 Status_isNULL = true; 115 133 HealthState_isNULL = true; 134 PrimaryStatus_isNULL = true; 135 DetailedStatus_isNULL = true; 136 OperatingStatus_isNULL = true; 137 CommunicationStatus_isNULL = true; 116 138 EnabledState_isNULL = true; 117 139 OtherEnabledState_isNULL = true; … … 119 141 EnabledDefault_isNULL = true; 120 142 TimeOfLastStateChange_isNULL = true; 143 AvailableRequestedStates_isNULL = true; 144 TransitioningToState_isNULL = true; 121 145 MaxNumberOfRecords_isNULL = true; 122 146 CurrentNumberOfRecords_isNULL = true; … … 251 275 } 252 276 277 int getPrimaryStatus(unsigned short& value) const { 278 if (PrimaryStatus_isNULL==true) 279 return NOT_FOUND; 280 value = PrimaryStatus; 281 return OK; 282 } 283 284 int setPrimaryStatus(const unsigned short& newValue) { 285 PrimaryStatus = newValue; 286 PrimaryStatus_isNULL = false; 287 return OK; 288 } 289 290 int getDetailedStatus(unsigned short& value) const { 291 if (DetailedStatus_isNULL==true) 292 return NOT_FOUND; 293 value = DetailedStatus; 294 return OK; 295 } 296 297 int setDetailedStatus(const unsigned short& newValue) { 298 DetailedStatus = newValue; 299 DetailedStatus_isNULL = false; 300 return OK; 301 } 302 303 int getOperatingStatus(unsigned short& value) const { 304 if (OperatingStatus_isNULL==true) 305 return NOT_FOUND; 306 value = OperatingStatus; 307 return OK; 308 } 309 310 int setOperatingStatus(const unsigned short& newValue) { 311 OperatingStatus = newValue; 312 OperatingStatus_isNULL = false; 313 return OK; 314 } 315 316 int getCommunicationStatus(unsigned short& value) const { 317 if (CommunicationStatus_isNULL==true) 318 return NOT_FOUND; 319 value = CommunicationStatus; 320 return OK; 321 } 322 323 int setCommunicationStatus(const unsigned short& newValue) { 324 CommunicationStatus = newValue; 325 CommunicationStatus_isNULL = false; 326 return OK; 327 } 328 253 329 int getEnabledState(unsigned short& value) const { 254 330 if (EnabledState_isNULL==true) … … 313 389 TimeOfLastStateChange = newValue; 314 390 TimeOfLastStateChange_isNULL = false; 391 return OK; 392 } 393 394 int getAvailableRequestedStates(vector<unsigned short>& value) const { 395 if (AvailableRequestedStates_isNULL==true) 396 return NOT_FOUND; 397 value = AvailableRequestedStates; 398 return OK; 399 } 400 401 int setAvailableRequestedStates(const vector<unsigned short>& newValue) { 402 AvailableRequestedStates = newValue; 403 AvailableRequestedStates_isNULL = false; 404 return OK; 405 } 406 407 int getTransitioningToState(unsigned short& value) const { 408 if (TransitioningToState_isNULL==true) 409 return NOT_FOUND; 410 value = TransitioningToState; 411 return OK; 412 } 413 414 int setTransitioningToState(const unsigned short& newValue) { 415 TransitioningToState = newValue; 416 TransitioningToState_isNULL = false; 315 417 return OK; 316 418 } Linux_Management_Providers/Record_Log/trunk/OpenDRIM_RecordLog/OpenDRIM_RecordLogAccess.cpp
r913 r1151 2 2 # Linux Management Providers (LMP), OpenDRIM_RecordLogPackage provider package 3 3 # Copyright (C) 2007 Ilsoo Byun <widepis@etri.re.kr ,widepis@gmail.com> 4 # 4 # 5 5 # This program is being developed under the "OpenDRIM" project. 6 6 # The "OpenDRIM" project web page: www.opendrim.org 7 7 # The "OpenDRIM" project mailing list: opendrim@googlegroups.com 8 # 8 # 9 9 # This program is free software; you can redistribute it and/or 10 10 # modify it under the terms of the GNU General Public License 11 11 # as published by the Free Software Foundation; version 2 12 12 # of the License. 13 # 13 # 14 14 # This program is distributed in the hope that it will be useful, 15 15 # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 17 # GNU General Public License for more details. 18 # 18 # 19 19 # You should have received a copy of the GNU General Public License 20 20 # along with this program; if not, write to the Free Software … … 25 25 # To contributors, please leave your contact information in this section 26 26 # AND comment your changes in the source code. 27 # 27 # 28 28 # Modified by <Author(s)>, <Affiliation>, <Year> 29 29 ###############################################################################*/ … … 61 61 static bool isAvailableLine(string& line, vector<string>& tokens) { 62 62 _E_; 63 63 64 64 if (line.size() == 0 || CF_startsWith(line, "\\") || line[0] == '#') 65 65 return false; … … 69 69 if (tokens.size() != 2) 70 70 return false; 71 71 72 72 //If the first character is '-', remove it 73 73 if (CF_startsWith(tokens[1], "-")) 74 74 tokens[1].erase(0,1); 75 75 76 76 vector<string> filepath_elements; 77 77 CF_splitText(filepath_elements, tokens[1], '/'); … … 82 82 file_container += filepath_elements[i]; 83 83 } 84 85 if (CF_startsWith(tokens[1], "/dev/") || !CF_isExist(file_container)) 86 return false; 84 85 if (CF_startsWith(tokens[1], "/dev/") || !CF_isExist(file_container)) 86 return false; 87 87 _L_; 88 88 return true; … … 115 115 ifs.close(); 116 116 _L_; 117 return OK; 117 return OK; 118 118 } 119 119 … … 128 128 if (!isAvailableLine(line, tokens)) 129 129 continue; 130 130 131 131 if (!instance.InstanceID_isNULL && instance.InstanceID == tokens[1]) { 132 132 if (OpenDRIM_RecordLogPackage_OpenDRIM_RecordLog_populate( … … 140 140 } 141 141 ifs.close(); 142 _L_; 142 _L_; 143 143 return NOT_FOUND; 144 144 } … … 197 197 break; 198 198 } 199 199 200 200 vector<unsigned short> severities; 201 201 for (vector<unsigned short>::size_type i = 0; i < facility_count; ++i) { … … 249 249 } 250 250 ifs.close(); 251 251 252 252 // rewriting the syslog configuation file. 253 253 ofstream ofs(SYSLOG_CONFIG_FILE, ios::trunc); … … 285 285 string line; 286 286 CF_assert(convertLogInstanceToString(instance, line, errorMessage)); 287 287 288 288 //Append a line. 289 289 ofstream ofs(SYSLOG_CONFIG_FILE, ios::app); … … 303 303 //Don't write 304 304 if (isAvailableLine(line, tokens) && tokens[1] == instance.InstanceID) 305 continue; 305 continue; 306 306 lines.push_back(line); 307 307 } 308 308 ifs.close(); 309 309 310 310 //Rewrinting the syslog configuation file. 311 311 ofstream ofs(SYSLOG_CONFIG_FILE, ios::trunc); … … 314 314 } 315 315 ofs.close(); 316 316 317 317 _L_; 318 318 return OK; … … 346 346 int OpenDRIM_RecordLogPackage_OpenDRIM_RecordLog_populate(OpenDRIM_RecordLog& instance, vector<string>& tokens, string& errorMessage) { 347 347 _E_; 348 349 /* 350 * Properties to fill from profile 351 * + Mandatory: 352 * [X] InstanceID [KEY] 353 * [X] MaxNumberOfRecords 354 * [X] LogState 355 * [X] OverwritePolicy 356 * [X] RequestedState 357 * [X] EnabledState 358 * [X] OperationalStatus 359 * [X] HealthState 360 * [X] ElementName 361 * + Others: 362 * [X] AvailableRequestedStates 363 * [X] CurrentNumberOfRecords 364 * [X] StatusDescriptions 365 * [X] TimeOfLastStateChange 366 */ 367 348 368 instance.setElementName(tokens[1]); 349 369 350 370 // Extract the facilities and the severities 351 371 vector<unsigned short> Facilities; 352 372 vector<unsigned short> Severities; 353 373 354 374 // Split into substrings using ';' as a delimiter 355 375 vector<string> facility_severity; … … 385 405 instance.setFacility(Facilities); 386 406 instance.setSeverity(Severities); 387 407 388 408 string time; 389 409 CF_assert(CF_lastModified(tokens[1], time, errorMessage)); 390 410 instance.setTimeOfLastStateChange(time); 391 411 392 412 string record_count, stdout, stderr; 393 413 CF_assert(CF_runCommand("cat "+instance.InstanceID+" | wc -l", stdout, stderr, errorMessage)); 394 414 instance.setCurrentNumberOfRecords(atoi(stdout.c_str())); 395 415 396 416 instance.setMaxNumberOfRecords(0); 397 417 instance.setOverwritePolicy(7); … … 400 420 status.push_back(2); 401 421 instance.setOperationalStatus(status); 422 423 instance.setLogState(LS_NOT_APPLICABLE); 424 instance.setEnabledState(ES_NOT_APPLICABLE); 425 instance.setRequestedState(RS_NOT_APPLICABLE); 402 426 _L_; 403 427 return OK; Linux_Management_Providers/Record_Log/trunk/OpenDRIM_RecordLog/OpenDRIM_RecordLogProvider.cpp
r841 r1151 169 169 return rc; 170 170 } 171 CMPI Instance* _ci = OpenDRIM_RecordLogPackage_OpenDRIM_RecordLog_toCMPIInstance(_broker, instance);172 CMReturn Instance(rslt, _ci);171 CMPIObjectPath* _cop = OpenDRIM_RecordLogPackage_OpenDRIM_RecordLog_toCMPIObjectPath(_broker, instance); 172 CMReturnObjectPath(rslt, _cop); 173 173 CMReturnDone(rslt); 174 174 _L_; … … 200 200 } 201 201 202 //CMPIAcessor - ex maple implementation202 //CMPIAcessor - example implementation 203 203 static CMPIData accessor(const char* propertyName, void* param) { 204 204 CMPIInstance* inst = (CMPIInstance*) param; Linux_Management_Providers/Record_Log/trunk/OpenDRIM_RecordLog/cmpiOpenDRIM_RecordLog.cpp
r836 r1151 74 74 ci.setProperty("HealthState", instance.HealthState); 75 75 76 if (!instance.PrimaryStatus_isNULL) 77 ci.setProperty("PrimaryStatus", instance.PrimaryStatus); 78 79 if (!instance.DetailedStatus_isNULL) 80 &
