Implement recovery of ReadonlyUpdateUninstall
[platform/core/appfw/app-installers.git] / src / common / step / recovery / step_recovery.h
1 // Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by an apache-2.0 license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMMON_STEP_RECOVERY_STEP_RECOVERY_H_
6 #define COMMON_STEP_RECOVERY_STEP_RECOVERY_H_
7
8 #include "common/installer_context.h"
9
10 #include "common/step/step.h"
11
12 namespace common_installer {
13 namespace recovery {
14
15 /**
16  * @brief The StepRecovery class
17  *
18  * Common base of all steps that performs recovery. Recover is supported for
19  * new and update request modes. Each step that performs recovery needs
20  * to override methods:
21  *  - RecoveryNew(),
22  *  - RecoveryUpdate(),
23  * instead of:
24  *  - process().
25  */
26 class StepRecovery : public Step {
27  public:
28   using Step::Step;
29
30   Status process() override;
31   Status clean() override { return Status::OK; }
32   Status undo() override { return Status::OK; }
33   Status precheck() override { return Status::OK; }
34
35   virtual Status RecoveryNew() = 0;
36   virtual Status RecoveryUpdate() = 0;
37   virtual Status RecoveryUninstall();
38   virtual Status RecoveryDelta();
39   virtual Status RecoveryMountNew();
40   virtual Status RecoveryMountUpdate();
41   virtual Status RecoveryReadonlyUpdateInstall();
42   virtual Status RecoveryReadonlyUpdateUninstall();
43   virtual Status Cleanup();
44 };
45
46 }  // namespace recovery
47 }  // namespace common_installer
48
49 #endif  // COMMON_STEP_RECOVERY_STEP_RECOVERY_H_