karazeh
A cross-platform software updating library.
kzh::operation Class Referenceabstract

#include <operation.hpp>

+ Inheritance diagram for kzh::operation:
+ Collaboration diagram for kzh::operation:

Public Member Functions

 operation (config_t const &config, release_manifest const &rm)
 
virtual ~operation ()
 
virtual void commit ()
 
virtual STAGE_RC deploy ()=0
 
virtual void rollback ()=0
 
virtual STAGE_RC stage ()=0
 
virtual string_t tostring ()
 

Protected Attributes

config_t const & config_
 
release_manifest const & rm_
 

Constructor & Destructor Documentation

kzh::operation::operation ( config_t const &  config,
release_manifest const &  rm 
)
inline
virtual kzh::operation::~operation ( )
inlinevirtual

Member Function Documentation

virtual void kzh::operation::commit ( )
inlinevirtual

Purging is handy for operations that use the Karazeh cache while deploying or staging. When an operation is called to commit, it is guaranteed that the patch has been rolled out successfully and any transient data will not be needed (no rollback will be invoked).

The cache is used for operations that require storing some data in a safe place only for the use of rollbacks if required, but should otherwise be discarded.

Reimplemented in kzh::update_operation, kzh::delete_operation, and kzh::create_operation.

virtual STAGE_RC kzh::operation::deploy ( )
pure virtual

When all operations are staged, they are called to deploy their changes and do whatever is necessary now that they have their resources.

Failure at the deploy stage will incur a rollback() on all the patch operations that have been deployted and/or staged.

Implemented in kzh::create_operation, kzh::update_operation, and kzh::delete_operation.

virtual void kzh::operation::rollback ( )
pure virtual

Rolling-back ALL the changes that have been made to the repository while stage()ing or deploy()ing.

Use internal flags or members to keep track of the changes you make if necessary. rollback() might be invoked after operation::stage(), operation::deploy(), or neither!

Implemented in kzh::update_operation, kzh::delete_operation, and kzh::create_operation.

virtual STAGE_RC kzh::operation::stage ( )
pure virtual

An operation gets "staged" in order to verify whether all its required conditions are fulfilled in order to be deployted.

Usually, operations verify permissions, existence (or lack of) required files, and the downloading of resources while staging.

If an operation returns anything other than STAGE_OK, all registered patch operations will be called to rollback().

Implemented in kzh::create_operation, kzh::update_operation, and kzh::delete_operation.

virtual string_t kzh::operation::tostring ( )
inlinevirtual

Used internally for exceptions and logging

Reimplemented in kzh::update_operation, kzh::delete_operation, and kzh::create_operation.

Member Data Documentation


The documentation for this class was generated from the following file: