Skip to content

Commit

Permalink
Json meta to IDL changes in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
HaseenaSainul committed Nov 7, 2024
1 parent 8c69e90 commit 1c117d4
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 41 deletions.
12 changes: 6 additions & 6 deletions interfaces/IDeviceInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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 */
Expand Down Expand Up @@ -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 */
Expand All @@ -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 */
Expand All @@ -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;
};
}
}
57 changes: 33 additions & 24 deletions interfaces/IMonitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */;
Expand All @@ -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<string, RPC::ID_STRINGITERATOR>;

// @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<Statistics, ID_MONITOR_STATISTICS_ITERATOR>;
// @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;
};
}
}
9 changes: 1 addition & 8 deletions interfaces/IOCDM.h
Original file line number Diff line number Diff line change
Expand Up @@ -400,17 +400,10 @@ struct EXTERNAL IOCDM : virtual public Core::IUnknown {
virtual ~IOCDM() = default;

using IStringIterator = RPC::IIteratorType<string, RPC::ID_STRINGITERATOR>;
struct Drm {
string name /* @brief Name of the DRM */;
string /* @opaque */ keySystems /* @brief Supported key Systems */;
};
using IDrmIterator = RPC::IIteratorType<Drm, ID_OCDM_DRMS_ITERATOR>;

// @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;
Expand Down
4 changes: 2 additions & 2 deletions interfaces/ISecurityAgent.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
}
}
1 change: 0 additions & 1 deletion interfaces/Ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down

0 comments on commit 1c117d4

Please sign in to comment.