From 1c117d49dd19058f5f3426c4bfc81e53afaf7786 Mon Sep 17 00:00:00 2001 From: HaseenaSainul Date: Thu, 7 Nov 2024 10:12:07 -0500 Subject: [PATCH] Json meta to IDL changes in progress --- interfaces/IDeviceInfo.h | 12 ++++---- interfaces/IMonitor.h | 57 +++++++++++++++++++++---------------- interfaces/IOCDM.h | 9 +----- interfaces/ISecurityAgent.h | 4 +-- interfaces/Ids.h | 1 - 5 files changed, 42 insertions(+), 41 deletions(-) diff --git a/interfaces/IDeviceInfo.h b/interfaces/IDeviceInfo.h index 5bc684c..b466b59 100644 --- a/interfaces/IDeviceInfo.h +++ b/interfaces/IDeviceInfo.h @@ -238,8 +238,8 @@ namespace Exchange { }; // @property - // @brief Retrieves Device Info - virtual Core::hresult DeviceData(Device& device /* @out */) const = 0; + // @brief Retrieves Device Metadata + virtual Core::hresult DeviceMetadata(Device& device /* @out */) const = 0; }; /* @json 1.0.0 */ @@ -264,7 +264,7 @@ namespace Exchange { // @property // @brief Retrieves Firware Information - virtual Core::hresult FirmwareInfo(Firmware& firmware /* @out */) const = 0; + virtual Core::hresult ImageMetadata(Firmware& firmware /* @out */) const = 0; }; /* @json 1.0.0 */ @@ -294,7 +294,7 @@ namespace Exchange { // @property // @brief Retrieves SystemInfo - virtual Core::hresult SystemInfo(System& system /* @out */) const = 0; + virtual Core::hresult SystemMetadata(System& system /* @out */) const = 0; }; /* @json 1.0.0 */ @@ -314,7 +314,7 @@ namespace Exchange { // @property // @brief Retrieves SocketInfo - virtual Core::hresult SocketInfo(Socket& socket /* @out */) const = 0; + virtual Core::hresult SocketMetadata(Socket& socket /* @out */) const = 0; }; /* @json 1.0.0 */ @@ -333,7 +333,7 @@ namespace Exchange { // @property // @brief Retrieves AddressInfo // @param addresses: An array of Interface address - virtual Core::hresult AddressInfo(IAddressIterator*& ip /* @out */) const = 0; + virtual Core::hresult AddressMetadata(IAddressIterator*& ip /* @out */) const = 0; }; } } diff --git a/interfaces/IMonitor.h b/interfaces/IMonitor.h index febecf0..7a229bc 100644 --- a/interfaces/IMonitor.h +++ b/interfaces/IMonitor.h @@ -34,7 +34,7 @@ namespace Exchange { uint64_t average /* @brief Average of all measurements */; uint64_t last /* @brief Last measured value */; }; - struct Measurements { + struct Statistics { Measurement resident /* @brief Resident memory measurement */; Measurement allocated /* @brief Allocated memory measurement */; Measurement shared /* @brief Shared memory measurement */; @@ -46,35 +46,44 @@ namespace Exchange { uint8_t limit /* @brief Maximum number or restarts to be attempted */; uint16_t window /* @brief Time period (in seconds) within which failures must happen for the limit to be considered crossed */; }; - struct Statistics { - Measurements measurements /* @brief Measurements for the service */; - string observable /* @brief A callsign of the watched service */; - RestartInfo restart /* @brief Restart limits for failures applying to the service */; - }; - struct ActionParams { - string callsign /* @brief Callsign of the service the Monitor acted upon */; - string action /* @brief The action executed by the Monitor on a service. One of: "Activate", "Deactivate", "StoppedRestarting" */; - string reason /* @brief A message describing the reason the action was taken */; - }; - struct RestartLimitsInfo { - string callsign /* @brief The callsign of a service to reset measurements snapshot of */; - RestartInfo restart /* @brief Restart limits for failures applying to the service */; - }; + using IStringIterator = RPC::IIteratorType; + + // @event struct EXTERNAL INotification : virtual public Core::IUnknown { enum { ID = ID_MONITOR_NOTIFICATION }; - virtual void Action(const string& callsign, const string& action, const string& reason) = 0; + enum action : uint8_t { + DEACTIVATE, + ACTIVATE, + RESTARTING_IS_STOPPED, + }; + // @brief Signals an action taken by the Monitor + // @param callsign: Callsign of the service the Monitor acted upon + // @param action: The action executed by the Monitor on a service. One of: Activate, Deactivate, StoppedRestarting + // @param reason: A message describing the reason the action was taken + virtual void Actionconst string& callsign, const action value, const string& reason) = 0; }; - using IStatisticsIterator = RPC::IIteratorType; - // @brief RestartLimits: Sets new restart limits for a plugin - virtual uint32_t RestartLimits(const RestartLimitsInfo& params) = 0; - // @brief ResetStats: Resets memory and process statistics for a single plugin watched by the Monitor - virtual uint32_t ResetStats(const string& callsign, Statistics& statistics /* @out */) = 0; + // Pushing notifications to interested sinks + virtual Core::hresult Register(INotification* notification) = 0; + virtual Core::hresult Unregister(INotification* notification) = 0; + + // @property + // @brief RestartLimits: Set/Get new restart limits for a plugin + // @param callsign: Callsign of the plugin + // @param params: Restart Information + virtual Core::hresult RestartLimits(const string& callsign /* @index */, const RestartInfo& params) = 0; + virtual Core::hresult RestartLimits(const string& callsign /* @index */, RestartInfo& params /* @out */) const = 0; + + // @brief ResetStats: Resets memory for a single plugin watched by the Monitor + virtual Core::hresult Reset(const string& callsign) = 0; + + // @property + // @brief Observables: List of plugins watched by the Monitor + virtual Core::hresult Observables(IStringIterator*& observables /* @out */) const = 0; // @property - // @brief Status: The memory and process statistics either for a single plugin or - // all plugins watched by the Monitor - virtual uint32_t Status(const string& callsign /* @index */, IStatisticsIterator*& statistics /* @out */) const = 0; + // @brief Statistics: The memory and process statistics either for a given plugin + virtual Core::hresult StatisticsInfo(const string& callsign /* @index */, Statistics& statistics /* @out */) const = 0; }; } } diff --git a/interfaces/IOCDM.h b/interfaces/IOCDM.h index 5e53241..2bd52bd 100644 --- a/interfaces/IOCDM.h +++ b/interfaces/IOCDM.h @@ -400,17 +400,10 @@ struct EXTERNAL IOCDM : virtual public Core::IUnknown { virtual ~IOCDM() = default; using IStringIterator = RPC::IIteratorType; - struct Drm { - string name /* @brief Name of the DRM */; - string /* @opaque */ keySystems /* @brief Supported key Systems */; - }; - using IDrmIterator = RPC::IIteratorType; - // @alt Drms // @property // @brief Systems - Retrieves all key systems available in the system (e.g. Nagra, PlayReady, WideVine etc) - virtual Core::hresult Systems(IDrmIterator*& drms /* @out */) const = 0; - // @alt KeySystems + virtual Core::hresult Systems(IStringIterator*& drms /* @out */) const = 0; // @property // @brief Designators - Retrieves all designators associated with a Key System (Nagra, PlayReady, WideVine). virtual Core::hresult Designators(const string& drm /* @index */, IStringIterator*& keys /* @out */) const = 0; diff --git a/interfaces/ISecurityAgent.h b/interfaces/ISecurityAgent.h index 1f69434..9cdf090 100644 --- a/interfaces/ISecurityAgent.h +++ b/interfaces/ISecurityAgent.h @@ -35,9 +35,9 @@ namespace Exchange { }; // @brief Creates Token - virtual uint32_t CreateToken(const TokenInput& input, string& token /* @out */) = 0; + virtual Core::hresult CreateToken(const TokenInput& input, string& token /* @out */) = 0; // @brief Validate Token - virtual uint32_t Validate(const string& token, bool& valid /* @out */) = 0; + virtual Core::hresult Validate(const string& token, bool& valid /* @out */) = 0; }; } } diff --git a/interfaces/Ids.h b/interfaces/Ids.h index c06f850..89cd729 100644 --- a/interfaces/Ids.h +++ b/interfaces/Ids.h @@ -381,7 +381,6 @@ namespace Exchange { ID_MONITOR = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x500, ID_MONITOR_NOTIFICATION = ID_MONITOR + 1, - ID_MONITOR_STATISTICS_ITERATOR = ID_MONITOR + 2, ID_SECURITYAGENT = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x510 };