BackupDeviceAction


interface BackupDeviceAction

Known direct subclasses
AssertStorageAction

Asserts the correctness of restored test data.

PopulateStorageAction

Populates test data inside the application sandbox before a backup.


Runs an action inside the application sandbox on the target device.

Implementations must provide a public no-arg constructor to enable dynamic instantiation.

An action reads its configuration from BackupDeviceActionArgs, whose documented keys are listed in BackupActionInputKeys, and reports its outcome through BackupDeviceActionResult, whose documented keys are listed in BackupActionOutputKeys. Build the outcome with BackupDeviceActionResult.success or BackupDeviceActionResult.failure so that the host can tell the two apart.

Summary

Constants

const Int

Seeds data inside the application sandbox before a backup.

const Int

Verifies restored data inside the application sandbox after a restore.

Public functions

BackupDeviceActionResult

Runs the action payload.

Public properties

Int

Lifecycle phase when this action runs.

Constants

PHASE_POPULATE

Added in 1.0.0-alpha02
const val PHASE_POPULATE = 1: Int

Seeds data inside the application sandbox before a backup.

PHASE_VERIFY

Added in 1.0.0-alpha02
const val PHASE_VERIFY = 2: Int

Verifies restored data inside the application sandbox after a restore.

Public functions

execute

Added in 1.0.0-alpha02
fun execute(context: Context, args: BackupDeviceActionArgs): BackupDeviceActionResult

Runs the action payload.

Implementations should report a recoverable problem, such as a missing argument or a failed assertion, by returning BackupDeviceActionResult.failure rather than by throwing. The host treats a thrown exception as a crash of the action and reports it with a stack trace.

Parameters
context: Context

application context on the target device

args: BackupDeviceActionArgs

input arguments passed from the host orchestrator, keyed by BackupActionInputKeys

Returns
BackupDeviceActionResult

result returned to the host, keyed by BackupActionOutputKeys

Public properties

phase

Added in 1.0.0-alpha02
val phase: Int

Lifecycle phase when this action runs.