From be6db99ca9b99a3b72b71a8fb1f5fcd9fc8aaf8f Mon Sep 17 00:00:00 2001 From: Yatian XU Date: Tue, 10 Sep 2019 13:50:31 +0800 Subject: Contribute C++ implement of VES spec 7.0.1 to ONAP/vnfsdk: Part3: encode library Issue-ID: VNFSDK-466 Signed-off-by: Yatian XU Change-Id: I2bf21e61e9027385ec9b604206ba81a3acea99c5 --- .../ves_cpplibrary/src/lib/encode/CMakeLists.txt | 21 ++ .../ves_cpplibrary/src/lib/encode/XBatch.cpp | 7 + .../ves_cpplibrary/src/lib/encode/XBatchImp.cpp | 45 +++ .../ves_cpplibrary/src/lib/encode/XBatchImp.h | 24 ++ .../ves_cpplibrary/src/lib/encode/XCodecsInUse.cpp | 21 ++ .../src/lib/encode/XCodecsInUseImp.cpp | 42 +++ .../src/lib/encode/XCodecsInUseImp.h | 29 ++ .../src/lib/encode/XCommonEventHeader.cpp | 13 + .../src/lib/encode/XCommonEventHeaderImp.cpp | 192 ++++++++++ .../src/lib/encode/XCommonEventHeaderImp.h | 62 ++++ .../ves_cpplibrary/src/lib/encode/XCounter.cpp | 26 ++ .../ves_cpplibrary/src/lib/encode/XCounterImp.cpp | 55 +++ .../ves_cpplibrary/src/lib/encode/XCounterImp.h | 32 ++ .../ves_cpplibrary/src/lib/encode/XCpuUsage.cpp | 96 +++++ .../ves_cpplibrary/src/lib/encode/XCpuUsageImp.cpp | 117 ++++++ .../ves_cpplibrary/src/lib/encode/XCpuUsageImp.h | 45 +++ .../ves_cpplibrary/src/lib/encode/XDiskUsage.cpp | 286 +++++++++++++++ .../src/lib/encode/XDiskUsageImp.cpp | 304 ++++++++++++++++ .../ves_cpplibrary/src/lib/encode/XDiskUsageImp.h | 81 +++++ .../src/lib/encode/XEndOfCallVqmSummaries.cpp | 156 ++++++++ .../src/lib/encode/XEndOfCallVqmSummariesImp.cpp | 188 ++++++++++ .../src/lib/encode/XEndOfCallVqmSummariesImp.h | 57 +++ .../ves_cpplibrary/src/lib/encode/XFaultFields.cpp | 13 + .../src/lib/encode/XFaultFieldsImp.cpp | 149 ++++++++ .../src/lib/encode/XFaultFieldsImp.h | 48 +++ .../src/lib/encode/XFilesystemUsage.cpp | 46 +++ .../src/lib/encode/XFilesystemUsageImp.cpp | 82 +++++ .../src/lib/encode/XFilesystemUsageImp.h | 46 +++ .../src/lib/encode/XGtpPerFlowMetrics.cpp | 291 +++++++++++++++ .../src/lib/encode/XGtpPerFlowMetricsImp.cpp | 395 +++++++++++++++++++++ .../src/lib/encode/XGtpPerFlowMetricsImp.h | 140 ++++++++ .../src/lib/encode/XHeartbeatFields.cpp | 7 + .../src/lib/encode/XHeartbeatFieldsImp.cpp | 72 ++++ .../src/lib/encode/XHeartbeatFieldsImp.h | 34 ++ .../ves_cpplibrary/src/lib/encode/XHugePages.cpp | 46 +++ .../src/lib/encode/XHugePagesImp.cpp | 64 ++++ .../ves_cpplibrary/src/lib/encode/XHugePagesImp.h | 33 ++ .../ves_cpplibrary/src/lib/encode/XInternal.cpp | 22 ++ .../ves_cpplibrary/src/lib/encode/XInternal.h | 53 +++ veslibrary/ves_cpplibrary/src/lib/encode/XIpmi.cpp | 77 ++++ .../src/lib/encode/XIpmiBaseboardTemperature.cpp | 21 ++ .../lib/encode/XIpmiBaseboardTemperatureImp.cpp | 39 ++ .../src/lib/encode/XIpmiBaseboardTemperatureImp.h | 28 ++ .../lib/encode/XIpmiBaseboardVoltageRegulator.cpp | 21 ++ .../encode/XIpmiBaseboardVoltageRegulatorImp.cpp | 39 ++ .../lib/encode/XIpmiBaseboardVoltageRegulatorImp.h | 28 ++ .../ves_cpplibrary/src/lib/encode/XIpmiBattery.cpp | 26 ++ .../src/lib/encode/XIpmiBatteryImp.cpp | 44 +++ .../src/lib/encode/XIpmiBatteryImp.h | 29 ++ .../ves_cpplibrary/src/lib/encode/XIpmiFan.cpp | 21 ++ .../ves_cpplibrary/src/lib/encode/XIpmiFanImp.cpp | 39 ++ .../ves_cpplibrary/src/lib/encode/XIpmiFanImp.h | 28 ++ .../XIpmiGlobalAggregateTemperatureMargin.cpp | 21 ++ .../XIpmiGlobalAggregateTemperatureMarginImp.cpp | 42 +++ .../XIpmiGlobalAggregateTemperatureMarginImp.h | 30 ++ .../ves_cpplibrary/src/lib/encode/XIpmiHsbp.cpp | 21 ++ .../ves_cpplibrary/src/lib/encode/XIpmiHsbpImp.cpp | 39 ++ .../ves_cpplibrary/src/lib/encode/XIpmiHsbpImp.h | 28 ++ .../ves_cpplibrary/src/lib/encode/XIpmiImp.cpp | 134 +++++++ .../ves_cpplibrary/src/lib/encode/XIpmiImp.h | 46 +++ .../ves_cpplibrary/src/lib/encode/XIpmiNic.cpp | 21 ++ .../ves_cpplibrary/src/lib/encode/XIpmiNicImp.cpp | 39 ++ .../ves_cpplibrary/src/lib/encode/XIpmiNicImp.h | 28 ++ .../src/lib/encode/XIpmiPowerSupply.cpp | 31 ++ .../src/lib/encode/XIpmiPowerSupplyImp.cpp | 49 +++ .../src/lib/encode/XIpmiPowerSupplyImp.h | 30 ++ .../src/lib/encode/XIpmiProcessor.cpp | 31 ++ .../src/lib/encode/XIpmiProcessorImp.cpp | 52 +++ .../src/lib/encode/XIpmiProcessorImp.h | 31 ++ .../ves_cpplibrary/src/lib/encode/XJsonObject.cpp | 41 +++ .../src/lib/encode/XJsonObjectImp.cpp | 64 ++++ .../ves_cpplibrary/src/lib/encode/XJsonObjectImp.h | 35 ++ .../src/lib/encode/XJsonObjectInstance.cpp | 31 ++ .../src/lib/encode/XJsonObjectInstanceImp.cpp | 63 ++++ .../src/lib/encode/XJsonObjectInstanceImp.h | 32 ++ veslibrary/ves_cpplibrary/src/lib/encode/XKey.cpp | 26 ++ .../ves_cpplibrary/src/lib/encode/XKeyImp.cpp | 44 +++ veslibrary/ves_cpplibrary/src/lib/encode/XKeyImp.h | 29 ++ .../src/lib/encode/XLatencyBucketMeasure.cpp | 26 ++ .../src/lib/encode/XLatencyBucketMeasureImp.cpp | 44 +++ .../src/lib/encode/XLatencyBucketMeasureImp.h | 29 ++ veslibrary/ves_cpplibrary/src/lib/encode/XLoad.cpp | 27 ++ .../ves_cpplibrary/src/lib/encode/XLoadImp.cpp | 41 +++ .../ves_cpplibrary/src/lib/encode/XLoadImp.h | 27 ++ .../src/lib/encode/XMachineCheckException.cpp | 36 ++ .../src/lib/encode/XMachineCheckExceptionImp.cpp | 54 +++ .../src/lib/encode/XMachineCheckExceptionImp.h | 30 ++ .../src/lib/encode/XMeasurementFields.cpp | 7 + .../src/lib/encode/XMeasurementFieldsImp.cpp | 255 +++++++++++++ .../src/lib/encode/XMeasurementFieldsImp.h | 71 ++++ .../ves_cpplibrary/src/lib/encode/XMemoryUsage.cpp | 96 +++++ .../src/lib/encode/XMemoryUsageImp.cpp | 121 +++++++ .../src/lib/encode/XMemoryUsageImp.h | 47 +++ .../src/lib/encode/XMobileFlowFields.cpp | 15 + .../src/lib/encode/XMobileFlowFieldsImp.cpp | 246 +++++++++++++ .../src/lib/encode/XMobileFlowFieldsImp.h | 80 +++++ .../src/lib/encode/XNamedHashMap.cpp | 21 ++ .../src/lib/encode/XNamedHashMapImp.cpp | 42 +++ .../src/lib/encode/XNamedHashMapImp.h | 30 ++ .../src/lib/encode/XNicPerformance.cpp | 206 +++++++++++ .../src/lib/encode/XNicPerformanceImp.cpp | 246 +++++++++++++ .../src/lib/encode/XNicPerformanceImp.h | 69 ++++ .../src/lib/encode/XNotificationFields.cpp | 7 + .../src/lib/encode/XNotificationFieldsImp.cpp | 114 ++++++ .../src/lib/encode/XNotificationFieldsImp.h | 46 +++ .../ves_cpplibrary/src/lib/encode/XOtherFields.cpp | 7 + .../src/lib/encode/XOtherFieldsImp.cpp | 85 +++++ .../src/lib/encode/XOtherFieldsImp.h | 36 ++ .../src/lib/encode/XPnfRegistrationFields.cpp | 7 + .../src/lib/encode/XPnfRegistrationFieldsImp.cpp | 123 +++++++ .../src/lib/encode/XPnfRegistrationFieldsImp.h | 44 +++ .../src/lib/encode/XProcessStats.cpp | 51 +++ .../src/lib/encode/XProcessStatsImp.cpp | 69 ++++ .../src/lib/encode/XProcessStatsImp.h | 34 ++ .../XProcessorDimmAggregateThermalMargin.cpp | 21 ++ .../XProcessorDimmAggregateThermalMarginImp.cpp | 42 +++ .../XProcessorDimmAggregateThermalMarginImp.h | 30 ++ .../src/lib/encode/XSipSignalingFields.cpp | 13 + .../src/lib/encode/XSipSignalingFieldsImp.cpp | 125 +++++++ .../src/lib/encode/XSipSignalingFieldsImp.h | 53 +++ .../src/lib/encode/XStateChangeFields.cpp | 7 + .../src/lib/encode/XStateChangeFieldsImp.cpp | 99 ++++++ .../src/lib/encode/XStateChangeFieldsImp.h | 42 +++ .../src/lib/encode/XSyslogFields.cpp | 7 + .../src/lib/encode/XSyslogFieldsImp.cpp | 173 +++++++++ .../src/lib/encode/XSyslogFieldsImp.h | 55 +++ .../lib/encode/XThresholdCrossingAlertFields.cpp | 14 + .../encode/XThresholdCrossingAlertFieldsImp.cpp | 188 ++++++++++ .../lib/encode/XThresholdCrossingAlertFieldsImp.h | 63 ++++ .../src/lib/encode/XVendorNfNameFields.cpp | 26 ++ .../src/lib/encode/XVendorNfNameFieldsImp.cpp | 49 +++ .../src/lib/encode/XVendorNfNameFieldsImp.h | 29 ++ .../src/lib/encode/XVoiceQualityFields.cpp | 12 + .../src/lib/encode/XVoiceQualityFieldsImp.cpp | 126 +++++++ .../src/lib/encode/XVoiceQualityFieldsImp.h | 51 +++ .../ves_cpplibrary/src/lib/encode/include/XBatch.h | 20 ++ .../src/lib/encode/include/XCodecsInUse.h | 26 ++ .../src/lib/encode/include/XCommonEventHeader.h | 83 +++++ .../src/lib/encode/include/XCounter.h | 35 ++ .../src/lib/encode/include/XCpuUsage.h | 42 +++ .../src/lib/encode/include/XDiskUsage.h | 79 +++++ .../lib/encode/include/XEndOfCallVqmSummaries.h | 58 +++ .../ves_cpplibrary/src/lib/encode/include/XEvent.h | 32 ++ .../src/lib/encode/include/XFaultFields.h | 70 ++++ .../src/lib/encode/include/XFilesystemUsage.h | 38 ++ .../src/lib/encode/include/XGtpPerFlowMetrics.h | 101 ++++++ .../src/lib/encode/include/XHeartbeatFields.h | 27 ++ .../src/lib/encode/include/XHugePages.h | 31 ++ .../ves_cpplibrary/src/lib/encode/include/XIpmi.h | 44 +++ .../lib/encode/include/XIpmiBaseboardTemperature.h | 26 ++ .../include/XIpmiBaseboardVoltageRegulator.h | 26 ++ .../src/lib/encode/include/XIpmiBattery.h | 27 ++ .../src/lib/encode/include/XIpmiFan.h | 26 ++ .../XIpmiGlobalAggregateTemperatureMargin.h | 27 ++ .../src/lib/encode/include/XIpmiHsbp.h | 26 ++ .../src/lib/encode/include/XIpmiNic.h | 26 ++ .../src/lib/encode/include/XIpmiPowerSupply.h | 28 ++ .../src/lib/encode/include/XIpmiProcessor.h | 29 ++ .../src/lib/encode/include/XJsonObject.h | 32 ++ .../src/lib/encode/include/XJsonObjectInstance.h | 29 ++ .../ves_cpplibrary/src/lib/encode/include/XKey.h | 27 ++ .../src/lib/encode/include/XLatencyBucketMeasure.h | 27 ++ .../ves_cpplibrary/src/lib/encode/include/XLoad.h | 26 ++ .../lib/encode/include/XMachineCheckException.h | 29 ++ .../src/lib/encode/include/XMeasurementFields.h | 64 ++++ .../src/lib/encode/include/XMemoryUsage.h | 43 +++ .../src/lib/encode/include/XMobileFlowFields.h | 67 ++++ .../src/lib/encode/include/XNamedHashMap.h | 27 ++ .../src/lib/encode/include/XNicPerformance.h | 82 +++++ .../src/lib/encode/include/XNotificationFields.h | 38 ++ .../src/lib/encode/include/XOtherFields.h | 31 ++ .../lib/encode/include/XPnfRegistrationFields.h | 39 ++ .../src/lib/encode/include/XProcessStats.h | 32 ++ .../include/XProcessorDimmAggregateThermalMargin.h | 27 ++ .../src/lib/encode/include/XSipSignalingFields.h | 42 +++ .../src/lib/encode/include/XStateChangeFields.h | 40 +++ .../src/lib/encode/include/XSyslogFields.h | 71 ++++ .../encode/include/XThresholdCrossingAlertFields.h | 74 ++++ .../src/lib/encode/include/XVendorNfNameFields.h | 25 ++ .../src/lib/encode/include/XVoiceQualityFields.h | 41 +++ 180 files changed, 10472 insertions(+) create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/CMakeLists.txt create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XBatch.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XBatchImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XBatchImp.h create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/XCodecsInUse.cpp create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/XCodecsInUseImp.cpp create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/XCodecsInUseImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XCommonEventHeader.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XCommonEventHeaderImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XCommonEventHeaderImp.h create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/XCounter.cpp create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/XCounterImp.cpp create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/XCounterImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XCpuUsage.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XCpuUsageImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XCpuUsageImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XDiskUsage.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XDiskUsageImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XDiskUsageImp.h create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/XEndOfCallVqmSummaries.cpp create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/XEndOfCallVqmSummariesImp.cpp create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/XEndOfCallVqmSummariesImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XFaultFields.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XFaultFieldsImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XFaultFieldsImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XFilesystemUsage.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XFilesystemUsageImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XFilesystemUsageImp.h create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/XGtpPerFlowMetrics.cpp create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/XGtpPerFlowMetricsImp.cpp create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/XGtpPerFlowMetricsImp.h create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/XHeartbeatFields.cpp create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/XHeartbeatFieldsImp.cpp create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/XHeartbeatFieldsImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XHugePages.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XHugePagesImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XHugePagesImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XInternal.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XInternal.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmi.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBaseboardTemperature.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBaseboardTemperatureImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBaseboardTemperatureImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBaseboardVoltageRegulator.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBaseboardVoltageRegulatorImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBaseboardVoltageRegulatorImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBattery.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBatteryImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBatteryImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiFan.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiFanImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiFanImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiGlobalAggregateTemperatureMargin.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiGlobalAggregateTemperatureMarginImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiGlobalAggregateTemperatureMarginImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiHsbp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiHsbpImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiHsbpImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiNic.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiNicImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiNicImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiPowerSupply.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiPowerSupplyImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiPowerSupplyImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiProcessor.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiProcessorImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XIpmiProcessorImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XJsonObject.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XJsonObjectImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XJsonObjectImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XJsonObjectInstance.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XJsonObjectInstanceImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XJsonObjectInstanceImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XKey.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XKeyImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XKeyImp.h create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/XLatencyBucketMeasure.cpp create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/XLatencyBucketMeasureImp.cpp create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/XLatencyBucketMeasureImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XLoad.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XLoadImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XLoadImp.h create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/XMachineCheckException.cpp create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/XMachineCheckExceptionImp.cpp create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/XMachineCheckExceptionImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XMeasurementFields.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XMeasurementFieldsImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XMeasurementFieldsImp.h create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/XMemoryUsage.cpp create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/XMemoryUsageImp.cpp create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/XMemoryUsageImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XMobileFlowFields.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XMobileFlowFieldsImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XMobileFlowFieldsImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XNamedHashMap.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XNamedHashMapImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XNamedHashMapImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XNicPerformance.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XNicPerformanceImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XNicPerformanceImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XNotificationFields.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XNotificationFieldsImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XNotificationFieldsImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XOtherFields.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XOtherFieldsImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XOtherFieldsImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XPnfRegistrationFields.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XPnfRegistrationFieldsImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XPnfRegistrationFieldsImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XProcessStats.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XProcessStatsImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XProcessStatsImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XProcessorDimmAggregateThermalMargin.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XProcessorDimmAggregateThermalMarginImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XProcessorDimmAggregateThermalMarginImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XSipSignalingFields.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XSipSignalingFieldsImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XSipSignalingFieldsImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XStateChangeFields.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XStateChangeFieldsImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XStateChangeFieldsImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XSyslogFields.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XSyslogFieldsImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XSyslogFieldsImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XThresholdCrossingAlertFields.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XThresholdCrossingAlertFieldsImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XThresholdCrossingAlertFieldsImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XVendorNfNameFields.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XVendorNfNameFieldsImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XVendorNfNameFieldsImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XVoiceQualityFields.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XVoiceQualityFieldsImp.cpp create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/XVoiceQualityFieldsImp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XBatch.h create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/include/XCodecsInUse.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XCommonEventHeader.h create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/include/XCounter.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XCpuUsage.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XDiskUsage.h create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/include/XEndOfCallVqmSummaries.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XEvent.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XFaultFields.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XFilesystemUsage.h create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/include/XGtpPerFlowMetrics.h create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/include/XHeartbeatFields.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XHugePages.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmi.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiBaseboardTemperature.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiBaseboardVoltageRegulator.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiBattery.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiFan.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiGlobalAggregateTemperatureMargin.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiHsbp.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiNic.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiPowerSupply.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiProcessor.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XJsonObject.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XJsonObjectInstance.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XKey.h create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/include/XLatencyBucketMeasure.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XLoad.h create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/include/XMachineCheckException.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XMeasurementFields.h create mode 100644 veslibrary/ves_cpplibrary/src/lib/encode/include/XMemoryUsage.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XMobileFlowFields.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XNamedHashMap.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XNicPerformance.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XNotificationFields.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XOtherFields.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XPnfRegistrationFields.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XProcessStats.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XProcessorDimmAggregateThermalMargin.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XSipSignalingFields.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XStateChangeFields.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XSyslogFields.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XThresholdCrossingAlertFields.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XVendorNfNameFields.h create mode 100755 veslibrary/ves_cpplibrary/src/lib/encode/include/XVoiceQualityFields.h diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/CMakeLists.txt b/veslibrary/ves_cpplibrary/src/lib/encode/CMakeLists.txt new file mode 100755 index 0000000..771677e --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/CMakeLists.txt @@ -0,0 +1,21 @@ +aux_source_directory(../common LOG_SRCS) +aux_source_directory(. ENCODE_SRCS) + +find_package(nlohmann_json REQUIRED) +find_package(spdlog REQUIRED) + +include_directories(include) + +add_library(xencode SHARED ${LOG_SRCS} ${ENCODE_SRCS}) + +file(GLOB HDRS "include/*.h") + +install(FILES ${HDRS} + DESTINATION "include/xvesagent/xencode" +) +install(FILES ../../cmake/xencodeConfig.cmake + DESTINATION "lib/cmake/xencode" +) +INSTALL(TARGETS xencode + LIBRARY DESTINATION lib +) diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XBatch.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XBatch.cpp new file mode 100755 index 0000000..8c09d78 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XBatch.cpp @@ -0,0 +1,7 @@ +#include "XBatch.h" +#include "XBatchImp.h" + +std::shared_ptr vagt::encode::XBatch::create() +{ + return std::make_shared(); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XBatchImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XBatchImp.cpp new file mode 100755 index 0000000..6610d2f --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XBatchImp.cpp @@ -0,0 +1,45 @@ +#include "XBatchImp.h" + +std::string XBatchImp::toString() +{ + try + { + auto js = toJson(); + return js.dump(); + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to dump XIpmiNic to json string:{}.", e.what()); + return ""; + } +} + +void XBatchImp::addEvent(shared_ptr event) +{ + events_.push_back(event); +} + +nlohmann::json vagt::encode::XBatchImp::toJson() +{ + try + { + json field = json::array(); + + for (auto event : events_) + { + if (event) + { + field.push_back( dynamic_pointer_cast(event)->toJson()["event"]); + } + } + + json jsEvent; + jsEvent["eventList"] = field; + return jsEvent; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XBatch to json object:{}.", e.what()); + return json(); + } +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XBatchImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XBatchImp.h new file mode 100755 index 0000000..c4ae077 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XBatchImp.h @@ -0,0 +1,24 @@ +#pragma once + +#include "XBatch.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XBatchImp: public XBatch, public XJsonable + { + public: + virtual std::string toString() override; + + virtual json toJson() override; + + virtual void addEvent(std::shared_ptr event) override; + + private: + std::vector> events_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XCodecsInUse.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XCodecsInUse.cpp new file mode 100644 index 0000000..d62a82d --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XCodecsInUse.cpp @@ -0,0 +1,21 @@ +#include "XCodecsInUse.h" +#include "XCodecsInUseImp.h" + +vagt::encode::XCodecsInUse::XCodecsInUse() +{ +} + +vagt::encode::XCodecsInUse::XCodecsInUse(const XString & codecIdentifier, XInteger numberInUse): + imp_(make_shared(codecIdentifier, numberInUse)) +{ +} + +void vagt::encode::XCodecsInUse::setCodecIdentifier(const XString & codecIdentifier) +{ + return imp_->setCodecIdentifier(codecIdentifier); +} + +void vagt::encode::XCodecsInUse::setNumberInUse(XInteger numberInUse) +{ + return imp_->setNumberInUse(numberInUse); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XCodecsInUseImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XCodecsInUseImp.cpp new file mode 100644 index 0000000..efe73aa --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XCodecsInUseImp.cpp @@ -0,0 +1,42 @@ +#include "XCodecsInUseImp.h" + +XCodecsInUseImp::XCodecsInUseImp(const XString& codecIdentifier, + XInteger numberInUse): + codecIdentifier_(codecIdentifier), + numberInUse_(numberInUse) +{ + +} + +void XCodecsInUseImp::setCodecIdentifier(const XString& codecIdentifier) +{ + comVals_["codecIdentifier"] = codecIdentifier; +} + +void XCodecsInUseImp::setNumberInUse(XInteger numberInUse) +{ + comVals_["numberInUse"] = numberInUse; +} + +json XCodecsInUseImp::toJson() +{ + try + { + json field = { + {"codecIdentifier", codecIdentifier_}, + {"numberInUse", numberInUse_} + }; + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XCodecsInUse to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XCodecsInUseImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XCodecsInUseImp.h new file mode 100644 index 0000000..62ed4a6 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XCodecsInUseImp.h @@ -0,0 +1,29 @@ +#pragma once + +#include "XCodecsInUse.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XCodecsInUseImp : public XCodecsInUse, public XJsonable + { + public: + XCodecsInUseImp(const XString& codecIdentifier, + XInteger numberInUse); + + virtual json toJson() override; + virtual void setCodecIdentifier(const XString& codecIdentifier) override; + virtual void setNumberInUse(XInteger numberInUse) override; + + private: + //required + XString codecIdentifier_; + XInteger numberInUse_; + //optional + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XCommonEventHeader.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XCommonEventHeader.cpp new file mode 100755 index 0000000..03c1522 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XCommonEventHeader.cpp @@ -0,0 +1,13 @@ +#include "XCommonEventHeader.h" +#include "XCommonEventHeaderImp.h" + +std::shared_ptr vagt::encode::XCommonEventHeader::create(const XString & eventName, const XString & eventId, const XString & sourceName, const XString & reportingEntityName, XEnumCommonEventHeaderPriority priority, XInteger sequence) +{ + return std::make_shared(eventName, + eventId, + sourceName, + reportingEntityName, + priority, + sequence + ); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XCommonEventHeaderImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XCommonEventHeaderImp.cpp new file mode 100755 index 0000000..3d28354 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XCommonEventHeaderImp.cpp @@ -0,0 +1,192 @@ +#include +#include "XCommonEventHeaderImp.h" + +const std::string XEnumCommonEventHeaderVersionMapping[] = { + "4.0.1" +}; + +const std::string XEnumCommonEventHeaderVesEventListenerVersionMapping[] = { + "7.0.1" +}; + +const std::string XEnumCommonEventHeaderDomainMapping[] = { + "fault", + "heartbeat", + "measurement", + "mobileFlow", + "notification", + "other", + "pnfRegistration", + "sipSignaling", + "stateChange", + "syslog", + "thresholdCrossingAlert", + "voiceQuality" +}; + +const std::string XEnumCommonEventHeaderPriorityMapping[] = { + "High", + "Medium", + "Normal", + "Low" +}; + +XCommonEventHeaderImp::XCommonEventHeaderImp( + const XString& eventName, + const XString& eventId, + const XString& sourceName, + const XString& reportingEntityName, + XEnumCommonEventHeaderPriority priority, + XInteger sequence): + domain_(XEnumCommonEventHeaderDomainOther), + eventName_(eventName), + eventId_(eventId), + sourceName_(sourceName), + reportingEntityName_(reportingEntityName), + priority_(priority), + sequence_(sequence), + version_(XEnumCommonEventHeaderVersion4_0_1), + vesEventListenerVersion_(XEnumCommonEventHeaderVesEventListenerVersion7_0_1) +{ + struct timeval tv; + gettimeofday(&tv, nullptr); + + startEpochMicrosec_ = tv.tv_usec + 1000000 * tv.tv_sec; + lastEpochMicrosec_ = startEpochMicrosec_; +} + + +std::string XCommonEventHeaderImp::toString() +{ + try + { + auto js = toJson(); + return js.dump(); + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to dump XCommonEventHeaderImp to json string:{}.", e.what()); + return ""; + } +} + +void XCommonEventHeaderImp::setEventId(const XString& eventId) +{ + comVals_["eventId"] = eventId; +} + +void XCommonEventHeaderImp::setReportingEntityId(const XString& reportingEntityId) +{ + comVals_["reportingEntityId"] = reportingEntityId; +} + +void XCommonEventHeaderImp::setDomain(XEnumCommonEventHeaderDomain domain) +{ + auto val = XEnumCommonEventHeaderDomainMapping[domain]; + comVals_["domain"] = val; +} + +void XCommonEventHeaderImp::setLastEpochMicrosec(XInteger lastEpochMicrosec) +{ + comVals_["lastEpochMicrosec"] = lastEpochMicrosec; +} + +void XCommonEventHeaderImp::setReportingEntityName(const XString& reportingEntityName) +{ + comVals_["reportingEntityName"] = reportingEntityName; +} + +void XCommonEventHeaderImp::setSourceId(const XString& sourceId) +{ + comVals_["sourceId"] = sourceId; +} + +void XCommonEventHeaderImp::setEventType(const XString& eventType) +{ + comVals_["eventType"] = eventType; +} + +void XCommonEventHeaderImp::setSequence(XInteger sequence) +{ + comVals_["sequence"] = sequence; +} + +void XCommonEventHeaderImp::setInternalHeaderFields(const XInternalHeaderFields& internalHeaderFields) +{ + comVals_["internalHeaderFields"] = internalHeaderFields; +} + +void XCommonEventHeaderImp::setPriority(XEnumCommonEventHeaderPriority priority) +{ + auto val = XEnumCommonEventHeaderPriorityMapping[priority]; + comVals_["priority"] = val; +} + +void XCommonEventHeaderImp::setSourceName(const XString& sourceName) +{ + comVals_["sourceName"] = sourceName; +} + +void XCommonEventHeaderImp::setEventName(const XString& eventName) +{ + comVals_["eventName"] = eventName; +} + +void XCommonEventHeaderImp::setNfNamingCode(const XString& nfNamingCode) +{ + comVals_["nfNamingCode"] = nfNamingCode; +} + +void XCommonEventHeaderImp::setStartEpochMicrosec(XInteger startEpochMicrosec) +{ + comVals_["startEpochMicrosec"] = startEpochMicrosec; +} + +void XCommonEventHeaderImp::setNfVendorName(const XString& nfVendorName) +{ + comVals_["nfVendorName"] = nfVendorName; +} + +void XCommonEventHeaderImp::setTimeZoneOffset(const XString& timeZoneOffset) +{ + comVals_["timeZoneOffset"] = timeZoneOffset; +} + +void XCommonEventHeaderImp::setNfcNamingCode(const XString& nfcNamingCode) +{ + comVals_["nfcNamingCode"] = nfcNamingCode; +} + +nlohmann::json XCommonEventHeaderImp::toJson() +{ + try + { + json field = { + {"eventId", eventId_}, + {"domain", XEnumCommonEventHeaderDomainMapping[domain_]}, + {"lastEpochMicrosec", (unsigned long)(lastEpochMicrosec_)}, + {"reportingEntityName", reportingEntityName_}, + {"sequence", sequence_}, + {"priority", XEnumCommonEventHeaderPriorityMapping[priority_]}, + {"sourceName", sourceName_}, + {"eventName", eventName_}, + {"version", XEnumCommonEventHeaderVersionMapping[version_]}, + {"startEpochMicrosec", (unsigned long)(startEpochMicrosec_)}, + {"vesEventListenerVersion", XEnumCommonEventHeaderVesEventListenerVersionMapping[vesEventListenerVersion_]} + }; + + if (!internalHeaderFields_.empty()) + { + field["internalHeaderFields"] = internalHeaderFields_; + } + //optVal + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XCommonEventHeaderImp to json object:{}.", e.what()); + return json(); + } +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XCommonEventHeaderImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XCommonEventHeaderImp.h new file mode 100755 index 0000000..d474392 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XCommonEventHeaderImp.h @@ -0,0 +1,62 @@ +#pragma once + +#include "XCommonEventHeader.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XCommonEventHeaderImp : public XCommonEventHeader, public XJsonable + { + public: + XCommonEventHeaderImp( + const XString& eventName, + const XString& eventId, + const XString& sourceName, + const XString& reportingEntityName, + XEnumCommonEventHeaderPriority priority, + XInteger sequence); + + virtual std::string toString() override; + + virtual nlohmann::json toJson() override; + + virtual void setEventId(const XString& eventId) override; + virtual void setReportingEntityId(const XString& reportingEntityId) override; + virtual void setDomain(XEnumCommonEventHeaderDomain domain) override; + virtual void setLastEpochMicrosec(XInteger lastEpochMicrosec) override; + virtual void setReportingEntityName(const XString& reportingEntityName) override; + virtual void setSourceId(const XString& sourceId) override; + virtual void setEventType(const XString& eventType) override; + virtual void setSequence(XInteger sequence) override; + virtual void setInternalHeaderFields(const XInternalHeaderFields& internalHeaderFields) override; + virtual void setPriority(XEnumCommonEventHeaderPriority priority) override; + virtual void setSourceName(const XString& sourceName) override; + virtual void setEventName(const XString& eventName) override; + virtual void setNfNamingCode(const XString& nfNamingCode) override; + virtual void setStartEpochMicrosec(XInteger startEpochMicrosec) override; + virtual void setNfVendorName(const XString& nfVendorName) override; + virtual void setTimeZoneOffset(const XString& timeZoneOffset) override; + virtual void setNfcNamingCode(const XString& nfcNamingCode) override; + + private: + //required + XString eventId_; + XEnumCommonEventHeaderDomain domain_; + XInteger startEpochMicrosec_; + XInteger lastEpochMicrosec_; + XString reportingEntityName_; + XInteger sequence_; + XEnumCommonEventHeaderPriority priority_; + XString sourceName_; + XString eventName_; + XEnumCommonEventHeaderVersion version_; + XEnumCommonEventHeaderVesEventListenerVersion vesEventListenerVersion_; + //optional + XInternalHeaderFields internalHeaderFields_; + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XCounter.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XCounter.cpp new file mode 100644 index 0000000..3d316fb --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XCounter.cpp @@ -0,0 +1,26 @@ +#include "XCounter.h" +#include "XCounterImp.h" + +vagt::encode::XCounter::XCounter() +{ +} + +vagt::encode::XCounter::XCounter(XEnumCounterCriticality criticality, const XHashMap & hashMap, const XString & thresholdCrossed): + imp_(make_shared(criticality, hashMap, thresholdCrossed)) +{ +} + +void vagt::encode::XCounter::setThresholdCrossed(const XString & thresholdCrossed) +{ + return imp_->setThresholdCrossed(thresholdCrossed); +} + +void vagt::encode::XCounter::setHashMap(const XHashMap & hashMap) +{ + return imp_->setHashMap(hashMap); +} + +void vagt::encode::XCounter::setCriticality(XEnumCounterCriticality criticality) +{ + return imp_->setCriticality(criticality); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XCounterImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XCounterImp.cpp new file mode 100644 index 0000000..96036a8 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XCounterImp.cpp @@ -0,0 +1,55 @@ +#include "XCounterImp.h" + +const std::string XEnumCounterCriticalityMapping[] = { + "CRIT", + "MAJ" +}; + +XCounterImp::XCounterImp(XEnumCounterCriticality criticality, + const XHashMap& hashMap, + const XString& thresholdCrossed) : + criticality_(criticality), + hashMap_(hashMap), + thresholdCrossed_(thresholdCrossed) +{ + +} + +void XCounterImp::setThresholdCrossed(const XString& thresholdCrossed) +{ + comVals_["thresholdCrossed"] = thresholdCrossed; +} + +void XCounterImp::setHashMap(const XHashMap& hashMap) +{ + hashMap_ = hashMap; +} + +void XCounterImp::setCriticality(XEnumCounterCriticality criticality) +{ + auto val = XEnumCounterCriticalityMapping[criticality]; + comVals_["criticality"] = val; +} + +json XCounterImp::toJson() +{ + try + { + json field = { + { "thresholdCrossed", thresholdCrossed_ }, + { "hashMap", hashMap_ }, + { "criticality", XEnumCounterCriticalityMapping[criticality_] } + }; + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XCounter to json object:{}.", e.what()); + return json(); + } +} \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XCounterImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XCounterImp.h new file mode 100644 index 0000000..cd951c4 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XCounterImp.h @@ -0,0 +1,32 @@ +#pragma once + +#include "XCounter.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XCounterImp : public XCounter, public XJsonable + { + public: + XCounterImp(XEnumCounterCriticality criticality, + const XHashMap& hashMap, + const XString& thresholdCrossed); + + virtual json toJson() override; + + virtual void setThresholdCrossed(const XString& thresholdCrossed) override; + virtual void setHashMap(const XHashMap& hashMap) override; + virtual void setCriticality(XEnumCounterCriticality criticality) override; + + private: + //required + XString thresholdCrossed_; + XHashMap hashMap_; + XEnumCounterCriticality criticality_; + //optional + std::map comVals_; + }; + } +} \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XCpuUsage.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XCpuUsage.cpp new file mode 100755 index 0000000..4e8611d --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XCpuUsage.cpp @@ -0,0 +1,96 @@ +#include "XCpuUsage.h" +#include "XCpuUsageImp.h" + +vagt::encode::XCpuUsage::XCpuUsage() +{ +} + +vagt::encode::XCpuUsage::XCpuUsage(const XString & cpuIdentifier, XNumber percentUsage): + imp_(make_shared(cpuIdentifier, percentUsage)) +{ +} + +void vagt::encode::XCpuUsage::setPercentUsage(XNumber percentUsage) +{ + return imp_->setPercentUsage(percentUsage); +} + +void vagt::encode::XCpuUsage::setCpuUsageInterrupt(XNumber cpuUsageInterrupt) +{ + return imp_->setCpuUsageInterrupt(cpuUsageInterrupt); +} + +void vagt::encode::XCpuUsage::setCpuWait(XNumber cpuWait) +{ + return imp_->setCpuWait(cpuWait); +} + +void vagt::encode::XCpuUsage::setCpuCapacityContention(XNumber cpuCapacityContention) +{ + return imp_->setCpuCapacityContention(cpuCapacityContention); +} + +void vagt::encode::XCpuUsage::setCpuUsageNice(XNumber cpuUsageNice) +{ + return imp_->setCpuUsageNice(cpuUsageNice); +} + +void vagt::encode::XCpuUsage::setCpuDemandMhz(XNumber cpuDemandMhz) +{ + return imp_->setCpuDemandMhz(cpuDemandMhz); +} + +void vagt::encode::XCpuUsage::setCpuUsageSoftIrq(XNumber cpuUsageSoftIrq) +{ + return imp_->setCpuUsageSoftIrq(cpuUsageSoftIrq); +} + +void vagt::encode::XCpuUsage::setCpuLatencyAvg(XNumber cpuLatencyAvg) +{ + return imp_->setCpuLatencyAvg(cpuLatencyAvg); +} + +void vagt::encode::XCpuUsage::setCpuUsageSteal(XNumber cpuUsageSteal) +{ + return imp_->setCpuUsageSteal(cpuUsageSteal); +} + +void vagt::encode::XCpuUsage::setCpuDemandPct(XNumber cpuDemandPct) +{ + return imp_->setCpuDemandPct(cpuDemandPct); +} + +void vagt::encode::XCpuUsage::setCpuDemandAvg(XNumber cpuDemandAvg) +{ + return imp_->setCpuDemandAvg(cpuDemandAvg); +} + +void vagt::encode::XCpuUsage::setCpuIdle(XNumber cpuIdle) +{ + return imp_->setCpuIdle(cpuIdle); +} + +void vagt::encode::XCpuUsage::setCpuSwapWaitTime(XNumber cpuSwapWaitTime) +{ + return imp_->setCpuSwapWaitTime(cpuSwapWaitTime); +} + +void vagt::encode::XCpuUsage::setCpuUsageSystem(XNumber cpuUsageSystem) +{ + return imp_->setCpuUsageSystem(cpuUsageSystem); +} + +void vagt::encode::XCpuUsage::setCpuOverheadAvg(XNumber cpuOverheadAvg) +{ + return imp_->setCpuOverheadAvg(cpuOverheadAvg); +} + +void vagt::encode::XCpuUsage::setCpuUsageUser(XNumber cpuUsageUser) +{ + return imp_->setCpuUsageUser(cpuUsageUser); +} + +void vagt::encode::XCpuUsage::setCpuIdentifier(const XString & cpuIdentifier) +{ + return imp_->setCpuIdentifier(cpuIdentifier); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XCpuUsageImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XCpuUsageImp.cpp new file mode 100755 index 0000000..d55c8a0 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XCpuUsageImp.cpp @@ -0,0 +1,117 @@ +#include "XCpuUsageImp.h" + +XCpuUsageImp::XCpuUsageImp(const XString& cpuIdentifier, + XNumber percentUsage): + cpuIdentifier_(cpuIdentifier), + percentUsage_(percentUsage) +{ + +} + +void XCpuUsageImp::setPercentUsage(XNumber percentUsage) +{ + comVals_["percentUsage"] = percentUsage; +} + +void XCpuUsageImp::setCpuUsageInterrupt(XNumber cpuUsageInterrupt) +{ + comVals_["cpuUsageInterrupt"] = cpuUsageInterrupt; +} + +void XCpuUsageImp::setCpuWait(XNumber cpuWait) +{ + comVals_["cpuWait"] = cpuWait; +} + +void XCpuUsageImp::setCpuCapacityContention(XNumber cpuCapacityContention) +{ + comVals_["cpuCapacityContention"] = cpuCapacityContention; +} + +void XCpuUsageImp::setCpuUsageNice(XNumber cpuUsageNice) +{ + comVals_["cpuUsageNice"] = cpuUsageNice; +} + +void XCpuUsageImp::setCpuDemandMhz(XNumber cpuDemandMhz) +{ + comVals_["cpuDemandMhz"] = cpuDemandMhz; +} + +void XCpuUsageImp::setCpuUsageSoftIrq(XNumber cpuUsageSoftIrq) +{ + comVals_["cpuUsageSoftIrq"] = cpuUsageSoftIrq; +} + +void XCpuUsageImp::setCpuLatencyAvg(XNumber cpuLatencyAvg) +{ + comVals_["cpuLatencyAvg"] = cpuLatencyAvg; +} + +void XCpuUsageImp::setCpuUsageSteal(XNumber cpuUsageSteal) +{ + comVals_["cpuUsageSteal"] = cpuUsageSteal; +} + +void XCpuUsageImp::setCpuDemandPct(XNumber cpuDemandPct) +{ + comVals_["cpuDemandPct"] = cpuDemandPct; +} + +void XCpuUsageImp::setCpuDemandAvg(XNumber cpuDemandAvg) +{ + comVals_["cpuDemandAvg"] = cpuDemandAvg; +} + +void XCpuUsageImp::setCpuIdle(XNumber cpuIdle) +{ + comVals_["cpuIdle"] = cpuIdle; +} + +void XCpuUsageImp::setCpuSwapWaitTime(XNumber cpuSwapWaitTime) +{ + comVals_["cpuSwapWaitTime"] = cpuSwapWaitTime; +} + +void XCpuUsageImp::setCpuUsageSystem(XNumber cpuUsageSystem) +{ + comVals_["cpuUsageSystem"] = cpuUsageSystem; +} + +void XCpuUsageImp::setCpuOverheadAvg(XNumber cpuOverheadAvg) +{ + comVals_["cpuOverheadAvg"] = cpuOverheadAvg; +} + +void XCpuUsageImp::setCpuUsageUser(XNumber cpuUsageUser) +{ + comVals_["cpuUsageUser"] = cpuUsageUser; +} + +void XCpuUsageImp::setCpuIdentifier(const XString& cpuIdentifier) +{ + comVals_["cpuIdentifier"] = cpuIdentifier; +} + +json XCpuUsageImp::toJson() +{ + try + { + json field = { + {"percentUsage", percentUsage_}, + {"cpuIdentifier", cpuIdentifier_} + }; + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XCpuUsage to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XCpuUsageImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XCpuUsageImp.h new file mode 100755 index 0000000..6209e29 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XCpuUsageImp.h @@ -0,0 +1,45 @@ +#pragma once + +#include "XCpuUsage.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XCpuUsageImp: public XCpuUsage, public XJsonable + { + public: + XCpuUsageImp(const XString& cpuIdentifier, + XNumber percentUsage); + + virtual json toJson() override; + + virtual void setPercentUsage(XNumber percentUsage) override; + virtual void setCpuUsageInterrupt(XNumber cpuUsageInterrupt) override; + virtual void setCpuWait(XNumber cpuWait) override; + virtual void setCpuCapacityContention(XNumber cpuCapacityContention) override; + virtual void setCpuUsageNice(XNumber cpuUsageNice) override; + virtual void setCpuDemandMhz(XNumber cpuDemandMhz) override; + virtual void setCpuUsageSoftIrq(XNumber cpuUsageSoftIrq) override; + virtual void setCpuLatencyAvg(XNumber cpuLatencyAvg) override; + virtual void setCpuUsageSteal(XNumber cpuUsageSteal) override; + virtual void setCpuDemandPct(XNumber cpuDemandPct) override; + virtual void setCpuDemandAvg(XNumber cpuDemandAvg) override; + virtual void setCpuIdle(XNumber cpuIdle) override; + virtual void setCpuSwapWaitTime(XNumber cpuSwapWaitTime) override; + virtual void setCpuUsageSystem(XNumber cpuUsageSystem) override; + virtual void setCpuOverheadAvg(XNumber cpuOverheadAvg) override; + virtual void setCpuUsageUser(XNumber cpuUsageUser) override; + virtual void setCpuIdentifier(const XString& cpuIdentifier) override; + + private: + //required + XNumber percentUsage_; + XString cpuIdentifier_; + //optional + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XDiskUsage.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XDiskUsage.cpp new file mode 100755 index 0000000..69a44c8 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XDiskUsage.cpp @@ -0,0 +1,286 @@ +#include "XDiskUsage.h" +#include "XDiskUsageImp.h" + +vagt::encode::XDiskUsage::XDiskUsage() +{ +} + +vagt::encode::XDiskUsage::XDiskUsage(const XString & diskIdentifier): + imp_(make_shared(diskIdentifier)) +{ +} + +void vagt::encode::XDiskUsage::setDiskOctetsWriteLast(XNumber diskOctetsWriteLast) +{ + return imp_->setDiskOctetsWriteLast(diskOctetsWriteLast); +} + +void vagt::encode::XDiskUsage::setDiskIoTimeAvg(XNumber diskIoTimeAvg) +{ + return imp_->setDiskIoTimeAvg(diskIoTimeAvg); +} + +void vagt::encode::XDiskUsage::setDiskMergedReadMin(XNumber diskMergedReadMin) +{ + return imp_->setDiskMergedReadMin(diskMergedReadMin); +} + +void vagt::encode::XDiskUsage::setDiskTotalReadLatencyAvg(XNumber diskTotalReadLatencyAvg) +{ + return imp_->setDiskTotalReadLatencyAvg(diskTotalReadLatencyAvg); +} + +void vagt::encode::XDiskUsage::setDiskOpsReadMax(XNumber diskOpsReadMax) +{ + return imp_->setDiskOpsReadMax(diskOpsReadMax); +} + +void vagt::encode::XDiskUsage::setDiskOpsReadMin(XNumber diskOpsReadMin) +{ + return imp_->setDiskOpsReadMin(diskOpsReadMin); +} + +void vagt::encode::XDiskUsage::setDiskBusResets(XNumber diskBusResets) +{ + return imp_->setDiskBusResets(diskBusResets); +} + +void vagt::encode::XDiskUsage::setDiskMergedReadLast(XNumber diskMergedReadLast) +{ + return imp_->setDiskMergedReadLast(diskMergedReadLast); +} + +void vagt::encode::XDiskUsage::setDiskTimeReadAvg(XNumber diskTimeReadAvg) +{ + return imp_->setDiskTimeReadAvg(diskTimeReadAvg); +} + +void vagt::encode::XDiskUsage::setDiskMergedWriteMax(XNumber diskMergedWriteMax) +{ + return imp_->setDiskMergedWriteMax(diskMergedWriteMax); +} + +void vagt::encode::XDiskUsage::setDiskTime(XNumber diskTime) +{ + return imp_->setDiskTime(diskTime); +} + +void vagt::encode::XDiskUsage::setDiskOpsWriteLast(XNumber diskOpsWriteLast) +{ + return imp_->setDiskOpsWriteLast(diskOpsWriteLast); +} + +void vagt::encode::XDiskUsage::setDiskOpsReadAvg(XNumber diskOpsReadAvg) +{ + return imp_->setDiskOpsReadAvg(diskOpsReadAvg); +} + +void vagt::encode::XDiskUsage::setDiskFlushRequests(XNumber diskFlushRequests) +{ + return imp_->setDiskFlushRequests(diskFlushRequests); +} + +void vagt::encode::XDiskUsage::setDiskFlushTime(XNumber diskFlushTime) +{ + return imp_->setDiskFlushTime(diskFlushTime); +} + +void vagt::encode::XDiskUsage::setDiskOpsReadLast(XNumber diskOpsReadLast) +{ + return imp_->setDiskOpsReadLast(diskOpsReadLast); +} + +void vagt::encode::XDiskUsage::setDiskMergedReadAvg(XNumber diskMergedReadAvg) +{ + return imp_->setDiskMergedReadAvg(diskMergedReadAvg); +} + +void vagt::encode::XDiskUsage::setDiskWriteCommandsAvg(XNumber diskWriteCommandsAvg) +{ + return imp_->setDiskWriteCommandsAvg(diskWriteCommandsAvg); +} + +void vagt::encode::XDiskUsage::setDiskTimeReadMin(XNumber diskTimeReadMin) +{ + return imp_->setDiskTimeReadMin(diskTimeReadMin); +} + +void vagt::encode::XDiskUsage::setDiskOpsWriteAvg(XNumber diskOpsWriteAvg) +{ + return imp_->setDiskOpsWriteAvg(diskOpsWriteAvg); +} + +void vagt::encode::XDiskUsage::setDiskWeightedIoTimeMin(XNumber diskWeightedIoTimeMin) +{ + return imp_->setDiskWeightedIoTimeMin(diskWeightedIoTimeMin); +} + +void vagt::encode::XDiskUsage::setDiskIoTimeLast(XNumber diskIoTimeLast) +{ + return imp_->setDiskIoTimeLast(diskIoTimeLast); +} + +void vagt::encode::XDiskUsage::setDiskMergedReadMax(XNumber diskMergedReadMax) +{ + return imp_->setDiskMergedReadMax(diskMergedReadMax); +} + +void vagt::encode::XDiskUsage::setDiskOctetsReadMin(XNumber diskOctetsReadMin) +{ + return imp_->setDiskOctetsReadMin(diskOctetsReadMin); +} + +void vagt::encode::XDiskUsage::setDiskWeightedIoTimeAvg(XNumber diskWeightedIoTimeAvg) +{ + return imp_->setDiskWeightedIoTimeAvg(diskWeightedIoTimeAvg); +} + +void vagt::encode::XDiskUsage::setDiskTimeWriteMin(XNumber diskTimeWriteMin) +{ + return imp_->setDiskTimeWriteMin(diskTimeWriteMin); +} + +void vagt::encode::XDiskUsage::setDiskCommandsAvg(XNumber diskCommandsAvg) +{ + return imp_->setDiskCommandsAvg(diskCommandsAvg); +} + +void vagt::encode::XDiskUsage::setDiskTimeWriteMax(XNumber diskTimeWriteMax) +{ + return imp_->setDiskTimeWriteMax(diskTimeWriteMax); +} + +void vagt::encode::XDiskUsage::setDiskPendingOperationsMin(XNumber diskPendingOperationsMin) +{ + return imp_->setDiskPendingOperationsMin(diskPendingOperationsMin); +} + +void vagt::encode::XDiskUsage::setDiskTimeReadMax(XNumber diskTimeReadMax) +{ + return imp_->setDiskTimeReadMax(diskTimeReadMax); +} + +void vagt::encode::XDiskUsage::setDiskOctetsReadMax(XNumber diskOctetsReadMax) +{ + return imp_->setDiskOctetsReadMax(diskOctetsReadMax); +} + +void vagt::encode::XDiskUsage::setDiskOpsWriteMin(XNumber diskOpsWriteMin) +{ + return imp_->setDiskOpsWriteMin(diskOpsWriteMin); +} + +void vagt::encode::XDiskUsage::setDiskReadCommandsAvg(XNumber diskReadCommandsAvg) +{ + return imp_->setDiskReadCommandsAvg(diskReadCommandsAvg); +} + +void vagt::encode::XDiskUsage::setDiskMergedWriteMin(XNumber diskMergedWriteMin) +{ + return imp_->setDiskMergedWriteMin(diskMergedWriteMin); +} + +void vagt::encode::XDiskUsage::setDiskOctetsWriteMax(XNumber diskOctetsWriteMax) +{ + return imp_->setDiskOctetsWriteMax(diskOctetsWriteMax); +} + +void vagt::encode::XDiskUsage::setDiskTimeWriteLast(XNumber diskTimeWriteLast) +{ + return imp_->setDiskTimeWriteLast(diskTimeWriteLast); +} + +void vagt::encode::XDiskUsage::setDiskPendingOperationsLast(XNumber diskPendingOperationsLast) +{ + return imp_->setDiskPendingOperationsLast(diskPendingOperationsLast); +} + +void vagt::encode::XDiskUsage::setDiskWeightedIoTimeLast(XNumber diskWeightedIoTimeLast) +{ + return imp_->setDiskWeightedIoTimeLast(diskWeightedIoTimeLast); +} + +void vagt::encode::XDiskUsage::setDiskIdentifier(const XString & diskIdentifier) +{ + return imp_->setDiskIdentifier(diskIdentifier); +} + +void vagt::encode::XDiskUsage::setDiskOctetsWriteMin(XNumber diskOctetsWriteMin) +{ + return imp_->setDiskOctetsWriteMin(diskOctetsWriteMin); +} + +void vagt::encode::XDiskUsage::setDiskTimeWriteAvg(XNumber diskTimeWriteAvg) +{ + return imp_->setDiskTimeWriteAvg(diskTimeWriteAvg); +} + +void vagt::encode::XDiskUsage::setDiskOctetsWriteAvg(XNumber diskOctetsWriteAvg) +{ + return imp_->setDiskOctetsWriteAvg(diskOctetsWriteAvg); +} + +void vagt::encode::XDiskUsage::setDiskOctetsReadLast(XNumber diskOctetsReadLast) +{ + return imp_->setDiskOctetsReadLast(diskOctetsReadLast); +} + +void vagt::encode::XDiskUsage::setDiskWeightedIoTimeMax(XNumber diskWeightedIoTimeMax) +{ + return imp_->setDiskWeightedIoTimeMax(diskWeightedIoTimeMax); +} + +void vagt::encode::XDiskUsage::setDiskCommandsAborted(XNumber diskCommandsAborted) +{ + return imp_->setDiskCommandsAborted(diskCommandsAborted); +} + +void vagt::encode::XDiskUsage::setDiskOpsWriteMax(XNumber diskOpsWriteMax) +{ + return imp_->setDiskOpsWriteMax(diskOpsWriteMax); +} + +void vagt::encode::XDiskUsage::setDiskTimeReadLast(XNumber diskTimeReadLast) +{ + return imp_->setDiskTimeReadLast(diskTimeReadLast); +} + +void vagt::encode::XDiskUsage::setDiskMergedWriteAvg(XNumber diskMergedWriteAvg) +{ + return imp_->setDiskMergedWriteAvg(diskMergedWriteAvg); +} + +void vagt::encode::XDiskUsage::setDiskOctetsReadAvg(XNumber diskOctetsReadAvg) +{ + return imp_->setDiskOctetsReadAvg(diskOctetsReadAvg); +} + +void vagt::encode::XDiskUsage::setDiskTotalWriteLatencyAvg(XNumber diskTotalWriteLatencyAvg) +{ + return imp_->setDiskTotalWriteLatencyAvg(diskTotalWriteLatencyAvg); +} + +void vagt::encode::XDiskUsage::setDiskIoTimeMax(XNumber diskIoTimeMax) +{ + return imp_->setDiskIoTimeMax(diskIoTimeMax); +} + +void vagt::encode::XDiskUsage::setDiskIoTimeMin(XNumber diskIoTimeMin) +{ + return imp_->setDiskIoTimeMin(diskIoTimeMin); +} + +void vagt::encode::XDiskUsage::setDiskPendingOperationsAvg(XNumber diskPendingOperationsAvg) +{ + return imp_->setDiskPendingOperationsAvg(diskPendingOperationsAvg); +} + +void vagt::encode::XDiskUsage::setDiskMergedWriteLast(XNumber diskMergedWriteLast) +{ + return imp_->setDiskMergedWriteLast(diskMergedWriteLast); +} + +void vagt::encode::XDiskUsage::setDiskPendingOperationsMax(XNumber diskPendingOperationsMax) +{ + return imp_->setDiskPendingOperationsMax(diskPendingOperationsMax); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XDiskUsageImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XDiskUsageImp.cpp new file mode 100755 index 0000000..d5a662d --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XDiskUsageImp.cpp @@ -0,0 +1,304 @@ +#include "XDiskUsageImp.h" + +XDiskUsageImp::XDiskUsageImp(const XString& diskIdentifier): + diskIdentifier_(diskIdentifier) +{ + +} + +void XDiskUsageImp::setDiskOctetsWriteLast(XNumber diskOctetsWriteLast) +{ + comVals_["diskOctetsWriteLast"] = diskOctetsWriteLast; +} + +void XDiskUsageImp::setDiskIoTimeAvg(XNumber diskIoTimeAvg) +{ + comVals_["diskIoTimeAvg"] = diskIoTimeAvg; +} + +void XDiskUsageImp::setDiskMergedReadMin(XNumber diskMergedReadMin) +{ + comVals_["diskMergedReadMin"] = diskMergedReadMin; +} + +void XDiskUsageImp::setDiskTotalReadLatencyAvg(XNumber diskTotalReadLatencyAvg) +{ + comVals_["diskTotalReadLatencyAvg"] = diskTotalReadLatencyAvg; +} + +void XDiskUsageImp::setDiskOpsReadMax(XNumber diskOpsReadMax) +{ + comVals_["diskOpsReadMax"] = diskOpsReadMax; +} + +void XDiskUsageImp::setDiskOpsReadMin(XNumber diskOpsReadMin) +{ + comVals_["diskOpsReadMin"] = diskOpsReadMin; +} + +void XDiskUsageImp::setDiskBusResets(XNumber diskBusResets) +{ + comVals_["diskBusResets"] = diskBusResets; +} + +void XDiskUsageImp::setDiskMergedReadLast(XNumber diskMergedReadLast) +{ + comVals_["diskMergedReadLast"] = diskMergedReadLast; +} + +void XDiskUsageImp::setDiskTimeReadAvg(XNumber diskTimeReadAvg) +{ + comVals_["diskTimeReadAvg"] = diskTimeReadAvg; +} + +void XDiskUsageImp::setDiskMergedWriteMax(XNumber diskMergedWriteMax) +{ + comVals_["diskMergedWriteMax"] = diskMergedWriteMax; +} + +void XDiskUsageImp::setDiskTime(XNumber diskTime) +{ + comVals_["diskTime"] = diskTime; +} + +void XDiskUsageImp::setDiskOpsWriteLast(XNumber diskOpsWriteLast) +{ + comVals_["diskOpsWriteLast"] = diskOpsWriteLast; +} + +void XDiskUsageImp::setDiskOpsReadAvg(XNumber diskOpsReadAvg) +{ + comVals_["diskOpsReadAvg"] = diskOpsReadAvg; +} + +void XDiskUsageImp::setDiskFlushRequests(XNumber diskFlushRequests) +{ + comVals_["diskFlushRequests"] = diskFlushRequests; +} + +void XDiskUsageImp::setDiskFlushTime(XNumber diskFlushTime) +{ + comVals_["diskFlushTime"] = diskFlushTime; +} + +void XDiskUsageImp::setDiskOpsReadLast(XNumber diskOpsReadLast) +{ + comVals_["diskOpsReadLast"] = diskOpsReadLast; +} + +void XDiskUsageImp::setDiskMergedReadAvg(XNumber diskMergedReadAvg) +{ + comVals_["diskMergedReadAvg"] = diskMergedReadAvg; +} + +void XDiskUsageImp::setDiskWriteCommandsAvg(XNumber diskWriteCommandsAvg) +{ + comVals_["diskWriteCommandsAvg"] = diskWriteCommandsAvg; +} + +void XDiskUsageImp::setDiskTimeReadMin(XNumber diskTimeReadMin) +{ + comVals_["diskTimeReadMin"] = diskTimeReadMin; +} + +void XDiskUsageImp::setDiskOpsWriteAvg(XNumber diskOpsWriteAvg) +{ + comVals_["diskOpsWriteAvg"] = diskOpsWriteAvg; +} + +void XDiskUsageImp::setDiskWeightedIoTimeMin(XNumber diskWeightedIoTimeMin) +{ + comVals_["diskWeightedIoTimeMin"] = diskWeightedIoTimeMin; +} + +void XDiskUsageImp::setDiskIoTimeLast(XNumber diskIoTimeLast) +{ + comVals_["diskIoTimeLast"] = diskIoTimeLast; +} + +void XDiskUsageImp::setDiskMergedReadMax(XNumber diskMergedReadMax) +{ + comVals_["diskMergedReadMax"] = diskMergedReadMax; +} + +void XDiskUsageImp::setDiskOctetsReadMin(XNumber diskOctetsReadMin) +{ + comVals_["diskOctetsReadMin"] = diskOctetsReadMin; +} + +void XDiskUsageImp::setDiskWeightedIoTimeAvg(XNumber diskWeightedIoTimeAvg) +{ + comVals_["diskWeightedIoTimeAvg"] = diskWeightedIoTimeAvg; +} + +void XDiskUsageImp::setDiskTimeWriteMin(XNumber diskTimeWriteMin) +{ + comVals_["diskTimeWriteMin"] = diskTimeWriteMin; +} + +void XDiskUsageImp::setDiskCommandsAvg(XNumber diskCommandsAvg) +{ + comVals_["diskCommandsAvg"] = diskCommandsAvg; +} + +void XDiskUsageImp::setDiskTimeWriteMax(XNumber diskTimeWriteMax) +{ + comVals_["diskTimeWriteMax"] = diskTimeWriteMax; +} + +void XDiskUsageImp::setDiskPendingOperationsMin(XNumber diskPendingOperationsMin) +{ + comVals_["diskPendingOperationsMin"] = diskPendingOperationsMin; +} + +void XDiskUsageImp::setDiskTimeReadMax(XNumber diskTimeReadMax) +{ + comVals_["diskTimeReadMax"] = diskTimeReadMax; +} + +void XDiskUsageImp::setDiskOctetsReadMax(XNumber diskOctetsReadMax) +{ + comVals_["diskOctetsReadMax"] = diskOctetsReadMax; +} + +void XDiskUsageImp::setDiskOpsWriteMin(XNumber diskOpsWriteMin) +{ + comVals_["diskOpsWriteMin"] = diskOpsWriteMin; +} + +void XDiskUsageImp::setDiskReadCommandsAvg(XNumber diskReadCommandsAvg) +{ + comVals_["diskReadCommandsAvg"] = diskReadCommandsAvg; +} + +void XDiskUsageImp::setDiskMergedWriteMin(XNumber diskMergedWriteMin) +{ + comVals_["diskMergedWriteMin"] = diskMergedWriteMin; +} + +void XDiskUsageImp::setDiskOctetsWriteMax(XNumber diskOctetsWriteMax) +{ + comVals_["diskOctetsWriteMax"] = diskOctetsWriteMax; +} + +void XDiskUsageImp::setDiskTimeWriteLast(XNumber diskTimeWriteLast) +{ + comVals_["diskTimeWriteLast"] = diskTimeWriteLast; +} + +void XDiskUsageImp::setDiskPendingOperationsLast(XNumber diskPendingOperationsLast) +{ + comVals_["diskPendingOperationsLast"] = diskPendingOperationsLast; +} + +void XDiskUsageImp::setDiskWeightedIoTimeLast(XNumber diskWeightedIoTimeLast) +{ + comVals_["diskWeightedIoTimeLast"] = diskWeightedIoTimeLast; +} + +void XDiskUsageImp::setDiskIdentifier(const XString& diskIdentifier) +{ + comVals_["diskIdentifier"] = diskIdentifier; +} + +void XDiskUsageImp::setDiskOctetsWriteMin(XNumber diskOctetsWriteMin) +{ + comVals_["diskOctetsWriteMin"] = diskOctetsWriteMin; +} + +void XDiskUsageImp::setDiskTimeWriteAvg(XNumber diskTimeWriteAvg) +{ + comVals_["diskTimeWriteAvg"] = diskTimeWriteAvg; +} + +void XDiskUsageImp::setDiskOctetsWriteAvg(XNumber diskOctetsWriteAvg) +{ + comVals_["diskOctetsWriteAvg"] = diskOctetsWriteAvg; +} + +void XDiskUsageImp::setDiskOctetsReadLast(XNumber diskOctetsReadLast) +{ + comVals_["diskOctetsReadLast"] = diskOctetsReadLast; +} + +void XDiskUsageImp::setDiskWeightedIoTimeMax(XNumber diskWeightedIoTimeMax) +{ + comVals_["diskWeightedIoTimeMax"] = diskWeightedIoTimeMax; +} + +void XDiskUsageImp::setDiskCommandsAborted(XNumber diskCommandsAborted) +{ + comVals_["diskCommandsAborted"] = diskCommandsAborted; +} + +void XDiskUsageImp::setDiskOpsWriteMax(XNumber diskOpsWriteMax) +{ + comVals_["diskOpsWriteMax"] = diskOpsWriteMax; +} + +void XDiskUsageImp::setDiskTimeReadLast(XNumber diskTimeReadLast) +{ + comVals_["diskTimeReadLast"] = diskTimeReadLast; +} + +void XDiskUsageImp::setDiskMergedWriteAvg(XNumber diskMergedWriteAvg) +{ + comVals_["diskMergedWriteAvg"] = diskMergedWriteAvg; +} + +void XDiskUsageImp::setDiskOctetsReadAvg(XNumber diskOctetsReadAvg) +{ + comVals_["diskOctetsReadAvg"] = diskOctetsReadAvg; +} + +void XDiskUsageImp::setDiskTotalWriteLatencyAvg(XNumber diskTotalWriteLatencyAvg) +{ + comVals_["diskTotalWriteLatencyAvg"] = diskTotalWriteLatencyAvg; +} + +void XDiskUsageImp::setDiskIoTimeMax(XNumber diskIoTimeMax) +{ + comVals_["diskIoTimeMax"] = diskIoTimeMax; +} + +void XDiskUsageImp::setDiskIoTimeMin(XNumber diskIoTimeMin) +{ + comVals_["diskIoTimeMin"] = diskIoTimeMin; +} + +void XDiskUsageImp::setDiskPendingOperationsAvg(XNumber diskPendingOperationsAvg) +{ + comVals_["diskPendingOperationsAvg"] = diskPendingOperationsAvg; +} + +void XDiskUsageImp::setDiskMergedWriteLast(XNumber diskMergedWriteLast) +{ + comVals_["diskMergedWriteLast"] = diskMergedWriteLast; +} + +void XDiskUsageImp::setDiskPendingOperationsMax(XNumber diskPendingOperationsMax) +{ + comVals_["diskPendingOperationsMax"] = diskPendingOperationsMax; +} + +json XDiskUsageImp::toJson() +{ + try + { + json field = { + {"diskIdentifier", diskIdentifier_} + }; + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XDiskUsage to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XDiskUsageImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XDiskUsageImp.h new file mode 100755 index 0000000..5ae7403 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XDiskUsageImp.h @@ -0,0 +1,81 @@ +#pragma once + +#include "XDiskUsage.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XDiskUsageImp : public XDiskUsage, public XJsonable + { + public: + XDiskUsageImp(const XString& diskIdentifier); + + virtual json toJson() override; + + virtual void setDiskOctetsWriteLast(XNumber diskOctetsWriteLast) override; + virtual void setDiskIoTimeAvg(XNumber diskIoTimeAvg) override; + virtual void setDiskMergedReadMin(XNumber diskMergedReadMin) override; + virtual void setDiskTotalReadLatencyAvg(XNumber diskTotalReadLatencyAvg) override; + virtual void setDiskOpsReadMax(XNumber diskOpsReadMax) override; + virtual void setDiskOpsReadMin(XNumber diskOpsReadMin) override; + virtual void setDiskBusResets(XNumber diskBusResets) override; + virtual void setDiskMergedReadLast(XNumber diskMergedReadLast) override; + virtual void setDiskTimeReadAvg(XNumber diskTimeReadAvg) override; + virtual void setDiskMergedWriteMax(XNumber diskMergedWriteMax) override; + virtual void setDiskTime(XNumber diskTime) override; + virtual void setDiskOpsWriteLast(XNumber diskOpsWriteLast) override; + virtual void setDiskOpsReadAvg(XNumber diskOpsReadAvg) override; + virtual void setDiskFlushRequests(XNumber diskFlushRequests) override; + virtual void setDiskFlushTime(XNumber diskFlushTime) override; + virtual void setDiskOpsReadLast(XNumber diskOpsReadLast) override; + virtual void setDiskMergedReadAvg(XNumber diskMergedReadAvg) override; + virtual void setDiskWriteCommandsAvg(XNumber diskWriteCommandsAvg) override; + virtual void setDiskTimeReadMin(XNumber diskTimeReadMin) override; + virtual void setDiskOpsWriteAvg(XNumber diskOpsWriteAvg) override; + virtual void setDiskWeightedIoTimeMin(XNumber diskWeightedIoTimeMin) override; + virtual void setDiskIoTimeLast(XNumber diskIoTimeLast) override; + virtual void setDiskMergedReadMax(XNumber diskMergedReadMax) override; + virtual void setDiskOctetsReadMin(XNumber diskOctetsReadMin) override; + virtual void setDiskWeightedIoTimeAvg(XNumber diskWeightedIoTimeAvg) override; + virtual void setDiskTimeWriteMin(XNumber diskTimeWriteMin) override; + virtual void setDiskCommandsAvg(XNumber diskCommandsAvg) override; + virtual void setDiskTimeWriteMax(XNumber diskTimeWriteMax) override; + virtual void setDiskPendingOperationsMin(XNumber diskPendingOperationsMin) override; + virtual void setDiskTimeReadMax(XNumber diskTimeReadMax) override; + virtual void setDiskOctetsReadMax(XNumber diskOctetsReadMax) override; + virtual void setDiskOpsWriteMin(XNumber diskOpsWriteMin) override; + virtual void setDiskReadCommandsAvg(XNumber diskReadCommandsAvg) override; + virtual void setDiskMergedWriteMin(XNumber diskMergedWriteMin) override; + virtual void setDiskOctetsWriteMax(XNumber diskOctetsWriteMax) override; + virtual void setDiskTimeWriteLast(XNumber diskTimeWriteLast) override; + virtual void setDiskPendingOperationsLast(XNumber diskPendingOperationsLast) override; + virtual void setDiskWeightedIoTimeLast(XNumber diskWeightedIoTimeLast) override; + virtual void setDiskIdentifier(const XString& diskIdentifier) override; + virtual void setDiskOctetsWriteMin(XNumber diskOctetsWriteMin) override; + virtual void setDiskTimeWriteAvg(XNumber diskTimeWriteAvg) override; + virtual void setDiskOctetsWriteAvg(XNumber diskOctetsWriteAvg) override; + virtual void setDiskOctetsReadLast(XNumber diskOctetsReadLast) override; + virtual void setDiskWeightedIoTimeMax(XNumber diskWeightedIoTimeMax) override; + virtual void setDiskCommandsAborted(XNumber diskCommandsAborted) override; + virtual void setDiskOpsWriteMax(XNumber diskOpsWriteMax) override; + virtual void setDiskTimeReadLast(XNumber diskTimeReadLast) override; + virtual void setDiskMergedWriteAvg(XNumber diskMergedWriteAvg) override; + virtual void setDiskOctetsReadAvg(XNumber diskOctetsReadAvg) override; + virtual void setDiskTotalWriteLatencyAvg(XNumber diskTotalWriteLatencyAvg) override; + virtual void setDiskIoTimeMax(XNumber diskIoTimeMax) override; + virtual void setDiskIoTimeMin(XNumber diskIoTimeMin) override; + virtual void setDiskPendingOperationsAvg(XNumber diskPendingOperationsAvg) override; + virtual void setDiskMergedWriteLast(XNumber diskMergedWriteLast) override; + virtual void setDiskPendingOperationsMax(XNumber diskPendingOperationsMax) override; + + private: + //required + XString diskIdentifier_; + //optional + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XEndOfCallVqmSummaries.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XEndOfCallVqmSummaries.cpp new file mode 100644 index 0000000..377aeb4 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XEndOfCallVqmSummaries.cpp @@ -0,0 +1,156 @@ +#include "XEndOfCallVqmSummaries.h" +#include "XEndOfCallVqmSummariesImp.h" + +vagt::encode::XEndOfCallVqmSummaries::XEndOfCallVqmSummaries() +{ +} + +vagt::encode::XEndOfCallVqmSummaries::XEndOfCallVqmSummaries(const XString & adjacencyName, XEnumEndOfCallVqmSummariesEndpointDescription endpointDescription): + imp_(make_shared(adjacencyName, endpointDescription)) +{ +} + +void vagt::encode::XEndOfCallVqmSummaries::setLocalRtpPacketsDiscarded(XNumber localRtpPacketsDiscarded) +{ + return imp_->setLocalRtpPacketsDiscarded(localRtpPacketsDiscarded); +} + +void vagt::encode::XEndOfCallVqmSummaries::setLocalMaxJitter(XNumber localMaxJitter) +{ + return imp_->setLocalMaxJitter(localMaxJitter); +} + +void vagt::encode::XEndOfCallVqmSummaries::setRoundTripDelay(XNumber roundTripDelay) +{ + return imp_->setRoundTripDelay(roundTripDelay); +} + +void vagt::encode::XEndOfCallVqmSummaries::setLocalRtpOctetsSent(XNumber localRtpOctetsSent) +{ + return imp_->setLocalRtpOctetsSent(localRtpOctetsSent); +} + +void vagt::encode::XEndOfCallVqmSummaries::setLocalAverageJitterBufferDelay(XNumber localAverageJitterBufferDelay) +{ + return imp_->setLocalAverageJitterBufferDelay(localAverageJitterBufferDelay); +} + +void vagt::encode::XEndOfCallVqmSummaries::setLocalRtpPacketsLost(XNumber localRtpPacketsLost) +{ + return imp_->setLocalRtpPacketsLost(localRtpPacketsLost); +} + +void vagt::encode::XEndOfCallVqmSummaries::setEndpointRtpOctetsReceived(XNumber endpointRtpOctetsReceived) +{ + return imp_->setEndpointRtpOctetsReceived(endpointRtpOctetsReceived); +} + +void vagt::encode::XEndOfCallVqmSummaries::setRFactor(XNumber rFactor) +{ + return imp_->setRFactor(rFactor); +} + +void vagt::encode::XEndOfCallVqmSummaries::setLocalRtpPacketsReceived(XNumber localRtpPacketsReceived) +{ + return imp_->setLocalRtpPacketsReceived(localRtpPacketsReceived); +} + +void vagt::encode::XEndOfCallVqmSummaries::setEndpointRtpPacketsLost(XNumber endpointRtpPacketsLost) +{ + return imp_->setEndpointRtpPacketsLost(endpointRtpPacketsLost); +} + +void vagt::encode::XEndOfCallVqmSummaries::setLocalAverageJitter(XNumber localAverageJitter) +{ + return imp_->setLocalAverageJitter(localAverageJitter); +} + +void vagt::encode::XEndOfCallVqmSummaries::setMosCqe(XNumber mosCqe) +{ + return imp_->setMosCqe(mosCqe); +} + +void vagt::encode::XEndOfCallVqmSummaries::setOneWayDelay(XNumber oneWayDelay) +{ + return imp_->setOneWayDelay(oneWayDelay); +} + +void vagt::encode::XEndOfCallVqmSummaries::setEndpointRtpOctetsLost(XNumber endpointRtpOctetsLost) +{ + return imp_->setEndpointRtpOctetsLost(endpointRtpOctetsLost); +} + +void vagt::encode::XEndOfCallVqmSummaries::setAdjacencyName(const XString & adjacencyName) +{ + return imp_->setAdjacencyName(adjacencyName); +} + +void vagt::encode::XEndOfCallVqmSummaries::setPacketLossPercent(XNumber packetLossPercent) +{ + return imp_->setPacketLossPercent(packetLossPercent); +} + +void vagt::encode::XEndOfCallVqmSummaries::setEndpointRtpOctetsDiscarded(XNumber endpointRtpOctetsDiscarded) +{ + return imp_->setEndpointRtpOctetsDiscarded(endpointRtpOctetsDiscarded); +} + +void vagt::encode::XEndOfCallVqmSummaries::setLocalRtpPacketsSent(XNumber localRtpPacketsSent) +{ + return imp_->setLocalRtpPacketsSent(localRtpPacketsSent); +} + +void vagt::encode::XEndOfCallVqmSummaries::setEndpointAverageJitter(XNumber endpointAverageJitter) +{ + return imp_->setEndpointAverageJitter(endpointAverageJitter); +} + +void vagt::encode::XEndOfCallVqmSummaries::setEndpointRtpOctetsSent(XNumber endpointRtpOctetsSent) +{ + return imp_->setEndpointRtpOctetsSent(endpointRtpOctetsSent); +} + +void vagt::encode::XEndOfCallVqmSummaries::setEndpointMaxJitter(XNumber endpointMaxJitter) +{ + return imp_->setEndpointMaxJitter(endpointMaxJitter); +} + +void vagt::encode::XEndOfCallVqmSummaries::setEndpointRtpPacketsReceived(XNumber endpointRtpPacketsReceived) +{ + return imp_->setEndpointRtpPacketsReceived(endpointRtpPacketsReceived); +} + +void vagt::encode::XEndOfCallVqmSummaries::setEndpointRtpPacketsSent(XNumber endpointRtpPacketsSent) +{ + return imp_->setEndpointRtpPacketsSent(endpointRtpPacketsSent); +} + +void vagt::encode::XEndOfCallVqmSummaries::setLocalMaxJitterBufferDelay(XNumber localMaxJitterBufferDelay) +{ + return imp_->setLocalMaxJitterBufferDelay(localMaxJitterBufferDelay); +} + +void vagt::encode::XEndOfCallVqmSummaries::setLocalRtpOctetsLost(XNumber localRtpOctetsLost) +{ + return imp_->setLocalRtpOctetsLost(localRtpOctetsLost); +} + +void vagt::encode::XEndOfCallVqmSummaries::setLocalRtpOctetsReceived(XNumber localRtpOctetsReceived) +{ + return imp_->setLocalRtpOctetsReceived(localRtpOctetsReceived); +} + +void vagt::encode::XEndOfCallVqmSummaries::setEndpointRtpPacketsDiscarded(XNumber endpointRtpPacketsDiscarded) +{ + return imp_->setEndpointRtpPacketsDiscarded(endpointRtpPacketsDiscarded); +} + +void vagt::encode::XEndOfCallVqmSummaries::setEndpointDescription(XEnumEndOfCallVqmSummariesEndpointDescription endpointDescription) +{ + return imp_->setEndpointDescription(endpointDescription); +} + +void vagt::encode::XEndOfCallVqmSummaries::setLocalRtpOctetsDiscarded(XNumber localRtpOctetsDiscarded) +{ + return imp_->setLocalRtpOctetsDiscarded(localRtpOctetsDiscarded); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XEndOfCallVqmSummariesImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XEndOfCallVqmSummariesImp.cpp new file mode 100644 index 0000000..7364324 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XEndOfCallVqmSummariesImp.cpp @@ -0,0 +1,188 @@ +#include "XEndOfCallVqmSummariesImp.h" + +const std::string XEnumEndOfCallVqmSummariesEndpointDescriptionMapping[] = { + "Caller", + "Callee" +}; + +XEndOfCallVqmSummariesImp::XEndOfCallVqmSummariesImp(const XString& adjacencyName, + XEnumEndOfCallVqmSummariesEndpointDescription endpointDescription): + adjacencyName_(adjacencyName), + endpointDescription_(endpointDescription) +{ + +} + +void XEndOfCallVqmSummariesImp::setLocalRtpPacketsDiscarded(XNumber localRtpPacketsDiscarded) +{ + comVals_["localRtpPacketsDiscarded"] = localRtpPacketsDiscarded; +} + +void XEndOfCallVqmSummariesImp::setLocalMaxJitter(XNumber localMaxJitter) +{ + comVals_["localMaxJitter"] = localMaxJitter; +} + +void XEndOfCallVqmSummariesImp::setRoundTripDelay(XNumber roundTripDelay) +{ + comVals_["roundTripDelay"] = roundTripDelay; +} + +void XEndOfCallVqmSummariesImp::setLocalRtpOctetsSent(XNumber localRtpOctetsSent) +{ + comVals_["localRtpOctetsSent"] = localRtpOctetsSent; +} + +void XEndOfCallVqmSummariesImp::setLocalAverageJitterBufferDelay(XNumber localAverageJitterBufferDelay) +{ + comVals_["localAverageJitterBufferDelay"] = localAverageJitterBufferDelay; +} + +void XEndOfCallVqmSummariesImp::setLocalRtpPacketsLost(XNumber localRtpPacketsLost) +{ + comVals_["localRtpPacketsLost"] = localRtpPacketsLost; +} + +void XEndOfCallVqmSummariesImp::setEndpointRtpOctetsReceived(XNumber endpointRtpOctetsReceived) +{ + comVals_["endpointRtpOctetsReceived"] = endpointRtpOctetsReceived; +} + +void XEndOfCallVqmSummariesImp::setRFactor(XNumber rFactor) +{ + comVals_["rFactor"] = rFactor; +} + +void XEndOfCallVqmSummariesImp::setLocalRtpPacketsReceived(XNumber localRtpPacketsReceived) +{ + comVals_["localRtpPacketsReceived"] = localRtpPacketsReceived; +} + +void XEndOfCallVqmSummariesImp::setEndpointRtpPacketsLost(XNumber endpointRtpPacketsLost) +{ + comVals_["endpointRtpPacketsLost"] = endpointRtpPacketsLost; +} + +void XEndOfCallVqmSummariesImp::setLocalAverageJitter(XNumber localAverageJitter) +{ + comVals_["localAverageJitter"] = localAverageJitter; +} + +void XEndOfCallVqmSummariesImp::setMosCqe(XNumber mosCqe) +{ + comVals_["mosCqe"] = mosCqe; +} + +void XEndOfCallVqmSummariesImp::setOneWayDelay(XNumber oneWayDelay) +{ + comVals_["oneWayDelay"] = oneWayDelay; +} + +void XEndOfCallVqmSummariesImp::setEndpointRtpOctetsLost(XNumber endpointRtpOctetsLost) +{ + comVals_["endpointRtpOctetsLost"] = endpointRtpOctetsLost; +} + +void XEndOfCallVqmSummariesImp::setAdjacencyName(const XString& adjacencyName) +{ + comVals_["adjacencyName"] = adjacencyName; +} + +void XEndOfCallVqmSummariesImp::setPacketLossPercent(XNumber packetLossPercent) +{ + comVals_["packetLossPercent"] = packetLossPercent; +} + +void XEndOfCallVqmSummariesImp::setEndpointRtpOctetsDiscarded(XNumber endpointRtpOctetsDiscarded) +{ + comVals_["endpointRtpOctetsDiscarded"] = endpointRtpOctetsDiscarded; +} + +void XEndOfCallVqmSummariesImp::setLocalRtpPacketsSent(XNumber localRtpPacketsSent) +{ + comVals_["localRtpPacketsSent"] = localRtpPacketsSent; +} + +void XEndOfCallVqmSummariesImp::setEndpointAverageJitter(XNumber endpointAverageJitter) +{ + comVals_["endpointAverageJitter"] = endpointAverageJitter; +} + +void XEndOfCallVqmSummariesImp::setEndpointRtpOctetsSent(XNumber endpointRtpOctetsSent) +{ + comVals_["endpointRtpOctetsSent"] = endpointRtpOctetsSent; +} + +void XEndOfCallVqmSummariesImp::setEndpointMaxJitter(XNumber endpointMaxJitter) +{ + comVals_["endpointMaxJitter"] = endpointMaxJitter; +} + +void XEndOfCallVqmSummariesImp::setEndpointRtpPacketsReceived(XNumber endpointRtpPacketsReceived) +{ + comVals_["endpointRtpPacketsReceived"] = endpointRtpPacketsReceived; +} + +void XEndOfCallVqmSummariesImp::setEndpointRtpPacketsSent(XNumber endpointRtpPacketsSent) +{ + comVals_["endpointRtpPacketsSent"] = endpointRtpPacketsSent; +} + +void XEndOfCallVqmSummariesImp::setLocalMaxJitterBufferDelay(XNumber localMaxJitterBufferDelay) +{ + comVals_["localMaxJitterBufferDelay"] = localMaxJitterBufferDelay; +} + +void XEndOfCallVqmSummariesImp::setLocalRtpOctetsLost(XNumber localRtpOctetsLost) +{ + comVals_["localRtpOctetsLost"] = localRtpOctetsLost; +} + +void XEndOfCallVqmSummariesImp::setLocalRtpOctetsReceived(XNumber localRtpOctetsReceived) +{ + comVals_["localRtpOctetsReceived"] = localRtpOctetsReceived; +} + +void XEndOfCallVqmSummariesImp::setEndpointRtpPacketsDiscarded(XNumber endpointRtpPacketsDiscarded) +{ + comVals_["endpointRtpPacketsDiscarded"] = endpointRtpPacketsDiscarded; +} + +void XEndOfCallVqmSummariesImp::setEndpointDescription(XEnumEndOfCallVqmSummariesEndpointDescription endpointDescription) +{ + auto val = XEnumEndOfCallVqmSummariesEndpointDescriptionMapping[endpointDescription]; + comVals_["endpointDescription"] = val; +} + +void XEndOfCallVqmSummariesImp::setLocalRtpOctetsDiscarded(XNumber localRtpOctetsDiscarded) +{ + comVals_["localRtpOctetsDiscarded"] = localRtpOctetsDiscarded; +} + +json XEndOfCallVqmSummariesImp::toJson() +{ + try + { + if (adjacencyName_.empty()) + { + return json(); + } + + json field = { + {"adjacencyName", adjacencyName_}, + {"endpointDescription", XEnumEndOfCallVqmSummariesEndpointDescriptionMapping[endpointDescription_]} + }; + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XEndOfCallVqmSummaries to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XEndOfCallVqmSummariesImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XEndOfCallVqmSummariesImp.h new file mode 100644 index 0000000..586e4ab --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XEndOfCallVqmSummariesImp.h @@ -0,0 +1,57 @@ +#pragma once + +#include "XEndOfCallVqmSummaries.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XEndOfCallVqmSummariesImp : public XEndOfCallVqmSummaries, public XJsonable + { + public: + XEndOfCallVqmSummariesImp(const XString& adjacencyName, + XEnumEndOfCallVqmSummariesEndpointDescription endpointDescription); + + virtual json toJson() override; + + virtual void setLocalRtpPacketsDiscarded(XNumber localRtpPacketsDiscarded) override; + virtual void setLocalMaxJitter(XNumber localMaxJitter) override; + virtual void setRoundTripDelay(XNumber roundTripDelay) override; + virtual void setLocalRtpOctetsSent(XNumber localRtpOctetsSent) override; + virtual void setLocalAverageJitterBufferDelay(XNumber localAverageJitterBufferDelay) override; + virtual void setLocalRtpPacketsLost(XNumber localRtpPacketsLost) override; + virtual void setEndpointRtpOctetsReceived(XNumber endpointRtpOctetsReceived) override; + virtual void setRFactor(XNumber rFactor) override; + virtual void setLocalRtpPacketsReceived(XNumber localRtpPacketsReceived) override; + virtual void setEndpointRtpPacketsLost(XNumber endpointRtpPacketsLost) override; + virtual void setLocalAverageJitter(XNumber localAverageJitter) override; + virtual void setMosCqe(XNumber mosCqe) override; + virtual void setOneWayDelay(XNumber oneWayDelay) override; + virtual void setEndpointRtpOctetsLost(XNumber endpointRtpOctetsLost) override; + virtual void setAdjacencyName(const XString& adjacencyName) override; + virtual void setPacketLossPercent(XNumber packetLossPercent) override; + virtual void setEndpointRtpOctetsDiscarded(XNumber endpointRtpOctetsDiscarded) override; + virtual void setLocalRtpPacketsSent(XNumber localRtpPacketsSent) override; + virtual void setEndpointAverageJitter(XNumber endpointAverageJitter) override; + virtual void setEndpointRtpOctetsSent(XNumber endpointRtpOctetsSent) override; + virtual void setEndpointMaxJitter(XNumber endpointMaxJitter) override; + virtual void setEndpointRtpPacketsReceived(XNumber endpointRtpPacketsReceived) override; + virtual void setEndpointRtpPacketsSent(XNumber endpointRtpPacketsSent) override; + virtual void setLocalMaxJitterBufferDelay(XNumber localMaxJitterBufferDelay) override; + virtual void setLocalRtpOctetsLost(XNumber localRtpOctetsLost) override; + virtual void setLocalRtpOctetsReceived(XNumber localRtpOctetsReceived) override; + virtual void setEndpointRtpPacketsDiscarded(XNumber endpointRtpPacketsDiscarded) override; + virtual void setEndpointDescription(XEnumEndOfCallVqmSummariesEndpointDescription endpointDescription) override; + virtual void setLocalRtpOctetsDiscarded(XNumber localRtpOctetsDiscarded) override; + + private: + //required + XString adjacencyName_; + XEnumEndOfCallVqmSummariesEndpointDescription endpointDescription_; + //optional + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XFaultFields.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XFaultFields.cpp new file mode 100755 index 0000000..84d6351 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XFaultFields.cpp @@ -0,0 +1,13 @@ +#include "XFaultFields.h" +#include "XFaultFieldsImp.h" + +std::shared_ptr vagt::encode::XFaultFields::create(std::shared_ptr header, const XString & alarmCondition, const XString & specificProblem, XEnumFaultFieldsEventSourceType eventSourceType, XEnumFaultFieldsEventSeverity eventSeverity, XEnumFaultFieldsVfStatus vfStatus) +{ + return std::make_shared(header, + alarmCondition, + specificProblem, + eventSourceType, + eventSeverity, + vfStatus + ); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XFaultFieldsImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XFaultFieldsImp.cpp new file mode 100755 index 0000000..1685c80 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XFaultFieldsImp.cpp @@ -0,0 +1,149 @@ +#include "XFaultFieldsImp.h" + +const std::string XEnumFaultFieldsEventSeverityMapping[] = { + "CRITICAL", + "MAJOR", + "MINOR", + "WARNING", + "NORMAL" +}; + +const std::string XEnumFaultFieldsVfStatusMapping[] = { + "Active", + "Idle", + "Preparing to terminate", + "Ready to terminate", + "Requesting termination" +}; + +const std::string XEnumFaultFieldsFaultFieldsVersionMapping[] = { + "4.0" +}; + +const std::string XEnumFaultFieldsEventSourceTypeMapping[] = { + "other", + "router", + "switch", + "host", + "card", + "port", + "slotThreshold", + "portThreshold", + "virtualMachine", + "virtualNetworkFunction" +}; + +XFaultFieldsImp::XFaultFieldsImp(shared_ptr header, + const XString& alarmCondition, + const XString& specificProblem, + XEnumFaultFieldsEventSourceType eventSourceType, + XEnumFaultFieldsEventSeverity eventSeverity, + XEnumFaultFieldsVfStatus vfStatus): + header_(header), + alarmCondition_(alarmCondition), + eventSeverity_(eventSeverity), + eventSourceType_(eventSourceType), + faultFieldsVersion_(XEnumFaultFieldsFaultFieldsVersion4_0), + specificProblem_(specificProblem), + vfStatus_(vfStatus) +{ + +} + +std::string XFaultFieldsImp::toString() +{ + try + { + auto js = toJson(); + return js.dump(); + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to dump XFaultFields to json string:{}.", e.what()); + return ""; + } +} + +shared_ptr XFaultFieldsImp::getCommonHeader() +{ + return header_; +} + +void XFaultFieldsImp::setAlarmInterfaceA(const XString& alarmInterfaceA) +{ + comVals_["alarmInterfaceA"] = alarmInterfaceA; +} + +void XFaultFieldsImp::setEventSeverity(XEnumFaultFieldsEventSeverity eventSeverity) +{ + auto val = XEnumFaultFieldsEventSeverityMapping[eventSeverity]; + comVals_["eventSeverity"] = val; +} + +void XFaultFieldsImp::setAlarmCondition(const XString& alarmCondition) +{ + comVals_["alarmCondition"] = alarmCondition; +} + +void XFaultFieldsImp::setVfStatus(XEnumFaultFieldsVfStatus vfStatus) +{ + auto val = XEnumFaultFieldsVfStatusMapping[vfStatus]; + comVals_["vfStatus"] = val; +} + +void XFaultFieldsImp::setEventCategory(const XString& eventCategory) +{ + comVals_["eventCategory"] = eventCategory; +} + +void XFaultFieldsImp::setEventSourceType(XEnumFaultFieldsEventSourceType eventSourceType) +{ + auto val = XEnumFaultFieldsEventSourceTypeMapping[eventSourceType]; + comVals_["eventSourceType"] = val; +} + +void XFaultFieldsImp::setSpecificProblem(const XString& specificProblem) +{ + comVals_["specificProblem"] = specificProblem; +} + +void XFaultFieldsImp::setAlarmAdditionalInformation(const XHashMap& alarmAdditionalInformation) +{ + alarmAdditionalInformation_ = alarmAdditionalInformation; +} + +json XFaultFieldsImp::toJson() +{ + try + { + json field = { + {"eventSeverity", XEnumFaultFieldsEventSeverityMapping[eventSeverity_]}, + {"alarmCondition", alarmCondition_}, + {"vfStatus", XEnumFaultFieldsVfStatusMapping[vfStatus_]}, + {"eventSourceType", XEnumFaultFieldsEventSourceTypeMapping[eventSourceType_]}, + {"specificProblem", specificProblem_}, + {"faultFieldsVersion", XEnumFaultFieldsFaultFieldsVersionMapping[faultFieldsVersion_]} + }; + + //optional val + if (!alarmAdditionalInformation_.empty()) + { + field["alarmAdditionalInformation"] = alarmAdditionalInformation_; + } + field = mergeCommonValues(field, comVals_); + + json jsEvent; + + header_->setDomain(XEnumCommonEventHeaderDomainFault); + jsEvent["event"]["commonEventHeader"] = dynamic_pointer_cast(header_)->toJson(); + jsEvent["event"]["faultFields"] = field; + + return jsEvent; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XFaultFields to json object:{}.", e.what()); + return json(); + } +} + diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XFaultFieldsImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XFaultFieldsImp.h new file mode 100755 index 0000000..fa55d01 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XFaultFieldsImp.h @@ -0,0 +1,48 @@ +#pragma once + +#include "XFaultFields.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XFaultFieldsImp : public XFaultFields, public XJsonable + { + public: + XFaultFieldsImp(shared_ptr header, + const XString& alarmCondition, + const XString& specificProblem, + XEnumFaultFieldsEventSourceType eventSourceType, + XEnumFaultFieldsEventSeverity eventSeverity, + XEnumFaultFieldsVfStatus vfStatus); + + virtual std::string toString() override; + virtual json toJson() override; + virtual std::shared_ptr getCommonHeader() override; + + virtual void setAlarmInterfaceA(const XString& alarmInterfaceA) override; + virtual void setEventSeverity(XEnumFaultFieldsEventSeverity eventSeverity) override; + virtual void setAlarmCondition(const XString& alarmCondition) override; + virtual void setVfStatus(XEnumFaultFieldsVfStatus vfStatus) override; + virtual void setEventCategory(const XString& eventCategory) override; + virtual void setEventSourceType(XEnumFaultFieldsEventSourceType eventSourceType) override; + virtual void setSpecificProblem(const XString& specificProblem) override; + virtual void setAlarmAdditionalInformation(const XHashMap& alarmAdditionalInformation) override; + + private: + //required + shared_ptr header_; + XEnumFaultFieldsEventSeverity eventSeverity_; + XString alarmCondition_; + XEnumFaultFieldsVfStatus vfStatus_; + XEnumFaultFieldsEventSourceType eventSourceType_; + XString specificProblem_; + XEnumFaultFieldsFaultFieldsVersion faultFieldsVersion_; + //optional + XHashMap alarmAdditionalInformation_; + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XFilesystemUsage.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XFilesystemUsage.cpp new file mode 100755 index 0000000..b97be47 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XFilesystemUsage.cpp @@ -0,0 +1,46 @@ +#include "XFilesystemUsage.h" +#include "XFilesystemUsageImp.h" + +vagt::encode::XFilesystemUsage::XFilesystemUsage() +{ +} + +vagt::encode::XFilesystemUsage::XFilesystemUsage(const XString & filesystemName, XNumber blockConfigured, XNumber blockIops, XNumber blockUsed, XNumber ephemeralConfigured, XNumber ephemeralIops, XNumber ephemeralUsed): + imp_(make_shared(filesystemName, blockConfigured, blockIops, blockUsed, ephemeralConfigured, ephemeralIops, ephemeralUsed )) +{ +} + +void vagt::encode::XFilesystemUsage::setBlockConfigured(XNumber blockConfigured) +{ + return imp_->setBlockConfigured(blockConfigured); +} + +void vagt::encode::XFilesystemUsage::setBlockUsed(XNumber blockUsed) +{ + return imp_->setBlockUsed(blockUsed); +} + +void vagt::encode::XFilesystemUsage::setEphemeralConfigured(XNumber ephemeralConfigured) +{ + return imp_->setEphemeralConfigured(ephemeralConfigured); +} + +void vagt::encode::XFilesystemUsage::setEphemeralIops(XNumber ephemeralIops) +{ + return imp_->setEphemeralIops(ephemeralIops); +} + +void vagt::encode::XFilesystemUsage::setFilesystemName(const XString & filesystemName) +{ + return imp_->setFilesystemName(filesystemName); +} + +void vagt::encode::XFilesystemUsage::setBlockIops(XNumber blockIops) +{ + return imp_->setBlockIops(blockIops); +} + +void vagt::encode::XFilesystemUsage::setEphemeralUsed(XNumber ephemeralUsed) +{ + return imp_->setEphemeralUsed(ephemeralUsed); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XFilesystemUsageImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XFilesystemUsageImp.cpp new file mode 100755 index 0000000..cc0fa32 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XFilesystemUsageImp.cpp @@ -0,0 +1,82 @@ +#include "XFilesystemUsageImp.h" + +XFilesystemUsageImp::XFilesystemUsageImp(const XString& filesystemName, + XNumber blockConfigured, + XNumber blockIops, + XNumber blockUsed, + XNumber ephemeralConfigured, + XNumber ephemeralIops, + XNumber ephemeralUsed): + blockConfigured_(blockConfigured), + blockIops_(blockIops), + blockUsed_(blockUsed), + ephemeralConfigured_(ephemeralConfigured), + ephemeralIops_(ephemeralIops), + ephemeralUsed_(ephemeralUsed), + filesystemName_(filesystemName) +{ + +} + +void XFilesystemUsageImp::setBlockConfigured(XNumber blockConfigured) +{ + comVals_["blockConfigured"] = blockConfigured; +} + +void XFilesystemUsageImp::setBlockUsed(XNumber blockUsed) +{ + comVals_["blockUsed"] = blockUsed; +} + +void XFilesystemUsageImp::setEphemeralConfigured(XNumber ephemeralConfigured) +{ + comVals_["ephemeralConfigured"] = ephemeralConfigured; +} + +void XFilesystemUsageImp::setEphemeralIops(XNumber ephemeralIops) +{ + comVals_["ephemeralIops"] = ephemeralIops; +} + +void XFilesystemUsageImp::setFilesystemName(const XString& filesystemName) +{ + comVals_["filesystemName"] = filesystemName; +} + +void XFilesystemUsageImp::setBlockIops(XNumber blockIops) +{ + comVals_["blockIops"] = blockIops; +} + +void XFilesystemUsageImp::setEphemeralUsed(XNumber ephemeralUsed) +{ + comVals_["ephemeralUsed"] = ephemeralUsed; +} + +json XFilesystemUsageImp::toJson() +{ + try + { + json field = { + {"blockConfigured", blockConfigured_}, + {"blockUsed", blockUsed_}, + {"ephemeralConfigured", ephemeralConfigured_}, + {"ephemeralIops", ephemeralIops_}, + {"filesystemName", filesystemName_}, + {"blockIops", blockIops_}, + {"ephemeralUsed", ephemeralUsed_} + }; + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XFilesystemUsage to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XFilesystemUsageImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XFilesystemUsageImp.h new file mode 100755 index 0000000..5c58e07 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XFilesystemUsageImp.h @@ -0,0 +1,46 @@ +#pragma once + +#include "XFilesystemUsage.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XFilesystemUsageImp : public XFilesystemUsage, public XJsonable + { + public: + XFilesystemUsageImp(const XString& filesystemName, + XNumber blockConfigured, + XNumber blockIops, + XNumber blockUsed, + XNumber ephemeralConfigured, + XNumber ephemeralIops, + XNumber ephemeralUsed + ); + + virtual json toJson() override; + + virtual void setBlockConfigured(XNumber blockConfigured) override; + virtual void setBlockUsed(XNumber blockUsed) override; + virtual void setEphemeralConfigured(XNumber ephemeralConfigured) override; + virtual void setEphemeralIops(XNumber ephemeralIops) override; + virtual void setFilesystemName(const XString& filesystemName) override; + virtual void setBlockIops(XNumber blockIops) override; + virtual void setEphemeralUsed(XNumber ephemeralUsed) override; + + private: + //required + XNumber blockConfigured_; + XNumber blockUsed_; + XNumber ephemeralConfigured_; + XNumber ephemeralIops_; + XString filesystemName_; + XNumber blockIops_; + XNumber ephemeralUsed_; + //optional + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XGtpPerFlowMetrics.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XGtpPerFlowMetrics.cpp new file mode 100644 index 0000000..780422a --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XGtpPerFlowMetrics.cpp @@ -0,0 +1,291 @@ +#include "XGtpPerFlowMetrics.h" +#include "XGtpPerFlowMetricsImp.h" + +vagt::encode::XGtpPerFlowMetrics::XGtpPerFlowMetrics() +{ +} + +vagt::encode::XGtpPerFlowMetrics::XGtpPerFlowMetrics(XNumber avgBitErrorRate, XNumber avgPacketDelayVariation, XNumber avgPacketLatency, XNumber avgReceiveThroughput, XNumber avgTransmitThroughput, XNumber flowActivationEpoch, XNumber flowActivationMicrosec, XNumber flowDeactivationEpoch, XNumber flowDeactivationMicrosec, const XString & flowDeactivationTime, const XString & flowStatus, XNumber maxPacketDelayVariation, XNumber numActivationFailures, XNumber numBitErrors, XNumber numBytesReceived, XNumber numBytesTransmitted, XNumber numDroppedPackets, XNumber numL7BytesReceived, XNumber numL7BytesTransmitted, XNumber numLostPackets, XNumber numOutOfOrderPackets, XNumber numPacketErrors, XNumber numPacketsReceivedExclRetrans, XNumber numPacketsReceivedInclRetrans, XNumber numPacketsTransmittedInclRetrans, XNumber numRetries, XNumber numTimeouts, XNumber numTunneledL7BytesReceived, XNumber roundTripTime, XNumber timeToFirstByte): + imp_(make_shared(avgBitErrorRate, + avgPacketDelayVariation, + avgPacketLatency, + avgReceiveThroughput, + avgTransmitThroughput, + flowActivationEpoch, + flowActivationMicrosec, + flowDeactivationEpoch, + flowDeactivationMicrosec, + flowDeactivationTime, + flowStatus, + maxPacketDelayVariation, + numActivationFailures, + numBitErrors, + numBytesReceived, + numBytesTransmitted, + numDroppedPackets, + numL7BytesReceived, + numL7BytesTransmitted, + numLostPackets, + numOutOfOrderPackets, + numPacketErrors, + numPacketsReceivedExclRetrans, + numPacketsReceivedInclRetrans, + numPacketsTransmittedInclRetrans, + numRetries, + numTimeouts, + numTunneledL7BytesReceived, + roundTripTime, + timeToFirstByte + )) +{ +} + +void vagt::encode::XGtpPerFlowMetrics::setNumLostPackets(XNumber numLostPackets) +{ + return imp_->setNumLostPackets(numLostPackets); +} + +void vagt::encode::XGtpPerFlowMetrics::setNumPacketsReceivedExclRetrans(XNumber numPacketsReceivedExclRetrans) +{ + return imp_->setNumPacketsReceivedExclRetrans(numPacketsReceivedExclRetrans); +} + +void vagt::encode::XGtpPerFlowMetrics::setFlowActivationTime(const XString & flowActivationTime) +{ + return imp_->setFlowActivationTime(flowActivationTime); +} + +void vagt::encode::XGtpPerFlowMetrics::setFlowDeactivationMicrosec(XNumber flowDeactivationMicrosec) +{ + return imp_->setFlowDeactivationMicrosec(flowDeactivationMicrosec); +} + +void vagt::encode::XGtpPerFlowMetrics::setFlowDeactivationTime(const XString & flowDeactivationTime) +{ + return imp_->setFlowDeactivationTime(flowDeactivationTime); +} + +void vagt::encode::XGtpPerFlowMetrics::setAvgTransmitThroughput(XNumber avgTransmitThroughput) +{ + return imp_->setAvgTransmitThroughput(avgTransmitThroughput); +} + +void vagt::encode::XGtpPerFlowMetrics::setLargePacketRtt(XNumber largePacketRtt) +{ + return imp_->setLargePacketRtt(largePacketRtt); +} + +void vagt::encode::XGtpPerFlowMetrics::setNumHttpErrors(XNumber numHttpErrors) +{ + return imp_->setNumHttpErrors(numHttpErrors); +} + +void vagt::encode::XGtpPerFlowMetrics::setNumTimeouts(XNumber numTimeouts) +{ + return imp_->setNumTimeouts(numTimeouts); +} + +void vagt::encode::XGtpPerFlowMetrics::setFlowActivationEpoch(XNumber flowActivationEpoch) +{ + return imp_->setFlowActivationEpoch(flowActivationEpoch); +} + +void vagt::encode::XGtpPerFlowMetrics::setNumPacketErrors(XNumber numPacketErrors) +{ + return imp_->setNumPacketErrors(numPacketErrors); +} + +void vagt::encode::XGtpPerFlowMetrics::setAvgPacketDelayVariation(XNumber avgPacketDelayVariation) +{ + return imp_->setAvgPacketDelayVariation(avgPacketDelayVariation); +} + +void vagt::encode::XGtpPerFlowMetrics::setAvgBitErrorRate(XNumber avgBitErrorRate) +{ + return imp_->setAvgBitErrorRate(avgBitErrorRate); +} + +void vagt::encode::XGtpPerFlowMetrics::setFlowActivationMicrosec(XNumber flowActivationMicrosec) +{ + return imp_->setFlowActivationMicrosec(flowActivationMicrosec); +} + +void vagt::encode::XGtpPerFlowMetrics::setAvgPacketLatency(XNumber avgPacketLatency) +{ + return imp_->setAvgPacketLatency(avgPacketLatency); +} + +void vagt::encode::XGtpPerFlowMetrics::setNumBytesTransmitted(XNumber numBytesTransmitted) +{ + return imp_->setNumBytesTransmitted(numBytesTransmitted); +} + +void vagt::encode::XGtpPerFlowMetrics::setNumBitErrors(XNumber numBitErrors) +{ + return imp_->setNumBitErrors(numBitErrors); +} + +void vagt::encode::XGtpPerFlowMetrics::setMaxReceiveBitRate(XNumber maxReceiveBitRate) +{ + return imp_->setMaxReceiveBitRate(maxReceiveBitRate); +} + +void vagt::encode::XGtpPerFlowMetrics::setMaxTransmitBitRate(XNumber maxTransmitBitRate) +{ + return imp_->setMaxTransmitBitRate(maxTransmitBitRate); +} + +void vagt::encode::XGtpPerFlowMetrics::setAvgReceiveThroughput(XNumber avgReceiveThroughput) +{ + return imp_->setAvgReceiveThroughput(avgReceiveThroughput); +} + +void vagt::encode::XGtpPerFlowMetrics::setFlowActivatedBy(const XString & flowActivatedBy) +{ + return imp_->setFlowActivatedBy(flowActivatedBy); +} + +void vagt::encode::XGtpPerFlowMetrics::setNumRetries(XNumber numRetries) +{ + return imp_->setNumRetries(numRetries); +} + +void vagt::encode::XGtpPerFlowMetrics::setDurConnectionFailedStatus(XNumber durConnectionFailedStatus) +{ + return imp_->setDurConnectionFailedStatus(durConnectionFailedStatus); +} + +void vagt::encode::XGtpPerFlowMetrics::setIpTosCountList(const XHashMap & ipTosCountList) +{ + return imp_->setIpTosCountList(ipTosCountList); +} + +void vagt::encode::XGtpPerFlowMetrics::setNumL7BytesTransmitted(XNumber numL7BytesTransmitted) +{ + return imp_->setNumL7BytesTransmitted(numL7BytesTransmitted); +} + +void vagt::encode::XGtpPerFlowMetrics::setTimeToFirstByte(XNumber timeToFirstByte) +{ + return imp_->setTimeToFirstByte(timeToFirstByte); +} + +void vagt::encode::XGtpPerFlowMetrics::setNumBytesReceived(XNumber numBytesReceived) +{ + return imp_->setNumBytesReceived(numBytesReceived); +} + +void vagt::encode::XGtpPerFlowMetrics::setFlowDeactivationEpoch(XNumber flowDeactivationEpoch) +{ + return imp_->setFlowDeactivationEpoch(flowDeactivationEpoch); +} + +void vagt::encode::XGtpPerFlowMetrics::setNumGtpEchoFailures(XNumber numGtpEchoFailures) +{ + return imp_->setNumGtpEchoFailures(numGtpEchoFailures); +} + +void vagt::encode::XGtpPerFlowMetrics::setNumPacketsReceivedInclRetrans(XNumber numPacketsReceivedInclRetrans) +{ + return imp_->setNumPacketsReceivedInclRetrans(numPacketsReceivedInclRetrans); +} + +void vagt::encode::XGtpPerFlowMetrics::setMobileQciCosCountList(const XHashMap & mobileQciCosCountList) +{ + return imp_->setMobileQciCosCountList(mobileQciCosCountList); +} + +void vagt::encode::XGtpPerFlowMetrics::setNumGtpTunnelErrors(XNumber numGtpTunnelErrors) +{ + return imp_->setNumGtpTunnelErrors(numGtpTunnelErrors); +} + +void vagt::encode::XGtpPerFlowMetrics::setRoundTripTime(XNumber roundTripTime) +{ + return imp_->setRoundTripTime(roundTripTime); +} + +void vagt::encode::XGtpPerFlowMetrics::setNumActivationFailures(XNumber numActivationFailures) +{ + return imp_->setNumActivationFailures(numActivationFailures); +} + +void vagt::encode::XGtpPerFlowMetrics::setMaxPacketDelayVariation(XNumber maxPacketDelayVariation) +{ + return imp_->setMaxPacketDelayVariation(maxPacketDelayVariation); +} + +void vagt::encode::XGtpPerFlowMetrics::setNumTunneledL7BytesReceived(XNumber numTunneledL7BytesReceived) +{ + return imp_->setNumTunneledL7BytesReceived(numTunneledL7BytesReceived); +} + +void vagt::encode::XGtpPerFlowMetrics::setNumL7BytesReceived(XNumber numL7BytesReceived) +{ + return imp_->setNumL7BytesReceived(numL7BytesReceived); +} + +void vagt::encode::XGtpPerFlowMetrics::setIpTosList(const XArrayOfString & ipTosList) +{ + return imp_->setIpTosList(ipTosList); +} + +void vagt::encode::XGtpPerFlowMetrics::setMobileQciCosList(const XArrayOfString & mobileQciCosList) +{ + return imp_->setMobileQciCosList(mobileQciCosList); +} + +void vagt::encode::XGtpPerFlowMetrics::setGtpConnectionStatus(const XString & gtpConnectionStatus) +{ + return imp_->setGtpConnectionStatus(gtpConnectionStatus); +} + +void vagt::encode::XGtpPerFlowMetrics::setTcpFlagList(const XArrayOfString & tcpFlagList) +{ + return imp_->setTcpFlagList(tcpFlagList); +} + +void vagt::encode::XGtpPerFlowMetrics::setFlowStatus(const XString & flowStatus) +{ + return imp_->setFlowStatus(flowStatus); +} + +void vagt::encode::XGtpPerFlowMetrics::setNumDroppedPackets(XNumber numDroppedPackets) +{ + return imp_->setNumDroppedPackets(numDroppedPackets); +} + +void vagt::encode::XGtpPerFlowMetrics::setGtpTunnelStatus(const XString & gtpTunnelStatus) +{ + return imp_->setGtpTunnelStatus(gtpTunnelStatus); +} + +void vagt::encode::XGtpPerFlowMetrics::setNumPacketsTransmittedInclRetrans(XNumber numPacketsTransmittedInclRetrans) +{ + return imp_->setNumPacketsTransmittedInclRetrans(numPacketsTransmittedInclRetrans); +} + +void vagt::encode::XGtpPerFlowMetrics::setNumOutOfOrderPackets(XNumber numOutOfOrderPackets) +{ + return imp_->setNumOutOfOrderPackets(numOutOfOrderPackets); +} + +void vagt::encode::XGtpPerFlowMetrics::setLargePacketThreshold(XNumber largePacketThreshold) +{ + return imp_->setLargePacketThreshold(largePacketThreshold); +} + +void vagt::encode::XGtpPerFlowMetrics::setDurTunnelFailedStatus(XNumber durTunnelFailedStatus) +{ + return imp_->setDurTunnelFailedStatus(durTunnelFailedStatus); +} + +void vagt::encode::XGtpPerFlowMetrics::setTcpFlagCountList(const XHashMap & tcpFlagCountList) +{ + return imp_->setTcpFlagCountList(tcpFlagCountList); +} + +void vagt::encode::XGtpPerFlowMetrics::setFlowDeactivatedBy(const XString & flowDeactivatedBy) +{ + return imp_->setFlowDeactivatedBy(flowDeactivatedBy); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XGtpPerFlowMetricsImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XGtpPerFlowMetricsImp.cpp new file mode 100644 index 0000000..a068f98 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XGtpPerFlowMetricsImp.cpp @@ -0,0 +1,395 @@ +#include "XGtpPerFlowMetricsImp.h" + +XGtpPerFlowMetricsImp::XGtpPerFlowMetricsImp(XNumber avgBitErrorRate, + XNumber avgPacketDelayVariation, + XNumber avgPacketLatency, + XNumber avgReceiveThroughput, + XNumber avgTransmitThroughput, + XNumber flowActivationEpoch, + XNumber flowActivationMicrosec, + XNumber flowDeactivationEpoch, + XNumber flowDeactivationMicrosec, + const XString& flowDeactivationTime, + const XString& flowStatus, + XNumber maxPacketDelayVariation, + XNumber numActivationFailures, + XNumber numBitErrors, + XNumber numBytesReceived, + XNumber numBytesTransmitted, + XNumber numDroppedPackets, + XNumber numL7BytesReceived, + XNumber numL7BytesTransmitted, + XNumber numLostPackets, + XNumber numOutOfOrderPackets, + XNumber numPacketErrors, + XNumber numPacketsReceivedExclRetrans, + XNumber numPacketsReceivedInclRetrans, + XNumber numPacketsTransmittedInclRetrans, + XNumber numRetries, + XNumber numTimeouts, + XNumber numTunneledL7BytesReceived, + XNumber roundTripTime, + XNumber timeToFirstByte): + avgBitErrorRate_(avgBitErrorRate), + avgPacketDelayVariation_(avgPacketDelayVariation), + avgPacketLatency_(avgPacketLatency), + avgReceiveThroughput_(avgReceiveThroughput), + avgTransmitThroughput_(avgTransmitThroughput), + flowActivationEpoch_(flowActivationEpoch), + flowActivationMicrosec_(flowActivationMicrosec), + flowDeactivationEpoch_(flowDeactivationEpoch), + flowDeactivationMicrosec_(flowDeactivationMicrosec), + flowDeactivationTime_(flowDeactivationTime), + flowStatus_(flowStatus), + maxPacketDelayVariation_(maxPacketDelayVariation), + numActivationFailures_(numActivationFailures), + numBitErrors_(numBitErrors), + numBytesReceived_(numBytesReceived), + numBytesTransmitted_(numBytesTransmitted), + numDroppedPackets_(numDroppedPackets), + numL7BytesReceived_(numL7BytesReceived), + numL7BytesTransmitted_(numL7BytesTransmitted), + numLostPackets_(numLostPackets), + numOutOfOrderPackets_(numOutOfOrderPackets), + numPacketErrors_(numPacketErrors), + numPacketsReceivedExclRetrans_(numPacketsReceivedExclRetrans), + numPacketsReceivedInclRetrans_(numPacketsReceivedInclRetrans), + numPacketsTransmittedInclRetrans_(numPacketsTransmittedInclRetrans), + numRetries_(numRetries), + numTimeouts_(numTimeouts), + numTunneledL7BytesReceived_(numTunneledL7BytesReceived), + roundTripTime_(roundTripTime), + timeToFirstByte_(timeToFirstByte) +{ + +} + +void XGtpPerFlowMetricsImp::setNumLostPackets(XNumber numLostPackets) +{ + comVals_["numLostPackets"] = numLostPackets; +} + +void XGtpPerFlowMetricsImp::setNumPacketsReceivedExclRetrans(XNumber numPacketsReceivedExclRetrans) +{ + comVals_["numPacketsReceivedExclRetrans"] = numPacketsReceivedExclRetrans; +} + +void XGtpPerFlowMetricsImp::setFlowActivationTime(const XString& flowActivationTime) +{ + comVals_["flowActivationTime"] = flowActivationTime; +} + +void XGtpPerFlowMetricsImp::setFlowDeactivationMicrosec(XNumber flowDeactivationMicrosec) +{ + comVals_["flowDeactivationMicrosec"] = flowDeactivationMicrosec; +} + +void XGtpPerFlowMetricsImp::setFlowDeactivationTime(const XString& flowDeactivationTime) +{ + comVals_["flowDeactivationTime"] = flowDeactivationTime; +} + +void XGtpPerFlowMetricsImp::setAvgTransmitThroughput(XNumber avgTransmitThroughput) +{ + comVals_["avgTransmitThroughput"] = avgTransmitThroughput; +} + +void XGtpPerFlowMetricsImp::setLargePacketRtt(XNumber largePacketRtt) +{ + comVals_["largePacketRtt"] = largePacketRtt; +} + +void XGtpPerFlowMetricsImp::setNumHttpErrors(XNumber numHttpErrors) +{ + comVals_["numHttpErrors"] = numHttpErrors; +} + +void XGtpPerFlowMetricsImp::setNumTimeouts(XNumber numTimeouts) +{ + comVals_["numTimeouts"] = numTimeouts; +} + +void XGtpPerFlowMetricsImp::setFlowActivationEpoch(XNumber flowActivationEpoch) +{ + comVals_["flowActivationEpoch"] = flowActivationEpoch; +} + +void XGtpPerFlowMetricsImp::setNumPacketErrors(XNumber numPacketErrors) +{ + comVals_["numPacketErrors"] = numPacketErrors; +} + +void XGtpPerFlowMetricsImp::setAvgPacketDelayVariation(XNumber avgPacketDelayVariation) +{ + comVals_["avgPacketDelayVariation"] = avgPacketDelayVariation; +} + +void XGtpPerFlowMetricsImp::setAvgBitErrorRate(XNumber avgBitErrorRate) +{ + comVals_["avgBitErrorRate"] = avgBitErrorRate; +} + +void XGtpPerFlowMetricsImp::setFlowActivationMicrosec(XNumber flowActivationMicrosec) +{ + comVals_["flowActivationMicrosec"] = flowActivationMicrosec; +} + +void XGtpPerFlowMetricsImp::setAvgPacketLatency(XNumber avgPacketLatency) +{ + comVals_["avgPacketLatency"] = avgPacketLatency; +} + +void XGtpPerFlowMetricsImp::setNumBytesTransmitted(XNumber numBytesTransmitted) +{ + comVals_["numBytesTransmitted"] = numBytesTransmitted; +} + +void XGtpPerFlowMetricsImp::setNumBitErrors(XNumber numBitErrors) +{ + comVals_["numBitErrors"] = numBitErrors; +} + +void XGtpPerFlowMetricsImp::setMaxReceiveBitRate(XNumber maxReceiveBitRate) +{ + comVals_["maxReceiveBitRate"] = maxReceiveBitRate; +} + +void XGtpPerFlowMetricsImp::setMaxTransmitBitRate(XNumber maxTransmitBitRate) +{ + comVals_["maxTransmitBitRate"] = maxTransmitBitRate; +} + +void XGtpPerFlowMetricsImp::setAvgReceiveThroughput(XNumber avgReceiveThroughput) +{ + comVals_["avgReceiveThroughput"] = avgReceiveThroughput; +} + +void XGtpPerFlowMetricsImp::setFlowActivatedBy(const XString& flowActivatedBy) +{ + comVals_["flowActivatedBy"] = flowActivatedBy; +} + +void XGtpPerFlowMetricsImp::setNumRetries(XNumber numRetries) +{ + comVals_["numRetries"] = numRetries; +} + +void XGtpPerFlowMetricsImp::setDurConnectionFailedStatus(XNumber durConnectionFailedStatus) +{ + comVals_["durConnectionFailedStatus"] = durConnectionFailedStatus; +} + +void XGtpPerFlowMetricsImp::setIpTosCountList(const XHashMap& ipTosCountList) +{ + ipTosCountList_ = ipTosCountList; +} + +void XGtpPerFlowMetricsImp::setNumL7BytesTransmitted(XNumber numL7BytesTransmitted) +{ + comVals_["numL7BytesTransmitted"] = numL7BytesTransmitted; +} + +void XGtpPerFlowMetricsImp::setTimeToFirstByte(XNumber timeToFirstByte) +{ + comVals_["timeToFirstByte"] = timeToFirstByte; +} + +void XGtpPerFlowMetricsImp::setNumBytesReceived(XNumber numBytesReceived) +{ + comVals_["numBytesReceived"] = numBytesReceived; +} + +void XGtpPerFlowMetricsImp::setFlowDeactivationEpoch(XNumber flowDeactivationEpoch) +{ + comVals_["flowDeactivationEpoch"] = flowDeactivationEpoch; +} + +void XGtpPerFlowMetricsImp::setNumGtpEchoFailures(XNumber numGtpEchoFailures) +{ + comVals_["numGtpEchoFailures"] = numGtpEchoFailures; +} + +void XGtpPerFlowMetricsImp::setNumPacketsReceivedInclRetrans(XNumber numPacketsReceivedInclRetrans) +{ + comVals_["numPacketsReceivedInclRetrans"] = numPacketsReceivedInclRetrans; +} + +void XGtpPerFlowMetricsImp::setMobileQciCosCountList(const XHashMap& mobileQciCosCountList) +{ + mobileQciCosCountList_ = mobileQciCosCountList; +} + +void XGtpPerFlowMetricsImp::setNumGtpTunnelErrors(XNumber numGtpTunnelErrors) +{ + comVals_["numGtpTunnelErrors"] = numGtpTunnelErrors; +} + +void XGtpPerFlowMetricsImp::setRoundTripTime(XNumber roundTripTime) +{ + comVals_["roundTripTime"] = roundTripTime; +} + +void XGtpPerFlowMetricsImp::setNumActivationFailures(XNumber numActivationFailures) +{ + comVals_["numActivationFailures"] = numActivationFailures; +} + +void XGtpPerFlowMetricsImp::setMaxPacketDelayVariation(XNumber maxPacketDelayVariation) +{ + comVals_["maxPacketDelayVariation"] = maxPacketDelayVariation; +} + +void XGtpPerFlowMetricsImp::setNumTunneledL7BytesReceived(XNumber numTunneledL7BytesReceived) +{ + comVals_["numTunneledL7BytesReceived"] = numTunneledL7BytesReceived; +} + +void XGtpPerFlowMetricsImp::setNumL7BytesReceived(XNumber numL7BytesReceived) +{ + comVals_["numL7BytesReceived"] = numL7BytesReceived; +} + +void XGtpPerFlowMetricsImp::setIpTosList(const XArrayOfString& ipTosList) +{ + ipTosList_ = ipTosList; +} + +void XGtpPerFlowMetricsImp::setMobileQciCosList(const XArrayOfString& mobileQciCosList) +{ + mobileQciCosList_ = mobileQciCosList; +} + +void XGtpPerFlowMetricsImp::setGtpConnectionStatus(const XString& gtpConnectionStatus) +{ + comVals_["gtpConnectionStatus"] = gtpConnectionStatus; +} + +void XGtpPerFlowMetricsImp::setTcpFlagList(const XArrayOfString& tcpFlagList) +{ + tcpFlagList_ = tcpFlagList; +} + +void XGtpPerFlowMetricsImp::setFlowStatus(const XString& flowStatus) +{ + comVals_["flowStatus"] = flowStatus; +} + +void XGtpPerFlowMetricsImp::setNumDroppedPackets(XNumber numDroppedPackets) +{ + comVals_["numDroppedPackets"] = numDroppedPackets; +} + +void XGtpPerFlowMetricsImp::setGtpTunnelStatus(const XString& gtpTunnelStatus) +{ + comVals_["gtpTunnelStatus"] = gtpTunnelStatus; +} + +void XGtpPerFlowMetricsImp::setNumPacketsTransmittedInclRetrans(XNumber numPacketsTransmittedInclRetrans) +{ + comVals_["numPacketsTransmittedInclRetrans"] = numPacketsTransmittedInclRetrans; +} + +void XGtpPerFlowMetricsImp::setNumOutOfOrderPackets(XNumber numOutOfOrderPackets) +{ + comVals_["numOutOfOrderPackets"] = numOutOfOrderPackets; +} + +void XGtpPerFlowMetricsImp::setLargePacketThreshold(XNumber largePacketThreshold) +{ + comVals_["largePacketThreshold"] = largePacketThreshold; +} + +void XGtpPerFlowMetricsImp::setDurTunnelFailedStatus(XNumber durTunnelFailedStatus) +{ + comVals_["durTunnelFailedStatus"] = durTunnelFailedStatus; +} + +void XGtpPerFlowMetricsImp::setTcpFlagCountList(const XHashMap& tcpFlagCountList) +{ + tcpFlagCountList_ = tcpFlagCountList; +} + +void XGtpPerFlowMetricsImp::setFlowDeactivatedBy(const XString& flowDeactivatedBy) +{ + comVals_["flowDeactivatedBy"] = flowDeactivatedBy; +} + +json XGtpPerFlowMetricsImp::toJson() +{ + try + { + json field = { + {"numLostPackets", numLostPackets_}, + {"numPacketsReceivedExclRetrans", numPacketsReceivedExclRetrans_}, + {"flowDeactivationMicrosec", flowDeactivationMicrosec_}, + {"flowDeactivationTime", flowDeactivationTime_}, + {"avgTransmitThroughput", avgTransmitThroughput_}, + {"numTimeouts", numTimeouts_}, + {"flowActivationEpoch", flowActivationEpoch_}, + {"numPacketErrors", numPacketErrors_}, + {"avgPacketDelayVariation", avgPacketDelayVariation_}, + {"avgBitErrorRate", avgBitErrorRate_}, + {"flowActivationMicrosec", flowActivationMicrosec_}, + {"avgPacketLatency", avgPacketLatency_}, + {"numBytesTransmitted", numBytesTransmitted_}, + {"numBitErrors", numBitErrors_}, + {"avgReceiveThroughput", avgReceiveThroughput_}, + {"numRetries", numRetries_}, + {"numL7BytesTransmitted", numL7BytesTransmitted_}, + {"timeToFirstByte", timeToFirstByte_}, + {"numBytesReceived", numBytesReceived_}, + {"flowDeactivationEpoch", flowDeactivationEpoch_}, + {"numPacketsReceivedInclRetrans", numPacketsReceivedInclRetrans_}, + {"roundTripTime", roundTripTime_}, + {"numActivationFailures", numActivationFailures_}, + {"maxPacketDelayVariation", maxPacketDelayVariation_}, + {"numTunneledL7BytesReceived", numTunneledL7BytesReceived_}, + {"numL7BytesReceived", numL7BytesReceived_}, + {"flowStatus", flowStatus_}, + {"numDroppedPackets", numDroppedPackets_}, + {"numPacketsTransmittedInclRetrans", numPacketsTransmittedInclRetrans_}, + {"numOutOfOrderPackets", numOutOfOrderPackets_} + }; + + //optional val + if (!ipTosCountList_.empty()) + { + field["ipTosCountList"] = ipTosCountList_; + } + + if (!mobileQciCosCountList_.empty()) + { + field["mobileQciCosCountList"] = mobileQciCosCountList_; + } + + if (!ipTosList_.empty()) + { + field["ipTosList"] = ipTosList_; + } + + if (!mobileQciCosList_.empty()) + { + field["mobileQciCosList"] = mobileQciCosList_; + } + + if (!tcpFlagList_.empty()) + { + field["tcpFlagList"] = tcpFlagList_; + } + + if (!tcpFlagCountList_.empty()) + { + field["tcpFlagCountList"] = tcpFlagCountList_; + } + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XGtpPerFlowMetrics to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XGtpPerFlowMetricsImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XGtpPerFlowMetricsImp.h new file mode 100644 index 0000000..1a0ae7e --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XGtpPerFlowMetricsImp.h @@ -0,0 +1,140 @@ +#pragma once + +#include "XGtpPerFlowMetrics.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XGtpPerFlowMetricsImp : public XGtpPerFlowMetrics, public XJsonable + { + public: + XGtpPerFlowMetricsImp(XNumber avgBitErrorRate, + XNumber avgPacketDelayVariation, + XNumber avgPacketLatency, + XNumber avgReceiveThroughput, + XNumber avgTransmitThroughput, + XNumber flowActivationEpoch, + XNumber flowActivationMicrosec, + XNumber flowDeactivationEpoch, + XNumber flowDeactivationMicrosec, + const XString& flowDeactivationTime, + const XString& flowStatus, + XNumber maxPacketDelayVariation, + XNumber numActivationFailures, + XNumber numBitErrors, + XNumber numBytesReceived, + XNumber numBytesTransmitted, + XNumber numDroppedPackets, + XNumber numL7BytesReceived, + XNumber numL7BytesTransmitted, + XNumber numLostPackets, + XNumber numOutOfOrderPackets, + XNumber numPacketErrors, + XNumber numPacketsReceivedExclRetrans, + XNumber numPacketsReceivedInclRetrans, + XNumber numPacketsTransmittedInclRetrans, + XNumber numRetries, + XNumber numTimeouts, + XNumber numTunneledL7BytesReceived, + XNumber roundTripTime, + XNumber timeToFirstByte); + + virtual json toJson() override; + + virtual void setNumLostPackets(XNumber numLostPackets) override; + virtual void setNumPacketsReceivedExclRetrans(XNumber numPacketsReceivedExclRetrans) override; + virtual void setFlowActivationTime(const XString& flowActivationTime) override; + virtual void setFlowDeactivationMicrosec(XNumber flowDeactivationMicrosec) override; + virtual void setFlowDeactivationTime(const XString& flowDeactivationTime) override; + virtual void setAvgTransmitThroughput(XNumber avgTransmitThroughput) override; + virtual void setLargePacketRtt(XNumber largePacketRtt) override; + virtual void setNumHttpErrors(XNumber numHttpErrors) override; + virtual void setNumTimeouts(XNumber numTimeouts) override; + virtual void setFlowActivationEpoch(XNumber flowActivationEpoch) override; + virtual void setNumPacketErrors(XNumber numPacketErrors) override; + virtual void setAvgPacketDelayVariation(XNumber avgPacketDelayVariation) override; + virtual void setAvgBitErrorRate(XNumber avgBitErrorRate) override; + virtual void setFlowActivationMicrosec(XNumber flowActivationMicrosec) override; + virtual void setAvgPacketLatency(XNumber avgPacketLatency) override; + virtual void setNumBytesTransmitted(XNumber numBytesTransmitted) override; + virtual void setNumBitErrors(XNumber numBitErrors) override; + virtual void setMaxReceiveBitRate(XNumber maxReceiveBitRate) override; + virtual void setMaxTransmitBitRate(XNumber maxTransmitBitRate) override; + virtual void setAvgReceiveThroughput(XNumber avgReceiveThroughput) override; + virtual void setFlowActivatedBy(const XString& flowActivatedBy) override; + virtual void setNumRetries(XNumber numRetries) override; + virtual void setDurConnectionFailedStatus(XNumber durConnectionFailedStatus) override; + virtual void setIpTosCountList(const XHashMap& ipTosCountList) override; + virtual void setNumL7BytesTransmitted(XNumber numL7BytesTransmitted) override; + virtual void setTimeToFirstByte(XNumber timeToFirstByte) override; + virtual void setNumBytesReceived(XNumber numBytesReceived) override; + virtual void setFlowDeactivationEpoch(XNumber flowDeactivationEpoch) override; + virtual void setNumGtpEchoFailures(XNumber numGtpEchoFailures) override; + virtual void setNumPacketsReceivedInclRetrans(XNumber numPacketsReceivedInclRetrans) override; + virtual void setMobileQciCosCountList(const XHashMap& mobileQciCosCountList) override; + virtual void setNumGtpTunnelErrors(XNumber numGtpTunnelErrors) override; + virtual void setRoundTripTime(XNumber roundTripTime) override; + virtual void setNumActivationFailures(XNumber numActivationFailures) override; + virtual void setMaxPacketDelayVariation(XNumber maxPacketDelayVariation) override; + virtual void setNumTunneledL7BytesReceived(XNumber numTunneledL7BytesReceived) override; + virtual void setNumL7BytesReceived(XNumber numL7BytesReceived) override; + virtual void setIpTosList(const XArrayOfString& ipTosList) override; + virtual void setMobileQciCosList(const XArrayOfString& mobileQciCosList) override; + virtual void setGtpConnectionStatus(const XString& gtpConnectionStatus) override; + virtual void setTcpFlagList(const XArrayOfString& tcpFlagList) override; + virtual void setFlowStatus(const XString& flowStatus) override; + virtual void setNumDroppedPackets(XNumber numDroppedPackets) override; + virtual void setGtpTunnelStatus(const XString& gtpTunnelStatus) override; + virtual void setNumPacketsTransmittedInclRetrans(XNumber numPacketsTransmittedInclRetrans) override; + virtual void setNumOutOfOrderPackets(XNumber numOutOfOrderPackets) override; + virtual void setLargePacketThreshold(XNumber largePacketThreshold) override; + virtual void setDurTunnelFailedStatus(XNumber durTunnelFailedStatus) override; + virtual void setTcpFlagCountList(const XHashMap& tcpFlagCountList) override; + virtual void setFlowDeactivatedBy(const XString& flowDeactivatedBy) override; + + private: + //required + XNumber numLostPackets_; + XNumber numPacketsReceivedExclRetrans_; + XNumber flowDeactivationMicrosec_; + XString flowDeactivationTime_; + XNumber avgTransmitThroughput_; + XNumber numTimeouts_; + XNumber flowActivationEpoch_; + XNumber numPacketErrors_; + XNumber avgPacketDelayVariation_; + XNumber avgBitErrorRate_; + XNumber flowActivationMicrosec_; + XNumber avgPacketLatency_; + XNumber numBytesTransmitted_; + XNumber numBitErrors_; + XNumber avgReceiveThroughput_; + XNumber numRetries_; + XNumber numL7BytesTransmitted_; + XNumber timeToFirstByte_; + XNumber numBytesReceived_; + XNumber flowDeactivationEpoch_; + XNumber numPacketsReceivedInclRetrans_; + XNumber roundTripTime_; + XNumber numActivationFailures_; + XNumber maxPacketDelayVariation_; + XNumber numTunneledL7BytesReceived_; + XNumber numL7BytesReceived_; + XString flowStatus_; + XNumber numDroppedPackets_; + XNumber numPacketsTransmittedInclRetrans_; + XNumber numOutOfOrderPackets_; + //optional + XHashMap ipTosCountList_; + XHashMap mobileQciCosCountList_; + XArrayOfString ipTosList_; + XArrayOfString mobileQciCosList_; + XArrayOfString tcpFlagList_; + XHashMap tcpFlagCountList_; + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XHeartbeatFields.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XHeartbeatFields.cpp new file mode 100644 index 0000000..2686fad --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XHeartbeatFields.cpp @@ -0,0 +1,7 @@ +#include "XHeartbeatFields.h" +#include "XHeartbeatFieldsImp.h" + +std::shared_ptr vagt::encode::XHeartbeatFields::create(std::shared_ptr header, XInteger heartbeatInterval) +{ + return std::make_shared(header, heartbeatInterval); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XHeartbeatFieldsImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XHeartbeatFieldsImp.cpp new file mode 100644 index 0000000..23ffa92 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XHeartbeatFieldsImp.cpp @@ -0,0 +1,72 @@ +#include "XHeartbeatFieldsImp.h" + +const std::string XEnumHeartbeatFieldsHeartbeatFieldsVersionMapping[] = { + "3.0" +}; + +XHeartbeatFieldsImp::XHeartbeatFieldsImp(std::shared_ptr header, XInteger heartbeatInterval): + header_(header), + heartbeatFieldsVersion_(XEnumHeartbeatFieldsHeartbeatFieldsVersion3_0), + heartbeatInterval_(heartbeatInterval) +{ + +} + +void XHeartbeatFieldsImp::setHeartbeatInterval(XInteger heartbeatInterval) +{ + comVals_["heartbeatInterval"] = heartbeatInterval; +} + +void XHeartbeatFieldsImp::setAdditionalFields(const XHashMap& additionalFields) +{ + additionalFields_ = additionalFields; +} + +std::shared_ptr XHeartbeatFieldsImp::getCommonHeader() +{ + return header_; +} + +std::string XHeartbeatFieldsImp::toString() +{ + try + { + auto js = toJson(); + return js.dump(); + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to dump XHeartbeatFields to json string:{}.", e.what()); + return ""; + } +} + +json XHeartbeatFieldsImp::toJson() +{ + try + { + json field = { + {"heartbeatInterval", heartbeatInterval_}, + {"heartbeatFieldsVersion", XEnumHeartbeatFieldsHeartbeatFieldsVersionMapping[heartbeatFieldsVersion_]} + }; + + //optional val + if (!additionalFields_.empty()) + { + field["additionalFields"] = additionalFields_; + } + + json jsEvent; + header_->setDomain(XEnumCommonEventHeaderDomainHeartbeat); + jsEvent["event"]["commonEventHeader"] = dynamic_pointer_cast(header_)->toJson(); + jsEvent["event"]["heartbeatFields"] = field; + + return jsEvent; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XHeartbeatFields to json object:{}.", e.what()); + return json(); + } +} + diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XHeartbeatFieldsImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XHeartbeatFieldsImp.h new file mode 100644 index 0000000..3265823 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XHeartbeatFieldsImp.h @@ -0,0 +1,34 @@ +#pragma once + +#include "XHeartbeatFields.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XHeartbeatFieldsImp : public XHeartbeatFields, public XJsonable + { + public: + XHeartbeatFieldsImp(std::shared_ptr header, XInteger heartbeatInterval); + + virtual std::string toString() override; + virtual json toJson() override; + + virtual std::shared_ptr getCommonHeader() override; + + virtual void setHeartbeatInterval(XInteger heartbeatInterval) override; + virtual void setAdditionalFields(const XHashMap& additionalFields) override; + + private: + //required + std::shared_ptr header_; + XInteger heartbeatInterval_; + XEnumHeartbeatFieldsHeartbeatFieldsVersion heartbeatFieldsVersion_; + //optional + XHashMap additionalFields_; + std::map comVals_; + }; + } +} + diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XHugePages.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XHugePages.cpp new file mode 100755 index 0000000..8d6973c --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XHugePages.cpp @@ -0,0 +1,46 @@ +#include "XHugePages.h" +#include "XHugePagesImp.h" + +vagt::encode::XHugePages::XHugePages() +{ +} + +vagt::encode::XHugePages::XHugePages(const XString & hugePagesIdentifier): + imp_(make_shared(hugePagesIdentifier)) +{ +} + +void vagt::encode::XHugePages::setBytesUsed(XNumber bytesUsed) +{ + return imp_->setBytesUsed(bytesUsed); +} + +void vagt::encode::XHugePages::setHugePagesIdentifier(const XString & hugePagesIdentifier) +{ + return imp_->setHugePagesIdentifier(hugePagesIdentifier); +} + +void vagt::encode::XHugePages::setVmPageNumberFree(XNumber vmPageNumberFree) +{ + return imp_->setVmPageNumberFree(vmPageNumberFree); +} + +void vagt::encode::XHugePages::setBytesFree(XNumber bytesFree) +{ + return imp_->setBytesFree(bytesFree); +} + +void vagt::encode::XHugePages::setPercentFree(XNumber percentFree) +{ + return imp_->setPercentFree(percentFree); +} + +void vagt::encode::XHugePages::setPercentUsed(XNumber percentUsed) +{ + return imp_->setPercentUsed(percentUsed); +} + +void vagt::encode::XHugePages::setVmPageNumberUsed(XNumber vmPageNumberUsed) +{ + return imp_->setVmPageNumberUsed(vmPageNumberUsed); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XHugePagesImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XHugePagesImp.cpp new file mode 100755 index 0000000..febd644 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XHugePagesImp.cpp @@ -0,0 +1,64 @@ +#include "XHugePagesImp.h" + +XHugePagesImp::XHugePagesImp(const XString& hugePagesIdentifier): + hugePagesIdentifier_(hugePagesIdentifier) +{ + +} + +void XHugePagesImp::setBytesUsed(XNumber bytesUsed) +{ + comVals_["bytesUsed"] = bytesUsed; +} + +void XHugePagesImp::setHugePagesIdentifier(const XString& hugePagesIdentifier) +{ + comVals_["hugePagesIdentifier"] = hugePagesIdentifier; +} + +void XHugePagesImp::setVmPageNumberFree(XNumber vmPageNumberFree) +{ + comVals_["vmPageNumberFree"] = vmPageNumberFree; +} + +void XHugePagesImp::setBytesFree(XNumber bytesFree) +{ + comVals_["bytesFree"] = bytesFree; +} + +void XHugePagesImp::setPercentFree(XNumber percentFree) +{ + comVals_["percentFree"] = percentFree; +} + +void XHugePagesImp::setPercentUsed(XNumber percentUsed) +{ + comVals_["percentUsed"] = percentUsed; +} + +void XHugePagesImp::setVmPageNumberUsed(XNumber vmPageNumberUsed) +{ + comVals_["vmPageNumberUsed"] = vmPageNumberUsed; +} + +json XHugePagesImp::toJson() +{ + try + { + json field = { + {"hugePagesIdentifier", hugePagesIdentifier_} + }; + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XHugePages to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XHugePagesImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XHugePagesImp.h new file mode 100755 index 0000000..000940e --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XHugePagesImp.h @@ -0,0 +1,33 @@ +#pragma once + +#include "XHugePages.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XHugePagesImp : public XHugePages, public XJsonable + { + public: + XHugePagesImp(const XString& hugePagesIdentifier); + + virtual json toJson() override; + + void setBytesUsed(XNumber bytesUsed); + void setHugePagesIdentifier(const XString& hugePagesIdentifier); + void setVmPageNumberFree(XNumber vmPageNumberFree); + void setBytesFree(XNumber bytesFree); + void setPercentFree(XNumber percentFree); + void setPercentUsed(XNumber percentUsed); + void setVmPageNumberUsed(XNumber vmPageNumberUsed); + + private: + //required + XString hugePagesIdentifier_; + //optional + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XInternal.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XInternal.cpp new file mode 100755 index 0000000..a32ae1e --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XInternal.cpp @@ -0,0 +1,22 @@ +#include "XInternal.h" + +json vagt::encode::mergeCommonValues(json jsonObj, const std::map& values) +{ + for (auto it : values) + { + if (XDataTypeInteger == it.second.dataType_) + { + jsonObj[it.first] = it.second.intVal_; + } + else if (XDataTypeNumber == it.second.dataType_) + { + jsonObj[it.first] = it.second.numberVal_; + } + else if (XDataTypeString == it.second.dataType_) + { + jsonObj[it.first] = it.second.strVal_; + } + } + + return jsonObj; +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XInternal.h b/veslibrary/ves_cpplibrary/src/lib/encode/XInternal.h new file mode 100755 index 0000000..38aa1db --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XInternal.h @@ -0,0 +1,53 @@ +#pragma once + +#include "XEvent.h" +#include "nlohmann/json.hpp" + +#ifndef SPDLOG_ACTIVE_LEVEL +#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_TRACE +#endif + +#include "spdlog/spdlog.h" + +using namespace std; +using namespace vagt::encode; +using json = nlohmann::json; + +namespace vagt +{ + namespace encode + { + class XJsonable + { + public: + virtual json toJson() = 0; + }; + + class XCommonValue + { + public: + XCommonValue() :dataType_(XDataTypeUnknown) {} + XCommonValue(const std::string& val) :dataType_(XDataTypeString), strVal_(val) {} + XCommonValue(XInteger val) :dataType_(XDataTypeInteger), intVal_(val) {} + XCommonValue(XNumber val) :dataType_(XDataTypeNumber), numberVal_(val) {} + + XDataType dataType_; + XInteger intVal_; + XNumber numberVal_; + XString strVal_; + }; + + json mergeCommonValues(json jsonObj, const std::map& values); + + template + inline json fromArray(const T& v) + { + json jsonArray = json::array(); + for (auto e : v) + { + jsonArray.push_back(dynamic_pointer_cast(e.imp_)->toJson()); + } + return jsonArray; + } + } +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmi.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmi.cpp new file mode 100755 index 0000000..153fb97 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmi.cpp @@ -0,0 +1,77 @@ +#include "XIpmi.h" +#include "XIpmiImp.h" + +vagt::encode::XIpmi::XIpmi(void*) +{ +} + +vagt::encode::XIpmi::XIpmi(): + imp_(make_shared()) +{ + +} + +void vagt::encode::XIpmi::setSystemAirflow(XNumber systemAirflow) +{ + return imp_->setSystemAirflow(systemAirflow); +} + +void vagt::encode::XIpmi::setIpmiFanArray(const XArrayOfXIpmiFan & ipmiFanArray) +{ + return imp_->setIpmiFanArray(ipmiFanArray); +} + +void vagt::encode::XIpmi::setIpmiProcessorArray(const XArrayOfXIpmiProcessor & ipmiProcessorArray) +{ + return imp_->setIpmiProcessorArray(ipmiProcessorArray); +} + +void vagt::encode::XIpmi::setExitAirTemperature(XNumber exitAirTemperature) +{ + return imp_->setExitAirTemperature(exitAirTemperature); +} + +void vagt::encode::XIpmi::setIpmiBaseboardVoltageRegulatorArray(const XArrayOfXIpmiBaseboardVoltageRegulator & ipmiBaseboardVoltageRegulatorArray) +{ + return imp_->setIpmiBaseboardVoltageRegulatorArray(ipmiBaseboardVoltageRegulatorArray); +} + +void vagt::encode::XIpmi::setIpmiGlobalAggregateTemperatureMarginArray(const XArrayOfXIpmiGlobalAggregateTemperatureMargin & ipmiGlobalAggregateTemperatureMarginArray) +{ + return imp_->setIpmiGlobalAggregateTemperatureMarginArray(ipmiGlobalAggregateTemperatureMarginArray); +} + +void vagt::encode::XIpmi::setIpmiNicArray(const XArrayOfXIpmiNic & ipmiNicArray) +{ + return imp_->setIpmiNicArray(ipmiNicArray); +} + +void vagt::encode::XIpmi::setIpmiBaseboardTemperatureArray(const XArrayOfXIpmiBaseboardTemperature & ipmiBaseboardTemperatureArray) +{ + return imp_->setIpmiBaseboardTemperatureArray(ipmiBaseboardTemperatureArray); +} + +void vagt::encode::XIpmi::setIpmiPowerSupplyArray(const XArrayOfXIpmiPowerSupply & ipmiPowerSupplyArray) +{ + return imp_->setIpmiPowerSupplyArray(ipmiPowerSupplyArray); +} + +void vagt::encode::XIpmi::setIoModuleTemperature(XNumber ioModuleTemperature) +{ + return imp_->setIoModuleTemperature(ioModuleTemperature); +} + +void vagt::encode::XIpmi::setIpmiHsbpArray(const XArrayOfXIpmiHsbp & ipmiHsbpArray) +{ + return imp_->setIpmiHsbpArray(ipmiHsbpArray); +} + +void vagt::encode::XIpmi::setIpmiBatteryArray(const XArrayOfXIpmiBattery & ipmiBatteryArray) +{ + return imp_->setIpmiBatteryArray(ipmiBatteryArray); +} + +void vagt::encode::XIpmi::setFrontPanelTemperature(XNumber frontPanelTemperature) +{ + return imp_->setFrontPanelTemperature(frontPanelTemperature); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBaseboardTemperature.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBaseboardTemperature.cpp new file mode 100755 index 0000000..bebefd3 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBaseboardTemperature.cpp @@ -0,0 +1,21 @@ +#include "XIpmiBaseboardTemperature.h" +#include "XIpmiBaseboardTemperatureImp.h" + +vagt::encode::XIpmiBaseboardTemperature::XIpmiBaseboardTemperature() +{ +} + +vagt::encode::XIpmiBaseboardTemperature::XIpmiBaseboardTemperature(const XString & baseboardTemperatureIdentifier): + imp_(make_shared(baseboardTemperatureIdentifier)) +{ +} + +void vagt::encode::XIpmiBaseboardTemperature::setBaseboardTemperature(XNumber baseboardTemperature) +{ + return imp_->setBaseboardTemperature(baseboardTemperature); +} + +void vagt::encode::XIpmiBaseboardTemperature::setBaseboardTemperatureIdentifier(const XString & baseboardTemperatureIdentifier) +{ + return imp_->setBaseboardTemperatureIdentifier(baseboardTemperatureIdentifier); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBaseboardTemperatureImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBaseboardTemperatureImp.cpp new file mode 100755 index 0000000..e537dd0 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBaseboardTemperatureImp.cpp @@ -0,0 +1,39 @@ +#include "XIpmiBaseboardTemperatureImp.h" + +XIpmiBaseboardTemperatureImp::XIpmiBaseboardTemperatureImp(const XString& baseboardTemperatureIdentifier): + baseboardTemperatureIdentifier_(baseboardTemperatureIdentifier) +{ + +} + +void XIpmiBaseboardTemperatureImp::setBaseboardTemperature(XNumber baseboardTemperature) +{ + comVals_["baseboardTemperature"] = baseboardTemperature; +} + +void XIpmiBaseboardTemperatureImp::setBaseboardTemperatureIdentifier(const XString& baseboardTemperatureIdentifier) +{ + comVals_["baseboardTemperatureIdentifier"] = baseboardTemperatureIdentifier; +} + +json XIpmiBaseboardTemperatureImp::toJson() +{ + try + { + json field = { + {"baseboardTemperatureIdentifier", baseboardTemperatureIdentifier_} + }; + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XIpmiBaseboardTemperature to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBaseboardTemperatureImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBaseboardTemperatureImp.h new file mode 100755 index 0000000..5f9bd1f --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBaseboardTemperatureImp.h @@ -0,0 +1,28 @@ +#pragma once + +#include "XIpmiBaseboardTemperature.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XIpmiBaseboardTemperatureImp : public XIpmiBaseboardTemperature, public XJsonable + { + public: + XIpmiBaseboardTemperatureImp(const XString& baseboardTemperatureIdentifier); + + virtual json toJson() override; + + virtual void setBaseboardTemperature(XNumber baseboardTemperature) override; + virtual void setBaseboardTemperatureIdentifier(const XString& baseboardTemperatureIdentifier) override; + + private: + //required + XString baseboardTemperatureIdentifier_; + //optional + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBaseboardVoltageRegulator.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBaseboardVoltageRegulator.cpp new file mode 100755 index 0000000..d46dc39 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBaseboardVoltageRegulator.cpp @@ -0,0 +1,21 @@ +#include "XIpmiBaseboardVoltageRegulator.h" +#include "XIpmiBaseboardVoltageRegulatorImp.h" + +vagt::encode::XIpmiBaseboardVoltageRegulator::XIpmiBaseboardVoltageRegulator() +{ +} + +vagt::encode::XIpmiBaseboardVoltageRegulator::XIpmiBaseboardVoltageRegulator(const XString & baseboardVoltageRegulatorIdentifier): + imp_(make_shared(baseboardVoltageRegulatorIdentifier)) +{ +} + +void vagt::encode::XIpmiBaseboardVoltageRegulator::setBaseboardVoltageRegulatorIdentifier(const XString & baseboardVoltageRegulatorIdentifier) +{ + return imp_->setBaseboardVoltageRegulatorIdentifier(baseboardVoltageRegulatorIdentifier); +} + +void vagt::encode::XIpmiBaseboardVoltageRegulator::setVoltageRegulatorTemperature(XNumber voltageRegulatorTemperature) +{ + return imp_->setVoltageRegulatorTemperature(voltageRegulatorTemperature); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBaseboardVoltageRegulatorImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBaseboardVoltageRegulatorImp.cpp new file mode 100755 index 0000000..748a055 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBaseboardVoltageRegulatorImp.cpp @@ -0,0 +1,39 @@ +#include "XIpmiBaseboardVoltageRegulatorImp.h" + +XIpmiBaseboardVoltageRegulatorImp::XIpmiBaseboardVoltageRegulatorImp(const XString& baseboardVoltageRegulatorIdentifier): + baseboardVoltageRegulatorIdentifier_(baseboardVoltageRegulatorIdentifier) +{ + +} + +void XIpmiBaseboardVoltageRegulatorImp::setBaseboardVoltageRegulatorIdentifier(const XString& baseboardVoltageRegulatorIdentifier) +{ + comVals_["baseboardVoltageRegulatorIdentifier"] = baseboardVoltageRegulatorIdentifier; +} + +void XIpmiBaseboardVoltageRegulatorImp::setVoltageRegulatorTemperature(XNumber voltageRegulatorTemperature) +{ + comVals_["voltageRegulatorTemperature"] = voltageRegulatorTemperature; +} + +json XIpmiBaseboardVoltageRegulatorImp::toJson() +{ + try + { + json field = { + {"baseboardVoltageRegulatorIdentifier", baseboardVoltageRegulatorIdentifier_} + }; + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XIpmiBaseboardVoltageRegulator to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBaseboardVoltageRegulatorImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBaseboardVoltageRegulatorImp.h new file mode 100755 index 0000000..a139ac1 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBaseboardVoltageRegulatorImp.h @@ -0,0 +1,28 @@ +#pragma once + +#include "XIpmiBaseboardVoltageRegulator.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XIpmiBaseboardVoltageRegulatorImp : public XIpmiBaseboardVoltageRegulator, public XJsonable + { + public: + XIpmiBaseboardVoltageRegulatorImp(const XString& baseboardVoltageRegulatorIdentifier); + + virtual json toJson() override; + + virtual void setBaseboardVoltageRegulatorIdentifier(const XString& baseboardVoltageRegulatorIdentifier) override; + virtual void setVoltageRegulatorTemperature(XNumber voltageRegulatorTemperature) override; + + private: + //required + XString baseboardVoltageRegulatorIdentifier_; + //optional + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBattery.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBattery.cpp new file mode 100755 index 0000000..3d9ba50 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBattery.cpp @@ -0,0 +1,26 @@ +#include "XIpmiBattery.h" +#include "XIpmiBatteryImp.h" + +vagt::encode::XIpmiBattery::XIpmiBattery() +{ +} + +vagt::encode::XIpmiBattery::XIpmiBattery(const XString & batteryIdentifier): + imp_(make_shared(batteryIdentifier)) +{ +} + +void vagt::encode::XIpmiBattery::setBatteryType(const XString & batteryType) +{ + return imp_->setBatteryType(batteryType); +} + +void vagt::encode::XIpmiBattery::setBatteryIdentifier(const XString & batteryIdentifier) +{ + return imp_->setBatteryIdentifier(batteryIdentifier); +} + +void vagt::encode::XIpmiBattery::setBatteryVoltageLevel(XNumber batteryVoltageLevel) +{ + return imp_->setBatteryVoltageLevel(batteryVoltageLevel); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBatteryImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBatteryImp.cpp new file mode 100755 index 0000000..ab123af --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBatteryImp.cpp @@ -0,0 +1,44 @@ +#include "XIpmiBatteryImp.h" + +XIpmiBatteryImp::XIpmiBatteryImp(const XString& batteryIdentifier): + batteryIdentifier_(batteryIdentifier) +{ + +} + +void XIpmiBatteryImp::setBatteryType(const XString& batteryType) +{ + comVals_["batteryType"] = batteryType; +} + +void XIpmiBatteryImp::setBatteryIdentifier(const XString& batteryIdentifier) +{ + comVals_["batteryIdentifier"] = batteryIdentifier; +} + +void XIpmiBatteryImp::setBatteryVoltageLevel(XNumber batteryVoltageLevel) +{ + comVals_["batteryVoltageLevel"] = batteryVoltageLevel; +} + +json XIpmiBatteryImp::toJson() +{ + try + { + json field = { + {"batteryIdentifier", batteryIdentifier_} + }; + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XIpmiBattery to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBatteryImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBatteryImp.h new file mode 100755 index 0000000..2a06bae --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiBatteryImp.h @@ -0,0 +1,29 @@ +#pragma once + +#include "XIpmiBattery.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XIpmiBatteryImp : public XIpmiBattery, public XJsonable + { + public: + XIpmiBatteryImp(const XString& batteryIdentifier); + + virtual json toJson() override; + + virtual void setBatteryType(const XString& batteryType); + virtual void setBatteryIdentifier(const XString& batteryIdentifier); + virtual void setBatteryVoltageLevel(XNumber batteryVoltageLevel); + + private: + //required + XString batteryIdentifier_; + //optional + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiFan.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiFan.cpp new file mode 100755 index 0000000..dd9c52d --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiFan.cpp @@ -0,0 +1,21 @@ +#include "XIpmiFan.h" +#include "XIpmiFanImp.h" + +vagt::encode::XIpmiFan::XIpmiFan() +{ +} + +vagt::encode::XIpmiFan::XIpmiFan(const XString & fanIdentifier): + imp_(make_shared(fanIdentifier)) +{ +} + +void vagt::encode::XIpmiFan::setFanSpeed(XNumber fanSpeed) +{ + return imp_->setFanSpeed(fanSpeed); +} + +void vagt::encode::XIpmiFan::setFanIdentifier(const XString & fanIdentifier) +{ + return imp_->setFanIdentifier(fanIdentifier); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiFanImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiFanImp.cpp new file mode 100755 index 0000000..5ce71e2 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiFanImp.cpp @@ -0,0 +1,39 @@ +#include "XIpmiFanImp.h" + +XIpmiFanImp::XIpmiFanImp(const XString& fanIdentifier): + fanIdentifier_(fanIdentifier) +{ + +} + +void XIpmiFanImp::setFanSpeed(XNumber fanSpeed) +{ + comVals_["fanSpeed"] = fanSpeed; +} + +void XIpmiFanImp::setFanIdentifier(const XString& fanIdentifier) +{ + comVals_["fanIdentifier"] = fanIdentifier; +} + +json XIpmiFanImp::toJson() +{ + try + { + json field = { + {"fanIdentifier", fanIdentifier_} + }; + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XIpmiFan to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiFanImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiFanImp.h new file mode 100755 index 0000000..fc3d5f3 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiFanImp.h @@ -0,0 +1,28 @@ +#pragma once + +#include "XIpmiFan.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XIpmiFanImp : public XIpmiFan, public XJsonable + { + public: + XIpmiFanImp(const XString& fanIdentifier); + + virtual json toJson() override; + + virtual void setFanSpeed(XNumber fanSpeed) override; + virtual void setFanIdentifier(const XString& fanIdentifier) override; + + private: + //required + XString fanIdentifier_; + //optional + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiGlobalAggregateTemperatureMargin.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiGlobalAggregateTemperatureMargin.cpp new file mode 100755 index 0000000..ce620ae --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiGlobalAggregateTemperatureMargin.cpp @@ -0,0 +1,21 @@ +#include "XIpmiGlobalAggregateTemperatureMargin.h" +#include "XIpmiGlobalAggregateTemperatureMarginImp.h" + +vagt::encode::XIpmiGlobalAggregateTemperatureMargin::XIpmiGlobalAggregateTemperatureMargin() +{ +} + +vagt::encode::XIpmiGlobalAggregateTemperatureMargin::XIpmiGlobalAggregateTemperatureMargin(const XString & ipmiGlobalAggregateTemperatureMarginIdentifier, XNumber globalAggregateTemperatureMargin): + imp_(make_shared(ipmiGlobalAggregateTemperatureMarginIdentifier, globalAggregateTemperatureMargin)) +{ +} + +void vagt::encode::XIpmiGlobalAggregateTemperatureMargin::setIpmiGlobalAggregateTemperatureMarginIdentifier(const XString & ipmiGlobalAggregateTemperatureMarginIdentifier) +{ + return imp_->setIpmiGlobalAggregateTemperatureMarginIdentifier(ipmiGlobalAggregateTemperatureMarginIdentifier); +} + +void vagt::encode::XIpmiGlobalAggregateTemperatureMargin::setGlobalAggregateTemperatureMargin(XNumber globalAggregateTemperatureMargin) +{ + return imp_->setGlobalAggregateTemperatureMargin(globalAggregateTemperatureMargin); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiGlobalAggregateTemperatureMarginImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiGlobalAggregateTemperatureMarginImp.cpp new file mode 100755 index 0000000..ff94b9c --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiGlobalAggregateTemperatureMarginImp.cpp @@ -0,0 +1,42 @@ +#include "XIpmiGlobalAggregateTemperatureMarginImp.h" + +XIpmiGlobalAggregateTemperatureMarginImp::XIpmiGlobalAggregateTemperatureMarginImp(const XString& ipmiGlobalAggregateTemperatureMarginIdentifier, + XNumber globalAggregateTemperatureMargin): + ipmiGlobalAggregateTemperatureMarginIdentifier_(ipmiGlobalAggregateTemperatureMarginIdentifier), + globalAggregateTemperatureMargin_(globalAggregateTemperatureMargin) +{ + +} + +void XIpmiGlobalAggregateTemperatureMarginImp::setIpmiGlobalAggregateTemperatureMarginIdentifier(const XString& ipmiGlobalAggregateTemperatureMarginIdentifier) +{ + comVals_["ipmiGlobalAggregateTemperatureMarginIdentifier"] = ipmiGlobalAggregateTemperatureMarginIdentifier; +} + +void XIpmiGlobalAggregateTemperatureMarginImp::setGlobalAggregateTemperatureMargin(XNumber globalAggregateTemperatureMargin) +{ + comVals_["globalAggregateTemperatureMargin"] = globalAggregateTemperatureMargin; +} + +json XIpmiGlobalAggregateTemperatureMarginImp::toJson() +{ + try + { + json field = { + {"ipmiGlobalAggregateTemperatureMarginIdentifier", ipmiGlobalAggregateTemperatureMarginIdentifier_}, + {"globalAggregateTemperatureMargin", globalAggregateTemperatureMargin_} + }; + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XIpmiGlobalAggregateTemperatureMargin to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiGlobalAggregateTemperatureMarginImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiGlobalAggregateTemperatureMarginImp.h new file mode 100755 index 0000000..3e1478a --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiGlobalAggregateTemperatureMarginImp.h @@ -0,0 +1,30 @@ +#pragma once + +#include "XIpmiGlobalAggregateTemperatureMargin.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XIpmiGlobalAggregateTemperatureMarginImp : public XIpmiGlobalAggregateTemperatureMargin, public XJsonable + { + public: + XIpmiGlobalAggregateTemperatureMarginImp(const XString& ipmiGlobalAggregateTemperatureMarginIdentifier, + XNumber globalAggregateTemperatureMargin); + + virtual json toJson() override; + + virtual void setIpmiGlobalAggregateTemperatureMarginIdentifier(const XString& ipmiGlobalAggregateTemperatureMarginIdentifier) override; + virtual void setGlobalAggregateTemperatureMargin(XNumber globalAggregateTemperatureMargin) override; + + private: + //required + XString ipmiGlobalAggregateTemperatureMarginIdentifier_; + XNumber globalAggregateTemperatureMargin_; + //optional + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiHsbp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiHsbp.cpp new file mode 100755 index 0000000..2007fe6 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiHsbp.cpp @@ -0,0 +1,21 @@ +#include "XIpmiHsbp.h" +#include "XIpmiHsbpImp.h" + +vagt::encode::XIpmiHsbp::XIpmiHsbp() +{ +} + +vagt::encode::XIpmiHsbp::XIpmiHsbp(const XString & hsbpIdentifier): + imp_(make_shared(hsbpIdentifier)) +{ +} + +void vagt::encode::XIpmiHsbp::setHsbpTemperature(XNumber hsbpTemperature) +{ + return imp_->setHsbpTemperature(hsbpTemperature); +} + +void vagt::encode::XIpmiHsbp::setHsbpIdentifier(const XString & hsbpIdentifier) +{ + return imp_->setHsbpIdentifier(hsbpIdentifier); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiHsbpImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiHsbpImp.cpp new file mode 100755 index 0000000..fdc2e21 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiHsbpImp.cpp @@ -0,0 +1,39 @@ +#include "XIpmiHsbpImp.h" + +XIpmiHsbpImp::XIpmiHsbpImp(const XString& hsbpIdentifier): + hsbpIdentifier_(hsbpIdentifier) +{ + +} + +void XIpmiHsbpImp::setHsbpTemperature(XNumber hsbpTemperature) +{ + comVals_["hsbpTemperature"] = hsbpTemperature; +} + +void XIpmiHsbpImp::setHsbpIdentifier(const XString& hsbpIdentifier) +{ + comVals_["hsbpIdentifier"] = hsbpIdentifier; +} + +json XIpmiHsbpImp::toJson() +{ + try + { + json field = { + {"hsbpIdentifier", hsbpIdentifier_} + }; + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XIpmiHsbp to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiHsbpImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiHsbpImp.h new file mode 100755 index 0000000..3dd8d51 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiHsbpImp.h @@ -0,0 +1,28 @@ +#pragma once + +#include "XIpmiHsbp.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XIpmiHsbpImp : public XIpmiHsbp, public XJsonable + { + public: + XIpmiHsbpImp(const XString& hsbpIdentifier); + + virtual json toJson() override; + + virtual void setHsbpTemperature(XNumber hsbpTemperature) override; + virtual void setHsbpIdentifier(const XString& hsbpIdentifier) override; + + private: + //required + XString hsbpIdentifier_; + //optional + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiImp.cpp new file mode 100755 index 0000000..57b01a3 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiImp.cpp @@ -0,0 +1,134 @@ +#include "XIpmiImp.h" + +XIpmiImp::XIpmiImp():XIpmi(nullptr) +{ +} + +void XIpmiImp::setSystemAirflow(XNumber systemAirflow) +{ + comVals_["systemAirflow"] = systemAirflow; +} + +void XIpmiImp::setIpmiFanArray(const XArrayOfXIpmiFan& ipmiFanArray) +{ + ipmiFanArray_ = ipmiFanArray; +} + +void XIpmiImp::setIpmiProcessorArray(const XArrayOfXIpmiProcessor& ipmiProcessorArray) +{ + ipmiProcessorArray_ = ipmiProcessorArray; +} + +void XIpmiImp::setExitAirTemperature(XNumber exitAirTemperature) +{ + comVals_["exitAirTemperature"] = exitAirTemperature; +} + +void XIpmiImp::setIpmiBaseboardVoltageRegulatorArray(const XArrayOfXIpmiBaseboardVoltageRegulator& ipmiBaseboardVoltageRegulatorArray) +{ + ipmiBaseboardVoltageRegulatorArray_ = ipmiBaseboardVoltageRegulatorArray; +} + +void XIpmiImp::setIpmiGlobalAggregateTemperatureMarginArray(const XArrayOfXIpmiGlobalAggregateTemperatureMargin& ipmiGlobalAggregateTemperatureMarginArray) +{ + ipmiGlobalAggregateTemperatureMarginArray_ = ipmiGlobalAggregateTemperatureMarginArray; +} + +void XIpmiImp::setIpmiNicArray(const XArrayOfXIpmiNic& ipmiNicArray) +{ + ipmiNicArray_ = ipmiNicArray; +} + +void XIpmiImp::setIpmiBaseboardTemperatureArray(const XArrayOfXIpmiBaseboardTemperature& ipmiBaseboardTemperatureArray) +{ + ipmiBaseboardTemperatureArray_ = ipmiBaseboardTemperatureArray; +} + +void XIpmiImp::setIpmiPowerSupplyArray(const XArrayOfXIpmiPowerSupply& ipmiPowerSupplyArray) +{ + ipmiPowerSupplyArray_ = ipmiPowerSupplyArray; +} + +void XIpmiImp::setIoModuleTemperature(XNumber ioModuleTemperature) +{ + comVals_["ioModuleTemperature"] = ioModuleTemperature; +} + +void XIpmiImp::setIpmiHsbpArray(const XArrayOfXIpmiHsbp& ipmiHsbpArray) +{ + ipmiHsbpArray_ = ipmiHsbpArray; +} + +void XIpmiImp::setIpmiBatteryArray(const XArrayOfXIpmiBattery& ipmiBatteryArray) +{ + ipmiBatteryArray_ = ipmiBatteryArray; +} + +void XIpmiImp::setFrontPanelTemperature(XNumber frontPanelTemperature) +{ + comVals_["frontPanelTemperature"] = frontPanelTemperature; +} + +json XIpmiImp::toJson() +{ + try + { + json field; + + //optional val + if (!ipmiFanArray_.empty()) + { + field["ipmiFanArray"] = fromArray(ipmiFanArray_); + } + + if (!ipmiProcessorArray_.empty()) + { + field["ipmiProcessorArray"] = fromArray(ipmiProcessorArray_); + } + + if (!ipmiBaseboardVoltageRegulatorArray_.empty()) + { + field["ipmiBaseboardVoltageRegulatorArray"] = fromArray(ipmiBaseboardVoltageRegulatorArray_); + } + + if (!ipmiGlobalAggregateTemperatureMarginArray_.empty()) + { + field["ipmiGlobalAggregateTemperatureMarginArray"] = fromArray(ipmiGlobalAggregateTemperatureMarginArray_); + } + + if (!ipmiNicArray_.empty()) + { + field["ipmiNicArray"] = fromArray(ipmiNicArray_); + } + + if (!ipmiBaseboardTemperatureArray_.empty()) + { + field["ipmiBaseboardTemperatureArray"] = fromArray(ipmiBaseboardTemperatureArray_); + } + + if (!ipmiPowerSupplyArray_.empty()) + { + field["ipmiPowerSupplyArray"] = fromArray(ipmiPowerSupplyArray_); + } + + if (!ipmiHsbpArray_.empty()) + { + field["ipmiHsbpArray"] = fromArray(ipmiHsbpArray_); + } + + if (!ipmiBatteryArray_.empty()) + { + field["ipmiBatteryArray"] = fromArray(ipmiBatteryArray_); + } + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XIpmi to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiImp.h new file mode 100755 index 0000000..8be2272 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiImp.h @@ -0,0 +1,46 @@ +#pragma once + +#include "XIpmi.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XIpmiImp : public XIpmi, public XJsonable + { + public: + XIpmiImp(); + + virtual json toJson() override; + + virtual void setSystemAirflow(XNumber systemAirflow) override; + virtual void setIpmiFanArray(const XArrayOfXIpmiFan& ipmiFanArray) override; + virtual void setIpmiProcessorArray(const XArrayOfXIpmiProcessor& ipmiProcessorArray) override; + virtual void setExitAirTemperature(XNumber exitAirTemperature) override; + virtual void setIpmiBaseboardVoltageRegulatorArray(const XArrayOfXIpmiBaseboardVoltageRegulator& ipmiBaseboardVoltageRegulatorArray) override; + virtual void setIpmiGlobalAggregateTemperatureMarginArray(const XArrayOfXIpmiGlobalAggregateTemperatureMargin& ipmiGlobalAggregateTemperatureMarginArray) override; + virtual void setIpmiNicArray(const XArrayOfXIpmiNic& ipmiNicArray) override; + virtual void setIpmiBaseboardTemperatureArray(const XArrayOfXIpmiBaseboardTemperature& ipmiBaseboardTemperatureArray) override; + virtual void setIpmiPowerSupplyArray(const XArrayOfXIpmiPowerSupply& ipmiPowerSupplyArray) override; + virtual void setIoModuleTemperature(XNumber ioModuleTemperature) override; + virtual void setIpmiHsbpArray(const XArrayOfXIpmiHsbp& ipmiHsbpArray) override; + virtual void setIpmiBatteryArray(const XArrayOfXIpmiBattery& ipmiBatteryArray) override; + virtual void setFrontPanelTemperature(XNumber frontPanelTemperature) override; + + private: + //optional + XArrayOfXIpmiFan ipmiFanArray_; + XArrayOfXIpmiProcessor ipmiProcessorArray_; + XArrayOfXIpmiBaseboardVoltageRegulator ipmiBaseboardVoltageRegulatorArray_; + XArrayOfXIpmiGlobalAggregateTemperatureMargin ipmiGlobalAggregateTemperatureMarginArray_; + XArrayOfXIpmiNic ipmiNicArray_; + XArrayOfXIpmiBaseboardTemperature ipmiBaseboardTemperatureArray_; + XArrayOfXIpmiPowerSupply ipmiPowerSupplyArray_; + XArrayOfXIpmiHsbp ipmiHsbpArray_; + XArrayOfXIpmiBattery ipmiBatteryArray_; + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiNic.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiNic.cpp new file mode 100755 index 0000000..a56b67f --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiNic.cpp @@ -0,0 +1,21 @@ +#include "XIpmiNic.h" +#include "XIpmiNicImp.h" + +vagt::encode::XIpmiNic::XIpmiNic() +{ +} + +vagt::encode::XIpmiNic::XIpmiNic(const XString & nicIdentifier): + imp_(make_shared(nicIdentifier)) +{ +} + +void vagt::encode::XIpmiNic::setNicIdentifier(const XString & nicIdentifier) +{ + return imp_->setNicIdentifier(nicIdentifier); +} + +void vagt::encode::XIpmiNic::setNicTemperature(XNumber nicTemperature) +{ + return imp_->setNicTemperature(nicTemperature); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiNicImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiNicImp.cpp new file mode 100755 index 0000000..e328adc --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiNicImp.cpp @@ -0,0 +1,39 @@ +#include "XIpmiNicImp.h" + +XIpmiNicImp::XIpmiNicImp(const XString& nicIdentifier): + nicIdentifier_(nicIdentifier) +{ + +} + +void XIpmiNicImp::setNicIdentifier(const XString& nicIdentifier) +{ + comVals_["nicIdentifier"] = nicIdentifier; +} + +void XIpmiNicImp::setNicTemperature(XNumber nicTemperature) +{ + comVals_["nicTemperature"] = nicTemperature; +} + +json XIpmiNicImp::toJson() +{ + try + { + json field = { + {"nicIdentifier", nicIdentifier_} + }; + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XIpmiNic to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiNicImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiNicImp.h new file mode 100755 index 0000000..93cb8dc --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiNicImp.h @@ -0,0 +1,28 @@ +#pragma once + +#include "XIpmiNic.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XIpmiNicImp : public XIpmiNic, public XJsonable + { + public: + XIpmiNicImp(const XString& nicIdentifier); + + virtual json toJson() override; + + virtual void setNicIdentifier(const XString& nicIdentifier) override; + virtual void setNicTemperature(XNumber nicTemperature) override; + + private: + //required + XString nicIdentifier_; + //optional + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiPowerSupply.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiPowerSupply.cpp new file mode 100755 index 0000000..3fb3a12 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiPowerSupply.cpp @@ -0,0 +1,31 @@ +#include "XIpmiPowerSupply.h" +#include "XIpmiPowerSupplyImp.h" + +vagt::encode::XIpmiPowerSupply::XIpmiPowerSupply() +{ +} + +vagt::encode::XIpmiPowerSupply::XIpmiPowerSupply(const XString & powerSupplyIdentifier): + imp_(make_shared(powerSupplyIdentifier)) +{ +} + +void vagt::encode::XIpmiPowerSupply::setPowerSupplyInputPower(XNumber powerSupplyInputPower) +{ + return imp_->setPowerSupplyInputPower(powerSupplyInputPower); +} + +void vagt::encode::XIpmiPowerSupply::setPowerSupplyCurrentOutputPercent(XNumber powerSupplyCurrentOutputPercent) +{ + return imp_->setPowerSupplyCurrentOutputPercent(powerSupplyCurrentOutputPercent); +} + +void vagt::encode::XIpmiPowerSupply::setPowerSupplyIdentifier(const XString & powerSupplyIdentifier) +{ + return imp_->setPowerSupplyIdentifier(powerSupplyIdentifier); +} + +void vagt::encode::XIpmiPowerSupply::setPowerSupplyTemperature(XNumber powerSupplyTemperature) +{ + return imp_->setPowerSupplyTemperature(powerSupplyTemperature); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiPowerSupplyImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiPowerSupplyImp.cpp new file mode 100755 index 0000000..9babe88 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiPowerSupplyImp.cpp @@ -0,0 +1,49 @@ +#include "XIpmiPowerSupplyImp.h" + +XIpmiPowerSupplyImp::XIpmiPowerSupplyImp(const XString& powerSupplyIdentifier): + powerSupplyIdentifier_(powerSupplyIdentifier) +{ + +} + +void XIpmiPowerSupplyImp::setPowerSupplyInputPower(XNumber powerSupplyInputPower) +{ + comVals_["powerSupplyInputPower"] = powerSupplyInputPower; +} + +void XIpmiPowerSupplyImp::setPowerSupplyCurrentOutputPercent(XNumber powerSupplyCurrentOutputPercent) +{ + comVals_["powerSupplyCurrentOutputPercent"] = powerSupplyCurrentOutputPercent; +} + +void XIpmiPowerSupplyImp::setPowerSupplyIdentifier(const XString& powerSupplyIdentifier) +{ + comVals_["powerSupplyIdentifier"] = powerSupplyIdentifier; +} + +void XIpmiPowerSupplyImp::setPowerSupplyTemperature(XNumber powerSupplyTemperature) +{ + comVals_["powerSupplyTemperature"] = powerSupplyTemperature; +} + +json XIpmiPowerSupplyImp::toJson() +{ + try + { + json field = { + {"powerSupplyIdentifier", powerSupplyIdentifier_} + }; + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XIpmiPowerSupply to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiPowerSupplyImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiPowerSupplyImp.h new file mode 100755 index 0000000..fe24eda --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiPowerSupplyImp.h @@ -0,0 +1,30 @@ +#pragma once + +#include "XIpmiPowerSupply.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XIpmiPowerSupplyImp : public XIpmiPowerSupply, public XJsonable + { + public: + XIpmiPowerSupplyImp(const XString& powerSupplyIdentifier); + + virtual json toJson() override; + + virtual void setPowerSupplyInputPower(XNumber powerSupplyInputPower) override; + virtual void setPowerSupplyCurrentOutputPercent(XNumber powerSupplyCurrentOutputPercent) override; + virtual void setPowerSupplyIdentifier(const XString& powerSupplyIdentifier) override; + virtual void setPowerSupplyTemperature(XNumber powerSupplyTemperature) override; + + private: + //required + XString powerSupplyIdentifier_; + //optional + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiProcessor.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiProcessor.cpp new file mode 100755 index 0000000..47f8487 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiProcessor.cpp @@ -0,0 +1,31 @@ +#include "XIpmiProcessor.h" +#include "XIpmiProcessorImp.h" + +vagt::encode::XIpmiProcessor::XIpmiProcessor() +{ +} + +vagt::encode::XIpmiProcessor::XIpmiProcessor(const XString & processorIdentifier): + imp_(make_shared(processorIdentifier)) +{ +} + +void vagt::encode::XIpmiProcessor::setProcessorThermalControlPercent(XNumber processorThermalControlPercent) +{ + return imp_->setProcessorThermalControlPercent(processorThermalControlPercent); +} + +void vagt::encode::XIpmiProcessor::setProcessorDtsThermalMargin(XNumber processorDtsThermalMargin) +{ + return imp_->setProcessorDtsThermalMargin(processorDtsThermalMargin); +} + +void vagt::encode::XIpmiProcessor::setProcessorIdentifier(const XString & processorIdentifier) +{ + return imp_->setProcessorIdentifier(processorIdentifier); +} + +void vagt::encode::XIpmiProcessor::setProcessorDimmAggregateThermalMarginArray(const XArrayOfXProcessorDimmAggregateThermalMargin & processorDimmAggregateThermalMarginArray) +{ + return imp_->setProcessorDimmAggregateThermalMarginArray(processorDimmAggregateThermalMarginArray); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiProcessorImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiProcessorImp.cpp new file mode 100755 index 0000000..2a3862b --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiProcessorImp.cpp @@ -0,0 +1,52 @@ +#include "XIpmiProcessorImp.h" + +XIpmiProcessorImp::XIpmiProcessorImp(const XString& processorIdentifier): + processorIdentifier_(processorIdentifier) +{ + +} + +void XIpmiProcessorImp::setProcessorThermalControlPercent(XNumber processorThermalControlPercent) +{ + comVals_["processorThermalControlPercent"] = processorThermalControlPercent; +} + +void XIpmiProcessorImp::setProcessorDtsThermalMargin(XNumber processorDtsThermalMargin) +{ + comVals_["processorDtsThermalMargin"] = processorDtsThermalMargin; +} + +void XIpmiProcessorImp::setProcessorIdentifier(const XString& processorIdentifier) +{ + comVals_["processorIdentifier"] = processorIdentifier; +} + +void XIpmiProcessorImp::setProcessorDimmAggregateThermalMarginArray(const XArrayOfXProcessorDimmAggregateThermalMargin& processorDimmAggregateThermalMarginArray) +{ + processorDimmAggregateThermalMarginArray_ = processorDimmAggregateThermalMarginArray; +} + +json XIpmiProcessorImp::toJson() +{ + try + { + json field = { + {"processorIdentifier", processorIdentifier_} + }; + + //optional val + if (!processorDimmAggregateThermalMarginArray_.empty()) + { + field["processorDimmAggregateThermalMarginArray"] = fromArray(processorDimmAggregateThermalMarginArray_); + } + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XIpmiProcessor to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiProcessorImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiProcessorImp.h new file mode 100755 index 0000000..3b7125d --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XIpmiProcessorImp.h @@ -0,0 +1,31 @@ +#pragma once + +#include "XIpmiProcessor.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XIpmiProcessorImp : public XIpmiProcessor, public XJsonable + { + public: + XIpmiProcessorImp(const XString& processorIdentifier); + + virtual json toJson() override; + + virtual void setProcessorThermalControlPercent(XNumber processorThermalControlPercent) override; + virtual void setProcessorDtsThermalMargin(XNumber processorDtsThermalMargin) override; + virtual void setProcessorIdentifier(const XString& processorIdentifier) override; + virtual void setProcessorDimmAggregateThermalMarginArray(const XArrayOfXProcessorDimmAggregateThermalMargin& processorDimmAggregateThermalMarginArray) override; + + private: + //required + XString processorIdentifier_; + //optional + XArrayOfXProcessorDimmAggregateThermalMargin processorDimmAggregateThermalMarginArray_; + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XJsonObject.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XJsonObject.cpp new file mode 100755 index 0000000..8504881 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XJsonObject.cpp @@ -0,0 +1,41 @@ +#include "XJsonObject.h" +#include "XJsonObjectImp.h" + +vagt::encode::XJsonObject::XJsonObject() +{ +} + +vagt::encode::XJsonObject::XJsonObject(const XString & objectName, const XArrayOfXJsonObjectInstance & objectInstances): + imp_(make_shared(objectName, objectInstances)) +{ +} + +void vagt::encode::XJsonObject::setObjectSchema(const XString & objectSchema) +{ + return imp_->setObjectSchema(objectSchema); +} + +void vagt::encode::XJsonObject::setObjectName(const XString & objectName) +{ + return imp_->setObjectName(objectName); +} + +void vagt::encode::XJsonObject::setNfSubscriptionId(const XString & nfSubscriptionId) +{ + return imp_->setNfSubscriptionId(nfSubscriptionId); +} + +void vagt::encode::XJsonObject::setObjectInstances(const XArrayOfXJsonObjectInstance & objectInstances) +{ + return imp_->setObjectInstances(objectInstances); +} + +void vagt::encode::XJsonObject::setNfSubscribedObjectName(const XString & nfSubscribedObjectName) +{ + return imp_->setNfSubscribedObjectName(nfSubscribedObjectName); +} + +void vagt::encode::XJsonObject::setObjectSchemaUrl(const XString & objectSchemaUrl) +{ + return imp_->setObjectSchemaUrl(objectSchemaUrl); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XJsonObjectImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XJsonObjectImp.cpp new file mode 100755 index 0000000..6e60102 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XJsonObjectImp.cpp @@ -0,0 +1,64 @@ +#include "XJsonObjectImp.h" + +XJsonObjectImp::XJsonObjectImp(const XString& objectName, + const XArrayOfXJsonObjectInstance& objectInstances + ): + objectInstances_(objectInstances), + objectName_(objectName) +{ + +} + +void XJsonObjectImp::setObjectSchema(const XString& objectSchema) +{ + comVals_["objectSchema"] = objectSchema; +} + +void XJsonObjectImp::setObjectName(const XString& objectName) +{ + comVals_["objectName"] = objectName; +} + +void XJsonObjectImp::setNfSubscriptionId(const XString& nfSubscriptionId) +{ + comVals_["nfSubscriptionId"] = nfSubscriptionId; +} + +void XJsonObjectImp::setObjectInstances(const XArrayOfXJsonObjectInstance& objectInstances) +{ + objectInstances_ = objectInstances; +} + +void XJsonObjectImp::setNfSubscribedObjectName(const XString& nfSubscribedObjectName) +{ + comVals_["nfSubscribedObjectName"] = nfSubscribedObjectName; +} + +void XJsonObjectImp::setObjectSchemaUrl(const XString& objectSchemaUrl) +{ + comVals_["objectSchemaUrl"] = objectSchemaUrl; +} + +json XJsonObjectImp::toJson() +{ + try + { + json field = { + {"objectName", objectName_} + }; + + field["objectInstances"] = fromArray(objectInstances_); + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XJsonObject to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XJsonObjectImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XJsonObjectImp.h new file mode 100755 index 0000000..8d586ac --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XJsonObjectImp.h @@ -0,0 +1,35 @@ +#pragma once + +#include "XJsonObject.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XJsonObjectImp : public XJsonObject, public XJsonable + { + public: + XJsonObjectImp(const XString& objectName, + const XArrayOfXJsonObjectInstance& objectInstances + ); + + virtual json toJson() override; + + virtual void setObjectSchema(const XString& objectSchema) override; + virtual void setObjectName(const XString& objectName) override; + virtual void setNfSubscriptionId(const XString& nfSubscriptionId) override; + virtual void setObjectInstances(const XArrayOfXJsonObjectInstance& objectInstances) override; + virtual void setNfSubscribedObjectName(const XString& nfSubscribedObjectName) override; + virtual void setObjectSchemaUrl(const XString& objectSchemaUrl) override; + + private: + //required + XString objectName_; + XArrayOfXJsonObjectInstance objectInstances_; + //optional + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XJsonObjectInstance.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XJsonObjectInstance.cpp new file mode 100755 index 0000000..e64f8fa --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XJsonObjectInstance.cpp @@ -0,0 +1,31 @@ +#include "XJsonObjectInstance.h" +#include "XJsonObjectInstanceImp.h" + +vagt::encode::XJsonObjectInstance::XJsonObjectInstance(): + imp_(make_shared()) +{ +} + +vagt::encode::XJsonObjectInstance::XJsonObjectInstance(void*) +{ +} + +void vagt::encode::XJsonObjectInstance::setJsonObject(const XJsonObject& jsonObject) +{ + return imp_->setJsonObject(jsonObject); +} + +void vagt::encode::XJsonObjectInstance::setObjectInstance(const XString & objectInstance) +{ + return imp_->setObjectInstance(objectInstance); +} + +void vagt::encode::XJsonObjectInstance::setObjectInstanceEpochMicrosec(XNumber objectInstanceEpochMicrosec) +{ + return imp_->setObjectInstanceEpochMicrosec(objectInstanceEpochMicrosec); +} + +void vagt::encode::XJsonObjectInstance::setObjectKeys(const XArrayOfXKey & objectKeys) +{ + return imp_->setObjectKeys(objectKeys); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XJsonObjectInstanceImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XJsonObjectInstanceImp.cpp new file mode 100755 index 0000000..e371f6e --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XJsonObjectInstanceImp.cpp @@ -0,0 +1,63 @@ +#include "XJsonObjectInstanceImp.h" + +XJsonObjectInstanceImp::XJsonObjectInstanceImp():XJsonObjectInstance(nullptr) +{ +} + +void XJsonObjectInstanceImp::setJsonObject(const XJsonObject& jsonObject) +{ + jsonObject_ = jsonObject.imp_; +} + +void XJsonObjectInstanceImp::setObjectInstance(const XString& objectInstance) +{ + objectInstance_ = objectInstance; +} + +void XJsonObjectInstanceImp::setObjectInstanceEpochMicrosec(XNumber objectInstanceEpochMicrosec) +{ + comVals_["objectInstanceEpochMicrosec"] = objectInstanceEpochMicrosec; +} + +void XJsonObjectInstanceImp::setObjectKeys(const XArrayOfXKey& objectKeys) +{ + objectKeys_ = objectKeys; +} + +json XJsonObjectInstanceImp::toJson() +{ + try + { + json field; + + //optional val + if (jsonObject_) + { + auto jsobj = dynamic_pointer_cast(jsonObject_); + if (!jsobj->toJson().empty()) + { + field["jsonObject"] = jsobj->toJson(); + } + } + + if (!objectKeys_.empty()) + { + field["objectKeys"] = fromArray(objectKeys_); + } + + if (!objectInstance_.empty()) + { + field["objectInstance"] = json::parse(objectInstance_); + } + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XJsonObjectInstance to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XJsonObjectInstanceImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XJsonObjectInstanceImp.h new file mode 100755 index 0000000..7821738 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XJsonObjectInstanceImp.h @@ -0,0 +1,32 @@ +#pragma once + +#include "XJsonObjectInstance.h" +#include "XInternal.h" +#include "XJsonObject.h" + +namespace vagt +{ + namespace encode + { + class XJsonObjectInstanceImp : public XJsonObjectInstance, public XJsonable + { + public: + XJsonObjectInstanceImp(); + + virtual json toJson() override; + + virtual void setJsonObject(const XJsonObject& jsonObject) override; + virtual void setObjectInstance(const XString& objectInstance) override; + virtual void setObjectInstanceEpochMicrosec(XNumber objectInstanceEpochMicrosec) override; + virtual void setObjectKeys(const XArrayOfXKey& objectKeys) override; + + private: + //optional + XString objectInstance_; + std::shared_ptr jsonObject_; + XArrayOfXKey objectKeys_; + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XKey.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XKey.cpp new file mode 100755 index 0000000..7f895a5 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XKey.cpp @@ -0,0 +1,26 @@ +#include "XKey.h" +#include "XKeyImp.h" + +vagt::encode::XKey::XKey() +{ +} + +vagt::encode::XKey::XKey(const XString & keyName): + imp_(make_shared(keyName)) +{ +} + +void vagt::encode::XKey::setKeyValue(const XString & keyValue) +{ + return imp_->setKeyValue(keyValue); +} + +void vagt::encode::XKey::setKeyOrder(XInteger keyOrder) +{ + return imp_->setKeyOrder(keyOrder); +} + +void vagt::encode::XKey::setKeyName(const XString & keyName) +{ + return imp_->setKeyName(keyName); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XKeyImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XKeyImp.cpp new file mode 100755 index 0000000..fd0cc7a --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XKeyImp.cpp @@ -0,0 +1,44 @@ +#include "XKeyImp.h" + +XKeyImp::XKeyImp(const XString& keyName): + keyName_(keyName) +{ + +} + +void XKeyImp::setKeyValue(const XString& keyValue) +{ + comVals_["keyValue"] = keyValue; +} + +void XKeyImp::setKeyOrder(XInteger keyOrder) +{ + comVals_["keyOrder"] = keyOrder; +} + +void XKeyImp::setKeyName(const XString& keyName) +{ + comVals_["keyName"] = keyName; +} + +json XKeyImp::toJson() +{ + try + { + json field = { + {"keyName", keyName_} + }; + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XKey to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XKeyImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XKeyImp.h new file mode 100755 index 0000000..948b78a --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XKeyImp.h @@ -0,0 +1,29 @@ +#pragma once + +#include "XKey.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XKeyImp : public XKey, public XJsonable + { + public: + XKeyImp(const XString& keyName); + + virtual json toJson() override; + + virtual void setKeyValue(const XString& keyValue) override; + virtual void setKeyOrder(XInteger keyOrder) override; + virtual void setKeyName(const XString& keyName) override; + + private: + //required + XString keyName_; + //optional + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XLatencyBucketMeasure.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XLatencyBucketMeasure.cpp new file mode 100644 index 0000000..de7dc14 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XLatencyBucketMeasure.cpp @@ -0,0 +1,26 @@ +#include "XLatencyBucketMeasure.h" +#include "XLatencyBucketMeasureImp.h" + +vagt::encode::XLatencyBucketMeasure::XLatencyBucketMeasure() +{ +} + +vagt::encode::XLatencyBucketMeasure::XLatencyBucketMeasure(XNumber countsInTheBucket): + imp_(make_shared(countsInTheBucket)) +{ +} + +void vagt::encode::XLatencyBucketMeasure::setCountsInTheBucket(XNumber countsInTheBucket) +{ + return imp_->setCountsInTheBucket(countsInTheBucket); +} + +void vagt::encode::XLatencyBucketMeasure::setHighEndOfLatencyBucket(XNumber highEndOfLatencyBucket) +{ + return imp_->setHighEndOfLatencyBucket(highEndOfLatencyBucket); +} + +void vagt::encode::XLatencyBucketMeasure::setLowEndOfLatencyBucket(XNumber lowEndOfLatencyBucket) +{ + return imp_->setLowEndOfLatencyBucket(lowEndOfLatencyBucket); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XLatencyBucketMeasureImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XLatencyBucketMeasureImp.cpp new file mode 100644 index 0000000..37368e3 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XLatencyBucketMeasureImp.cpp @@ -0,0 +1,44 @@ +#include "XLatencyBucketMeasureImp.h" + +XLatencyBucketMeasureImp::XLatencyBucketMeasureImp(XNumber countsInTheBucket): + countsInTheBucket_(countsInTheBucket) +{ + +} + +void XLatencyBucketMeasureImp::setCountsInTheBucket(XNumber countsInTheBucket) +{ + comVals_["countsInTheBucket"] = countsInTheBucket; +} + +void XLatencyBucketMeasureImp::setHighEndOfLatencyBucket(XNumber highEndOfLatencyBucket) +{ + comVals_["highEndOfLatencyBucket"] = highEndOfLatencyBucket; +} + +void XLatencyBucketMeasureImp::setLowEndOfLatencyBucket(XNumber lowEndOfLatencyBucket) +{ + comVals_["lowEndOfLatencyBucket"] = lowEndOfLatencyBucket; +} + +json XLatencyBucketMeasureImp::toJson() +{ + try + { + json field = { + {"countsInTheBucket", countsInTheBucket_} + }; + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XLatencyBucketMeasure to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XLatencyBucketMeasureImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XLatencyBucketMeasureImp.h new file mode 100644 index 0000000..dca5f7d --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XLatencyBucketMeasureImp.h @@ -0,0 +1,29 @@ +#pragma once + +#include "XLatencyBucketMeasure.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XLatencyBucketMeasureImp : public XLatencyBucketMeasure, public XJsonable + { + public: + XLatencyBucketMeasureImp(XNumber countsInTheBucket); + + virtual json toJson() override; + + virtual void setCountsInTheBucket(XNumber countsInTheBucket) override; + virtual void setHighEndOfLatencyBucket(XNumber highEndOfLatencyBucket) override; + virtual void setLowEndOfLatencyBucket(XNumber lowEndOfLatencyBucket) override; + + private: + //required + XNumber countsInTheBucket_; + //optional + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XLoad.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XLoad.cpp new file mode 100755 index 0000000..e1f28ea --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XLoad.cpp @@ -0,0 +1,27 @@ +#include "XLoad.h" +#include "XLoadImp.h" + +vagt::encode::XLoad::XLoad(): + imp_(make_shared()) +{ +} + +vagt::encode::XLoad::XLoad(void*) +{ + +} + +void vagt::encode::XLoad::setShortTerm(XNumber shortTerm) +{ + return imp_->setShortTerm(shortTerm); +} + +void vagt::encode::XLoad::setLongTerm(XNumber longTerm) +{ + return imp_->setLongTerm(longTerm); +} + +void vagt::encode::XLoad::setMidTerm(XNumber midTerm) +{ + return imp_->setMidTerm(midTerm); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XLoadImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XLoadImp.cpp new file mode 100755 index 0000000..548686c --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XLoadImp.cpp @@ -0,0 +1,41 @@ +#include "XLoadImp.h" + +XLoadImp::XLoadImp():XLoad(nullptr) +{ + +} + +void XLoadImp::setShortTerm(XNumber shortTerm) +{ + comVals_["shortTerm"] = shortTerm; +} + +void XLoadImp::setLongTerm(XNumber longTerm) +{ + comVals_["longTerm"] = longTerm; +} + +void XLoadImp::setMidTerm(XNumber midTerm) +{ + comVals_["midTerm"] = midTerm; +} + +json XLoadImp::toJson() +{ + try + { + json field; + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XLoad to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XLoadImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XLoadImp.h new file mode 100755 index 0000000..0983ec4 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XLoadImp.h @@ -0,0 +1,27 @@ +#pragma once + +#include "XLoad.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XLoadImp : public XLoad, public XJsonable + { + public: + XLoadImp(); + + virtual json toJson() override; + + virtual void setShortTerm(XNumber shortTerm) override; + virtual void setLongTerm(XNumber longTerm) override; + virtual void setMidTerm(XNumber midTerm) override; + + private: + //optional + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XMachineCheckException.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XMachineCheckException.cpp new file mode 100644 index 0000000..75a17fa --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XMachineCheckException.cpp @@ -0,0 +1,36 @@ +#include "XMachineCheckException.h" +#include "XMachineCheckExceptionImp.h" + +vagt::encode::XMachineCheckException::XMachineCheckException() +{ +} + +vagt::encode::XMachineCheckException::XMachineCheckException(const XString & vmIdentifier): + imp_(make_shared(vmIdentifier)) +{ +} + +void vagt::encode::XMachineCheckException::setCorrectedMemoryErrors(XNumber correctedMemoryErrors) +{ + return imp_->setCorrectedMemoryErrors(correctedMemoryErrors); +} + +void vagt::encode::XMachineCheckException::setUncorrectedMemoryErrors(XNumber uncorrectedMemoryErrors) +{ + return imp_->setUncorrectedMemoryErrors(uncorrectedMemoryErrors); +} + +void vagt::encode::XMachineCheckException::setUncorrectedMemoryErrorsIn1Hr(XNumber uncorrectedMemoryErrorsIn1Hr) +{ + return imp_->setUncorrectedMemoryErrorsIn1Hr(uncorrectedMemoryErrorsIn1Hr); +} + +void vagt::encode::XMachineCheckException::setCorrectedMemoryErrorsIn1Hr(XNumber correctedMemoryErrorsIn1Hr) +{ + return imp_->setCorrectedMemoryErrorsIn1Hr(correctedMemoryErrorsIn1Hr); +} + +void vagt::encode::XMachineCheckException::setVmIdentifier(const XString & vmIdentifier) +{ + return imp_->setVmIdentifier(vmIdentifier); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XMachineCheckExceptionImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XMachineCheckExceptionImp.cpp new file mode 100644 index 0000000..05d0e41 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XMachineCheckExceptionImp.cpp @@ -0,0 +1,54 @@ +#include "XMachineCheckExceptionImp.h" + +XMachineCheckExceptionImp::XMachineCheckExceptionImp(const XString& vmIdentifier): + vmIdentifier_(vmIdentifier) +{ + +} + +void XMachineCheckExceptionImp::setCorrectedMemoryErrors(XNumber correctedMemoryErrors) +{ + comVals_["correctedMemoryErrors"] = correctedMemoryErrors; +} + +void XMachineCheckExceptionImp::setUncorrectedMemoryErrors(XNumber uncorrectedMemoryErrors) +{ + comVals_["uncorrectedMemoryErrors"] = uncorrectedMemoryErrors; +} + +void XMachineCheckExceptionImp::setUncorrectedMemoryErrorsIn1Hr(XNumber uncorrectedMemoryErrorsIn1Hr) +{ + comVals_["uncorrectedMemoryErrorsIn1Hr"] = uncorrectedMemoryErrorsIn1Hr; +} + +void XMachineCheckExceptionImp::setCorrectedMemoryErrorsIn1Hr(XNumber correctedMemoryErrorsIn1Hr) +{ + comVals_["correctedMemoryErrorsIn1Hr"] = correctedMemoryErrorsIn1Hr; +} + +void XMachineCheckExceptionImp::setVmIdentifier(const XString& vmIdentifier) +{ + comVals_["vmIdentifier"] = vmIdentifier; +} + +json XMachineCheckExceptionImp::toJson() +{ + try + { + json field = { + {"vmIdentifier", vmIdentifier_} + }; + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XMachineCheckException to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XMachineCheckExceptionImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XMachineCheckExceptionImp.h new file mode 100644 index 0000000..8a460c1 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XMachineCheckExceptionImp.h @@ -0,0 +1,30 @@ +#pragma once + +#include "XMachineCheckException.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XMachineCheckExceptionImp : public XMachineCheckException, public XJsonable + { + public: + XMachineCheckExceptionImp(const XString& vmIdentifier); + + virtual json toJson() override; + + virtual void setCorrectedMemoryErrors(XNumber correctedMemoryErrors) override; + virtual void setUncorrectedMemoryErrors(XNumber uncorrectedMemoryErrors) override; + virtual void setUncorrectedMemoryErrorsIn1Hr(XNumber uncorrectedMemoryErrorsIn1Hr) override; + virtual void setCorrectedMemoryErrorsIn1Hr(XNumber correctedMemoryErrorsIn1Hr) override; + virtual void setVmIdentifier(const XString& vmIdentifier) override; + private: + //required + XString vmIdentifier_; + //optional + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XMeasurementFields.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XMeasurementFields.cpp new file mode 100755 index 0000000..f07f673 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XMeasurementFields.cpp @@ -0,0 +1,7 @@ +#include "XMeasurementFields.h" +#include "XMeasurementFieldsImp.h" + +std::shared_ptr vagt::encode::XMeasurementFields::create(std::shared_ptr header, XNumber measurementInterval) +{ + return std::make_shared(header, measurementInterval); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XMeasurementFieldsImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XMeasurementFieldsImp.cpp new file mode 100755 index 0000000..61efbbc --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XMeasurementFieldsImp.cpp @@ -0,0 +1,255 @@ +#include "XMeasurementFieldsImp.h" + +const std::string XEnumMeasurementFieldsMeasurementFieldsVersionMapping[] = { + "4.0" +}; + +XMeasurementFieldsImp::XMeasurementFieldsImp(std::shared_ptr header, XNumber measurementInterval): + header_(header), + measurementInterval_(measurementInterval), + measurementFieldsVersion_(XEnumMeasurementFieldsMeasurementFieldsVersion4_0) +{ + +} + +std::string XMeasurementFieldsImp::toString() +{ + try + { + auto js = toJson(); + return js.dump(); + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to dump XMeasurementFields to json string:{}.", e.what()); + return ""; + } +} + +void XMeasurementFieldsImp::setCodecUsageArray(const XArrayOfXCodecsInUse& codecUsageArray) +{ + codecUsageArray_ = codecUsageArray; +} + +void XMeasurementFieldsImp::setFeatureUsageArray(const XHashMap& featureUsageArray) +{ + featureUsageArray_ = featureUsageArray; +} + +void XMeasurementFieldsImp::setConfiguredEntities(XInteger configuredEntities) +{ + comVals_["configuredEntities"] = configuredEntities; +} + +void XMeasurementFieldsImp::setAdditionalMeasurements(const XArrayOfNamedHashMap& additionalMeasurements) +{ + additionalMeasurements_ = additionalMeasurements; +} + +void XMeasurementFieldsImp::setCpuUsageArray(const XArrayOfXCpuUsage& cpuUsageArray) +{ + cpuUsageArray_ = cpuUsageArray; +} + +void XMeasurementFieldsImp::setRequestRate(XNumber requestRate) +{ + comVals_["requestRate"] = requestRate; +} + +void XMeasurementFieldsImp::setFilesystemUsageArray(const XArrayOfXFilesystemUsage& filesystemUsageArray) +{ + filesystemUsageArray_ = filesystemUsageArray; +} + +void XMeasurementFieldsImp::setLoadArray(const XArrayOfXLoad& loadArray) +{ + loadArray_ = loadArray; +} + +void XMeasurementFieldsImp::setMeasurementInterval(XNumber measurementInterval) +{ + comVals_["measurementInterval"] = measurementInterval; +} + +void XMeasurementFieldsImp::setMachineCheckExceptionArray(const XArrayOfXMachineCheckException& machineCheckExceptionArray) +{ + machineCheckExceptionArray_ = machineCheckExceptionArray; +} + +void XMeasurementFieldsImp::setMeanRequestLatency(XNumber meanRequestLatency) +{ + comVals_["meanRequestLatency"] = meanRequestLatency; +} + +void XMeasurementFieldsImp::setConcurrentSessions(XInteger concurrentSessions) +{ + comVals_["concurrentSessions"] = concurrentSessions; +} + +void XMeasurementFieldsImp::setAdditionalFields(const XHashMap& additionalFields) +{ + additionalFields_ = additionalFields; +} + +void XMeasurementFieldsImp::setProcessStatsArray(const XArrayOfXProcessStats& processStatsArray) +{ + processStatsArray_ = processStatsArray; +} + +void XMeasurementFieldsImp::setNicPerformanceArray(const XArrayOfXNicPerformance& nicPerformanceArray) +{ + nicPerformanceArray_ = nicPerformanceArray; +} + +void XMeasurementFieldsImp::setDiskUsageArray(const XArrayOfXDiskUsage& diskUsageArray) +{ + diskUsageArray_ = diskUsageArray; +} + +void XMeasurementFieldsImp::setIpmi(const XIpmi& ipmi) +{ + ipmi_ = ipmi; +} + +void XMeasurementFieldsImp::setLatencyDistribution(const XArrayOfXLatencyBucketMeasure& latencyDistribution) +{ + latencyDistribution_ = latencyDistribution; +} + +void XMeasurementFieldsImp::setHugePagesArray(const XArrayOfXHugePages& hugePagesArray) +{ + hugePagesArray_ = hugePagesArray; +} + +void XMeasurementFieldsImp::setAdditionalObjects(const XArrayOfJsonObject& additionalObjects) +{ + additionalObjects_ = additionalObjects; +} + +void XMeasurementFieldsImp::setMemoryUsageArray(const XArrayOfXMemoryUsage& memoryUsageArray) +{ + memoryUsageArray_ = memoryUsageArray; +} + +void XMeasurementFieldsImp::setNumberOfMediaPortsInUse(XInteger numberOfMediaPortsInUse) +{ + comVals_["numberOfMediaPortsInUse"] = numberOfMediaPortsInUse; +} + +void XMeasurementFieldsImp::setNfcScalingMetric(XInteger nfcScalingMetric) +{ + comVals_["nfcScalingMetric"] = nfcScalingMetric; +} + +std::shared_ptr XMeasurementFieldsImp::getCommonHeader() +{ + return header_; +} + +json XMeasurementFieldsImp::toJson() +{ + try + { + json field = { + {"measurementFieldsVersion", XEnumMeasurementFieldsMeasurementFieldsVersionMapping[measurementFieldsVersion_]}, + {"measurementInterval", measurementInterval_} + }; + + //optional val + if (!codecUsageArray_.empty()) + { + field["codecUsageArray"] = fromArray(codecUsageArray_); + } + + if (!featureUsageArray_.empty()) + { + field["featureUsageArray"] = featureUsageArray_; + } + + if (!additionalMeasurements_.empty()) + { + field["additionalMeasurements"] = fromArray(additionalMeasurements_); + } + + if (!cpuUsageArray_.empty()) + { + field["cpuUsageArray"] = fromArray(cpuUsageArray_); + } + + if (!filesystemUsageArray_.empty()) + { + field["filesystemUsageArray"] = fromArray(filesystemUsageArray_); + } + + if (!loadArray_.empty()) + { + field["loadArray"] = fromArray(loadArray_); + } + + if (!machineCheckExceptionArray_.empty()) + { + field["machineCheckExceptionArray"] = fromArray(machineCheckExceptionArray_); + } + + if (!additionalFields_.empty()) + { + field["additionalFields"] = additionalFields_; + } + + if (!processStatsArray_.empty()) + { + field["processStatsArray"] = fromArray(processStatsArray_); + } + + if (!nicPerformanceArray_.empty()) + { + field["nicPerformanceArray"] = fromArray(nicPerformanceArray_); + } + + if (!diskUsageArray_.empty()) + { + field["diskUsageArray"] = fromArray(diskUsageArray_); + } + + auto ipmi = dynamic_pointer_cast(ipmi_.imp_); + if (ipmi && !ipmi->toJson().empty()) + { + field["ipmi"] = ipmi->toJson(); + } + + if (!latencyDistribution_.empty()) + { + field["latencyDistribution"] = fromArray(latencyDistribution_); + } + + if (!hugePagesArray_.empty()) + { + field["hugePagesArray"] = fromArray(hugePagesArray_); + } + + if (!additionalObjects_.empty()) + { + field["additionalObjects"] = fromArray(additionalObjects_); + } + + if (!memoryUsageArray_.empty()) + { + field["memoryUsageArray"] = fromArray(memoryUsageArray_); + } + + field = mergeCommonValues(field, comVals_); + + json jsEvent; + header_->setDomain(XEnumCommonEventHeaderDomainMeasurement); + jsEvent["event"]["commonEventHeader"] = dynamic_pointer_cast(header_)->toJson(); + jsEvent["event"]["measurementFields"] = field; + + return jsEvent; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XMeasurementFields to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XMeasurementFieldsImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XMeasurementFieldsImp.h new file mode 100755 index 0000000..6e543c0 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XMeasurementFieldsImp.h @@ -0,0 +1,71 @@ +#pragma once + +#include "XMeasurementFields.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XMeasurementFieldsImp : public XMeasurementFields, public XJsonable + { + public: + XMeasurementFieldsImp(std::shared_ptr header, XNumber measurementInterval); + + virtual std::string toString() override; + + virtual json toJson() override; + + virtual std::shared_ptr getCommonHeader() override; + + virtual void setCodecUsageArray(const XArrayOfXCodecsInUse& codecUsageArray) override; + virtual void setFeatureUsageArray(const XHashMap& featureUsageArray) override; + virtual void setConfiguredEntities(XInteger configuredEntities) override; + virtual void setAdditionalMeasurements(const XArrayOfNamedHashMap& additionalMeasurements) override; + virtual void setCpuUsageArray(const XArrayOfXCpuUsage& cpuUsageArray) override; + virtual void setRequestRate(XNumber requestRate) override; + virtual void setFilesystemUsageArray(const XArrayOfXFilesystemUsage& filesystemUsageArray) override; + virtual void setLoadArray(const XArrayOfXLoad& loadArray) override; + virtual void setMeasurementInterval(XNumber measurementInterval) override; + virtual void setMachineCheckExceptionArray(const XArrayOfXMachineCheckException& machineCheckExceptionArray) override; + virtual void setMeanRequestLatency(XNumber meanRequestLatency) override; + virtual void setConcurrentSessions(XInteger concurrentSessions) override; + virtual void setAdditionalFields(const XHashMap& additionalFields) override; + virtual void setProcessStatsArray(const XArrayOfXProcessStats& processStatsArray) override; + virtual void setNicPerformanceArray(const XArrayOfXNicPerformance& nicPerformanceArray) override; + virtual void setDiskUsageArray(const XArrayOfXDiskUsage& diskUsageArray) override; + virtual void setIpmi(const XIpmi& ipmi) override; + virtual void setLatencyDistribution(const XArrayOfXLatencyBucketMeasure& latencyDistribution) override; + virtual void setHugePagesArray(const XArrayOfXHugePages& hugePagesArray) override; + virtual void setAdditionalObjects(const XArrayOfJsonObject& additionalObjects) override; + virtual void setMemoryUsageArray(const XArrayOfXMemoryUsage& memoryUsageArray) override; + virtual void setNumberOfMediaPortsInUse(XInteger numberOfMediaPortsInUse) override; + virtual void setNfcScalingMetric(XInteger nfcScalingMetric) override; + + private: + //required + std::shared_ptr header_; + XEnumMeasurementFieldsMeasurementFieldsVersion measurementFieldsVersion_; + XNumber measurementInterval_; + //optional + XArrayOfXCodecsInUse codecUsageArray_; + XHashMap featureUsageArray_; + XArrayOfNamedHashMap additionalMeasurements_; + XArrayOfXCpuUsage cpuUsageArray_; + XArrayOfXFilesystemUsage filesystemUsageArray_; + XArrayOfXLoad loadArray_; + XArrayOfXMachineCheckException machineCheckExceptionArray_; + XHashMap additionalFields_; + XArrayOfXProcessStats processStatsArray_; + XArrayOfXNicPerformance nicPerformanceArray_; + XArrayOfXDiskUsage diskUsageArray_; + XIpmi ipmi_; + XArrayOfXLatencyBucketMeasure latencyDistribution_; + XArrayOfXHugePages hugePagesArray_; + XArrayOfJsonObject additionalObjects_; + XArrayOfXMemoryUsage memoryUsageArray_; + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XMemoryUsage.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XMemoryUsage.cpp new file mode 100644 index 0000000..a5f68f3 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XMemoryUsage.cpp @@ -0,0 +1,96 @@ +#include "XMemoryUsage.h" +#include "XMemoryUsageImp.h" + +vagt::encode::XMemoryUsage::XMemoryUsage() +{ +} + +vagt::encode::XMemoryUsage::XMemoryUsage(const XString & vmIdentifier, XNumber memoryFree, XNumber memoryUsed): + imp_(make_shared(vmIdentifier, memoryFree, memoryUsed)) +{ +} + +void vagt::encode::XMemoryUsage::setMemorySwapInAvg(XNumber memorySwapInAvg) +{ + return imp_->setMemorySwapInAvg(memorySwapInAvg); +} + +void vagt::encode::XMemoryUsage::setMemorySwapUsedAvg(XNumber memorySwapUsedAvg) +{ + return imp_->setMemorySwapUsedAvg(memorySwapUsedAvg); +} + +void vagt::encode::XMemoryUsage::setMemorySlabRecl(XNumber memorySlabRecl) +{ + return imp_->setMemorySlabRecl(memorySlabRecl); +} + +void vagt::encode::XMemoryUsage::setMemorySwapInRateAvg(XNumber memorySwapInRateAvg) +{ + return imp_->setMemorySwapInRateAvg(memorySwapInRateAvg); +} + +void vagt::encode::XMemoryUsage::setMemoryDemand(XNumber memoryDemand) +{ + return imp_->setMemoryDemand(memoryDemand); +} + +void vagt::encode::XMemoryUsage::setMemoryConfigured(XNumber memoryConfigured) +{ + return imp_->setMemoryConfigured(memoryConfigured); +} + +void vagt::encode::XMemoryUsage::setMemorySharedAvg(XNumber memorySharedAvg) +{ + return imp_->setMemorySharedAvg(memorySharedAvg); +} + +void vagt::encode::XMemoryUsage::setVmIdentifier(const XString & vmIdentifier) +{ + return imp_->setVmIdentifier(vmIdentifier); +} + +void vagt::encode::XMemoryUsage::setMemoryLatencyAvg(XNumber memoryLatencyAvg) +{ + return imp_->setMemoryLatencyAvg(memoryLatencyAvg); +} + +void vagt::encode::XMemoryUsage::setMemorySwapOutAvg(XNumber memorySwapOutAvg) +{ + return imp_->setMemorySwapOutAvg(memorySwapOutAvg); +} + +void vagt::encode::XMemoryUsage::setMemorySwapOutRateAvg(XNumber memorySwapOutRateAvg) +{ + return imp_->setMemorySwapOutRateAvg(memorySwapOutRateAvg); +} + +void vagt::encode::XMemoryUsage::setMemoryFree(XNumber memoryFree) +{ + return imp_->setMemoryFree(memoryFree); +} + +void vagt::encode::XMemoryUsage::setMemorySlabUnrecl(XNumber memorySlabUnrecl) +{ + return imp_->setMemorySlabUnrecl(memorySlabUnrecl); +} + +void vagt::encode::XMemoryUsage::setMemoryCached(XNumber memoryCached) +{ + return imp_->setMemoryCached(memoryCached); +} + +void vagt::encode::XMemoryUsage::setMemoryUsed(XNumber memoryUsed) +{ + return imp_->setMemoryUsed(memoryUsed); +} + +void vagt::encode::XMemoryUsage::setMemoryBuffered(XNumber memoryBuffered) +{ + return imp_->setMemoryBuffered(memoryBuffered); +} + +void vagt::encode::XMemoryUsage::setPercentMemoryUsage(XNumber percentMemoryUsage) +{ + return imp_->setPercentMemoryUsage(percentMemoryUsage); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XMemoryUsageImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XMemoryUsageImp.cpp new file mode 100644 index 0000000..d0b9245 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XMemoryUsageImp.cpp @@ -0,0 +1,121 @@ +#include "XMemoryUsageImp.h" + +XMemoryUsageImp::XMemoryUsageImp(const XString& vmIdentifier, + XNumber memoryFree, + XNumber memoryUsed + ): + memoryFree_(memoryFree), + memoryUsed_(memoryUsed), + vmIdentifier_(vmIdentifier) +{ + +} + +void XMemoryUsageImp::setMemorySwapInAvg(XNumber memorySwapInAvg) +{ + comVals_["memorySwapInAvg"] = memorySwapInAvg; +} + +void XMemoryUsageImp::setMemorySwapUsedAvg(XNumber memorySwapUsedAvg) +{ + comVals_["memorySwapUsedAvg"] = memorySwapUsedAvg; +} + +void XMemoryUsageImp::setMemorySlabRecl(XNumber memorySlabRecl) +{ + comVals_["memorySlabRecl"] = memorySlabRecl; +} + +void XMemoryUsageImp::setMemorySwapInRateAvg(XNumber memorySwapInRateAvg) +{ + comVals_["memorySwapInRateAvg"] = memorySwapInRateAvg; +} + +void XMemoryUsageImp::setMemoryDemand(XNumber memoryDemand) +{ + comVals_["memoryDemand"] = memoryDemand; +} + +void XMemoryUsageImp::setMemoryConfigured(XNumber memoryConfigured) +{ + comVals_["memoryConfigured"] = memoryConfigured; +} + +void XMemoryUsageImp::setMemorySharedAvg(XNumber memorySharedAvg) +{ + comVals_["memorySharedAvg"] = memorySharedAvg; +} + +void XMemoryUsageImp::setVmIdentifier(const XString& vmIdentifier) +{ + comVals_["vmIdentifier"] = vmIdentifier; +} + +void XMemoryUsageImp::setMemoryLatencyAvg(XNumber memoryLatencyAvg) +{ + comVals_["memoryLatencyAvg"] = memoryLatencyAvg; +} + +void XMemoryUsageImp::setMemorySwapOutAvg(XNumber memorySwapOutAvg) +{ + comVals_["memorySwapOutAvg"] = memorySwapOutAvg; +} + +void XMemoryUsageImp::setMemorySwapOutRateAvg(XNumber memorySwapOutRateAvg) +{ + comVals_["memorySwapOutRateAvg"] = memorySwapOutRateAvg; +} + +void XMemoryUsageImp::setMemoryFree(XNumber memoryFree) +{ + comVals_["memoryFree"] = memoryFree; +} + +void XMemoryUsageImp::setMemorySlabUnrecl(XNumber memorySlabUnrecl) +{ + comVals_["memorySlabUnrecl"] = memorySlabUnrecl; +} + +void XMemoryUsageImp::setMemoryCached(XNumber memoryCached) +{ + comVals_["memoryCached"] = memoryCached; +} + +void XMemoryUsageImp::setMemoryUsed(XNumber memoryUsed) +{ + comVals_["memoryUsed"] = memoryUsed; +} + +void XMemoryUsageImp::setMemoryBuffered(XNumber memoryBuffered) +{ + comVals_["memoryBuffered"] = memoryBuffered; +} + +void XMemoryUsageImp::setPercentMemoryUsage(XNumber percentMemoryUsage) +{ + comVals_["percentMemoryUsage"] = percentMemoryUsage; +} + +json XMemoryUsageImp::toJson() +{ + try + { + json field = { + {"vmIdentifier", vmIdentifier_}, + {"memoryFree", memoryFree_}, + {"memoryUsed", memoryUsed_} + }; + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XMemoryUsage to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XMemoryUsageImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XMemoryUsageImp.h new file mode 100644 index 0000000..5cbe923 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XMemoryUsageImp.h @@ -0,0 +1,47 @@ +#pragma once + +#include "XMemoryUsage.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XMemoryUsageImp : public XMemoryUsage, public XJsonable + { + public: + XMemoryUsageImp(const XString& vmIdentifier, + XNumber memoryFree, + XNumber memoryUsed); + + virtual json toJson() override; + + virtual void setMemorySwapInAvg(XNumber memorySwapInAvg) override ; + virtual void setMemorySwapUsedAvg(XNumber memorySwapUsedAvg) override ; + virtual void setMemorySlabRecl(XNumber memorySlabRecl) override ; + virtual void setMemorySwapInRateAvg(XNumber memorySwapInRateAvg) override ; + virtual void setMemoryDemand(XNumber memoryDemand) override ; + virtual void setMemoryConfigured(XNumber memoryConfigured) override ; + virtual void setMemorySharedAvg(XNumber memorySharedAvg) override ; + virtual void setVmIdentifier(const XString& vmIdentifier) override ; + virtual void setMemoryLatencyAvg(XNumber memoryLatencyAvg) override ; + virtual void setMemorySwapOutAvg(XNumber memorySwapOutAvg) override ; + virtual void setMemorySwapOutRateAvg(XNumber memorySwapOutRateAvg) override ; + virtual void setMemoryFree(XNumber memoryFree) override ; + virtual void setMemorySlabUnrecl(XNumber memorySlabUnrecl) override ; + virtual void setMemoryCached(XNumber memoryCached) override ; + virtual void setMemoryUsed(XNumber memoryUsed) override ; + virtual void setMemoryBuffered(XNumber memoryBuffered) override ; + virtual void setPercentMemoryUsage(XNumber percentMemoryUsage) override ; + + private: + //required + XString vmIdentifier_; + XNumber memoryFree_; + XNumber memoryUsed_; + //optional + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XMobileFlowFields.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XMobileFlowFields.cpp new file mode 100755 index 0000000..90d31da --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XMobileFlowFields.cpp @@ -0,0 +1,15 @@ +#include "XMobileFlowFields.h" +#include "XMobileFlowFieldsImp.h" + +std::shared_ptr vagt::encode::XMobileFlowFields::create(std::shared_ptr header, const XString & flowDirection, const XGtpPerFlowMetrics & gtpPerFlowMetrics, const XString & ipProtocolType, const XString & ipVersion, const XString & otherEndpointIpAddress, XInteger otherEndpointPort, const XString & reportingEndpointIpAddr, XInteger reportingEndpointPort) +{ + return std::make_shared(header, + flowDirection, + gtpPerFlowMetrics, + ipProtocolType, + ipVersion, + otherEndpointIpAddress, + otherEndpointPort, + reportingEndpointIpAddr, + reportingEndpointPort); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XMobileFlowFieldsImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XMobileFlowFieldsImp.cpp new file mode 100755 index 0000000..8889db9 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XMobileFlowFieldsImp.cpp @@ -0,0 +1,246 @@ +#include "XMobileFlowFieldsImp.h" + +const std::string XEnumMobileFlowFieldsMobileFlowFieldsVersionMapping[] = { + "4.0" +}; + +XMobileFlowFieldsImp::XMobileFlowFieldsImp(std::shared_ptr header, + const XString& flowDirection, + const XGtpPerFlowMetrics& gtpPerFlowMetrics, + const XString& ipProtocolType, + const XString& ipVersion, + const XString& otherEndpointIpAddress, + XInteger otherEndpointPort, + const XString& reportingEndpointIpAddr, + XInteger reportingEndpointPort + ): + header_(header), + flowDirection_(flowDirection), + gtpPerFlowMetrics_(gtpPerFlowMetrics), + ipProtocolType_(ipProtocolType), + ipVersion_(ipVersion), + mobileFlowFieldsVersion_(XEnumMobileFlowFieldsMobileFlowFieldsVersion4_0), + otherEndpointIpAddress_(otherEndpointIpAddress), + otherEndpointPort_(otherEndpointPort), + reportingEndpointIpAddr_(reportingEndpointIpAddr), + reportingEndpointPort_(reportingEndpointPort) +{ + +} + +std::string XMobileFlowFieldsImp::toString() +{ + try + { + auto js = toJson(); + return js.dump(); + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to dump XMobileFlowFields to json string:{}.", e.what()); + return ""; + } +} + +void XMobileFlowFieldsImp::setRac(const XString& rac) +{ + comVals_["rac"] = rac; +} + +void XMobileFlowFieldsImp::setSac(const XString& sac) +{ + comVals_["sac"] = sac; +} + +void XMobileFlowFieldsImp::setSamplingAlgorithm(XInteger samplingAlgorithm) +{ + comVals_["samplingAlgorithm"] = samplingAlgorithm; +} + +void XMobileFlowFieldsImp::setIpVersion(const XString& ipVersion) +{ + comVals_["ipVersion"] = ipVersion; +} + +void XMobileFlowFieldsImp::setGtpPerFlowMetrics(const XGtpPerFlowMetrics& gtpPerFlowMetrics) +{ + gtpPerFlowMetrics_ = gtpPerFlowMetrics; +} + +void XMobileFlowFieldsImp::setTac(const XString& tac) +{ + comVals_["tac"] = tac; +} + +void XMobileFlowFieldsImp::setMnc(const XString& mnc) +{ + comVals_["mnc"] = mnc; +} + +void XMobileFlowFieldsImp::setTunnelId(const XString& tunnelId) +{ + comVals_["tunnelId"] = tunnelId; +} + +void XMobileFlowFieldsImp::setAppProtocolVersion(const XString& appProtocolVersion) +{ + comVals_["appProtocolVersion"] = appProtocolVersion; +} + +void XMobileFlowFieldsImp::setGtpVersion(const XString& gtpVersion) +{ + comVals_["gtpVersion"] = gtpVersion; +} + +void XMobileFlowFieldsImp::setConnectionType(const XString& connectionType) +{ + comVals_["connectionType"] = connectionType; +} + +void XMobileFlowFieldsImp::setAdditionalFields(const XHashMap& additionalFields) +{ + additionalFields_ = additionalFields; +} + +void XMobileFlowFieldsImp::setHttpHeader(const XString& httpHeader) +{ + comVals_["httpHeader"] = httpHeader; +} + +void XMobileFlowFieldsImp::setImsi(const XString& imsi) +{ + comVals_["imsi"] = imsi; +} + +void XMobileFlowFieldsImp::setApplicationType(const XString& applicationType) +{ + comVals_["applicationType"] = applicationType; +} + +void XMobileFlowFieldsImp::setMsisdn(const XString& msisdn) +{ + comVals_["msisdn"] = msisdn; +} + +void XMobileFlowFieldsImp::setMcc(const XString& mcc) +{ + comVals_["mcc"] = mcc; +} + +void XMobileFlowFieldsImp::setFlowDirection(const XString& flowDirection) +{ + comVals_["flowDirection"] = flowDirection; +} + +void XMobileFlowFieldsImp::setLac(const XString& lac) +{ + comVals_["lac"] = lac; +} + +void XMobileFlowFieldsImp::setOtherEndpointPort(XInteger otherEndpointPort) +{ + comVals_["otherEndpointPort"] = otherEndpointPort; +} + +void XMobileFlowFieldsImp::setVlanId(const XString& vlanId) +{ + comVals_["vlanId"] = vlanId; +} + +void XMobileFlowFieldsImp::setImei(const XString& imei) +{ + comVals_["imei"] = imei; +} + +void XMobileFlowFieldsImp::setGtpProtocolType(const XString& gtpProtocolType) +{ + comVals_["gtpProtocolType"] = gtpProtocolType; +} + +void XMobileFlowFieldsImp::setEcgi(const XString& ecgi) +{ + comVals_["ecgi"] = ecgi; +} + +void XMobileFlowFieldsImp::setCid(const XString& cid) +{ + comVals_["cid"] = cid; +} + +void XMobileFlowFieldsImp::setReportingEndpointPort(XInteger reportingEndpointPort) +{ + comVals_["reportingEndpointPort"] = reportingEndpointPort; +} + +void XMobileFlowFieldsImp::setRadioAccessTechnology(const XString& radioAccessTechnology) +{ + comVals_["radioAccessTechnology"] = radioAccessTechnology; +} + +void XMobileFlowFieldsImp::setAppProtocolType(const XString& appProtocolType) +{ + comVals_["appProtocolType"] = appProtocolType; +} + +void XMobileFlowFieldsImp::setOtherEndpointIpAddress(const XString& otherEndpointIpAddress) +{ + comVals_["otherEndpointIpAddress"] = otherEndpointIpAddress; +} + +void XMobileFlowFieldsImp::setIpProtocolType(const XString& ipProtocolType) +{ + comVals_["ipProtocolType"] = ipProtocolType; +} + +void XMobileFlowFieldsImp::setOtherFunctionalRole(const XString& otherFunctionalRole) +{ + comVals_["otherFunctionalRole"] = otherFunctionalRole; +} + +void XMobileFlowFieldsImp::setReportingEndpointIpAddr(const XString& reportingEndpointIpAddr) +{ + comVals_["reportingEndpointIpAddr"] = reportingEndpointIpAddr; +} + +json XMobileFlowFieldsImp::toJson() +{ + try + { + json field = { + {"ipVersion", ipVersion_}, + {"mobileFlowFieldsVersion", XEnumMobileFlowFieldsMobileFlowFieldsVersionMapping[mobileFlowFieldsVersion_]}, + {"gtpPerFlowMetrics", dynamic_pointer_cast(gtpPerFlowMetrics_.imp_)->toJson()}, + {"flowDirection", flowDirection_}, + {"otherEndpointPort", otherEndpointPort_}, + {"reportingEndpointPort", reportingEndpointPort_}, + {"otherEndpointIpAddress", otherEndpointIpAddress_}, + {"ipProtocolType", ipProtocolType_}, + {"reportingEndpointIpAddr", reportingEndpointIpAddr_} + }; + + //optional val + if (!additionalFields_.empty()) + { + field["additionalFields"] = additionalFields_; + } + field = mergeCommonValues(field, comVals_); + + json jsEvent; + header_->setDomain(XEnumCommonEventHeaderDomainMobileFlow); + jsEvent["event"]["commonEventHeader"] = dynamic_pointer_cast(header_)->toJson(); + jsEvent["event"]["mobileFlowFields"] = field; + + return jsEvent; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XMobileFlowFields to json object:{}.", e.what()); + return json(); + } +} + +std::shared_ptr XMobileFlowFieldsImp::getCommonHeader() +{ + return header_; +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XMobileFlowFieldsImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XMobileFlowFieldsImp.h new file mode 100755 index 0000000..55b81b3 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XMobileFlowFieldsImp.h @@ -0,0 +1,80 @@ +#pragma once + +#include "XMobileFlowFields.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XMobileFlowFieldsImp : public XMobileFlowFields, public XJsonable + { + public: + XMobileFlowFieldsImp(std::shared_ptr header, + const XString& flowDirection, + const XGtpPerFlowMetrics& gtpPerFlowMetrics, + const XString& ipProtocolType, + const XString& ipVersion, + const XString& otherEndpointIpAddress, + XInteger otherEndpointPort, + const XString& reportingEndpointIpAddr, + XInteger reportingEndpointPort); + + virtual std::string toString() override; + + virtual json toJson() override; + + virtual std::shared_ptr getCommonHeader() override; + + virtual void setRac(const XString& rac) override; + virtual void setSac(const XString& sac) override; + virtual void setSamplingAlgorithm(XInteger samplingAlgorithm) override; + virtual void setIpVersion(const XString& ipVersion) override; + virtual void setGtpPerFlowMetrics(const XGtpPerFlowMetrics& gtpPerFlowMetrics) override; + virtual void setTac(const XString& tac) override; + virtual void setMnc(const XString& mnc) override; + virtual void setTunnelId(const XString& tunnelId) override; + virtual void setAppProtocolVersion(const XString& appProtocolVersion) override; + virtual void setGtpVersion(const XString& gtpVersion) override; + virtual void setConnectionType(const XString& connectionType) override; + virtual void setAdditionalFields(const XHashMap& additionalFields) override; + virtual void setHttpHeader(const XString& httpHeader) override; + virtual void setImsi(const XString& imsi) override; + virtual void setApplicationType(const XString& applicationType) override; + virtual void setMsisdn(const XString& msisdn) override; + virtual void setMcc(const XString& mcc) override; + virtual void setFlowDirection(const XString& flowDirection) override; + virtual void setLac(const XString& lac) override; + virtual void setOtherEndpointPort(XInteger otherEndpointPort) override; + virtual void setVlanId(const XString& vlanId) override; + virtual void setImei(const XString& imei) override; + virtual void setGtpProtocolType(const XString& gtpProtocolType) override; + virtual void setEcgi(const XString& ecgi) override; + virtual void setCid(const XString& cid) override; + virtual void setReportingEndpointPort(XInteger reportingEndpointPort) override; + virtual void setRadioAccessTechnology(const XString& radioAccessTechnology) override; + virtual void setAppProtocolType(const XString& appProtocolType) override; + virtual void setOtherEndpointIpAddress(const XString& otherEndpointIpAddress) override; + virtual void setIpProtocolType(const XString& ipProtocolType) override; + virtual void setOtherFunctionalRole(const XString& otherFunctionalRole) override; + virtual void setReportingEndpointIpAddr(const XString& reportingEndpointIpAddr) override; + + private: + //required + std::shared_ptr header_; + XString ipVersion_; + XEnumMobileFlowFieldsMobileFlowFieldsVersion mobileFlowFieldsVersion_; + XGtpPerFlowMetrics gtpPerFlowMetrics_; + XString flowDirection_; + XInteger otherEndpointPort_; + XInteger reportingEndpointPort_; + XString otherEndpointIpAddress_; + XString ipProtocolType_; + XString reportingEndpointIpAddr_; + //optional + XHashMap additionalFields_; + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XNamedHashMap.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XNamedHashMap.cpp new file mode 100755 index 0000000..6f23383 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XNamedHashMap.cpp @@ -0,0 +1,21 @@ +#include "XNamedHashMap.h" +#include "XNamedHashMapImp.h" + +vagt::encode::XNamedHashMap::XNamedHashMap() +{ +} + +vagt::encode::XNamedHashMap::XNamedHashMap(const XString & name, const XHashMap & hashMap): + imp_(make_shared(name, hashMap)) +{ +} + +void vagt::encode::XNamedHashMap::setName(const XString & name) +{ + return imp_->setName(name); +} + +void vagt::encode::XNamedHashMap::setHashMap(const XHashMap & hashMap) +{ + return imp_->setHashMap(hashMap); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XNamedHashMapImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XNamedHashMapImp.cpp new file mode 100755 index 0000000..1c32d85 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XNamedHashMapImp.cpp @@ -0,0 +1,42 @@ +#include "XNamedHashMapImp.h" + +XNamedHashMapImp::XNamedHashMapImp(const XString& name, + const XHashMap& hashMap): + name_(name), + hashMap_(hashMap) +{ + +} + +void XNamedHashMapImp::setName(const XString& name) +{ + comVals_["name"] = name; +} + +void XNamedHashMapImp::setHashMap(const XHashMap& hashMap) +{ + hashMap_ = hashMap; +} + +json XNamedHashMapImp::toJson() +{ + try + { + json field = { + {"name", name_}, + {"hashMap", hashMap_} + }; + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XNamedHashMap to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XNamedHashMapImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XNamedHashMapImp.h new file mode 100755 index 0000000..98ba257 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XNamedHashMapImp.h @@ -0,0 +1,30 @@ +#pragma once + +#include "XNamedHashMap.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XNamedHashMapImp : public XNamedHashMap, public XJsonable + { + public: + XNamedHashMapImp(const XString& name, + const XHashMap& hashMap); + + virtual json toJson() override; + + virtual void setName(const XString& name) override; + virtual void setHashMap(const XHashMap& hashMap) override; + + private: + //required + XString name_; + XHashMap hashMap_; + + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XNicPerformance.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XNicPerformance.cpp new file mode 100755 index 0000000..5e16c63 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XNicPerformance.cpp @@ -0,0 +1,206 @@ +#include "XNicPerformance.h" +#include "XNicPerformanceImp.h" + +vagt::encode::XNicPerformance::XNicPerformance() +{ +} + +vagt::encode::XNicPerformance::XNicPerformance(const XString & nicIdentifier, XEnumNicPerformanceValuesAreSuspect valuesAreSuspect): + imp_(make_shared(nicIdentifier, valuesAreSuspect)) +{ +} + +void vagt::encode::XNicPerformance::setTransmittedErrorPacketsDelta(XNumber transmittedErrorPacketsDelta) +{ + return imp_->setTransmittedErrorPacketsDelta(transmittedErrorPacketsDelta); +} + +void vagt::encode::XNicPerformance::setReceivedErrorPacketsAccumulated(XNumber receivedErrorPacketsAccumulated) +{ + return imp_->setReceivedErrorPacketsAccumulated(receivedErrorPacketsAccumulated); +} + +void vagt::encode::XNicPerformance::setTransmittedDiscardedPacketsDelta(XNumber transmittedDiscardedPacketsDelta) +{ + return imp_->setTransmittedDiscardedPacketsDelta(transmittedDiscardedPacketsDelta); +} + +void vagt::encode::XNicPerformance::setReceivedOctetsDelta(XNumber receivedOctetsDelta) +{ + return imp_->setReceivedOctetsDelta(receivedOctetsDelta); +} + +void vagt::encode::XNicPerformance::setReceivedMulticastPacketsDelta(XNumber receivedMulticastPacketsDelta) +{ + return imp_->setReceivedMulticastPacketsDelta(receivedMulticastPacketsDelta); +} + +void vagt::encode::XNicPerformance::setTransmittedDiscardedPacketsAccumulated(XNumber transmittedDiscardedPacketsAccumulated) +{ + return imp_->setTransmittedDiscardedPacketsAccumulated(transmittedDiscardedPacketsAccumulated); +} + +void vagt::encode::XNicPerformance::setTransmittedMulticastPacketsAccumulated(XNumber transmittedMulticastPacketsAccumulated) +{ + return imp_->setTransmittedMulticastPacketsAccumulated(transmittedMulticastPacketsAccumulated); +} + +void vagt::encode::XNicPerformance::setReceivedDiscardedPacketsDelta(XNumber receivedDiscardedPacketsDelta) +{ + return imp_->setReceivedDiscardedPacketsDelta(receivedDiscardedPacketsDelta); +} + +void vagt::encode::XNicPerformance::setReceivedOctetsAccumulated(XNumber receivedOctetsAccumulated) +{ + return imp_->setReceivedOctetsAccumulated(receivedOctetsAccumulated); +} + +void vagt::encode::XNicPerformance::setTransmittedTotalPacketsAccumulated(XNumber transmittedTotalPacketsAccumulated) +{ + return imp_->setTransmittedTotalPacketsAccumulated(transmittedTotalPacketsAccumulated); +} + +void vagt::encode::XNicPerformance::setTransmittedOctetsAccumulated(XNumber transmittedOctetsAccumulated) +{ + return imp_->setTransmittedOctetsAccumulated(transmittedOctetsAccumulated); +} + +void vagt::encode::XNicPerformance::setSpeed(XNumber speed) +{ + return imp_->setSpeed(speed); +} + +void vagt::encode::XNicPerformance::setReceivedDiscardedPacketsAccumulated(XNumber receivedDiscardedPacketsAccumulated) +{ + return imp_->setReceivedDiscardedPacketsAccumulated(receivedDiscardedPacketsAccumulated); +} + +void vagt::encode::XNicPerformance::setReceivedBroadcastPacketsDelta(XNumber receivedBroadcastPacketsDelta) +{ + return imp_->setReceivedBroadcastPacketsDelta(receivedBroadcastPacketsDelta); +} + +void vagt::encode::XNicPerformance::setReceivedPercentDiscard(XNumber receivedPercentDiscard) +{ + return imp_->setReceivedPercentDiscard(receivedPercentDiscard); +} + +void vagt::encode::XNicPerformance::setValuesAreSuspect(XEnumNicPerformanceValuesAreSuspect valuesAreSuspect) +{ + return imp_->setValuesAreSuspect(valuesAreSuspect); +} + +void vagt::encode::XNicPerformance::setTransmittedPercentDiscard(XNumber transmittedPercentDiscard) +{ + return imp_->setTransmittedPercentDiscard(transmittedPercentDiscard); +} + +void vagt::encode::XNicPerformance::setTransmittedErrorPacketsAccumulated(XNumber transmittedErrorPacketsAccumulated) +{ + return imp_->setTransmittedErrorPacketsAccumulated(transmittedErrorPacketsAccumulated); +} + +void vagt::encode::XNicPerformance::setTransmittedBroadcastPacketsAccumulated(XNumber transmittedBroadcastPacketsAccumulated) +{ + return imp_->setTransmittedBroadcastPacketsAccumulated(transmittedBroadcastPacketsAccumulated); +} + +void vagt::encode::XNicPerformance::setReceivedTotalPacketsAccumulated(XNumber receivedTotalPacketsAccumulated) +{ + return imp_->setReceivedTotalPacketsAccumulated(receivedTotalPacketsAccumulated); +} + +void vagt::encode::XNicPerformance::setReceivedUnicastPacketsAccumulated(XNumber receivedUnicastPacketsAccumulated) +{ + return imp_->setReceivedUnicastPacketsAccumulated(receivedUnicastPacketsAccumulated); +} + +void vagt::encode::XNicPerformance::setTransmittedBroadcastPacketsDelta(XNumber transmittedBroadcastPacketsDelta) +{ + return imp_->setTransmittedBroadcastPacketsDelta(transmittedBroadcastPacketsDelta); +} + +void vagt::encode::XNicPerformance::setTransmittedMulticastPacketsDelta(XNumber transmittedMulticastPacketsDelta) +{ + return imp_->setTransmittedMulticastPacketsDelta(transmittedMulticastPacketsDelta); +} + +void vagt::encode::XNicPerformance::setReceivedMulticastPacketsAccumulated(XNumber receivedMulticastPacketsAccumulated) +{ + return imp_->setReceivedMulticastPacketsAccumulated(receivedMulticastPacketsAccumulated); +} + +void vagt::encode::XNicPerformance::setReceivedTotalPacketsDelta(XNumber receivedTotalPacketsDelta) +{ + return imp_->setReceivedTotalPacketsDelta(receivedTotalPacketsDelta); +} + +void vagt::encode::XNicPerformance::setReceivedPercentError(XNumber receivedPercentError) +{ + return imp_->setReceivedPercentError(receivedPercentError); +} + +void vagt::encode::XNicPerformance::setReceivedErrorPacketsDelta(XNumber receivedErrorPacketsDelta) +{ + return imp_->setReceivedErrorPacketsDelta(receivedErrorPacketsDelta); +} + +void vagt::encode::XNicPerformance::setTransmittedOctetsDelta(XNumber transmittedOctetsDelta) +{ + return imp_->setTransmittedOctetsDelta(transmittedOctetsDelta); +} + +void vagt::encode::XNicPerformance::setNicIdentifier(const XString & nicIdentifier) +{ + return imp_->setNicIdentifier(nicIdentifier); +} + +void vagt::encode::XNicPerformance::setOperationalState(XEnumNicPerformanceOperationalState operationalState) +{ + return imp_->setOperationalState(operationalState); +} + +void vagt::encode::XNicPerformance::setTransmittedUnicastPacketsAccumulated(XNumber transmittedUnicastPacketsAccumulated) +{ + return imp_->setTransmittedUnicastPacketsAccumulated(transmittedUnicastPacketsAccumulated); +} + +void vagt::encode::XNicPerformance::setReceivedUnicastPacketsDelta(XNumber receivedUnicastPacketsDelta) +{ + return imp_->setReceivedUnicastPacketsDelta(receivedUnicastPacketsDelta); +} + +void vagt::encode::XNicPerformance::setTransmittedUtilization(XNumber transmittedUtilization) +{ + return imp_->setTransmittedUtilization(transmittedUtilization); +} + +void vagt::encode::XNicPerformance::setReceivedBroadcastPacketsAccumulated(XNumber receivedBroadcastPacketsAccumulated) +{ + return imp_->setReceivedBroadcastPacketsAccumulated(receivedBroadcastPacketsAccumulated); +} + +void vagt::encode::XNicPerformance::setTransmittedUnicastPacketsDelta(XNumber transmittedUnicastPacketsDelta) +{ + return imp_->setTransmittedUnicastPacketsDelta(transmittedUnicastPacketsDelta); +} + +void vagt::encode::XNicPerformance::setReceivedUtilization(XNumber receivedUtilization) +{ + return imp_->setReceivedUtilization(receivedUtilization); +} + +void vagt::encode::XNicPerformance::setAdministrativeState(XEnumNicPerformanceAdministrativeState administrativeState) +{ + return imp_->setAdministrativeState(administrativeState); +} + +void vagt::encode::XNicPerformance::setTransmittedPercentError(XNumber transmittedPercentError) +{ + return imp_->setTransmittedPercentError(transmittedPercentError); +} + +void vagt::encode::XNicPerformance::setTransmittedTotalPacketsDelta(XNumber transmittedTotalPacketsDelta) +{ + return imp_->setTransmittedTotalPacketsDelta(transmittedTotalPacketsDelta); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XNicPerformanceImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XNicPerformanceImp.cpp new file mode 100755 index 0000000..9ea4dec --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XNicPerformanceImp.cpp @@ -0,0 +1,246 @@ +#include "XNicPerformanceImp.h" + +const std::string XEnumNicPerformanceValuesAreSuspectMapping[] = { + "true", + "false" +}; + +const std::string XEnumNicPerformanceOperationalStateMapping[] = { + "inService", + "outOfService" +}; + +const std::string XEnumNicPerformanceAdministrativeStateMapping[] = { + "inService", + "outOfService" +}; + +XNicPerformanceImp::XNicPerformanceImp(const XString& nicIdentifier, + XEnumNicPerformanceValuesAreSuspect valuesAreSuspect): + nicIdentifier_(nicIdentifier), + valuesAreSuspect_(valuesAreSuspect) +{ + +} + + +void XNicPerformanceImp::setTransmittedErrorPacketsDelta(XNumber transmittedErrorPacketsDelta) +{ + comVals_["transmittedErrorPacketsDelta"] = transmittedErrorPacketsDelta; +} + +void XNicPerformanceImp::setReceivedErrorPacketsAccumulated(XNumber receivedErrorPacketsAccumulated) +{ + comVals_["receivedErrorPacketsAccumulated"] = receivedErrorPacketsAccumulated; +} + +void XNicPerformanceImp::setTransmittedDiscardedPacketsDelta(XNumber transmittedDiscardedPacketsDelta) +{ + comVals_["transmittedDiscardedPacketsDelta"] = transmittedDiscardedPacketsDelta; +} + +void XNicPerformanceImp::setReceivedOctetsDelta(XNumber receivedOctetsDelta) +{ + comVals_["receivedOctetsDelta"] = receivedOctetsDelta; +} + +void XNicPerformanceImp::setReceivedMulticastPacketsDelta(XNumber receivedMulticastPacketsDelta) +{ + comVals_["receivedMulticastPacketsDelta"] = receivedMulticastPacketsDelta; +} + +void XNicPerformanceImp::setTransmittedDiscardedPacketsAccumulated(XNumber transmittedDiscardedPacketsAccumulated) +{ + comVals_["transmittedDiscardedPacketsAccumulated"] = transmittedDiscardedPacketsAccumulated; +} + +void XNicPerformanceImp::setTransmittedMulticastPacketsAccumulated(XNumber transmittedMulticastPacketsAccumulated) +{ + comVals_["transmittedMulticastPacketsAccumulated"] = transmittedMulticastPacketsAccumulated; +} + +void XNicPerformanceImp::setReceivedDiscardedPacketsDelta(XNumber receivedDiscardedPacketsDelta) +{ + comVals_["receivedDiscardedPacketsDelta"] = receivedDiscardedPacketsDelta; +} + +void XNicPerformanceImp::setReceivedOctetsAccumulated(XNumber receivedOctetsAccumulated) +{ + comVals_["receivedOctetsAccumulated"] = receivedOctetsAccumulated; +} + +void XNicPerformanceImp::setTransmittedTotalPacketsAccumulated(XNumber transmittedTotalPacketsAccumulated) +{ + comVals_["transmittedTotalPacketsAccumulated"] = transmittedTotalPacketsAccumulated; +} + +void XNicPerformanceImp::setTransmittedOctetsAccumulated(XNumber transmittedOctetsAccumulated) +{ + comVals_["transmittedOctetsAccumulated"] = transmittedOctetsAccumulated; +} + +void XNicPerformanceImp::setSpeed(XNumber speed) +{ + comVals_["speed"] = speed; +} + +void XNicPerformanceImp::setReceivedDiscardedPacketsAccumulated(XNumber receivedDiscardedPacketsAccumulated) +{ + comVals_["receivedDiscardedPacketsAccumulated"] = receivedDiscardedPacketsAccumulated; +} + +void XNicPerformanceImp::setReceivedBroadcastPacketsDelta(XNumber receivedBroadcastPacketsDelta) +{ + comVals_["receivedBroadcastPacketsDelta"] = receivedBroadcastPacketsDelta; +} + +void XNicPerformanceImp::setReceivedPercentDiscard(XNumber receivedPercentDiscard) +{ + comVals_["receivedPercentDiscard"] = receivedPercentDiscard; +} + +void XNicPerformanceImp::setValuesAreSuspect(XEnumNicPerformanceValuesAreSuspect valuesAreSuspect) +{ + auto val = XEnumNicPerformanceValuesAreSuspectMapping[valuesAreSuspect]; + comVals_["valuesAreSuspect"] = val; +} + +void XNicPerformanceImp::setTransmittedPercentDiscard(XNumber transmittedPercentDiscard) +{ + comVals_["transmittedPercentDiscard"] = transmittedPercentDiscard; +} + +void XNicPerformanceImp::setTransmittedErrorPacketsAccumulated(XNumber transmittedErrorPacketsAccumulated) +{ + comVals_["transmittedErrorPacketsAccumulated"] = transmittedErrorPacketsAccumulated; +} + +void XNicPerformanceImp::setTransmittedBroadcastPacketsAccumulated(XNumber transmittedBroadcastPacketsAccumulated) +{ + comVals_["transmittedBroadcastPacketsAccumulated"] = transmittedBroadcastPacketsAccumulated; +} + +void XNicPerformanceImp::setReceivedTotalPacketsAccumulated(XNumber receivedTotalPacketsAccumulated) +{ + comVals_["receivedTotalPacketsAccumulated"] = receivedTotalPacketsAccumulated; +} + +void XNicPerformanceImp::setReceivedUnicastPacketsAccumulated(XNumber receivedUnicastPacketsAccumulated) +{ + comVals_["receivedUnicastPacketsAccumulated"] = receivedUnicastPacketsAccumulated; +} + +void XNicPerformanceImp::setTransmittedBroadcastPacketsDelta(XNumber transmittedBroadcastPacketsDelta) +{ + comVals_["transmittedBroadcastPacketsDelta"] = transmittedBroadcastPacketsDelta; +} + +void XNicPerformanceImp::setTransmittedMulticastPacketsDelta(XNumber transmittedMulticastPacketsDelta) +{ + comVals_["transmittedMulticastPacketsDelta"] = transmittedMulticastPacketsDelta; +} + +void XNicPerformanceImp::setReceivedMulticastPacketsAccumulated(XNumber receivedMulticastPacketsAccumulated) +{ + comVals_["receivedMulticastPacketsAccumulated"] = receivedMulticastPacketsAccumulated; +} + +void XNicPerformanceImp::setReceivedTotalPacketsDelta(XNumber receivedTotalPacketsDelta) +{ + comVals_["receivedTotalPacketsDelta"] = receivedTotalPacketsDelta; +} + +void XNicPerformanceImp::setReceivedPercentError(XNumber receivedPercentError) +{ + comVals_["receivedPercentError"] = receivedPercentError; +} + +void XNicPerformanceImp::setReceivedErrorPacketsDelta(XNumber receivedErrorPacketsDelta) +{ + comVals_["receivedErrorPacketsDelta"] = receivedErrorPacketsDelta; +} + +void XNicPerformanceImp::setTransmittedOctetsDelta(XNumber transmittedOctetsDelta) +{ + comVals_["transmittedOctetsDelta"] = transmittedOctetsDelta; +} + +void XNicPerformanceImp::setNicIdentifier(const XString& nicIdentifier) +{ + comVals_["nicIdentifier"] = nicIdentifier; +} + +void XNicPerformanceImp::setOperationalState(XEnumNicPerformanceOperationalState operationalState) +{ + auto val = XEnumNicPerformanceOperationalStateMapping[operationalState]; + comVals_["operationalState"] = val; +} + +void XNicPerformanceImp::setTransmittedUnicastPacketsAccumulated(XNumber transmittedUnicastPacketsAccumulated) +{ + comVals_["transmittedUnicastPacketsAccumulated"] = transmittedUnicastPacketsAccumulated; +} + +void XNicPerformanceImp::setReceivedUnicastPacketsDelta(XNumber receivedUnicastPacketsDelta) +{ + comVals_["receivedUnicastPacketsDelta"] = receivedUnicastPacketsDelta; +} + +void XNicPerformanceImp::setTransmittedUtilization(XNumber transmittedUtilization) +{ + comVals_["transmittedUtilization"] = transmittedUtilization; +} + +void XNicPerformanceImp::setReceivedBroadcastPacketsAccumulated(XNumber receivedBroadcastPacketsAccumulated) +{ + comVals_["receivedBroadcastPacketsAccumulated"] = receivedBroadcastPacketsAccumulated; +} + +void XNicPerformanceImp::setTransmittedUnicastPacketsDelta(XNumber transmittedUnicastPacketsDelta) +{ + comVals_["transmittedUnicastPacketsDelta"] = transmittedUnicastPacketsDelta; +} + +void XNicPerformanceImp::setReceivedUtilization(XNumber receivedUtilization) +{ + comVals_["receivedUtilization"] = receivedUtilization; +} + +void XNicPerformanceImp::setAdministrativeState(XEnumNicPerformanceAdministrativeState administrativeState) +{ + auto val = XEnumNicPerformanceAdministrativeStateMapping[administrativeState]; + comVals_["administrativeState"] = val; +} + +void XNicPerformanceImp::setTransmittedPercentError(XNumber transmittedPercentError) +{ + comVals_["transmittedPercentError"] = transmittedPercentError; +} + +void XNicPerformanceImp::setTransmittedTotalPacketsDelta(XNumber transmittedTotalPacketsDelta) +{ + comVals_["transmittedTotalPacketsDelta"] = transmittedTotalPacketsDelta; +} + +json XNicPerformanceImp::toJson() +{ + try + { + json field = { + {"valuesAreSuspect", XEnumNicPerformanceValuesAreSuspectMapping[valuesAreSuspect_]}, + {"nicIdentifier", nicIdentifier_} + }; + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XNicPerformance to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XNicPerformanceImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XNicPerformanceImp.h new file mode 100755 index 0000000..8c66649 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XNicPerformanceImp.h @@ -0,0 +1,69 @@ +#pragma once + +#include "XNicPerformance.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XNicPerformanceImp : public XNicPerformance, public XJsonable + { + public: + XNicPerformanceImp(const XString& nicIdentifier, + XEnumNicPerformanceValuesAreSuspect valuesAreSuspect); + + virtual json toJson() override; + + virtual void setTransmittedErrorPacketsDelta(XNumber transmittedErrorPacketsDelta) override; + virtual void setReceivedErrorPacketsAccumulated(XNumber receivedErrorPacketsAccumulated) override; + virtual void setTransmittedDiscardedPacketsDelta(XNumber transmittedDiscardedPacketsDelta) override; + virtual void setReceivedOctetsDelta(XNumber receivedOctetsDelta) override; + virtual void setReceivedMulticastPacketsDelta(XNumber receivedMulticastPacketsDelta) override; + virtual void setTransmittedDiscardedPacketsAccumulated(XNumber transmittedDiscardedPacketsAccumulated) override; + virtual void setTransmittedMulticastPacketsAccumulated(XNumber transmittedMulticastPacketsAccumulated) override; + virtual void setReceivedDiscardedPacketsDelta(XNumber receivedDiscardedPacketsDelta) override; + virtual void setReceivedOctetsAccumulated(XNumber receivedOctetsAccumulated) override; + virtual void setTransmittedTotalPacketsAccumulated(XNumber transmittedTotalPacketsAccumulated) override; + virtual void setTransmittedOctetsAccumulated(XNumber transmittedOctetsAccumulated) override; + virtual void setSpeed(XNumber speed) override; + virtual void setReceivedDiscardedPacketsAccumulated(XNumber receivedDiscardedPacketsAccumulated) override; + virtual void setReceivedBroadcastPacketsDelta(XNumber receivedBroadcastPacketsDelta) override; + virtual void setReceivedPercentDiscard(XNumber receivedPercentDiscard) override; + virtual void setValuesAreSuspect(XEnumNicPerformanceValuesAreSuspect valuesAreSuspect) override; + virtual void setTransmittedPercentDiscard(XNumber transmittedPercentDiscard) override; + virtual void setTransmittedErrorPacketsAccumulated(XNumber transmittedErrorPacketsAccumulated) override; + virtual void setTransmittedBroadcastPacketsAccumulated(XNumber transmittedBroadcastPacketsAccumulated) override; + virtual void setReceivedTotalPacketsAccumulated(XNumber receivedTotalPacketsAccumulated) override; + virtual void setReceivedUnicastPacketsAccumulated(XNumber receivedUnicastPacketsAccumulated) override; + virtual void setTransmittedBroadcastPacketsDelta(XNumber transmittedBroadcastPacketsDelta) override; + virtual void setTransmittedMulticastPacketsDelta(XNumber transmittedMulticastPacketsDelta) override; + virtual void setReceivedMulticastPacketsAccumulated(XNumber receivedMulticastPacketsAccumulated) override; + virtual void setReceivedTotalPacketsDelta(XNumber receivedTotalPacketsDelta) override; + virtual void setReceivedPercentError(XNumber receivedPercentError) override; + virtual void setReceivedErrorPacketsDelta(XNumber receivedErrorPacketsDelta) override; + virtual void setTransmittedOctetsDelta(XNumber transmittedOctetsDelta) override; + virtual void setNicIdentifier(const XString& nicIdentifier) override; + virtual void setOperationalState(XEnumNicPerformanceOperationalState operationalState) override; + virtual void setTransmittedUnicastPacketsAccumulated(XNumber transmittedUnicastPacketsAccumulated) override; + virtual void setReceivedUnicastPacketsDelta(XNumber receivedUnicastPacketsDelta) override; + virtual void setTransmittedUtilization(XNumber transmittedUtilization) override; + virtual void setReceivedBroadcastPacketsAccumulated(XNumber receivedBroadcastPacketsAccumulated) override; + virtual void setTransmittedUnicastPacketsDelta(XNumber transmittedUnicastPacketsDelta) override; + virtual void setReceivedUtilization(XNumber receivedUtilization) override; + virtual void setAdministrativeState(XEnumNicPerformanceAdministrativeState administrativeState) override; + virtual void setTransmittedPercentError(XNumber transmittedPercentError) override; + virtual void setTransmittedTotalPacketsDelta(XNumber transmittedTotalPacketsDelta) override; + + private: + //required + XEnumNicPerformanceValuesAreSuspect valuesAreSuspect_; + XString nicIdentifier_; + //optional + XEnumNicPerformanceOperationalState operationalState_; + XEnumNicPerformanceAdministrativeState administrativeState_; + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XNotificationFields.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XNotificationFields.cpp new file mode 100755 index 0000000..dff29db --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XNotificationFields.cpp @@ -0,0 +1,7 @@ +#include "XNotificationFields.h" +#include "XNotificationFieldsImp.h" + +std::shared_ptr vagt::encode::XNotificationFields::create(std::shared_ptr header, const XString & changeIdentifier, const XString & changeType) +{ + return std::make_shared(header, changeIdentifier, changeType); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XNotificationFieldsImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XNotificationFieldsImp.cpp new file mode 100755 index 0000000..1434114 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XNotificationFieldsImp.cpp @@ -0,0 +1,114 @@ +#include "XNotificationFieldsImp.h" + +const std::string XEnumNotificationFieldsNotificationFieldsVersionMapping[] = { + "2.0" +}; + +XNotificationFieldsImp::XNotificationFieldsImp(std::shared_ptr header, + const XString& changeIdentifier, + const XString& changeType + ): + header_(header), + changeIdentifier_(changeIdentifier), + changeType_(changeType), + notificationFieldsVersion_(XEnumNotificationFieldsNotificationFieldsVersion2_0) +{ + +} + +std::string XNotificationFieldsImp::toString() +{ + try + { + auto js = toJson(); + return js.dump(); + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to dump XNotificationFields to json string:{}.", e.what()); + return ""; + } +} + +void XNotificationFieldsImp::setNewState(const XString& newState) +{ + comVals_["newState"] = newState; +} + +void XNotificationFieldsImp::setChangeType(const XString& changeType) +{ + comVals_["changeType"] = changeType; +} + +void XNotificationFieldsImp::setArrayOfNamedHashMap(const XArrayOfNamedHashMap& arrayOfNamedHashMap) +{ + arrayOfNamedHashMap_ = arrayOfNamedHashMap; +} + +void XNotificationFieldsImp::setChangeContact(const XString& changeContact) +{ + comVals_["changeContact"] = changeContact; +} + +void XNotificationFieldsImp::setChangeIdentifier(const XString& changeIdentifier) +{ + comVals_["changeIdentifier"] = changeIdentifier; +} + +void XNotificationFieldsImp::setAdditionalFields(const XHashMap& additionalFields) +{ + additionalFields_ = additionalFields; +} + +void XNotificationFieldsImp::setOldState(const XString& oldState) +{ + comVals_["oldState"] = oldState; +} + +void XNotificationFieldsImp::setStateInterface(const XString& stateInterface) +{ + comVals_["stateInterface"] = stateInterface; +} + +json XNotificationFieldsImp::toJson() +{ + try + { + json field = { + {"notificationFieldsVersion", XEnumNotificationFieldsNotificationFieldsVersionMapping[notificationFieldsVersion_]}, + {"changeType", changeType_}, + {"changeIdentifier", changeIdentifier_} + }; + + //optional val + if (!arrayOfNamedHashMap_.empty()) + { + field["arrayOfNamedHashMap"] = fromArray(arrayOfNamedHashMap_); + } + + if (!additionalFields_.empty()) + { + field["additionalFields"] = additionalFields_; + } + + field = mergeCommonValues(field, comVals_); + + json jsEvent; + header_->setDomain(XEnumCommonEventHeaderDomainNotification); + jsEvent["event"]["commonEventHeader"] = dynamic_pointer_cast(header_)->toJson(); + jsEvent["event"]["notificationFields"] = field; + + return jsEvent; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XNotificationFields to json object:{}.", e.what()); + return json(); + } +} + +std::shared_ptr XNotificationFieldsImp::getCommonHeader() +{ + return header_; +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XNotificationFieldsImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XNotificationFieldsImp.h new file mode 100755 index 0000000..1ae6869 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XNotificationFieldsImp.h @@ -0,0 +1,46 @@ +#pragma once + +#include "XNotificationFields.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XNotificationFieldsImp : public XNotificationFields, public XJsonable + { + public: + XNotificationFieldsImp(std::shared_ptr header, + const XString& changeIdentifier, + const XString& changeType + ); + + virtual std::string toString() override; + + virtual json toJson() override; + + virtual std::shared_ptr getCommonHeader() override; + + virtual void setNewState(const XString& newState) override; + virtual void setChangeType(const XString& changeType) override; + virtual void setArrayOfNamedHashMap(const XArrayOfNamedHashMap& arrayOfNamedHashMap) override; + virtual void setChangeContact(const XString& changeContact) override; + virtual void setChangeIdentifier(const XString& changeIdentifier) override; + virtual void setAdditionalFields(const XHashMap& additionalFields) override; + virtual void setOldState(const XString& oldState) override; + virtual void setStateInterface(const XString& stateInterface) override; + + private: + //required + std::shared_ptr header_; + XEnumNotificationFieldsNotificationFieldsVersion notificationFieldsVersion_; + XString changeType_; + XString changeIdentifier_; + //optional + XArrayOfNamedHashMap arrayOfNamedHashMap_; + XHashMap additionalFields_; + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XOtherFields.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XOtherFields.cpp new file mode 100755 index 0000000..15c7cef --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XOtherFields.cpp @@ -0,0 +1,7 @@ +#include "XOtherFields.h" +#include "XOtherFieldsImp.h" + +std::shared_ptr vagt::encode::XOtherFields::create(std::shared_ptr header) +{ + return std::make_shared(header); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XOtherFieldsImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XOtherFieldsImp.cpp new file mode 100755 index 0000000..e9b4487 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XOtherFieldsImp.cpp @@ -0,0 +1,85 @@ +#include "XOtherFieldsImp.h" + +const std::string XEnumOtherFieldsOtherFieldsVersionMapping[] = { + "3.0" +}; + +XOtherFieldsImp::XOtherFieldsImp(std::shared_ptr header): + header_(header), + otherFieldsVersion_(XEnumOtherFieldsOtherFieldsVersion3_0) +{ + +} + +std::string XOtherFieldsImp::toString() +{ + try + { + auto js = toJson(); + return js.dump(); + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to dump XOtherFields to json string:{}.", e.what()); + return ""; + } +} + +void XOtherFieldsImp::setJsonObjects(const XArrayOfJsonObject& jsonObjects) +{ + jsonObjects_ = jsonObjects; +} + +void XOtherFieldsImp::setArrayOfNamedHashMap(const XArrayOfNamedHashMap& arrayOfNamedHashMap) +{ + arrayOfNamedHashMap_ = arrayOfNamedHashMap; +} + +void XOtherFieldsImp::setHashMap(const XHashMap& hashMap) +{ + hashMap_ = hashMap; +} + +json XOtherFieldsImp::toJson() +{ + try + { + json field = { + {"otherFieldsVersion", XEnumOtherFieldsOtherFieldsVersionMapping[otherFieldsVersion_]} + }; + + //optional val + if (!jsonObjects_.empty()) + { + field["jsonObjects"] = fromArray(jsonObjects_); + } + + if (!arrayOfNamedHashMap_.empty()) + { + field["arrayOfNamedHashMap"] = fromArray(arrayOfNamedHashMap_); + } + + if (!hashMap_.empty()) + { + field["hashMap"] = hashMap_; + } + + json jsEvent; + header_->setDomain(XEnumCommonEventHeaderDomainOther); + jsEvent["event"]["commonEventHeader"] = dynamic_pointer_cast(header_)->toJson(); + jsEvent["event"]["otherFields"] = field; + + return jsEvent; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XOtherFields to json object:{}.", e.what()); + return json(); + } +} + +std::shared_ptr XOtherFieldsImp::getCommonHeader() +{ + return header_; +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XOtherFieldsImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XOtherFieldsImp.h new file mode 100755 index 0000000..b30495b --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XOtherFieldsImp.h @@ -0,0 +1,36 @@ +#pragma once + +#include "XOtherFields.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XOtherFieldsImp : public XOtherFields, public XJsonable + { + public: + XOtherFieldsImp(std::shared_ptr header); + + virtual std::string toString() override; + + virtual json toJson() override; + + virtual std::shared_ptr getCommonHeader() override; + + virtual void setJsonObjects(const XArrayOfJsonObject& jsonObjects) override; + virtual void setArrayOfNamedHashMap(const XArrayOfNamedHashMap& arrayOfNamedHashMap) override; + virtual void setHashMap(const XHashMap& hashMap) override; + + private: + //required + std::shared_ptr header_; + XEnumOtherFieldsOtherFieldsVersion otherFieldsVersion_; + //optional + XArrayOfJsonObject jsonObjects_; + XArrayOfNamedHashMap arrayOfNamedHashMap_; + XHashMap hashMap_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XPnfRegistrationFields.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XPnfRegistrationFields.cpp new file mode 100755 index 0000000..0ec378d --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XPnfRegistrationFields.cpp @@ -0,0 +1,7 @@ +#include "XPnfRegistrationFields.h" +#include "XPnfRegistrationFieldsImp.h" + +std::shared_ptr vagt::encode::XPnfRegistrationFields::create(std::shared_ptr header) +{ + return std::make_shared(header); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XPnfRegistrationFieldsImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XPnfRegistrationFieldsImp.cpp new file mode 100755 index 0000000..2ac5e5d --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XPnfRegistrationFieldsImp.cpp @@ -0,0 +1,123 @@ +#include "XPnfRegistrationFieldsImp.h" + +const std::string XEnumPnfRegistrationFieldsPnfRegistrationFieldsVersionMapping[] = { + "2.0" +}; + +XPnfRegistrationFieldsImp::XPnfRegistrationFieldsImp(std::shared_ptr header): + header_(header), + pnfRegistrationFieldsVersion_(XEnumPnfRegistrationFieldsPnfRegistrationFieldsVersion2_0) +{ + +} + +std::string XPnfRegistrationFieldsImp::toString() +{ + try + { + auto js = toJson(); + return js.dump(); + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to dump XPnfRegistrationFields to json string:{}.", e.what()); + return ""; + } +} + +void XPnfRegistrationFieldsImp::setMacAddress(const XString& macAddress) +{ + comVals_["macAddress"] = macAddress; +} + +void XPnfRegistrationFieldsImp::setUnitFamily(const XString& unitFamily) +{ + comVals_["unitFamily"] = unitFamily; +} + +void XPnfRegistrationFieldsImp::setSerialNumber(const XString& serialNumber) +{ + comVals_["serialNumber"] = serialNumber; +} + +void XPnfRegistrationFieldsImp::setUnitType(const XString& unitType) +{ + comVals_["unitType"] = unitType; +} + +void XPnfRegistrationFieldsImp::setManufactureDate(const XString& manufactureDate) +{ + comVals_["manufactureDate"] = manufactureDate; +} + +void XPnfRegistrationFieldsImp::setSoftwareVersion(const XString& softwareVersion) +{ + comVals_["softwareVersion"] = softwareVersion; +} + +void XPnfRegistrationFieldsImp::setModelNumber(const XString& modelNumber) +{ + comVals_["modelNumber"] = modelNumber; +} + +void XPnfRegistrationFieldsImp::setLastServiceDate(const XString& lastServiceDate) +{ + comVals_["lastServiceDate"] = lastServiceDate; +} + +void XPnfRegistrationFieldsImp::setOamV6IpAddress(const XString& oamV6IpAddress) +{ + comVals_["oamV6IpAddress"] = oamV6IpAddress; +} + +void XPnfRegistrationFieldsImp::setAdditionalFields(const XHashMap& additionalFields) +{ + additionalFields_ = additionalFields; +} + +void XPnfRegistrationFieldsImp::setVendorName(const XString& vendorName) +{ + comVals_["vendorName"] = vendorName; +} + +void XPnfRegistrationFieldsImp::setOamV4IpAddress(const XString& oamV4IpAddress) +{ + comVals_["oamV4IpAddress"] = oamV4IpAddress; +} + +std::shared_ptr XPnfRegistrationFieldsImp::getCommonHeader() +{ + return header_; +} + +json XPnfRegistrationFieldsImp::toJson() +{ + try + { + json field = { + {"pnfRegistrationFieldsVersion", XEnumPnfRegistrationFieldsPnfRegistrationFieldsVersionMapping[pnfRegistrationFieldsVersion_]} + }; + + //optional val + + if (!additionalFields_.empty()) + { + field["additionalFields"] = additionalFields_; + } + + field = mergeCommonValues(field, comVals_); + + json jsEvent; + header_->setDomain(XEnumCommonEventHeaderDomainPnfRegistration); + jsEvent["event"]["commonEventHeader"] = dynamic_pointer_cast(header_)->toJson(); + jsEvent["event"]["pnfRegistrationFields"] = field; + + return jsEvent; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XPnfRegistrationFields to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XPnfRegistrationFieldsImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XPnfRegistrationFieldsImp.h new file mode 100755 index 0000000..3fea1dc --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XPnfRegistrationFieldsImp.h @@ -0,0 +1,44 @@ +#pragma once + +#include "XPnfRegistrationFields.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XPnfRegistrationFieldsImp : public XPnfRegistrationFields, public XJsonable + { + public: + XPnfRegistrationFieldsImp(std::shared_ptr header); + + virtual std::string toString() override; + + virtual json toJson() override; + + virtual std::shared_ptr getCommonHeader() override; + + virtual void setMacAddress(const XString& macAddress) override; + virtual void setUnitFamily(const XString& unitFamily) override; + virtual void setSerialNumber(const XString& serialNumber) override; + virtual void setUnitType(const XString& unitType) override; + virtual void setManufactureDate(const XString& manufactureDate) override; + virtual void setSoftwareVersion(const XString& softwareVersion) override; + virtual void setModelNumber(const XString& modelNumber) override; + virtual void setLastServiceDate(const XString& lastServiceDate) override; + virtual void setOamV6IpAddress(const XString& oamV6IpAddress) override; + virtual void setAdditionalFields(const XHashMap& additionalFields) override; + virtual void setVendorName(const XString& vendorName) override; + virtual void setOamV4IpAddress(const XString& oamV4IpAddress) override; + + private: + //required + std::shared_ptr header_; + XEnumPnfRegistrationFieldsPnfRegistrationFieldsVersion pnfRegistrationFieldsVersion_; + //optional + XHashMap additionalFields_; + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XProcessStats.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XProcessStats.cpp new file mode 100755 index 0000000..ce2810c --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XProcessStats.cpp @@ -0,0 +1,51 @@ +#include "XProcessStats.h" +#include "XProcessStatsImp.h" + +vagt::encode::XProcessStats::XProcessStats() +{ +} + +vagt::encode::XProcessStats::XProcessStats(const XString & processIdentifier): + imp_(make_shared(processIdentifier)) +{ +} + +void vagt::encode::XProcessStats::setForkRate(XNumber forkRate) +{ + return imp_->setForkRate(forkRate); +} + +void vagt::encode::XProcessStats::setPsStateStopped(XNumber psStateStopped) +{ + return imp_->setPsStateStopped(psStateStopped); +} + +void vagt::encode::XProcessStats::setPsStatePaging(XNumber psStatePaging) +{ + return imp_->setPsStatePaging(psStatePaging); +} + +void vagt::encode::XProcessStats::setPsStateSleeping(XNumber psStateSleeping) +{ + return imp_->setPsStateSleeping(psStateSleeping); +} + +void vagt::encode::XProcessStats::setProcessIdentifier(const XString & processIdentifier) +{ + return imp_->setProcessIdentifier(processIdentifier); +} + +void vagt::encode::XProcessStats::setPsStateBlocked(XNumber psStateBlocked) +{ + return imp_->setPsStateBlocked(psStateBlocked); +} + +void vagt::encode::XProcessStats::setPsStateZombie(XNumber psStateZombie) +{ + return imp_->setPsStateZombie(psStateZombie); +} + +void vagt::encode::XProcessStats::setPsStateRunning(XNumber psStateRunning) +{ + return imp_->setPsStateRunning(psStateRunning); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XProcessStatsImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XProcessStatsImp.cpp new file mode 100755 index 0000000..ee2cc54 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XProcessStatsImp.cpp @@ -0,0 +1,69 @@ +#include "XProcessStatsImp.h" + +XProcessStatsImp::XProcessStatsImp(const XString& processIdentifier): + processIdentifier_(processIdentifier) +{ + +} + +void XProcessStatsImp::setForkRate(XNumber forkRate) +{ + comVals_["forkRate"] = forkRate; +} + +void XProcessStatsImp::setPsStateStopped(XNumber psStateStopped) +{ + comVals_["psStateStopped"] = psStateStopped; +} + +void XProcessStatsImp::setPsStatePaging(XNumber psStatePaging) +{ + comVals_["psStatePaging"] = psStatePaging; +} + +void XProcessStatsImp::setPsStateSleeping(XNumber psStateSleeping) +{ + comVals_["psStateSleeping"] = psStateSleeping; +} + +void XProcessStatsImp::setProcessIdentifier(const XString& processIdentifier) +{ + comVals_["processIdentifier"] = processIdentifier; +} + +void XProcessStatsImp::setPsStateBlocked(XNumber psStateBlocked) +{ + comVals_["psStateBlocked"] = psStateBlocked; +} + +void XProcessStatsImp::setPsStateZombie(XNumber psStateZombie) +{ + comVals_["psStateZombie"] = psStateZombie; +} + +void XProcessStatsImp::setPsStateRunning(XNumber psStateRunning) +{ + comVals_["psStateRunning"] = psStateRunning; +} + +json XProcessStatsImp::toJson() +{ + try + { + json field = { + {"processIdentifier", processIdentifier_} + }; + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XProcessStats to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XProcessStatsImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XProcessStatsImp.h new file mode 100755 index 0000000..3cd98fc --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XProcessStatsImp.h @@ -0,0 +1,34 @@ +#pragma once + +#include "XProcessStats.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XProcessStatsImp : public XProcessStats, public XJsonable + { + public: + XProcessStatsImp(const XString& processIdentifier); + + virtual json toJson() override; + + virtual void setForkRate(XNumber forkRate) override; + virtual void setPsStateStopped(XNumber psStateStopped) override; + virtual void setPsStatePaging(XNumber psStatePaging) override; + virtual void setPsStateSleeping(XNumber psStateSleeping) override; + virtual void setProcessIdentifier(const XString& processIdentifier) override; + virtual void setPsStateBlocked(XNumber psStateBlocked) override; + virtual void setPsStateZombie(XNumber psStateZombie) override; + virtual void setPsStateRunning(XNumber psStateRunning) override; + + private: + //required + XString processIdentifier_; + //optional + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XProcessorDimmAggregateThermalMargin.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XProcessorDimmAggregateThermalMargin.cpp new file mode 100755 index 0000000..e655af8 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XProcessorDimmAggregateThermalMargin.cpp @@ -0,0 +1,21 @@ +#include "XProcessorDimmAggregateThermalMargin.h" +#include "XProcessorDimmAggregateThermalMarginImp.h" + +vagt::encode::XProcessorDimmAggregateThermalMargin::XProcessorDimmAggregateThermalMargin() +{ +} + +vagt::encode::XProcessorDimmAggregateThermalMargin::XProcessorDimmAggregateThermalMargin(const XString & processorDimmAggregateThermalMarginIdentifier, XNumber thermalMargin): + imp_(make_shared(processorDimmAggregateThermalMarginIdentifier, thermalMargin)) +{ +} + +void vagt::encode::XProcessorDimmAggregateThermalMargin::setProcessorDimmAggregateThermalMarginIdentifier(const XString & processorDimmAggregateThermalMarginIdentifier) +{ + return imp_->setProcessorDimmAggregateThermalMarginIdentifier(processorDimmAggregateThermalMarginIdentifier); +} + +void vagt::encode::XProcessorDimmAggregateThermalMargin::setThermalMargin(XNumber thermalMargin) +{ + return imp_->setThermalMargin(thermalMargin); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XProcessorDimmAggregateThermalMarginImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XProcessorDimmAggregateThermalMarginImp.cpp new file mode 100755 index 0000000..e53f935 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XProcessorDimmAggregateThermalMarginImp.cpp @@ -0,0 +1,42 @@ +#include "XProcessorDimmAggregateThermalMarginImp.h" + +XProcessorDimmAggregateThermalMarginImp::XProcessorDimmAggregateThermalMarginImp(const XString& processorDimmAggregateThermalMarginIdentifier, + XNumber thermalMargin): + processorDimmAggregateThermalMarginIdentifier_(processorDimmAggregateThermalMarginIdentifier), + thermalMargin_(thermalMargin) +{ + +} + +void XProcessorDimmAggregateThermalMarginImp::setProcessorDimmAggregateThermalMarginIdentifier(const XString& processorDimmAggregateThermalMarginIdentifier) +{ + comVals_["processorDimmAggregateThermalMarginIdentifier"] = processorDimmAggregateThermalMarginIdentifier; +} + +void XProcessorDimmAggregateThermalMarginImp::setThermalMargin(XNumber thermalMargin) +{ + comVals_["thermalMargin"] = thermalMargin; +} + +json XProcessorDimmAggregateThermalMarginImp::toJson() +{ + try + { + json field = { + {"processorDimmAggregateThermalMarginIdentifier", processorDimmAggregateThermalMarginIdentifier_}, + {"thermalMargin", thermalMargin_} + }; + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XProcessorDimmAggregateThermalMargin to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XProcessorDimmAggregateThermalMarginImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XProcessorDimmAggregateThermalMarginImp.h new file mode 100755 index 0000000..ccc5c8e --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XProcessorDimmAggregateThermalMarginImp.h @@ -0,0 +1,30 @@ +#pragma once + +#include "XProcessorDimmAggregateThermalMargin.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XProcessorDimmAggregateThermalMarginImp : public XProcessorDimmAggregateThermalMargin, public XJsonable + { + public: + XProcessorDimmAggregateThermalMarginImp(const XString& processorDimmAggregateThermalMarginIdentifier, + XNumber thermalMargin); + + virtual json toJson() override; + + virtual void setProcessorDimmAggregateThermalMarginIdentifier(const XString& processorDimmAggregateThermalMarginIdentifier); + virtual void setThermalMargin(XNumber thermalMargin); + + private: + //required + XString processorDimmAggregateThermalMarginIdentifier_; + XNumber thermalMargin_; + //optional + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XSipSignalingFields.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XSipSignalingFields.cpp new file mode 100755 index 0000000..32dcd18 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XSipSignalingFields.cpp @@ -0,0 +1,13 @@ +#include "XSipSignalingFields.h" +#include "XSipSignalingFieldsImp.h" + +std::shared_ptr vagt::encode::XSipSignalingFields::create(std::shared_ptr header, const XString & correlator, const XString & localIpAddress, const XString & localPort, const XString & remoteIpAddress, const XString & remotePort, const XVendorNfNameFields & vendorNfNameFields) +{ + return std::make_shared(header, + correlator, + localIpAddress, + localPort, + remoteIpAddress, + remotePort, + vendorNfNameFields); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XSipSignalingFieldsImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XSipSignalingFieldsImp.cpp new file mode 100755 index 0000000..09d4467 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XSipSignalingFieldsImp.cpp @@ -0,0 +1,125 @@ +#include "XSipSignalingFieldsImp.h" + +const std::string XEnumSipSignalingFieldsSipSignalingFieldsVersionMapping[] = { + "3.0" +}; + +XSipSignalingFieldsImp::XSipSignalingFieldsImp(std::shared_ptr header, + const XString& correlator, + const XString& localIpAddress, + const XString& localPort, + const XString& remoteIpAddress, + const XString& remotePort, + const XVendorNfNameFields& vendorNfNameFields): + header_(header), + correlator_(correlator), + localIpAddress_(localIpAddress), + localPort_(localPort), + remoteIpAddress_(remoteIpAddress), + remotePort_(remotePort), + sipSignalingFieldsVersion_(XEnumSipSignalingFieldsSipSignalingFieldsVersion3_0), + vendorNfNameFields_(vendorNfNameFields) +{ + +} + +std::string XSipSignalingFieldsImp::toString() +{ + try + { + auto js = toJson(); + return js.dump(); + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to dump XSipSignalingFields to json string:{}.", e.what()); + return ""; + } +} + +void XSipSignalingFieldsImp::setRemotePort(const XString& remotePort) +{ + comVals_["remotePort"] = remotePort; +} + +void XSipSignalingFieldsImp::setSummarySip(const XString& summarySip) +{ + comVals_["summarySip"] = summarySip; +} + +void XSipSignalingFieldsImp::setLocalPort(const XString& localPort) +{ + comVals_["localPort"] = localPort; +} + +void XSipSignalingFieldsImp::setAdditionalInformation(const XHashMap& additionalInformation) +{ + additionalInformation_ = additionalInformation; +} + +void XSipSignalingFieldsImp::setLocalIpAddress(const XString& localIpAddress) +{ + comVals_["localIpAddress"] = localIpAddress; +} + +void XSipSignalingFieldsImp::setCompressedSip(const XString& compressedSip) +{ + comVals_["compressedSip"] = compressedSip; +} + +void XSipSignalingFieldsImp::setCorrelator(const XString& correlator) +{ + comVals_["correlator"] = correlator; +} + +void XSipSignalingFieldsImp::setRemoteIpAddress(const XString& remoteIpAddress) +{ + comVals_["remoteIpAddress"] = remoteIpAddress; +} + +void XSipSignalingFieldsImp::setVendorNfNameFields(const XVendorNfNameFields& vendorNfNameFields) +{ + vendorNfNameFields_ = vendorNfNameFields; +} + +json XSipSignalingFieldsImp::toJson() +{ + try + { + json field = { + {"sipSignalingFieldsVersion", XEnumSipSignalingFieldsSipSignalingFieldsVersionMapping[sipSignalingFieldsVersion_]}, + {"remotePort", remotePort_}, + {"localPort", localPort_}, + {"localIpAddress", localIpAddress_}, + {"correlator", correlator_}, + {"remoteIpAddress", remoteIpAddress_}, + {"vendorNfNameFields", dynamic_pointer_cast(vendorNfNameFields_.imp_)->toJson()} + }; + + //optional val + if (!additionalInformation_.empty()) + { + field["additionalInformation"] = additionalInformation_; + } + + field = mergeCommonValues(field, comVals_); + + json jsEvent; + header_->setDomain(XEnumCommonEventHeaderDomainSipSignaling); + jsEvent["event"]["commonEventHeader"] = dynamic_pointer_cast(header_)->toJson(); + jsEvent["event"]["sipSignalingFields"] = field; + + return jsEvent; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XSipSignalingFields to json object:{}.", e.what()); + return json(); + } +} + +std::shared_ptr XSipSignalingFieldsImp::getCommonHeader() +{ + return header_; +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XSipSignalingFieldsImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XSipSignalingFieldsImp.h new file mode 100755 index 0000000..c391eae --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XSipSignalingFieldsImp.h @@ -0,0 +1,53 @@ +#pragma once + +#include "XSipSignalingFields.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XSipSignalingFieldsImp : public XSipSignalingFields, public XJsonable + { + public: + XSipSignalingFieldsImp(std::shared_ptr header, + const XString& correlator, + const XString& localIpAddress, + const XString& localPort, + const XString& remoteIpAddress, + const XString& remotePort, + const XVendorNfNameFields& vendorNfNameFields); + + virtual std::string toString() override; + + virtual json toJson() override; + + virtual std::shared_ptr getCommonHeader() override; + + virtual void setRemotePort(const XString& remotePort) override; + virtual void setSummarySip(const XString& summarySip) override; + virtual void setLocalPort(const XString& localPort) override; + virtual void setAdditionalInformation(const XHashMap& additionalInformation) override; + virtual void setLocalIpAddress(const XString& localIpAddress) override; + virtual void setCompressedSip(const XString& compressedSip) override; + virtual void setCorrelator(const XString& correlator) override; + virtual void setRemoteIpAddress(const XString& remoteIpAddress) override; + virtual void setVendorNfNameFields(const XVendorNfNameFields& vendorNfNameFields) override; + + private: + //required + std::shared_ptr header_; + XEnumSipSignalingFieldsSipSignalingFieldsVersion sipSignalingFieldsVersion_; + XString remotePort_; + XString localPort_; + XString localIpAddress_; + XString correlator_; + XString remoteIpAddress_; + XVendorNfNameFields vendorNfNameFields_; + //optional + XHashMap additionalInformation_; + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XStateChangeFields.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XStateChangeFields.cpp new file mode 100755 index 0000000..aff204a --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XStateChangeFields.cpp @@ -0,0 +1,7 @@ +#include "XStateChangeFields.h" +#include "XStateChangeFieldsImp.h" + +std::shared_ptr vagt::encode::XStateChangeFields::create(std::shared_ptr header, XEnumStateChangeFieldsState newState, XEnumStateChangeFieldsState oldState, const XString & stateInterface) +{ + return std::make_shared(header, newState, oldState, stateInterface); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XStateChangeFieldsImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XStateChangeFieldsImp.cpp new file mode 100755 index 0000000..644ce1d --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XStateChangeFieldsImp.cpp @@ -0,0 +1,99 @@ +#include "XStateChangeFieldsImp.h" + +const std::string XEnumStateChangeFieldsStateChangeFieldsVersionMapping[] = { + "4.0" +}; + +const std::string XEnumStateChangeFieldsStateMapping[] = { + "inService", + "maintenance", + "outOfService" +}; + +XStateChangeFieldsImp::XStateChangeFieldsImp(std::shared_ptr header, + XEnumStateChangeFieldsState newState, + XEnumStateChangeFieldsState oldState, + const XString& stateInterface): + header_(header), + newState_(newState), + oldState_(oldState), + stateChangeFieldsVersion_(XEnumStateChangeFieldsStateChangeFieldsVersion4_0), + stateInterface_(stateInterface) +{ + +} + +std::string XStateChangeFieldsImp::toString() +{ + try + { + auto js = toJson(); + return js.dump(); + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to dump XStateChangeFields to json string:{}.", e.what()); + return ""; + } +} + +void XStateChangeFieldsImp::setNewState(XEnumStateChangeFieldsState newState) +{ + auto val = XEnumStateChangeFieldsStateMapping[newState]; + comVals_["newState"] = val; +} + +void XStateChangeFieldsImp::setOldState(XEnumStateChangeFieldsState oldState) +{ + auto val = XEnumStateChangeFieldsStateMapping[oldState]; + comVals_["oldState"] = val; +} + +void XStateChangeFieldsImp::setAdditionalFields(const XHashMap& additionalFields) +{ + additionalFields_ = additionalFields; +} + +void XStateChangeFieldsImp::setStateInterface(const XString& stateInterface) +{ + comVals_["stateInterface"] = stateInterface; +} + +json XStateChangeFieldsImp::toJson() +{ + try + { + json field = { + {"stateChangeFieldsVersion", XEnumStateChangeFieldsStateChangeFieldsVersionMapping[stateChangeFieldsVersion_]}, + {"newState", XEnumStateChangeFieldsStateMapping[newState_]}, + {"oldState", XEnumStateChangeFieldsStateMapping[oldState_]}, + {"stateInterface", stateInterface_} + }; + + //optional val + if (!additionalFields_.empty()) + { + field["additionalFields"] = additionalFields_; + } + + field = mergeCommonValues(field, comVals_); + + json jsEvent; + header_->setDomain(XEnumCommonEventHeaderDomainStateChange); + jsEvent["event"]["commonEventHeader"] = dynamic_pointer_cast(header_)->toJson(); + jsEvent["event"]["stateChangeFields"] = field; + + return jsEvent; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XStateChangeFields to json object:{}.", e.what()); + return json(); + } +} + +std::shared_ptr XStateChangeFieldsImp::getCommonHeader() +{ + return header_; +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XStateChangeFieldsImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XStateChangeFieldsImp.h new file mode 100755 index 0000000..911343d --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XStateChangeFieldsImp.h @@ -0,0 +1,42 @@ +#pragma once + +#include "XStateChangeFields.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XStateChangeFieldsImp : public XStateChangeFields, public XJsonable + { + public: + XStateChangeFieldsImp(std::shared_ptr header, + XEnumStateChangeFieldsState newState, + XEnumStateChangeFieldsState oldState, + const XString& stateInterface); + + virtual std::string toString() override; + + virtual json toJson() override; + + virtual std::shared_ptr getCommonHeader() override; + + virtual void setNewState(XEnumStateChangeFieldsState newState) override; + virtual void setOldState(XEnumStateChangeFieldsState oldState) override; + virtual void setAdditionalFields(const XHashMap& additionalFields) override; + virtual void setStateInterface(const XString& stateInterface) override; + + private: + //required + std::shared_ptr header_; + XEnumStateChangeFieldsStateChangeFieldsVersion stateChangeFieldsVersion_; + XEnumStateChangeFieldsState newState_; + XEnumStateChangeFieldsState oldState_; + XString stateInterface_; + //optional + XHashMap additionalFields_; + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XSyslogFields.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XSyslogFields.cpp new file mode 100755 index 0000000..7bf7986 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XSyslogFields.cpp @@ -0,0 +1,7 @@ +#include "XSyslogFields.h" +#include "XSyslogFieldsImp.h" + +std::shared_ptr vagt::encode::XSyslogFields::create(std::shared_ptr header, XEnumSyslogFieldsEventSourceType eventSourceType, const XString & syslogTag, const XString & syslogMsg) +{ + return std::make_shared(header, eventSourceType, syslogTag, syslogMsg); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XSyslogFieldsImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XSyslogFieldsImp.cpp new file mode 100755 index 0000000..d7baefd --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XSyslogFieldsImp.cpp @@ -0,0 +1,173 @@ +#include "XSyslogFieldsImp.h" + +const std::string XEnumSyslogFieldsEventSourceTypeMapping[] = { + "other", + "router", + "switch", + "host", + "card", + "port", + "slotThreshold", + "portThreshold", + "virtualMachine", + "virtualNetworkFunction" +}; + +const std::string XEnumSyslogFieldsSyslogSevMapping[] = { + "Alert", + "Critical", + "Debug", + "Emergency", + "Error", + "Info", + "Notice", + "Warning" +}; + +const std::string XEnumSyslogFieldsSyslogFieldsVersionMapping[] = { + "4.0" +}; + +XSyslogFieldsImp::XSyslogFieldsImp(std::shared_ptr header, + XEnumSyslogFieldsEventSourceType eventSourceType, + const XString& syslogTag, + const XString& syslogMsg + ): + header_(header), + eventSourceType_(eventSourceType), + syslogFieldsVersion_(XEnumSyslogFieldsSyslogFieldsVersion4_0), + syslogMsg_(syslogMsg), + syslogTag_(syslogTag) +{ + +} + +std::string XSyslogFieldsImp::toString() +{ + try + { + auto js = toJson(); + return js.dump(); + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to dump XSyslogFields to json string:{}.", e.what()); + return ""; + } +} + +void XSyslogFieldsImp::setSyslogProcId(XNumber syslogProcId) +{ + comVals_["syslogProcId"] = syslogProcId; +} + +void XSyslogFieldsImp::setSyslogFacility(XInteger syslogFacility) +{ + comVals_["syslogFacility"] = syslogFacility; +} + +void XSyslogFieldsImp::setSyslogPri(XInteger syslogPri) +{ + comVals_["syslogPri"] = syslogPri; +} + +void XSyslogFieldsImp::setEventSourceType(XEnumSyslogFieldsEventSourceType eventSourceType) +{ + auto val = XEnumSyslogFieldsEventSourceTypeMapping[eventSourceType]; + comVals_["eventSourceType"] = val; +} + +void XSyslogFieldsImp::setSyslogMsgHost(const XString& syslogMsgHost) +{ + comVals_["syslogMsgHost"] = syslogMsgHost; +} + +void XSyslogFieldsImp::setSyslogSev(XEnumSyslogFieldsSyslogSev syslogSev) +{ + auto val = XEnumSyslogFieldsSyslogSevMapping[syslogSev]; + comVals_["syslogSev"] = val; +} + +void XSyslogFieldsImp::setSyslogSData(const XString& syslogSData) +{ + comVals_["syslogSData"] = syslogSData; +} + +void XSyslogFieldsImp::setSyslogMsg(const XString& syslogMsg) +{ + comVals_["syslogMsg"] = syslogMsg; +} + +void XSyslogFieldsImp::setSyslogProc(const XString& syslogProc) +{ + comVals_["syslogProc"] = syslogProc; +} + +void XSyslogFieldsImp::setEventSourceHost(const XString& eventSourceHost) +{ + comVals_["eventSourceHost"] = eventSourceHost; +} + +void XSyslogFieldsImp::setSyslogTs(const XString& syslogTs) +{ + comVals_["syslogTs"] = syslogTs; +} + +void XSyslogFieldsImp::setSyslogTag(const XString& syslogTag) +{ + comVals_["syslogTag"] = syslogTag; +} + +void XSyslogFieldsImp::setSyslogVer(XNumber syslogVer) +{ + comVals_["syslogVer"] = syslogVer; +} + +void XSyslogFieldsImp::setAdditionalFields(const XHashMap& additionalFields) +{ + additionalFields_ = additionalFields; +} + +void XSyslogFieldsImp::setSyslogSdId(const XString& syslogSdId) +{ + comVals_["syslogSdId"] = syslogSdId; +} + +json XSyslogFieldsImp::toJson() +{ + try + { + json field = { + { "eventSourceType", XEnumSyslogFieldsEventSourceTypeMapping[eventSourceType_] }, + { "syslogMsg", syslogMsg_ }, + { "syslogFieldsVersion", XEnumSyslogFieldsSyslogFieldsVersionMapping[syslogFieldsVersion_] }, + { "syslogTag", syslogTag_ } + }; + + //optional val + if (!additionalFields_.empty()) + { + field["additionalFields"] = additionalFields_; + } + + field = mergeCommonValues(field, comVals_); + + json jsEvent; + header_->setDomain(XEnumCommonEventHeaderDomainSyslog); + jsEvent["event"]["commonEventHeader"] = dynamic_pointer_cast(header_)->toJson(); + jsEvent["event"]["syslogFields"] = field; + + return jsEvent; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XSyslogFields to json object:{}.", e.what()); + return json(); + } +} + +std::shared_ptr XSyslogFieldsImp::getCommonHeader() +{ + return header_; +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XSyslogFieldsImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XSyslogFieldsImp.h new file mode 100755 index 0000000..e730076 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XSyslogFieldsImp.h @@ -0,0 +1,55 @@ +#pragma once + +#include "XSyslogFields.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XSyslogFieldsImp : public XSyslogFields, public XJsonable + { + public: + XSyslogFieldsImp(std::shared_ptr header, + XEnumSyslogFieldsEventSourceType eventSourceType, + const XString& syslogTag, + const XString& syslogMsg + ); + + virtual std::string toString() override; + + virtual json toJson() override; + + virtual std::shared_ptr getCommonHeader() override; + + virtual void setSyslogProcId(XNumber syslogProcId) override; + virtual void setSyslogFacility(XInteger syslogFacility) override; + virtual void setSyslogPri(XInteger syslogPri) override; + virtual void setEventSourceType(XEnumSyslogFieldsEventSourceType eventSourceType) override; + virtual void setSyslogMsgHost(const XString& syslogMsgHost) override; + virtual void setSyslogSev(XEnumSyslogFieldsSyslogSev syslogSev) override; + virtual void setSyslogSData(const XString& syslogSData) override; + virtual void setSyslogMsg(const XString& syslogMsg) override; + virtual void setSyslogProc(const XString& syslogProc) override; + virtual void setEventSourceHost(const XString& eventSourceHost) override; + virtual void setSyslogTs(const XString& syslogTs) override; + virtual void setSyslogTag(const XString& syslogTag) override; + virtual void setSyslogVer(XNumber syslogVer) override; + virtual void setAdditionalFields(const XHashMap& additionalFields) override; + virtual void setSyslogSdId(const XString& syslogSdId) override; + + private: + //required + std::shared_ptr header_; + XEnumSyslogFieldsEventSourceType eventSourceType_; + XString syslogMsg_; + XEnumSyslogFieldsSyslogFieldsVersion syslogFieldsVersion_; + XString syslogTag_; + //optional + XEnumSyslogFieldsSyslogSev syslogSev_; + XHashMap additionalFields_; + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XThresholdCrossingAlertFields.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XThresholdCrossingAlertFields.cpp new file mode 100755 index 0000000..c9655c9 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XThresholdCrossingAlertFields.cpp @@ -0,0 +1,14 @@ +#include "XThresholdCrossingAlertFields.h" +#include "XThresholdCrossingAlertFieldsImp.h" + +std::shared_ptr vagt::encode::XThresholdCrossingAlertFields::create(std::shared_ptr header, XEnumThresholdCrossingAlertFieldsAlertAction alertAction, XEnumThresholdCrossingAlertFieldsAlertType alertType, XEnumThresholdCrossingAlertFieldsEventSeverity eventSeverity, const XString & alertDescription, const XString & collectionTimestamp, const XString & eventStartTimestamp, const XArrayOfXCounter & additionalParameters) +{ + return std::make_shared(header, + alertAction, + alertType, + eventSeverity, + alertDescription, + collectionTimestamp, + eventStartTimestamp, + additionalParameters); + } diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XThresholdCrossingAlertFieldsImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XThresholdCrossingAlertFieldsImp.cpp new file mode 100755 index 0000000..849dd31 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XThresholdCrossingAlertFieldsImp.cpp @@ -0,0 +1,188 @@ +#include "XThresholdCrossingAlertFieldsImp.h" + +const std::string XEnumThresholdCrossingAlertFieldsThresholdCrossingFieldsVersionMapping[] = { + "4.0" +}; + +const std::string XEnumThresholdCrossingAlertFieldsAlertTypeMapping[] = { + "CARD-ANOMALY", + "ELEMENT-ANOMALY", + "INTERFACE-ANOMALY", + "SERVICE-ANOMALY" +}; + +const std::string XEnumThresholdCrossingAlertFieldsEventSeverityMapping[] = { + "CRITICAL", + "MAJOR", + "MINOR", + "WARNING", + "NORMAL" +}; + +const std::string XEnumThresholdCrossingAlertFieldsAlertActionMapping[] = { + "CLEAR", + "CONT", + "SET" +}; + +XThresholdCrossingAlertFieldsImp::XThresholdCrossingAlertFieldsImp(std::shared_ptr header, + XEnumThresholdCrossingAlertFieldsAlertAction alertAction, + XEnumThresholdCrossingAlertFieldsAlertType alertType, + XEnumThresholdCrossingAlertFieldsEventSeverity eventSeverity, + const XString& alertDescription, + const XString& collectionTimestamp, + const XString& eventStartTimestamp, + const XArrayOfXCounter& additionalParameters + ): + header_(header), + additionalParameters_(additionalParameters), + alertAction_(alertAction), + alertDescription_(alertDescription), + alertType_(alertType), + collectionTimestamp_(collectionTimestamp), + eventSeverity_(eventSeverity), + eventStartTimestamp_(eventStartTimestamp), + thresholdCrossingFieldsVersion_(XEnumThresholdCrossingAlertFieldsThresholdCrossingFieldsVersion4_0) +{ + +} + +std::string XThresholdCrossingAlertFieldsImp::toString() +{ + try + { + auto js = toJson(); + return js.dump(); + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to dump XThresholdCrossingAlertFields to json string:{}.", e.what()); + return ""; + } +} + +void XThresholdCrossingAlertFieldsImp::setAlertDescription(const XString& alertDescription) +{ + comVals_["alertDescription"] = alertDescription; +} + +void XThresholdCrossingAlertFieldsImp::setAlertType(XEnumThresholdCrossingAlertFieldsAlertType alertType) +{ + auto val = XEnumThresholdCrossingAlertFieldsAlertTypeMapping[alertType]; + comVals_["alertType"] = val; +} + +void XThresholdCrossingAlertFieldsImp::setInterfaceName(const XString& interfaceName) +{ + comVals_["interfaceName"] = interfaceName; +} + +void XThresholdCrossingAlertFieldsImp::setCollectionTimestamp(const XString& collectionTimestamp) +{ + comVals_["collectionTimestamp"] = collectionTimestamp; +} + +void XThresholdCrossingAlertFieldsImp::setEventSeverity(XEnumThresholdCrossingAlertFieldsEventSeverity eventSeverity) +{ + auto val = XEnumThresholdCrossingAlertFieldsEventSeverityMapping[eventSeverity]; + comVals_["eventSeverity"] = val; +} + +void XThresholdCrossingAlertFieldsImp::setPossibleRootCause(const XString& possibleRootCause) +{ + comVals_["possibleRootCause"] = possibleRootCause; +} + +void XThresholdCrossingAlertFieldsImp::setAssociatedAlertIdList(const XArrayOfString& associatedAlertIdList) +{ + associatedAlertIdList_ = associatedAlertIdList; +} + +void XThresholdCrossingAlertFieldsImp::setAlertValue(const XString& alertValue) +{ + comVals_["alertValue"] = alertValue; +} + +void XThresholdCrossingAlertFieldsImp::setDataCollector(const XString& dataCollector) +{ + comVals_["dataCollector"] = dataCollector; +} + +void XThresholdCrossingAlertFieldsImp::setAdditionalParameters(const XArrayOfXCounter& additionalParameters) +{ + additionalParameters_ = additionalParameters; +} + +void XThresholdCrossingAlertFieldsImp::setAlertAction(XEnumThresholdCrossingAlertFieldsAlertAction alertAction) +{ + auto val = XEnumThresholdCrossingAlertFieldsAlertActionMapping[alertAction]; + comVals_["alertAction"] = val; +} + +void XThresholdCrossingAlertFieldsImp::setNetworkService(const XString& networkService) +{ + comVals_["networkService"] = networkService; +} + +void XThresholdCrossingAlertFieldsImp::setElementType(const XString& elementType) +{ + comVals_["elementType"] = elementType; +} + +void XThresholdCrossingAlertFieldsImp::setAdditionalFields(const XHashMap& additionalFields) +{ + additionalFields_ = additionalFields; +} + +void XThresholdCrossingAlertFieldsImp::setEventStartTimestamp(const XString& eventStartTimestamp) +{ + comVals_["eventStartTimestamp"] = eventStartTimestamp; +} + +json XThresholdCrossingAlertFieldsImp::toJson() +{ + try + { + json field = { + {"thresholdCrossingFieldsVersion", XEnumThresholdCrossingAlertFieldsThresholdCrossingFieldsVersionMapping[thresholdCrossingFieldsVersion_]}, + {"alertDescription", alertDescription_}, + {"alertType", XEnumThresholdCrossingAlertFieldsAlertTypeMapping[alertType_]}, + {"collectionTimestamp", collectionTimestamp_}, + {"eventSeverity", XEnumThresholdCrossingAlertFieldsEventSeverityMapping[eventSeverity_]}, + {"additionalParameters", fromArray(additionalParameters_)}, + {"alertAction", XEnumThresholdCrossingAlertFieldsAlertActionMapping[alertAction_]}, + {"eventStartTimestamp", eventStartTimestamp_} + }; + + //optional val + if (!associatedAlertIdList_.empty()) + { + field["associatedAlertIdList"] = associatedAlertIdList_; + } + + if (!additionalFields_.empty()) + { + field["additionalFields"] = additionalFields_; + } + + field = mergeCommonValues(field, comVals_); + + json jsEvent; + header_->setDomain(XEnumCommonEventHeaderDomainThresholdCrossingAlert); + jsEvent["event"]["commonEventHeader"] = dynamic_pointer_cast(header_)->toJson(); + jsEvent["event"]["thresholdCrossingAlertFields"] = field; + + return jsEvent; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XThresholdCrossingAlertFields to json object:{}.", e.what()); + return json(); + } +} + +std::shared_ptr XThresholdCrossingAlertFieldsImp::getCommonHeader() +{ + return header_; +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XThresholdCrossingAlertFieldsImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XThresholdCrossingAlertFieldsImp.h new file mode 100755 index 0000000..aea3960 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XThresholdCrossingAlertFieldsImp.h @@ -0,0 +1,63 @@ +#pragma once + +#include "XThresholdCrossingAlertFields.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XThresholdCrossingAlertFieldsImp : public XThresholdCrossingAlertFields, public XJsonable + { + public: + XThresholdCrossingAlertFieldsImp(std::shared_ptr header, + XEnumThresholdCrossingAlertFieldsAlertAction alertAction, + XEnumThresholdCrossingAlertFieldsAlertType alertType, + XEnumThresholdCrossingAlertFieldsEventSeverity eventSeverity, + const XString& alertDescription, + const XString& collectionTimestamp, + const XString& eventStartTimestamp, + const XArrayOfXCounter& additionalParameters + ); + + virtual std::string toString() override; + + virtual json toJson() override; + + virtual std::shared_ptr getCommonHeader() override; + + virtual void setAlertDescription(const XString& alertDescription) override; + virtual void setAlertType(XEnumThresholdCrossingAlertFieldsAlertType alertType) override; + virtual void setInterfaceName(const XString& interfaceName) override; + virtual void setCollectionTimestamp(const XString& collectionTimestamp) override; + virtual void setEventSeverity(XEnumThresholdCrossingAlertFieldsEventSeverity eventSeverity) override; + virtual void setPossibleRootCause(const XString& possibleRootCause) override; + virtual void setAssociatedAlertIdList(const XArrayOfString& associatedAlertIdList) override; + virtual void setAlertValue(const XString& alertValue) override; + virtual void setDataCollector(const XString& dataCollector) override; + virtual void setAdditionalParameters(const XArrayOfXCounter& additionalParameters) override; + virtual void setAlertAction(XEnumThresholdCrossingAlertFieldsAlertAction alertAction) override; + virtual void setNetworkService(const XString& networkService) override; + virtual void setElementType(const XString& elementType) override; + virtual void setAdditionalFields(const XHashMap& additionalFields) override; + virtual void setEventStartTimestamp(const XString& eventStartTimestamp) override; + + private: + //required + std::shared_ptr header_; + XEnumThresholdCrossingAlertFieldsThresholdCrossingFieldsVersion thresholdCrossingFieldsVersion_; + XString alertDescription_; + XEnumThresholdCrossingAlertFieldsAlertType alertType_; + XString collectionTimestamp_; + XEnumThresholdCrossingAlertFieldsEventSeverity eventSeverity_; + XArrayOfXCounter additionalParameters_; + XEnumThresholdCrossingAlertFieldsAlertAction alertAction_; + XString eventStartTimestamp_; + //optional + XArrayOfString associatedAlertIdList_; + XHashMap additionalFields_; + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XVendorNfNameFields.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XVendorNfNameFields.cpp new file mode 100755 index 0000000..b415c4a --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XVendorNfNameFields.cpp @@ -0,0 +1,26 @@ +#include "XVendorNfNameFields.h" +#include "XVendorNfNameFieldsImp.h" + +vagt::encode::XVendorNfNameFields::XVendorNfNameFields() +{ +} + +vagt::encode::XVendorNfNameFields::XVendorNfNameFields(const XString & vendorName): + imp_(make_shared(vendorName)) +{ +} + +void vagt::encode::XVendorNfNameFields::setNfModuleName(const XString & nfModuleName) +{ + return imp_->setNfModuleName(nfModuleName); +} + +void vagt::encode::XVendorNfNameFields::setNfName(const XString & nfName) +{ + return imp_->setNfName(nfName); +} + +void vagt::encode::XVendorNfNameFields::setVendorName(const XString & vendorName) +{ + return imp_->setVendorName(vendorName); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XVendorNfNameFieldsImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XVendorNfNameFieldsImp.cpp new file mode 100755 index 0000000..a0bc12f --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XVendorNfNameFieldsImp.cpp @@ -0,0 +1,49 @@ +#include "XVendorNfNameFieldsImp.h" + +XVendorNfNameFieldsImp::XVendorNfNameFieldsImp(const XString& vendorName): + vendorName_(vendorName) +{ + +} + +void XVendorNfNameFieldsImp::setNfModuleName(const XString& nfModuleName) +{ + comVals_["nfModuleName"] = nfModuleName; +} + +void XVendorNfNameFieldsImp::setNfName(const XString& nfName) +{ + comVals_["nfName"] = nfName; +} + +void XVendorNfNameFieldsImp::setVendorName(const XString& vendorName) +{ + comVals_["vendorName"] = vendorName; +} + +json XVendorNfNameFieldsImp::toJson() +{ + try + { + if (vendorName_.empty()) + { + return json(); + } + + json field = { + {"vendorName", vendorName_} + }; + + //optional val + + field = mergeCommonValues(field, comVals_); + + return field; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XVendorNfNameFields to json object:{}.", e.what()); + return json(); + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XVendorNfNameFieldsImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XVendorNfNameFieldsImp.h new file mode 100755 index 0000000..c907241 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XVendorNfNameFieldsImp.h @@ -0,0 +1,29 @@ +#pragma once + +#include "XVendorNfNameFields.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XVendorNfNameFieldsImp : public XVendorNfNameFields, public XJsonable + { + public: + XVendorNfNameFieldsImp(const XString& vendorName); + + virtual json toJson() override; + + virtual void setNfModuleName(const XString& nfModuleName) override; + virtual void setNfName(const XString& nfName) override; + virtual void setVendorName(const XString& vendorName) override; + + private: + //required + XString vendorName_; + //optional + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XVoiceQualityFields.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XVoiceQualityFields.cpp new file mode 100755 index 0000000..1b1f83d --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XVoiceQualityFields.cpp @@ -0,0 +1,12 @@ +#include "XVoiceQualityFields.h" +#include "XVoiceQualityFieldsImp.h" + +std::shared_ptr vagt::encode::XVoiceQualityFields::create(std::shared_ptr header, const XString & calleeSideCodec, const XString & callerSideCodec, const XString & correlator, const XString & midCallRtcp, const XVendorNfNameFields & vendorNfNameFields) +{ + return std::make_shared(header, + calleeSideCodec, + callerSideCodec, + correlator, + midCallRtcp, + vendorNfNameFields); +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XVoiceQualityFieldsImp.cpp b/veslibrary/ves_cpplibrary/src/lib/encode/XVoiceQualityFieldsImp.cpp new file mode 100755 index 0000000..055dd21 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XVoiceQualityFieldsImp.cpp @@ -0,0 +1,126 @@ +#include "XVoiceQualityFieldsImp.h" + +const std::string XEnumVoiceQualityFieldsVoiceQualityFieldsVersionMapping[] = { + "4.0" +}; + +XVoiceQualityFieldsImp::XVoiceQualityFieldsImp(std::shared_ptr header, + const XString& calleeSideCodec, + const XString& callerSideCodec, + const XString& correlator, + const XString& midCallRtcp, + const XVendorNfNameFields& vendorNfNameFields): + header_(header), + calleeSideCodec_(calleeSideCodec), + callerSideCodec_(callerSideCodec), + correlator_(correlator), + midCallRtcp_(midCallRtcp), + vendorNfNameFields_(vendorNfNameFields), + voiceQualityFieldsVersion_(XEnumVoiceQualityFieldsVoiceQualityFieldsVersion4_0) +{ + +} + +std::string XVoiceQualityFieldsImp::toString() +{ + try + { + auto js = toJson(); + return js.dump(); + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to dump XVoiceQualityFields to json string:{}.", e.what()); + return ""; + } +} + +void XVoiceQualityFieldsImp::setMidCallRtcp(const XString& midCallRtcp) +{ + comVals_["midCallRtcp"] = midCallRtcp; +} + +void XVoiceQualityFieldsImp::setAdditionalInformation(const XHashMap& additionalInformation) +{ + additionalInformation_ = additionalInformation; +} + +void XVoiceQualityFieldsImp::setEndOfCallVqmSummaries(const XEndOfCallVqmSummaries& endOfCallVqmSummaries) +{ + endOfCallVqmSummaries_ = endOfCallVqmSummaries.imp_; +} + +void XVoiceQualityFieldsImp::setCalleeSideCodec(const XString& calleeSideCodec) +{ + comVals_["calleeSideCodec"] = calleeSideCodec; +} + +void XVoiceQualityFieldsImp::setPhoneNumber(const XString& phoneNumber) +{ + comVals_["phoneNumber"] = phoneNumber; +} + +void XVoiceQualityFieldsImp::setCallerSideCodec(const XString& callerSideCodec) +{ + comVals_["callerSideCodec"] = callerSideCodec; +} + +void XVoiceQualityFieldsImp::setCorrelator(const XString& correlator) +{ + comVals_["correlator"] = correlator; +} + +void XVoiceQualityFieldsImp::setVendorNfNameFields(const XVendorNfNameFields& vendorNfNameFields) +{ + vendorNfNameFields_ = vendorNfNameFields; +} + +json XVoiceQualityFieldsImp::toJson() +{ + try + { + json field = { + {"midCallRtcp", midCallRtcp_}, + {"calleeSideCodec", calleeSideCodec_}, + {"callerSideCodec", callerSideCodec_}, + {"correlator", correlator_}, + {"vendorNfNameFields", dynamic_pointer_cast(vendorNfNameFields_.imp_)->toJson()}, + {"voiceQualityFieldsVersion", XEnumVoiceQualityFieldsVoiceQualityFieldsVersionMapping[voiceQualityFieldsVersion_]} + }; + + //optional val + if (!additionalInformation_.empty()) + { + field["additionalInformation"] = additionalInformation_; + } + + if (endOfCallVqmSummaries_) + { + auto endOfCallVqmSummaries = dynamic_pointer_cast(endOfCallVqmSummaries_); + if (endOfCallVqmSummaries && !endOfCallVqmSummaries->toJson().empty()) + { + field["endOfCallVqmSummaries"] = endOfCallVqmSummaries->toJson(); + } + } + + field = mergeCommonValues(field, comVals_); + + json jsEvent; + header_->setDomain(XEnumCommonEventHeaderDomainVoiceQuality); + jsEvent["event"]["commonEventHeader"] = dynamic_pointer_cast(header_)->toJson(); + jsEvent["event"]["voiceQualityFields"] = field; + + return jsEvent; + } + catch (json::exception& e) + { + SPDLOG_ERROR("Fail to build XVoiceQualityFields to json object:{}.", e.what()); + return json(); + } +} + +std::shared_ptr XVoiceQualityFieldsImp::getCommonHeader() +{ + return header_; +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/XVoiceQualityFieldsImp.h b/veslibrary/ves_cpplibrary/src/lib/encode/XVoiceQualityFieldsImp.h new file mode 100755 index 0000000..bfa2caf --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/XVoiceQualityFieldsImp.h @@ -0,0 +1,51 @@ +#pragma once + +#include "XVoiceQualityFields.h" +#include "XInternal.h" + +namespace vagt +{ + namespace encode + { + class XVoiceQualityFieldsImp : public XVoiceQualityFields, public XJsonable + { + public: + XVoiceQualityFieldsImp(std::shared_ptr header, + const XString& calleeSideCodec, + const XString& callerSideCodec, + const XString& correlator, + const XString& midCallRtcp, + const XVendorNfNameFields& vendorNfNameFields); + + virtual std::string toString() override; + + virtual json toJson() override; + + virtual std::shared_ptr getCommonHeader() override; + + virtual void setMidCallRtcp(const XString& midCallRtcp) override; + virtual void setAdditionalInformation(const XHashMap& additionalInformation) override; + virtual void setEndOfCallVqmSummaries(const XEndOfCallVqmSummaries& endOfCallVqmSummaries) override; + virtual void setCalleeSideCodec(const XString& calleeSideCodec) override; + virtual void setPhoneNumber(const XString& phoneNumber) override; + virtual void setCallerSideCodec(const XString& callerSideCodec) override; + virtual void setCorrelator(const XString& correlator) override; + virtual void setVendorNfNameFields(const XVendorNfNameFields& vendorNfNameFields) override; + + private: + //required + std::shared_ptr header_; + XString midCallRtcp_; + XString calleeSideCodec_; + XString callerSideCodec_; + XString correlator_; + XVendorNfNameFields vendorNfNameFields_; + XEnumVoiceQualityFieldsVoiceQualityFieldsVersion voiceQualityFieldsVersion_; + //optional + XHashMap additionalInformation_; + std::shared_ptr endOfCallVqmSummaries_; + std::map comVals_; + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XBatch.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XBatch.h new file mode 100755 index 0000000..c8c3663 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XBatch.h @@ -0,0 +1,20 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + class XBatch: public XSerialable + { + public: + virtual std::string toString() = 0; + + virtual void addEvent(std::shared_ptr event) = 0; + + static std::shared_ptr create(); + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XCodecsInUse.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XCodecsInUse.h new file mode 100644 index 0000000..42ab9e9 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XCodecsInUse.h @@ -0,0 +1,26 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + class XCodecsInUse + { + public: + XCodecsInUse(const XString& codecIdentifier, + XInteger numberInUse); + + virtual void setCodecIdentifier(const XString& codecIdentifier); + virtual void setNumberInUse(XInteger numberInUse); + + std::shared_ptr imp_; + protected: + XCodecsInUse(); + }; + + using XArrayOfXCodecsInUse = std::vector; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XCommonEventHeader.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XCommonEventHeader.h new file mode 100755 index 0000000..aefdfbb --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XCommonEventHeader.h @@ -0,0 +1,83 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + using XInternalHeaderFields = std::string; + + enum XEnumCommonEventHeaderVersion + { + XEnumCommonEventHeaderVersion4_0_1, + }; + + enum XEnumCommonEventHeaderVesEventListenerVersion + { + XEnumCommonEventHeaderVesEventListenerVersion7_0_1, + }; + + enum XEnumCommonEventHeaderDomain + { + XEnumCommonEventHeaderDomainFault, + XEnumCommonEventHeaderDomainHeartbeat, + XEnumCommonEventHeaderDomainMeasurement, + XEnumCommonEventHeaderDomainMobileFlow, + XEnumCommonEventHeaderDomainNotification, + XEnumCommonEventHeaderDomainOther, + XEnumCommonEventHeaderDomainPnfRegistration, + XEnumCommonEventHeaderDomainSipSignaling, + XEnumCommonEventHeaderDomainStateChange, + XEnumCommonEventHeaderDomainSyslog, + XEnumCommonEventHeaderDomainThresholdCrossingAlert, + XEnumCommonEventHeaderDomainVoiceQuality, + }; + + enum XEnumCommonEventHeaderPriority + { + XEnumCommonEventHeaderPriorityHigh, + XEnumCommonEventHeaderPriorityMedium, + XEnumCommonEventHeaderPriorityNormal, + XEnumCommonEventHeaderPriorityLow, + }; + + class XCommonEventHeader : public XSerialable + { + public: + virtual std::string toString() = 0; + + virtual void setEventId(const XString& eventId) = 0; + virtual void setReportingEntityId(const XString& reportingEntityId) = 0; + virtual void setDomain(XEnumCommonEventHeaderDomain domain) = 0; + virtual void setLastEpochMicrosec(XInteger lastEpochMicrosec) = 0; + virtual void setReportingEntityName(const XString& reportingEntityName) = 0; + virtual void setSourceId(const XString& sourceId) = 0; + virtual void setEventType(const XString& eventType) = 0; + virtual void setSequence(XInteger sequence) = 0; + virtual void setInternalHeaderFields(const XInternalHeaderFields& internalHeaderFields) = 0; + virtual void setPriority(XEnumCommonEventHeaderPriority priority) = 0; + virtual void setSourceName(const XString& sourceName) = 0; + virtual void setEventName(const XString& eventName) = 0; + virtual void setNfNamingCode(const XString& nfNamingCode) = 0; + virtual void setStartEpochMicrosec(XInteger startEpochMicrosec) = 0; + virtual void setNfVendorName(const XString& nfVendorName) = 0; + virtual void setTimeZoneOffset(const XString& timeZoneOffset) = 0; + virtual void setNfcNamingCode(const XString& nfcNamingCode) = 0; + + static std::shared_ptr create(const XString& eventName, + const XString& eventId, + const XString& sourceName, + const XString& reportingEntityName, + XEnumCommonEventHeaderPriority priority, + XInteger sequence); + }; + + class XExtendEvent : public XSerialable + { + public: + virtual std::shared_ptr getCommonHeader() = 0; + }; + } +} + diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XCounter.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XCounter.h new file mode 100644 index 0000000..467ae44 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XCounter.h @@ -0,0 +1,35 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + enum XEnumCounterCriticality + { + XEnumCounterCriticalityCRIT, + XEnumCounterCriticalityMAJ, + }; + + class XCounter + { + public: + XCounter(XEnumCounterCriticality criticality, + const XHashMap& hashMap, + const XString& thresholdCrossed); + + virtual void setThresholdCrossed(const XString& thresholdCrossed); + virtual void setHashMap(const XHashMap& hashMap); + virtual void setCriticality(XEnumCounterCriticality criticality); + + std::shared_ptr imp_; + + protected: + XCounter(); + }; + + using XArrayOfXCounter = std::vector; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XCpuUsage.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XCpuUsage.h new file mode 100755 index 0000000..3548468 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XCpuUsage.h @@ -0,0 +1,42 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + class XCpuUsage + { + public: + XCpuUsage(const XString& cpuIdentifier, + XNumber percentUsage); + + virtual void setPercentUsage(XNumber percentUsage); + virtual void setCpuUsageInterrupt(XNumber cpuUsageInterrupt); + virtual void setCpuWait(XNumber cpuWait); + virtual void setCpuCapacityContention(XNumber cpuCapacityContention); + virtual void setCpuUsageNice(XNumber cpuUsageNice); + virtual void setCpuDemandMhz(XNumber cpuDemandMhz); + virtual void setCpuUsageSoftIrq(XNumber cpuUsageSoftIrq); + virtual void setCpuLatencyAvg(XNumber cpuLatencyAvg); + virtual void setCpuUsageSteal(XNumber cpuUsageSteal); + virtual void setCpuDemandPct(XNumber cpuDemandPct); + virtual void setCpuDemandAvg(XNumber cpuDemandAvg); + virtual void setCpuIdle(XNumber cpuIdle); + virtual void setCpuSwapWaitTime(XNumber cpuSwapWaitTime); + virtual void setCpuUsageSystem(XNumber cpuUsageSystem); + virtual void setCpuOverheadAvg(XNumber cpuOverheadAvg); + virtual void setCpuUsageUser(XNumber cpuUsageUser); + virtual void setCpuIdentifier(const XString& cpuIdentifier); + + std::shared_ptr imp_; + + protected: + XCpuUsage(); + }; + + using XArrayOfXCpuUsage = std::vector; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XDiskUsage.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XDiskUsage.h new file mode 100755 index 0000000..8128cea --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XDiskUsage.h @@ -0,0 +1,79 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + class XDiskUsage + { + public: + XDiskUsage(const XString& diskIdentifier); + + virtual void setDiskOctetsWriteLast(XNumber diskOctetsWriteLast); + virtual void setDiskIoTimeAvg(XNumber diskIoTimeAvg); + virtual void setDiskMergedReadMin(XNumber diskMergedReadMin); + virtual void setDiskTotalReadLatencyAvg(XNumber diskTotalReadLatencyAvg); + virtual void setDiskOpsReadMax(XNumber diskOpsReadMax); + virtual void setDiskOpsReadMin(XNumber diskOpsReadMin); + virtual void setDiskBusResets(XNumber diskBusResets); + virtual void setDiskMergedReadLast(XNumber diskMergedReadLast); + virtual void setDiskTimeReadAvg(XNumber diskTimeReadAvg); + virtual void setDiskMergedWriteMax(XNumber diskMergedWriteMax); + virtual void setDiskTime(XNumber diskTime); + virtual void setDiskOpsWriteLast(XNumber diskOpsWriteLast); + virtual void setDiskOpsReadAvg(XNumber diskOpsReadAvg); + virtual void setDiskFlushRequests(XNumber diskFlushRequests); + virtual void setDiskFlushTime(XNumber diskFlushTime); + virtual void setDiskOpsReadLast(XNumber diskOpsReadLast); + virtual void setDiskMergedReadAvg(XNumber diskMergedReadAvg); + virtual void setDiskWriteCommandsAvg(XNumber diskWriteCommandsAvg); + virtual void setDiskTimeReadMin(XNumber diskTimeReadMin); + virtual void setDiskOpsWriteAvg(XNumber diskOpsWriteAvg); + virtual void setDiskWeightedIoTimeMin(XNumber diskWeightedIoTimeMin); + virtual void setDiskIoTimeLast(XNumber diskIoTimeLast); + virtual void setDiskMergedReadMax(XNumber diskMergedReadMax); + virtual void setDiskOctetsReadMin(XNumber diskOctetsReadMin); + virtual void setDiskWeightedIoTimeAvg(XNumber diskWeightedIoTimeAvg); + virtual void setDiskTimeWriteMin(XNumber diskTimeWriteMin); + virtual void setDiskCommandsAvg(XNumber diskCommandsAvg); + virtual void setDiskTimeWriteMax(XNumber diskTimeWriteMax); + virtual void setDiskPendingOperationsMin(XNumber diskPendingOperationsMin); + virtual void setDiskTimeReadMax(XNumber diskTimeReadMax); + virtual void setDiskOctetsReadMax(XNumber diskOctetsReadMax); + virtual void setDiskOpsWriteMin(XNumber diskOpsWriteMin); + virtual void setDiskReadCommandsAvg(XNumber diskReadCommandsAvg); + virtual void setDiskMergedWriteMin(XNumber diskMergedWriteMin); + virtual void setDiskOctetsWriteMax(XNumber diskOctetsWriteMax); + virtual void setDiskTimeWriteLast(XNumber diskTimeWriteLast); + virtual void setDiskPendingOperationsLast(XNumber diskPendingOperationsLast); + virtual void setDiskWeightedIoTimeLast(XNumber diskWeightedIoTimeLast); + virtual void setDiskIdentifier(const XString& diskIdentifier); + virtual void setDiskOctetsWriteMin(XNumber diskOctetsWriteMin); + virtual void setDiskTimeWriteAvg(XNumber diskTimeWriteAvg); + virtual void setDiskOctetsWriteAvg(XNumber diskOctetsWriteAvg); + virtual void setDiskOctetsReadLast(XNumber diskOctetsReadLast); + virtual void setDiskWeightedIoTimeMax(XNumber diskWeightedIoTimeMax); + virtual void setDiskCommandsAborted(XNumber diskCommandsAborted); + virtual void setDiskOpsWriteMax(XNumber diskOpsWriteMax); + virtual void setDiskTimeReadLast(XNumber diskTimeReadLast); + virtual void setDiskMergedWriteAvg(XNumber diskMergedWriteAvg); + virtual void setDiskOctetsReadAvg(XNumber diskOctetsReadAvg); + virtual void setDiskTotalWriteLatencyAvg(XNumber diskTotalWriteLatencyAvg); + virtual void setDiskIoTimeMax(XNumber diskIoTimeMax); + virtual void setDiskIoTimeMin(XNumber diskIoTimeMin); + virtual void setDiskPendingOperationsAvg(XNumber diskPendingOperationsAvg); + virtual void setDiskMergedWriteLast(XNumber diskMergedWriteLast); + virtual void setDiskPendingOperationsMax(XNumber diskPendingOperationsMax); + + std::shared_ptr imp_; + + protected: + XDiskUsage(); + }; + + using XArrayOfXDiskUsage = std::vector; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XEndOfCallVqmSummaries.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XEndOfCallVqmSummaries.h new file mode 100644 index 0000000..682c258 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XEndOfCallVqmSummaries.h @@ -0,0 +1,58 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + enum XEnumEndOfCallVqmSummariesEndpointDescription + { + XEnumEndOfCallVqmSummariesEndpointDescriptionCaller, + XEnumEndOfCallVqmSummariesEndpointDescriptionCallee, + }; + + class XEndOfCallVqmSummaries + { + public: + XEndOfCallVqmSummaries(const XString& adjacencyName, + XEnumEndOfCallVqmSummariesEndpointDescription endpointDescription); + + virtual void setLocalRtpPacketsDiscarded(XNumber localRtpPacketsDiscarded); + virtual void setLocalMaxJitter(XNumber localMaxJitter); + virtual void setRoundTripDelay(XNumber roundTripDelay); + virtual void setLocalRtpOctetsSent(XNumber localRtpOctetsSent); + virtual void setLocalAverageJitterBufferDelay(XNumber localAverageJitterBufferDelay); + virtual void setLocalRtpPacketsLost(XNumber localRtpPacketsLost); + virtual void setEndpointRtpOctetsReceived(XNumber endpointRtpOctetsReceived); + virtual void setRFactor(XNumber rFactor); + virtual void setLocalRtpPacketsReceived(XNumber localRtpPacketsReceived); + virtual void setEndpointRtpPacketsLost(XNumber endpointRtpPacketsLost); + virtual void setLocalAverageJitter(XNumber localAverageJitter); + virtual void setMosCqe(XNumber mosCqe); + virtual void setOneWayDelay(XNumber oneWayDelay); + virtual void setEndpointRtpOctetsLost(XNumber endpointRtpOctetsLost); + virtual void setAdjacencyName(const XString& adjacencyName); + virtual void setPacketLossPercent(XNumber packetLossPercent); + virtual void setEndpointRtpOctetsDiscarded(XNumber endpointRtpOctetsDiscarded); + virtual void setLocalRtpPacketsSent(XNumber localRtpPacketsSent); + virtual void setEndpointAverageJitter(XNumber endpointAverageJitter); + virtual void setEndpointRtpOctetsSent(XNumber endpointRtpOctetsSent); + virtual void setEndpointMaxJitter(XNumber endpointMaxJitter); + virtual void setEndpointRtpPacketsReceived(XNumber endpointRtpPacketsReceived); + virtual void setEndpointRtpPacketsSent(XNumber endpointRtpPacketsSent); + virtual void setLocalMaxJitterBufferDelay(XNumber localMaxJitterBufferDelay); + virtual void setLocalRtpOctetsLost(XNumber localRtpOctetsLost); + virtual void setLocalRtpOctetsReceived(XNumber localRtpOctetsReceived); + virtual void setEndpointRtpPacketsDiscarded(XNumber endpointRtpPacketsDiscarded); + virtual void setEndpointDescription(XEnumEndOfCallVqmSummariesEndpointDescription endpointDescription); + virtual void setLocalRtpOctetsDiscarded(XNumber localRtpOctetsDiscarded); + + std::shared_ptr imp_; + + protected: + XEndOfCallVqmSummaries(); + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XEvent.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XEvent.h new file mode 100755 index 0000000..4288d4d --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XEvent.h @@ -0,0 +1,32 @@ +#pragma once + +#include +#include +#include +#include + +namespace vagt +{ + namespace encode + { + using XInteger = long; + using XNumber = double; + using XString = std::string; + using XHashMap = std::map; + using XArrayOfString = std::vector; + + enum XDataType : unsigned short + { + XDataTypeUnknown, + XDataTypeInteger, + XDataTypeNumber, + XDataTypeString, + }; + + class XSerialable + { + public: + virtual std::string toString() = 0; + }; + } +} diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XFaultFields.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XFaultFields.h new file mode 100755 index 0000000..75ff076 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XFaultFields.h @@ -0,0 +1,70 @@ +#pragma once + +#include "XCommonEventHeader.h" + +namespace vagt +{ + namespace encode + { + enum XEnumFaultFieldsFaultFieldsVersion + { + XEnumFaultFieldsFaultFieldsVersion4_0, + }; + + enum XEnumFaultFieldsEventSeverity + { + XEnumFaultFieldsEventSeverityCRITICAL, + XEnumFaultFieldsEventSeverityMAJOR, + XEnumFaultFieldsEventSeverityMINOR, + XEnumFaultFieldsEventSeverityWARNING, + XEnumFaultFieldsEventSeverityNORMAL, + }; + + enum XEnumFaultFieldsVfStatus + { + XEnumFaultFieldsVfStatusActive, + XEnumFaultFieldsVfStatusIdle, + XEnumFaultFieldsVfStatusPreparingToTerminate, + XEnumFaultFieldsVfStatusReadyToTerminate, + XEnumFaultFieldsVfStatusRequestingTermination, + }; + + enum XEnumFaultFieldsEventSourceType + { + XEnumFaultFieldsEventSourceTypeOther, + XEnumFaultFieldsEventSourceTypeRouter, + XEnumFaultFieldsEventSourceTypeSwitch, + XEnumFaultFieldsEventSourceTypeHost, + XEnumFaultFieldsEventSourceTypeCard, + XEnumFaultFieldsEventSourceTypePort, + XEnumFaultFieldsEventSourceTypeSlotThreshold, + XEnumFaultFieldsEventSourceTypePortThreshold, + XEnumFaultFieldsEventSourceTypeVirtualMachine, + XEnumFaultFieldsEventSourceTypeVirtualNetworkFunction, + }; + + class XFaultFields : public XExtendEvent + { + public: + virtual std::string toString() = 0; + virtual std::shared_ptr getCommonHeader() = 0; + + virtual void setAlarmInterfaceA(const XString& alarmInterfaceA) = 0; + virtual void setEventSeverity(XEnumFaultFieldsEventSeverity eventSeverity) = 0; + virtual void setAlarmCondition(const XString& alarmCondition) = 0; + virtual void setVfStatus(XEnumFaultFieldsVfStatus vfStatus) = 0; + virtual void setEventCategory(const XString& eventCategory) = 0; + virtual void setEventSourceType(XEnumFaultFieldsEventSourceType eventSourceType) = 0; + virtual void setSpecificProblem(const XString& specificProblem) = 0; + virtual void setAlarmAdditionalInformation(const XHashMap& alarmAdditionalInformation) = 0; + + static std::shared_ptr create(std::shared_ptr header, + const XString& alarmCondition, + const XString& specificProblem, + XEnumFaultFieldsEventSourceType eventSourceType, + XEnumFaultFieldsEventSeverity eventSeverity, + XEnumFaultFieldsVfStatus vfStatus); + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XFilesystemUsage.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XFilesystemUsage.h new file mode 100755 index 0000000..ed1fef5 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XFilesystemUsage.h @@ -0,0 +1,38 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + class XFilesystemUsage + { + public: + XFilesystemUsage(const XString& filesystemName, + XNumber blockConfigured, + XNumber blockIops, + XNumber blockUsed, + XNumber ephemeralConfigured, + XNumber ephemeralIops, + XNumber ephemeralUsed + ); + + virtual void setBlockConfigured(XNumber blockConfigured); + virtual void setBlockUsed(XNumber blockUsed); + virtual void setEphemeralConfigured(XNumber ephemeralConfigured); + virtual void setEphemeralIops(XNumber ephemeralIops); + virtual void setFilesystemName(const XString& filesystemName); + virtual void setBlockIops(XNumber blockIops); + virtual void setEphemeralUsed(XNumber ephemeralUsed); + + std::shared_ptr imp_; + + protected: + XFilesystemUsage(); + }; + + using XArrayOfXFilesystemUsage = std::vector; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XGtpPerFlowMetrics.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XGtpPerFlowMetrics.h new file mode 100644 index 0000000..edf5b7a --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XGtpPerFlowMetrics.h @@ -0,0 +1,101 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + class XGtpPerFlowMetrics + { + public: + XGtpPerFlowMetrics(XNumber avgBitErrorRate, + XNumber avgPacketDelayVariation, + XNumber avgPacketLatency, + XNumber avgReceiveThroughput, + XNumber avgTransmitThroughput, + XNumber flowActivationEpoch, + XNumber flowActivationMicrosec, + XNumber flowDeactivationEpoch, + XNumber flowDeactivationMicrosec, + const XString& flowDeactivationTime, + const XString& flowStatus, + XNumber maxPacketDelayVariation, + XNumber numActivationFailures, + XNumber numBitErrors, + XNumber numBytesReceived, + XNumber numBytesTransmitted, + XNumber numDroppedPackets, + XNumber numL7BytesReceived, + XNumber numL7BytesTransmitted, + XNumber numLostPackets, + XNumber numOutOfOrderPackets, + XNumber numPacketErrors, + XNumber numPacketsReceivedExclRetrans, + XNumber numPacketsReceivedInclRetrans, + XNumber numPacketsTransmittedInclRetrans, + XNumber numRetries, + XNumber numTimeouts, + XNumber numTunneledL7BytesReceived, + XNumber roundTripTime, + XNumber timeToFirstByte); + + virtual void setNumLostPackets(XNumber numLostPackets); + virtual void setNumPacketsReceivedExclRetrans(XNumber numPacketsReceivedExclRetrans); + virtual void setFlowActivationTime(const XString& flowActivationTime); + virtual void setFlowDeactivationMicrosec(XNumber flowDeactivationMicrosec); + virtual void setFlowDeactivationTime(const XString& flowDeactivationTime); + virtual void setAvgTransmitThroughput(XNumber avgTransmitThroughput); + virtual void setLargePacketRtt(XNumber largePacketRtt); + virtual void setNumHttpErrors(XNumber numHttpErrors); + virtual void setNumTimeouts(XNumber numTimeouts); + virtual void setFlowActivationEpoch(XNumber flowActivationEpoch); + virtual void setNumPacketErrors(XNumber numPacketErrors); + virtual void setAvgPacketDelayVariation(XNumber avgPacketDelayVariation); + virtual void setAvgBitErrorRate(XNumber avgBitErrorRate); + virtual void setFlowActivationMicrosec(XNumber flowActivationMicrosec); + virtual void setAvgPacketLatency(XNumber avgPacketLatency); + virtual void setNumBytesTransmitted(XNumber numBytesTransmitted); + virtual void setNumBitErrors(XNumber numBitErrors); + virtual void setMaxReceiveBitRate(XNumber maxReceiveBitRate); + virtual void setMaxTransmitBitRate(XNumber maxTransmitBitRate); + virtual void setAvgReceiveThroughput(XNumber avgReceiveThroughput); + virtual void setFlowActivatedBy(const XString& flowActivatedBy); + virtual void setNumRetries(XNumber numRetries); + virtual void setDurConnectionFailedStatus(XNumber durConnectionFailedStatus); + virtual void setIpTosCountList(const XHashMap& ipTosCountList); + virtual void setNumL7BytesTransmitted(XNumber numL7BytesTransmitted); + virtual void setTimeToFirstByte(XNumber timeToFirstByte); + virtual void setNumBytesReceived(XNumber numBytesReceived); + virtual void setFlowDeactivationEpoch(XNumber flowDeactivationEpoch); + virtual void setNumGtpEchoFailures(XNumber numGtpEchoFailures); + virtual void setNumPacketsReceivedInclRetrans(XNumber numPacketsReceivedInclRetrans); + virtual void setMobileQciCosCountList(const XHashMap& mobileQciCosCountList); + virtual void setNumGtpTunnelErrors(XNumber numGtpTunnelErrors); + virtual void setRoundTripTime(XNumber roundTripTime); + virtual void setNumActivationFailures(XNumber numActivationFailures); + virtual void setMaxPacketDelayVariation(XNumber maxPacketDelayVariation); + virtual void setNumTunneledL7BytesReceived(XNumber numTunneledL7BytesReceived); + virtual void setNumL7BytesReceived(XNumber numL7BytesReceived); + virtual void setIpTosList(const XArrayOfString& ipTosList); + virtual void setMobileQciCosList(const XArrayOfString& mobileQciCosList); + virtual void setGtpConnectionStatus(const XString& gtpConnectionStatus); + virtual void setTcpFlagList(const XArrayOfString& tcpFlagList); + virtual void setFlowStatus(const XString& flowStatus); + virtual void setNumDroppedPackets(XNumber numDroppedPackets); + virtual void setGtpTunnelStatus(const XString& gtpTunnelStatus); + virtual void setNumPacketsTransmittedInclRetrans(XNumber numPacketsTransmittedInclRetrans); + virtual void setNumOutOfOrderPackets(XNumber numOutOfOrderPackets); + virtual void setLargePacketThreshold(XNumber largePacketThreshold); + virtual void setDurTunnelFailedStatus(XNumber durTunnelFailedStatus); + virtual void setTcpFlagCountList(const XHashMap& tcpFlagCountList); + virtual void setFlowDeactivatedBy(const XString& flowDeactivatedBy); + + std::shared_ptr imp_; + + protected: + XGtpPerFlowMetrics(); + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XHeartbeatFields.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XHeartbeatFields.h new file mode 100644 index 0000000..d09e83b --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XHeartbeatFields.h @@ -0,0 +1,27 @@ +#pragma once + +#include "XCommonEventHeader.h" + +namespace vagt +{ + namespace encode + { + enum XEnumHeartbeatFieldsHeartbeatFieldsVersion + { + XEnumHeartbeatFieldsHeartbeatFieldsVersion3_0, + }; + + class XHeartbeatFields : public XExtendEvent + { + public: + virtual std::string toString() = 0; + virtual std::shared_ptr getCommonHeader() = 0; + + virtual void setHeartbeatInterval(XInteger heartbeatInterval) = 0; + virtual void setAdditionalFields(const XHashMap& additionalFields) = 0; + + static std::shared_ptr create(std::shared_ptr header, XInteger heartbeatInterval); + }; + } +} + diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XHugePages.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XHugePages.h new file mode 100755 index 0000000..eed98e9 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XHugePages.h @@ -0,0 +1,31 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + class XHugePages + { + public: + XHugePages(const XString& hugePagesIdentifier); + + virtual void setBytesUsed(XNumber bytesUsed); + virtual void setHugePagesIdentifier(const XString& hugePagesIdentifier); + virtual void setVmPageNumberFree(XNumber vmPageNumberFree); + virtual void setBytesFree(XNumber bytesFree); + virtual void setPercentFree(XNumber percentFree); + virtual void setPercentUsed(XNumber percentUsed); + virtual void setVmPageNumberUsed(XNumber vmPageNumberUsed); + + std::shared_ptr imp_; + + protected: + XHugePages(); + }; + + using XArrayOfXHugePages = std::vector; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmi.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmi.h new file mode 100755 index 0000000..dcceed6 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmi.h @@ -0,0 +1,44 @@ +#pragma once + +#include "XEvent.h" +#include "XIpmiFan.h" +#include "XIpmiProcessor.h" +#include "XIpmiBaseboardVoltageRegulator.h" +#include "XIpmiGlobalAggregateTemperatureMargin.h" +#include "XIpmiNic.h" +#include "XIpmiBaseboardTemperature.h" +#include "XIpmiPowerSupply.h" +#include "XIpmiHsbp.h" +#include "XIpmiBattery.h" + +namespace vagt +{ + namespace encode + { + class XIpmi + { + public: + XIpmi(); + + virtual void setSystemAirflow(XNumber systemAirflow); + virtual void setIpmiFanArray(const XArrayOfXIpmiFan& ipmiFanArray); + virtual void setIpmiProcessorArray(const XArrayOfXIpmiProcessor& ipmiProcessorArray); + virtual void setExitAirTemperature(XNumber exitAirTemperature); + virtual void setIpmiBaseboardVoltageRegulatorArray(const XArrayOfXIpmiBaseboardVoltageRegulator& ipmiBaseboardVoltageRegulatorArray); + virtual void setIpmiGlobalAggregateTemperatureMarginArray(const XArrayOfXIpmiGlobalAggregateTemperatureMargin& ipmiGlobalAggregateTemperatureMarginArray); + virtual void setIpmiNicArray(const XArrayOfXIpmiNic& ipmiNicArray); + virtual void setIpmiBaseboardTemperatureArray(const XArrayOfXIpmiBaseboardTemperature& ipmiBaseboardTemperatureArray); + virtual void setIpmiPowerSupplyArray(const XArrayOfXIpmiPowerSupply& ipmiPowerSupplyArray); + virtual void setIoModuleTemperature(XNumber ioModuleTemperature); + virtual void setIpmiHsbpArray(const XArrayOfXIpmiHsbp& ipmiHsbpArray); + virtual void setIpmiBatteryArray(const XArrayOfXIpmiBattery& ipmiBatteryArray); + virtual void setFrontPanelTemperature(XNumber frontPanelTemperature); + + std::shared_ptr imp_; + + protected: + XIpmi(void*); + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiBaseboardTemperature.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiBaseboardTemperature.h new file mode 100755 index 0000000..183d0af --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiBaseboardTemperature.h @@ -0,0 +1,26 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + class XIpmiBaseboardTemperature + { + public: + XIpmiBaseboardTemperature(const XString& baseboardTemperatureIdentifier); + + virtual void setBaseboardTemperature(XNumber baseboardTemperature); + virtual void setBaseboardTemperatureIdentifier(const XString& baseboardTemperatureIdentifier); + + std::shared_ptr imp_; + + protected: + XIpmiBaseboardTemperature(); + }; + + using XArrayOfXIpmiBaseboardTemperature = std::vector; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiBaseboardVoltageRegulator.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiBaseboardVoltageRegulator.h new file mode 100755 index 0000000..8e259cd --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiBaseboardVoltageRegulator.h @@ -0,0 +1,26 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + class XIpmiBaseboardVoltageRegulator + { + public: + XIpmiBaseboardVoltageRegulator(const XString& baseboardVoltageRegulatorIdentifier); + + virtual void setBaseboardVoltageRegulatorIdentifier(const XString& baseboardVoltageRegulatorIdentifier); + virtual void setVoltageRegulatorTemperature(XNumber voltageRegulatorTemperature); + + std::shared_ptr imp_; + + protected: + XIpmiBaseboardVoltageRegulator(); + }; + + using XArrayOfXIpmiBaseboardVoltageRegulator = std::vector; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiBattery.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiBattery.h new file mode 100755 index 0000000..37f0ead --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiBattery.h @@ -0,0 +1,27 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + class XIpmiBattery + { + public: + XIpmiBattery(const XString& batteryIdentifier); + + virtual void setBatteryType(const XString& batteryType); + virtual void setBatteryIdentifier(const XString& batteryIdentifier); + virtual void setBatteryVoltageLevel(XNumber batteryVoltageLevel); + + std::shared_ptr imp_; + + protected: + XIpmiBattery(); + }; + + using XArrayOfXIpmiBattery = std::vector; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiFan.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiFan.h new file mode 100755 index 0000000..c297236 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiFan.h @@ -0,0 +1,26 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + class XIpmiFan + { + public: + XIpmiFan(const XString& fanIdentifier); + + virtual void setFanSpeed(XNumber fanSpeed); + virtual void setFanIdentifier(const XString& fanIdentifier); + + std::shared_ptr imp_; + + protected: + XIpmiFan(); + }; + + using XArrayOfXIpmiFan = std::vector; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiGlobalAggregateTemperatureMargin.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiGlobalAggregateTemperatureMargin.h new file mode 100755 index 0000000..9f5e77a --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiGlobalAggregateTemperatureMargin.h @@ -0,0 +1,27 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + class XIpmiGlobalAggregateTemperatureMargin + { + public: + XIpmiGlobalAggregateTemperatureMargin(const XString& ipmiGlobalAggregateTemperatureMarginIdentifier, + XNumber globalAggregateTemperatureMargin); + + virtual void setIpmiGlobalAggregateTemperatureMarginIdentifier(const XString& ipmiGlobalAggregateTemperatureMarginIdentifier); + virtual void setGlobalAggregateTemperatureMargin(XNumber globalAggregateTemperatureMargin); + + std::shared_ptr imp_; + + protected: + XIpmiGlobalAggregateTemperatureMargin(); + }; + + using XArrayOfXIpmiGlobalAggregateTemperatureMargin = std::vector; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiHsbp.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiHsbp.h new file mode 100755 index 0000000..4b1de67 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiHsbp.h @@ -0,0 +1,26 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + class XIpmiHsbp + { + public: + XIpmiHsbp(const XString& hsbpIdentifier); + + virtual void setHsbpTemperature(XNumber hsbpTemperature); + virtual void setHsbpIdentifier(const XString& hsbpIdentifier); + + std::shared_ptr imp_; + + protected: + XIpmiHsbp(); + }; + + using XArrayOfXIpmiHsbp = std::vector; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiNic.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiNic.h new file mode 100755 index 0000000..7eac49a --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiNic.h @@ -0,0 +1,26 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + class XIpmiNic + { + public: + XIpmiNic(const XString& nicIdentifier); + + virtual void setNicIdentifier(const XString& nicIdentifier); + virtual void setNicTemperature(XNumber nicTemperature); + + std::shared_ptr imp_; + + protected: + XIpmiNic(); + }; + + using XArrayOfXIpmiNic = std::vector; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiPowerSupply.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiPowerSupply.h new file mode 100755 index 0000000..429f640 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiPowerSupply.h @@ -0,0 +1,28 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + class XIpmiPowerSupply + { + public: + XIpmiPowerSupply(const XString& powerSupplyIdentifier); + + virtual void setPowerSupplyInputPower(XNumber powerSupplyInputPower); + virtual void setPowerSupplyCurrentOutputPercent(XNumber powerSupplyCurrentOutputPercent); + virtual void setPowerSupplyIdentifier(const XString& powerSupplyIdentifier); + virtual void setPowerSupplyTemperature(XNumber powerSupplyTemperature); + + std::shared_ptr imp_; + + protected: + XIpmiPowerSupply(); + }; + + using XArrayOfXIpmiPowerSupply = std::vector; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiProcessor.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiProcessor.h new file mode 100755 index 0000000..789e75c --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XIpmiProcessor.h @@ -0,0 +1,29 @@ +#pragma once + +#include "XEvent.h" +#include "XProcessorDimmAggregateThermalMargin.h" + +namespace vagt +{ + namespace encode + { + class XIpmiProcessor + { + public: + XIpmiProcessor(const XString& processorIdentifier); + + virtual void setProcessorThermalControlPercent(XNumber processorThermalControlPercent); + virtual void setProcessorDtsThermalMargin(XNumber processorDtsThermalMargin); + virtual void setProcessorIdentifier(const XString& processorIdentifier); + virtual void setProcessorDimmAggregateThermalMarginArray(const XArrayOfXProcessorDimmAggregateThermalMargin& processorDimmAggregateThermalMarginArray); + + std::shared_ptr imp_; + + protected: + XIpmiProcessor(); + }; + + using XArrayOfXIpmiProcessor = std::vector; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XJsonObject.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XJsonObject.h new file mode 100755 index 0000000..25cec50 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XJsonObject.h @@ -0,0 +1,32 @@ +#pragma once + +#include "XEvent.h" +#include "XJsonObjectInstance.h" + +namespace vagt +{ + namespace encode + { + class XJsonObject + { + public: + XJsonObject(const XString& objectName, + const XArrayOfXJsonObjectInstance& objectInstances + ); + + virtual void setObjectSchema(const XString& objectSchema); + virtual void setObjectName(const XString& objectName); + virtual void setNfSubscriptionId(const XString& nfSubscriptionId); + virtual void setObjectInstances(const XArrayOfXJsonObjectInstance& objectInstances); + virtual void setNfSubscribedObjectName(const XString& nfSubscribedObjectName); + virtual void setObjectSchemaUrl(const XString& objectSchemaUrl); + + std::shared_ptr imp_; + protected: + XJsonObject(); + }; + + using XArrayOfJsonObject = std::vector; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XJsonObjectInstance.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XJsonObjectInstance.h new file mode 100755 index 0000000..0c88280 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XJsonObjectInstance.h @@ -0,0 +1,29 @@ +#pragma once + +#include "XEvent.h" +#include "XKey.h" + +namespace vagt +{ + namespace encode + { + class XJsonObject; + class XJsonObjectInstance + { + public: + XJsonObjectInstance(); + + virtual void setJsonObject(const XJsonObject& jsonObject); + virtual void setObjectInstance(const XString& objectInstance); + virtual void setObjectInstanceEpochMicrosec(XNumber objectInstanceEpochMicrosec); + virtual void setObjectKeys(const XArrayOfXKey& objectKeys); + + std::shared_ptr imp_; + + protected: + XJsonObjectInstance(void*); + }; + using XArrayOfXJsonObjectInstance = std::vector; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XKey.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XKey.h new file mode 100755 index 0000000..5424bb3 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XKey.h @@ -0,0 +1,27 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + class XKey + { + public: + XKey(const XString& keyName); + + virtual void setKeyValue(const XString& keyValue); + virtual void setKeyOrder(XInteger keyOrder); + virtual void setKeyName(const XString& keyName); + + std::shared_ptr imp_; + + protected: + XKey(); + }; + + using XArrayOfXKey = std::vector; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XLatencyBucketMeasure.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XLatencyBucketMeasure.h new file mode 100644 index 0000000..b0d0b71 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XLatencyBucketMeasure.h @@ -0,0 +1,27 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + class XLatencyBucketMeasure + { + public: + XLatencyBucketMeasure(XNumber countsInTheBucket); + + virtual void setCountsInTheBucket(XNumber countsInTheBucket); + virtual void setHighEndOfLatencyBucket(XNumber highEndOfLatencyBucket); + virtual void setLowEndOfLatencyBucket(XNumber lowEndOfLatencyBucket); + + std::shared_ptr imp_; + + protected: + XLatencyBucketMeasure(); + }; + + using XArrayOfXLatencyBucketMeasure = std::vector; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XLoad.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XLoad.h new file mode 100755 index 0000000..5966486 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XLoad.h @@ -0,0 +1,26 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + class XLoad + { + public: + XLoad(); + + virtual void setShortTerm(XNumber shortTerm); + virtual void setLongTerm(XNumber longTerm); + virtual void setMidTerm(XNumber midTerm); + + std::shared_ptr imp_; + protected: + XLoad(void*); + }; + + using XArrayOfXLoad = std::vector; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XMachineCheckException.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XMachineCheckException.h new file mode 100644 index 0000000..49d1b81 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XMachineCheckException.h @@ -0,0 +1,29 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + class XMachineCheckException + { + public: + XMachineCheckException(const XString& vmIdentifier); + + virtual void setCorrectedMemoryErrors(XNumber correctedMemoryErrors); + virtual void setUncorrectedMemoryErrors(XNumber uncorrectedMemoryErrors); + virtual void setUncorrectedMemoryErrorsIn1Hr(XNumber uncorrectedMemoryErrorsIn1Hr); + virtual void setCorrectedMemoryErrorsIn1Hr(XNumber correctedMemoryErrorsIn1Hr); + virtual void setVmIdentifier(const XString& vmIdentifier); + + std::shared_ptr imp_; + + protected: + XMachineCheckException(); + }; + + using XArrayOfXMachineCheckException = std::vector; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XMeasurementFields.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XMeasurementFields.h new file mode 100755 index 0000000..309f89a --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XMeasurementFields.h @@ -0,0 +1,64 @@ +#pragma once + +#include "XCommonEventHeader.h" +#include "XNamedHashMap.h" +#include "XCodecsInUse.h" +#include "XCpuUsage.h" +#include "XFilesystemUsage.h" +#include "XLoad.h" +#include "XMachineCheckException.h" +#include "XProcessStats.h" +#include "XNicPerformance.h" +#include "XDiskUsage.h" +#include "XIpmi.h" +#include "XLatencyBucketMeasure.h" +#include "XHugePages.h" +#include "XMemoryUsage.h" +#include "XJsonObject.h" + +namespace vagt +{ + namespace encode + { + enum XEnumMeasurementFieldsMeasurementFieldsVersion + { + XEnumMeasurementFieldsMeasurementFieldsVersion4_0, + }; + + class XMeasurementFields : public XExtendEvent + { + public: + + virtual std::string toString() = 0; + + virtual std::shared_ptr getCommonHeader() = 0; + + virtual void setCodecUsageArray(const XArrayOfXCodecsInUse& codecUsageArray) = 0; + virtual void setFeatureUsageArray(const XHashMap& featureUsageArray) = 0; + virtual void setConfiguredEntities(XInteger configuredEntities) = 0; + virtual void setAdditionalMeasurements(const XArrayOfNamedHashMap& additionalMeasurements) = 0; + virtual void setCpuUsageArray(const XArrayOfXCpuUsage& cpuUsageArray) = 0; + virtual void setRequestRate(XNumber requestRate) = 0; + virtual void setFilesystemUsageArray(const XArrayOfXFilesystemUsage& filesystemUsageArray) = 0; + virtual void setLoadArray(const XArrayOfXLoad& loadArray) = 0; + virtual void setMeasurementInterval(XNumber measurementInterval) = 0; + virtual void setMachineCheckExceptionArray(const XArrayOfXMachineCheckException& machineCheckExceptionArray) = 0; + virtual void setMeanRequestLatency(XNumber meanRequestLatency) = 0; + virtual void setConcurrentSessions(XInteger concurrentSessions) = 0; + virtual void setAdditionalFields(const XHashMap& additionalFields) = 0; + virtual void setProcessStatsArray(const XArrayOfXProcessStats& processStatsArray) = 0; + virtual void setNicPerformanceArray(const XArrayOfXNicPerformance& nicPerformanceArray) = 0; + virtual void setDiskUsageArray(const XArrayOfXDiskUsage& diskUsageArray) = 0; + virtual void setIpmi(const XIpmi& ipmi) = 0; + virtual void setLatencyDistribution(const XArrayOfXLatencyBucketMeasure& latencyDistribution) = 0; + virtual void setHugePagesArray(const XArrayOfXHugePages& hugePagesArray) = 0; + virtual void setAdditionalObjects(const XArrayOfJsonObject& additionalObjects) = 0; + virtual void setMemoryUsageArray(const XArrayOfXMemoryUsage& memoryUsageArray) = 0; + virtual void setNumberOfMediaPortsInUse(XInteger numberOfMediaPortsInUse) = 0; + virtual void setNfcScalingMetric(XInteger nfcScalingMetric) = 0; + + static std::shared_ptr create(std::shared_ptr header, XNumber measurementInterval); + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XMemoryUsage.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XMemoryUsage.h new file mode 100644 index 0000000..1cf2cb4 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XMemoryUsage.h @@ -0,0 +1,43 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + class XMemoryUsage + { + public: + XMemoryUsage(const XString& vmIdentifier, + XNumber memoryFree, + XNumber memoryUsed); + + virtual void setMemorySwapInAvg(XNumber memorySwapInAvg); + virtual void setMemorySwapUsedAvg(XNumber memorySwapUsedAvg); + virtual void setMemorySlabRecl(XNumber memorySlabRecl); + virtual void setMemorySwapInRateAvg(XNumber memorySwapInRateAvg); + virtual void setMemoryDemand(XNumber memoryDemand); + virtual void setMemoryConfigured(XNumber memoryConfigured); + virtual void setMemorySharedAvg(XNumber memorySharedAvg); + virtual void setVmIdentifier(const XString& vmIdentifier); + virtual void setMemoryLatencyAvg(XNumber memoryLatencyAvg); + virtual void setMemorySwapOutAvg(XNumber memorySwapOutAvg); + virtual void setMemorySwapOutRateAvg(XNumber memorySwapOutRateAvg); + virtual void setMemoryFree(XNumber memoryFree); + virtual void setMemorySlabUnrecl(XNumber memorySlabUnrecl); + virtual void setMemoryCached(XNumber memoryCached); + virtual void setMemoryUsed(XNumber memoryUsed); + virtual void setMemoryBuffered(XNumber memoryBuffered); + virtual void setPercentMemoryUsage(XNumber percentMemoryUsage); + + std::shared_ptr imp_; + + protected: + XMemoryUsage(); + }; + + using XArrayOfXMemoryUsage = std::vector; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XMobileFlowFields.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XMobileFlowFields.h new file mode 100755 index 0000000..d690c48 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XMobileFlowFields.h @@ -0,0 +1,67 @@ +#pragma once + +#include "XCommonEventHeader.h" +#include "XGtpPerFlowMetrics.h" + +namespace vagt +{ + namespace encode + { + enum XEnumMobileFlowFieldsMobileFlowFieldsVersion + { + XEnumMobileFlowFieldsMobileFlowFieldsVersion4_0, + }; + + class XMobileFlowFields : public XExtendEvent + { + public: + virtual std::string toString() = 0; + + virtual std::shared_ptr getCommonHeader() = 0; + + virtual void setRac(const XString& rac) = 0; + virtual void setSac(const XString& sac) = 0; + virtual void setSamplingAlgorithm(XInteger samplingAlgorithm) = 0; + virtual void setIpVersion(const XString& ipVersion) = 0; + virtual void setGtpPerFlowMetrics(const XGtpPerFlowMetrics& gtpPerFlowMetrics) = 0; + virtual void setTac(const XString& tac) = 0; + virtual void setMnc(const XString& mnc) = 0; + virtual void setTunnelId(const XString& tunnelId) = 0; + virtual void setAppProtocolVersion(const XString& appProtocolVersion) = 0; + virtual void setGtpVersion(const XString& gtpVersion) = 0; + virtual void setConnectionType(const XString& connectionType) = 0; + virtual void setAdditionalFields(const XHashMap& additionalFields) = 0; + virtual void setHttpHeader(const XString& httpHeader) = 0; + virtual void setImsi(const XString& imsi) = 0; + virtual void setApplicationType(const XString& applicationType) = 0; + virtual void setMsisdn(const XString& msisdn) = 0; + virtual void setMcc(const XString& mcc) = 0; + virtual void setFlowDirection(const XString& flowDirection) = 0; + virtual void setLac(const XString& lac) = 0; + virtual void setOtherEndpointPort(XInteger otherEndpointPort) = 0; + virtual void setVlanId(const XString& vlanId) = 0; + virtual void setImei(const XString& imei) = 0; + virtual void setGtpProtocolType(const XString& gtpProtocolType) = 0; + virtual void setEcgi(const XString& ecgi) = 0; + virtual void setCid(const XString& cid) = 0; + virtual void setReportingEndpointPort(XInteger reportingEndpointPort) = 0; + virtual void setRadioAccessTechnology(const XString& radioAccessTechnology) = 0; + virtual void setAppProtocolType(const XString& appProtocolType) = 0; + virtual void setOtherEndpointIpAddress(const XString& otherEndpointIpAddress) = 0; + virtual void setIpProtocolType(const XString& ipProtocolType) = 0; + virtual void setOtherFunctionalRole(const XString& otherFunctionalRole) = 0; + virtual void setReportingEndpointIpAddr(const XString& reportingEndpointIpAddr) = 0; + + static std::shared_ptr create(std::shared_ptr header, + const XString& flowDirection, + const XGtpPerFlowMetrics& gtpPerFlowMetrics, + const XString& ipProtocolType, + const XString& ipVersion, + const XString& otherEndpointIpAddress, + XInteger otherEndpointPort, + const XString& reportingEndpointIpAddr, + XInteger reportingEndpointPort); + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XNamedHashMap.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XNamedHashMap.h new file mode 100755 index 0000000..d66bf77 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XNamedHashMap.h @@ -0,0 +1,27 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + class XNamedHashMap + { + public: + XNamedHashMap(const XString& name, + const XHashMap& hashMap); + + virtual void setName(const XString& name); + virtual void setHashMap(const XHashMap& hashMap); + + std::shared_ptr imp_; + + protected: + XNamedHashMap(); + }; + + using XArrayOfNamedHashMap = std::vector; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XNicPerformance.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XNicPerformance.h new file mode 100755 index 0000000..d345aa6 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XNicPerformance.h @@ -0,0 +1,82 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + enum XEnumNicPerformanceAdministrativeState + { + XEnumNicPerformanceAdministrativeStateInService, + XEnumNicPerformanceAdministrativeStateOutOfService, + }; + + enum XEnumNicPerformanceOperationalState + { + XEnumNicPerformanceOperationalStateInService, + XEnumNicPerformanceOperationalStateOutOfService, + }; + + enum XEnumNicPerformanceValuesAreSuspect + { + XEnumNicPerformanceValuesAreSuspectTrue, + XEnumNicPerformanceValuesAreSuspectFalse, + }; + + class XNicPerformance + { + public: + XNicPerformance(const XString& nicIdentifier, + XEnumNicPerformanceValuesAreSuspect valuesAreSuspect); + + virtual void setTransmittedErrorPacketsDelta(XNumber transmittedErrorPacketsDelta) ; + virtual void setReceivedErrorPacketsAccumulated(XNumber receivedErrorPacketsAccumulated) ; + virtual void setTransmittedDiscardedPacketsDelta(XNumber transmittedDiscardedPacketsDelta) ; + virtual void setReceivedOctetsDelta(XNumber receivedOctetsDelta) ; + virtual void setReceivedMulticastPacketsDelta(XNumber receivedMulticastPacketsDelta) ; + virtual void setTransmittedDiscardedPacketsAccumulated(XNumber transmittedDiscardedPacketsAccumulated) ; + virtual void setTransmittedMulticastPacketsAccumulated(XNumber transmittedMulticastPacketsAccumulated) ; + virtual void setReceivedDiscardedPacketsDelta(XNumber receivedDiscardedPacketsDelta) ; + virtual void setReceivedOctetsAccumulated(XNumber receivedOctetsAccumulated) ; + virtual void setTransmittedTotalPacketsAccumulated(XNumber transmittedTotalPacketsAccumulated) ; + virtual void setTransmittedOctetsAccumulated(XNumber transmittedOctetsAccumulated) ; + virtual void setSpeed(XNumber speed) ; + virtual void setReceivedDiscardedPacketsAccumulated(XNumber receivedDiscardedPacketsAccumulated) ; + virtual void setReceivedBroadcastPacketsDelta(XNumber receivedBroadcastPacketsDelta) ; + virtual void setReceivedPercentDiscard(XNumber receivedPercentDiscard) ; + virtual void setValuesAreSuspect(XEnumNicPerformanceValuesAreSuspect valuesAreSuspect) ; + virtual void setTransmittedPercentDiscard(XNumber transmittedPercentDiscard) ; + virtual void setTransmittedErrorPacketsAccumulated(XNumber transmittedErrorPacketsAccumulated) ; + virtual void setTransmittedBroadcastPacketsAccumulated(XNumber transmittedBroadcastPacketsAccumulated) ; + virtual void setReceivedTotalPacketsAccumulated(XNumber receivedTotalPacketsAccumulated) ; + virtual void setReceivedUnicastPacketsAccumulated(XNumber receivedUnicastPacketsAccumulated) ; + virtual void setTransmittedBroadcastPacketsDelta(XNumber transmittedBroadcastPacketsDelta) ; + virtual void setTransmittedMulticastPacketsDelta(XNumber transmittedMulticastPacketsDelta) ; + virtual void setReceivedMulticastPacketsAccumulated(XNumber receivedMulticastPacketsAccumulated) ; + virtual void setReceivedTotalPacketsDelta(XNumber receivedTotalPacketsDelta) ; + virtual void setReceivedPercentError(XNumber receivedPercentError) ; + virtual void setReceivedErrorPacketsDelta(XNumber receivedErrorPacketsDelta) ; + virtual void setTransmittedOctetsDelta(XNumber transmittedOctetsDelta) ; + virtual void setNicIdentifier(const XString& nicIdentifier) ; + virtual void setOperationalState(XEnumNicPerformanceOperationalState operationalState) ; + virtual void setTransmittedUnicastPacketsAccumulated(XNumber transmittedUnicastPacketsAccumulated) ; + virtual void setReceivedUnicastPacketsDelta(XNumber receivedUnicastPacketsDelta) ; + virtual void setTransmittedUtilization(XNumber transmittedUtilization) ; + virtual void setReceivedBroadcastPacketsAccumulated(XNumber receivedBroadcastPacketsAccumulated) ; + virtual void setTransmittedUnicastPacketsDelta(XNumber transmittedUnicastPacketsDelta) ; + virtual void setReceivedUtilization(XNumber receivedUtilization) ; + virtual void setAdministrativeState(XEnumNicPerformanceAdministrativeState administrativeState) ; + virtual void setTransmittedPercentError(XNumber transmittedPercentError) ; + virtual void setTransmittedTotalPacketsDelta(XNumber transmittedTotalPacketsDelta) ; + + std::shared_ptr imp_; + + protected: + XNicPerformance(); + }; + + using XArrayOfXNicPerformance = std::vector; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XNotificationFields.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XNotificationFields.h new file mode 100755 index 0000000..6a57a02 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XNotificationFields.h @@ -0,0 +1,38 @@ +#pragma once + +#include "XCommonEventHeader.h" +#include "XNamedHashMap.h" + +namespace vagt +{ + namespace encode + { + enum XEnumNotificationFieldsNotificationFieldsVersion + { + XEnumNotificationFieldsNotificationFieldsVersion2_0, + }; + + class XNotificationFields : public XExtendEvent + { + public: + virtual std::string toString() = 0; + + virtual std::shared_ptr getCommonHeader() = 0; + + virtual void setNewState(const XString& newState) = 0; + virtual void setChangeType(const XString& changeType) = 0; + virtual void setArrayOfNamedHashMap(const XArrayOfNamedHashMap& arrayOfNamedHashMap) = 0; + virtual void setChangeContact(const XString& changeContact) = 0; + virtual void setChangeIdentifier(const XString& changeIdentifier) = 0; + virtual void setAdditionalFields(const XHashMap& additionalFields) = 0; + virtual void setOldState(const XString& oldState) = 0; + virtual void setStateInterface(const XString& stateInterface) = 0; + + static std::shared_ptr create(std::shared_ptr header, + const XString& changeIdentifier, + const XString& changeType + ); + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XOtherFields.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XOtherFields.h new file mode 100755 index 0000000..5926222 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XOtherFields.h @@ -0,0 +1,31 @@ +#pragma once + +#include "XCommonEventHeader.h" +#include "XJsonObject.h" +#include "XNamedHashMap.h" + +namespace vagt +{ + namespace encode + { + enum XEnumOtherFieldsOtherFieldsVersion + { + XEnumOtherFieldsOtherFieldsVersion3_0, + }; + + class XOtherFields : public XExtendEvent + { + public: + virtual std::string toString() = 0; + + virtual std::shared_ptr getCommonHeader() = 0; + + virtual void setJsonObjects(const XArrayOfJsonObject& jsonObjects) = 0; + virtual void setArrayOfNamedHashMap(const XArrayOfNamedHashMap& arrayOfNamedHashMap) = 0; + virtual void setHashMap(const XHashMap& hashMap) = 0; + + static std::shared_ptr create(std::shared_ptr header); + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XPnfRegistrationFields.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XPnfRegistrationFields.h new file mode 100755 index 0000000..bd23fb2 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XPnfRegistrationFields.h @@ -0,0 +1,39 @@ +#pragma once + +#include "XCommonEventHeader.h" + +namespace vagt +{ + namespace encode + { + enum XEnumPnfRegistrationFieldsPnfRegistrationFieldsVersion + { + XEnumPnfRegistrationFieldsPnfRegistrationFieldsVersion2_0, + }; + + class XPnfRegistrationFields : public XExtendEvent + { + public: + + virtual std::string toString() = 0; + + virtual std::shared_ptr getCommonHeader() = 0; + + virtual void setMacAddress(const XString& macAddress) = 0; + virtual void setUnitFamily(const XString& unitFamily) = 0; + virtual void setSerialNumber(const XString& serialNumber) = 0; + virtual void setUnitType(const XString& unitType) = 0; + virtual void setManufactureDate(const XString& manufactureDate) = 0; + virtual void setSoftwareVersion(const XString& softwareVersion) = 0; + virtual void setModelNumber(const XString& modelNumber) = 0; + virtual void setLastServiceDate(const XString& lastServiceDate) = 0; + virtual void setOamV6IpAddress(const XString& oamV6IpAddress) = 0; + virtual void setAdditionalFields(const XHashMap& additionalFields) = 0; + virtual void setVendorName(const XString& vendorName) = 0; + virtual void setOamV4IpAddress(const XString& oamV4IpAddress) = 0; + + static std::shared_ptr create(std::shared_ptr header); + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XProcessStats.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XProcessStats.h new file mode 100755 index 0000000..e92bc25 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XProcessStats.h @@ -0,0 +1,32 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + class XProcessStats + { + public: + XProcessStats(const XString& processIdentifier); + + virtual void setForkRate(XNumber forkRate); + virtual void setPsStateStopped(XNumber psStateStopped); + virtual void setPsStatePaging(XNumber psStatePaging); + virtual void setPsStateSleeping(XNumber psStateSleeping); + virtual void setProcessIdentifier(const XString& processIdentifier); + virtual void setPsStateBlocked(XNumber psStateBlocked); + virtual void setPsStateZombie(XNumber psStateZombie); + virtual void setPsStateRunning(XNumber psStateRunning); + + std::shared_ptr imp_; + + protected: + XProcessStats(); + }; + + using XArrayOfXProcessStats = std::vector; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XProcessorDimmAggregateThermalMargin.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XProcessorDimmAggregateThermalMargin.h new file mode 100755 index 0000000..c0bf11a --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XProcessorDimmAggregateThermalMargin.h @@ -0,0 +1,27 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + class XProcessorDimmAggregateThermalMargin + { + public: + XProcessorDimmAggregateThermalMargin(const XString& processorDimmAggregateThermalMarginIdentifier, + XNumber thermalMargin); + + virtual void setProcessorDimmAggregateThermalMarginIdentifier(const XString& processorDimmAggregateThermalMarginIdentifier); + virtual void setThermalMargin(XNumber thermalMargin); + + std::shared_ptr imp_; + + protected: + XProcessorDimmAggregateThermalMargin(); + }; + + using XArrayOfXProcessorDimmAggregateThermalMargin = std::vector; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XSipSignalingFields.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XSipSignalingFields.h new file mode 100755 index 0000000..878e1b8 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XSipSignalingFields.h @@ -0,0 +1,42 @@ +#pragma once + +#include "XCommonEventHeader.h" +#include "XVendorNfNameFields.h" + +namespace vagt +{ + namespace encode + { + enum XEnumSipSignalingFieldsSipSignalingFieldsVersion + { + XEnumSipSignalingFieldsSipSignalingFieldsVersion3_0, + }; + + class XSipSignalingFields : public XExtendEvent + { + public: + virtual std::string toString() = 0; + + virtual std::shared_ptr getCommonHeader() = 0; + + virtual void setRemotePort(const XString& remotePort) = 0; + virtual void setSummarySip(const XString& summarySip) = 0; + virtual void setLocalPort(const XString& localPort) = 0; + virtual void setAdditionalInformation(const XHashMap& additionalInformation) = 0; + virtual void setLocalIpAddress(const XString& localIpAddress) = 0; + virtual void setCompressedSip(const XString& compressedSip) = 0; + virtual void setCorrelator(const XString& correlator) = 0; + virtual void setRemoteIpAddress(const XString& remoteIpAddress) = 0; + virtual void setVendorNfNameFields(const XVendorNfNameFields& vendorNfNameFields) = 0; + + static std::shared_ptr create(std::shared_ptr header, + const XString& correlator, + const XString& localIpAddress, + const XString& localPort, + const XString& remoteIpAddress, + const XString& remotePort, + const XVendorNfNameFields& vendorNfNameFields); + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XStateChangeFields.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XStateChangeFields.h new file mode 100755 index 0000000..c965a47 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XStateChangeFields.h @@ -0,0 +1,40 @@ +#pragma once + +#include "XCommonEventHeader.h" + +namespace vagt +{ + namespace encode + { + enum XEnumStateChangeFieldsState + { + XEnumStateChangeFieldsStateInService, + XEnumStateChangeFieldsStateMaintenance, + XEnumStateChangeFieldsStateOutOfService, + }; + + enum XEnumStateChangeFieldsStateChangeFieldsVersion + { + XEnumStateChangeFieldsStateChangeFieldsVersion4_0, + }; + + class XStateChangeFields : public XExtendEvent + { + public: + virtual std::string toString() = 0; + + virtual std::shared_ptr getCommonHeader() = 0; + + virtual void setNewState(XEnumStateChangeFieldsState newState) = 0; + virtual void setOldState(XEnumStateChangeFieldsState oldState) = 0; + virtual void setAdditionalFields(const XHashMap& additionalFields) = 0; + virtual void setStateInterface(const XString& stateInterface) = 0; + + static std::shared_ptr create(std::shared_ptr header, + XEnumStateChangeFieldsState newState, + XEnumStateChangeFieldsState oldState, + const XString& stateInterface); + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XSyslogFields.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XSyslogFields.h new file mode 100755 index 0000000..da3e298 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XSyslogFields.h @@ -0,0 +1,71 @@ +#pragma once + +#include "XCommonEventHeader.h" + +namespace vagt +{ + namespace encode + { + enum XEnumSyslogFieldsSyslogFieldsVersion + { + XEnumSyslogFieldsSyslogFieldsVersion4_0, + }; + + enum XEnumSyslogFieldsSyslogSev + { + XEnumSyslogFieldsSyslogSevAlert, + XEnumSyslogFieldsSyslogSevCritical, + XEnumSyslogFieldsSyslogSevDebug, + XEnumSyslogFieldsSyslogSevEmergency, + XEnumSyslogFieldsSyslogSevError, + XEnumSyslogFieldsSyslogSevInfo, + XEnumSyslogFieldsSyslogSevNotice, + XEnumSyslogFieldsSyslogSevWarning, + }; + + enum XEnumSyslogFieldsEventSourceType + { + XEnumSyslogFieldsEventSourceTypeOther, + XEnumSyslogFieldsEventSourceTypeRouter, + XEnumSyslogFieldsEventSourceTypeSwitch, + XEnumSyslogFieldsEventSourceTypeHost, + XEnumSyslogFieldsEventSourceTypeCard, + XEnumSyslogFieldsEventSourceTypePort, + XEnumSyslogFieldsEventSourceTypeSlotThreshold, + XEnumSyslogFieldsEventSourceTypePortThreshold, + XEnumSyslogFieldsEventSourceTypeVirtualMachine, + XEnumSyslogFieldsEventSourceTypeVirtualNetworkFunction, + }; + + class XSyslogFields : public XExtendEvent + { + public: + virtual std::string toString() = 0; + + virtual std::shared_ptr getCommonHeader() = 0; + + virtual void setSyslogProcId(XNumber syslogProcId) = 0; + virtual void setSyslogFacility(XInteger syslogFacility) = 0; + virtual void setSyslogPri(XInteger syslogPri) = 0; + virtual void setEventSourceType(XEnumSyslogFieldsEventSourceType eventSourceType) = 0; + virtual void setSyslogMsgHost(const XString& syslogMsgHost) = 0; + virtual void setSyslogSev(XEnumSyslogFieldsSyslogSev syslogSev) = 0; + virtual void setSyslogSData(const XString& syslogSData) = 0; + virtual void setSyslogMsg(const XString& syslogMsg) = 0; + virtual void setSyslogProc(const XString& syslogProc) = 0; + virtual void setEventSourceHost(const XString& eventSourceHost) = 0; + virtual void setSyslogTs(const XString& syslogTs) = 0; + virtual void setSyslogTag(const XString& syslogTag) = 0; + virtual void setSyslogVer(XNumber syslogVer) = 0; + virtual void setAdditionalFields(const XHashMap& additionalFields) = 0; + virtual void setSyslogSdId(const XString& syslogSdId) = 0; + + static std::shared_ptr create(std::shared_ptr header, + XEnumSyslogFieldsEventSourceType eventSourceType, + const XString& syslogTag, + const XString& syslogMsg + ); + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XThresholdCrossingAlertFields.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XThresholdCrossingAlertFields.h new file mode 100755 index 0000000..7b9d7fa --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XThresholdCrossingAlertFields.h @@ -0,0 +1,74 @@ +#pragma once + +#include "XCommonEventHeader.h" +#include "XCounter.h" + +namespace vagt +{ + namespace encode + { + enum XEnumThresholdCrossingAlertFieldsAlertAction + { + XEnumThresholdCrossingAlertFieldsAlertActionCLEAR, + XEnumThresholdCrossingAlertFieldsAlertActionCONT, + XEnumThresholdCrossingAlertFieldsAlertActionSET, + }; + + enum XEnumThresholdCrossingAlertFieldsAlertType + { + XEnumThresholdCrossingAlertFieldsAlertTypeCARD_ANOMALY, + XEnumThresholdCrossingAlertFieldsAlertTypeELEMENT_ANOMALY, + XEnumThresholdCrossingAlertFieldsAlertTypeINTERFACE_ANOMALY, + XEnumThresholdCrossingAlertFieldsAlertTypeSERVICE_ANOMALY, + }; + + enum XEnumThresholdCrossingAlertFieldsEventSeverity + { + XEnumThresholdCrossingAlertFieldsEventSeverityCRITICAL, + XEnumThresholdCrossingAlertFieldsEventSeverityMAJOR, + XEnumThresholdCrossingAlertFieldsEventSeverityMINOR, + XEnumThresholdCrossingAlertFieldsEventSeverityWARNING, + XEnumThresholdCrossingAlertFieldsEventSeverityNORMAL, + }; + + enum XEnumThresholdCrossingAlertFieldsThresholdCrossingFieldsVersion + { + XEnumThresholdCrossingAlertFieldsThresholdCrossingFieldsVersion4_0, + }; + + class XThresholdCrossingAlertFields : public XExtendEvent + { + public: + virtual std::string toString() = 0; + + virtual std::shared_ptr getCommonHeader() = 0; + + virtual void setAlertDescription(const XString& alertDescription)= 0; + virtual void setAlertType(XEnumThresholdCrossingAlertFieldsAlertType alertType)= 0; + virtual void setInterfaceName(const XString& interfaceName)= 0; + virtual void setCollectionTimestamp(const XString& collectionTimestamp)= 0; + virtual void setEventSeverity(XEnumThresholdCrossingAlertFieldsEventSeverity eventSeverity)= 0; + virtual void setPossibleRootCause(const XString& possibleRootCause)= 0; + virtual void setAssociatedAlertIdList(const XArrayOfString& associatedAlertIdList)= 0; + virtual void setAlertValue(const XString& alertValue)= 0; + virtual void setDataCollector(const XString& dataCollector)= 0; + virtual void setAdditionalParameters(const XArrayOfXCounter& additionalParameters)= 0; + virtual void setAlertAction(XEnumThresholdCrossingAlertFieldsAlertAction alertAction)= 0; + virtual void setNetworkService(const XString& networkService)= 0; + virtual void setElementType(const XString& elementType)= 0; + virtual void setAdditionalFields(const XHashMap& additionalFields)= 0; + virtual void setEventStartTimestamp(const XString& eventStartTimestamp)= 0; + + static std::shared_ptr create(std::shared_ptr header, + XEnumThresholdCrossingAlertFieldsAlertAction alertAction, + XEnumThresholdCrossingAlertFieldsAlertType alertType, + XEnumThresholdCrossingAlertFieldsEventSeverity eventSeverity, + const XString& alertDescription, + const XString& collectionTimestamp, + const XString& eventStartTimestamp, + const XArrayOfXCounter& additionalParameters + ); + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XVendorNfNameFields.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XVendorNfNameFields.h new file mode 100755 index 0000000..6912bcd --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XVendorNfNameFields.h @@ -0,0 +1,25 @@ +#pragma once + +#include "XEvent.h" + +namespace vagt +{ + namespace encode + { + class XVendorNfNameFields + { + public: + XVendorNfNameFields(const XString& vendorName); + + virtual void setNfModuleName(const XString& nfModuleName); + virtual void setNfName(const XString& nfName); + virtual void setVendorName(const XString& vendorName); + + std::shared_ptr imp_; + + protected: + XVendorNfNameFields(); + }; + } +} + \ No newline at end of file diff --git a/veslibrary/ves_cpplibrary/src/lib/encode/include/XVoiceQualityFields.h b/veslibrary/ves_cpplibrary/src/lib/encode/include/XVoiceQualityFields.h new file mode 100755 index 0000000..32dea01 --- /dev/null +++ b/veslibrary/ves_cpplibrary/src/lib/encode/include/XVoiceQualityFields.h @@ -0,0 +1,41 @@ +#pragma once + +#include "XCommonEventHeader.h" +#include "XVendorNfNameFields.h" +#include "XEndOfCallVqmSummaries.h" + +namespace vagt +{ + namespace encode + { + enum XEnumVoiceQualityFieldsVoiceQualityFieldsVersion + { + XEnumVoiceQualityFieldsVoiceQualityFieldsVersion4_0, + }; + + class XVoiceQualityFields : public XExtendEvent + { + public: + virtual std::string toString() = 0; + + virtual std::shared_ptr getCommonHeader() = 0; + + virtual void setMidCallRtcp(const XString& midCallRtcp) = 0; + virtual void setAdditionalInformation(const XHashMap& additionalInformation) = 0; + virtual void setEndOfCallVqmSummaries(const XEndOfCallVqmSummaries& endOfCallVqmSummaries) = 0; + virtual void setCalleeSideCodec(const XString& calleeSideCodec) = 0; + virtual void setPhoneNumber(const XString& phoneNumber) = 0; + virtual void setCallerSideCodec(const XString& callerSideCodec) = 0; + virtual void setCorrelator(const XString& correlator) = 0; + virtual void setVendorNfNameFields(const XVendorNfNameFields& vendorNfNameFields) = 0; + + static std::shared_ptr create(std::shared_ptr header, + const XString& calleeSideCodec, + const XString& callerSideCodec, + const XString& correlator, + const XString& midCallRtcp, + const XVendorNfNameFields& vendorNfNameFields); + }; + } +} + \ No newline at end of file -- cgit 1.2.3-korg