A org.rdk.MaintenanceManager plugin for Thunder framework.
The MaintenanceManager plugin allows you to control and monitor maintenance activities on set-top devices.
The plugin is designed to be loaded and executed within the Thunder framework. For more information about the framework refer to [Thunder].
The table below lists configuration options of the plugin.
| Name | Type | Description |
|---|---|---|
| callsign | string | Plugin instance name (default: org.rdk.MaintenanceManager) |
| classname | string | Class name: org.rdk.MaintenanceManager |
| locator | string | Library name: libWPEFrameworkMaintenanceManager.so |
| autostart | boolean | Determines if the plugin shall be started automatically along with the framework |
The following methods are provided by the org.rdk.MaintenanceManager plugin:
MaintenanceManager interface methods:
| Method | Description |
|---|---|
| getMaintenanceActivityStatus | Gets the maintenance activity status details |
| getMaintenanceStartTime | Gets the scheduled maintenance start time |
| setMaintenanceMode | Sets the maintenance mode and software upgrade opt-out mode |
| startMaintenance | Starts maintenance activities |
| stopMaintenance | Stops maintenance activities |
| getMaintenanceMode | Gets the current maintenance mode and software upgrade opt-out mode which are stored in the persistent location |
Gets the maintenance activity status details.
Maintenance Status
MAINTENANCE_IDLE- Maintenance service is not executing any activities before the start of first maintenance taskMAINTENANCE_STARTED- Maintenance has started either by schedule or on bootMAINTENANCE_ERROR- One or more tasks of the maintenance service has failedMAINTENANCE_COMPLETE- All critical maintenance tasks are completed successfullyMAINTENANCE_INCOMPLETE- Maintenance service didn't execute one or more of the tasks.
No Events
This method takes no parameters.
| Name | Type | Description |
|---|---|---|
| result | object | |
| result.maintenanceStatus | string | The current maintenance status |
| result.LastSuccessfulCompletionTime | integer | The time (in epoch time) the last maintenance completed or 0 if not applicable |
| result.isCriticalMaintenance | boolean | true if the maintenance activity cannot be aborted, otherwise false |
| result.isRebootPending | boolean | true if the device is going to reboot, otherwise false |
| result.success | boolean | Whether the request succeeded |
{
"jsonrpc": "2.0",
"id": 42,
"method": "org.rdk.MaintenanceManager.getMaintenanceActivityStatus"
}{
"jsonrpc": "2.0",
"id": 42,
"result": {
"maintenanceStatus": "MAINTENANCE_STARTED",
"LastSuccessfulCompletionTime": 12345678,
"isCriticalMaintenance": true,
"isRebootPending": false,
"success": true
}
}Gets the scheduled maintenance start time.
No Events
This method takes no parameters.
| Name | Type | Description |
|---|---|---|
| result | object | |
| result.maintenanceStartTime | integer | The start time (in epoch time) |
| result.success | boolean | Whether the request succeeded |
{
"jsonrpc": "2.0",
"id": 42,
"method": "org.rdk.MaintenanceManager.getMaintenanceStartTime"
}{
"jsonrpc": "2.0",
"id": 42,
"result": {
"maintenanceStartTime": 12345678,
"success": true
}
}Sets the maintenance mode and software upgrade opt-out mode.
Opt-Out Modes
NONE- The software upgrade process is unaffected and proceeds with the download and update.ENFORCE_OPTPOUT- The software upgrade process pauses after discovering an update is available and sends aSystemserviceonFirmwareUpdateStateChangeevent with theOn Hold for opt-outstate. An application must give the user the option of whether or not to accept the update. If the user accepts the update, then the opt-out mode must be set toBYPASS-OPTOUT.BYPASS_OPTOUTThe software upgrade process proceeds with a download and update, as directed by the application, for this occurrence of the maintenance window (used when the user accepts the software update).IGNORE-UPDATE- The software upgrade process ignores any non-mandatory firmware updates, and will NOT send any notification. Note that in this mode, the software upgrade process still setsENFORCE-OPTOUTif the update is mandatory. Use thegetFirmwareUpdateInfomethod from theSystemservice to determine what software version is available for download and to determine if the update is consider mandatory (using therebootImmediatelyparameter).
No Events
| Name | Type | Description |
|---|---|---|
| params | object | |
| params.maintenanceMode | string | The maintenance mode. The FOREGROUND mode runs all maintenance tasks. The BACKGROUND mode aborts activities currently running, if the task can't run in the background (if maintenance was already started with FOREGROUND mode) and executes tasks without impacting the user experience, if it is set before calling startMaintenance. (must be one of the following: FOREGROUND, BACKGROUND) |
| params.optOut | string | The opt-out mode. (must be one of the following: NONE, ENFORCE_OPTOUT, BYPASS_OPTOUT, IGNORE_UPDATE) |
| Name | Type | Description |
|---|---|---|
| result | object | |
| result.success | boolean | Whether the request succeeded |
{
"jsonrpc": "2.0",
"id": 42,
"method": "org.rdk.MaintenanceManager.setMaintenanceMode",
"params": {
"maintenanceMode": "BACKGROUND",
"optOut": "ENFORCE_OPTOUT"
}
}{
"jsonrpc": "2.0",
"id": 42,
"result": {
"success": true
}
}Starts maintenance activities.
| Event | Description |
|---|---|
| onMaintenanceStatusChange | Triggers whenever the maintenance status changes |
This method takes no parameters.
| Name | Type | Description |
|---|---|---|
| result | object | |
| result.success | boolean | Whether the request succeeded |
{
"jsonrpc": "2.0",
"id": 42,
"method": "org.rdk.MaintenanceManager.startMaintenance"
}{
"jsonrpc": "2.0",
"id": 42,
"result": {
"success": true
}
}Stops maintenance activities.
| Event | Description |
|---|---|
| onMaintenanceStatusChange | Triggers whenever the maintenance status changes |
This method takes no parameters.
| Name | Type | Description |
|---|---|---|
| result | object | |
| result.success | boolean | Whether the request succeeded |
{
"jsonrpc": "2.0",
"id": 42,
"method": "org.rdk.MaintenanceManager.stopMaintenance"
}{
"jsonrpc": "2.0",
"id": 42,
"result": {
"success": true
}
}Gets the current maintenance mode and software upgrade opt-out mode which are stored in the persistent location.
No Events
This method takes no parameters.
| Name | Type | Description |
|---|---|---|
| result | object | |
| result.maintenanceMode | string | The maintenance mode. The FOREGROUND mode runs all maintenance tasks. The BACKGROUND mode aborts activities currently running, if the task can't run in the background (if maintenance was already started with FOREGROUND mode) and executes tasks without impacting the user experience, if it is set before calling startMaintenance. (must be one of the following: FOREGROUND, BACKGROUND) |
| result.optOut | string | The opt-out mode. See setMaintenanceMode for a description of each opt-out mode (must be one of the following: NONE, ENFORCE_OPTOUT, BYPASS_OPTOUT, IGNORE_UPDATE) |
| result.success | boolean | Whether the request succeeded |
{
"jsonrpc": "2.0",
"id": 42,
"method": "org.rdk.MaintenanceManager.getMaintenanceMode"
}{
"jsonrpc": "2.0",
"id": 42,
"result": {
"maintenanceMode": "BACKGROUND",
"optOut": "ENFORCE_OPTOUT",
"success": true
}
}Notifications are autonomous events, triggered by the internals of the implementation, and broadcasted via JSON-RPC to all registered observers. Refer to [Thunder] for information on how to register for a notification.
The following events are provided by the org.rdk.MaintenanceManager plugin:
MaintenanceManager interface events:
| Event | Description |
|---|---|
| onMaintenanceStatusChange | Triggered when the maintenance manager status changes |
Triggered when the maintenance manager status changes. See getMaintenanceActivityStatus for a list of statuses.
| Name | Type | Description |
|---|---|---|
| params | object | |
| params.maintenanceStatus | string | The current maintenance status |
{
"jsonrpc": "2.0",
"method": "client.events.onMaintenanceStatusChange",
"params": {
"maintenanceStatus": "MAINTENANCE_STARTED"
}
}