nx_server_plugin_sdk 1.0 Server Plugin SDK

engine.h
1 // Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/
2
3 #pragma once
4
5 #include <nx/sdk/analytics/helpers/engine.h>
6 #include <nx/sdk/analytics/helpers/integration.h>
7
8 #include "active_settings_builder.h"
9
10 namespace nx {
11 namespace vms_server_plugins {
12 namespace analytics {
13 namespace stub {
14 namespace settings {
15
16 class Engine: public nx::sdk::analytics::Engine
17 {
18 public:
19 Engine(nx::sdk::analytics::Integration* integration);
20 virtual ~Engine() override;
21
22 nx::sdk::analytics::Integration* const integration() const { return m_integration; }
23
24 protected:
25 virtual std::string manifestString() const override;
26
27 virtual nx::sdk::Result<const nx::sdk::ISettingsResponse*> settingsReceived() override;
28
29 protected:
30 virtual void doObtainDeviceAgent(
31 nx::sdk::Result<nx::sdk::analytics::IDeviceAgent*>* outResult,
32 const nx::sdk::IDeviceInfo* deviceInfo) override;
33
34 virtual void getIntegrationSideSettings(
35 nx::sdk::Result<const nx::sdk::ISettingsResponse*>* outResult) const override;
36
37 virtual void doGetSettingsOnActiveSettingChange(
38 nx::sdk::Result<const nx::sdk::IActiveSettingChangedResponse*>* outResult,
39 const nx::sdk::IActiveSettingChangedAction* activeSettingChangedAction) override;
40
41 virtual void doSetSettings(
42 nx::sdk::Result<const nx::sdk::ISettingsResponse*>* outResult,
43 const nx::sdk::IStringMap* settings) override;
44
45 private:
46 bool processActiveSettings(
47 nx::kit::Json::object* model,
48 std::map<std::string, std::string>* values,
49 const std::vector<std::string>& settingIdsToUpdate = {}) const;
50
51 std::string manifestWithoutDeviceAgentSettingsModel() const;
52
53 private:
54 nx::sdk::analytics::Integration* const m_integration;
55 ActiveSettingsBuilder m_activeSettingsBuilder;
56 };
57
58 } // namespace settings
59 } // namespace stub
60 } // namespace analytics
61 } // namespace vms_server_plugins
62 } // namespace nx
nx::sdk::IStringMap
Definition: i_string_map.h:9
nx::sdk::IActiveSettingChangedAction
Definition: i_active_setting_changed_action.h:14
nx::vms_server_plugins::analytics::stub::settings::Engine::settingsReceived
virtual nx::sdk::Result< const nx::sdk::ISettingsResponse * > settingsReceived() override
Definition: engine.cpp:138
nx::sdk::IDeviceInfo
Definition: i_device_info.h:13
nx::sdk::Result
Definition: result.h:52
nx
Definition: apple_utils.h:6
nx::sdk::analytics::Engine
Definition: engine.h:31
nx::vms_server_plugins::analytics::stub::settings::ActiveSettingsBuilder
Definition: active_settings_builder.h:20
nx::vms_server_plugins::analytics::stub::settings::Engine
Definition: engine.h:16
nx::sdk::analytics::Integration
Definition: integration.h:21