karazeh
A cross-platform software updating library.
|
#include <delete.hpp>
Public Member Functions | |
delete_operation (config_t const &, release_manifest const &) | |
virtual | ~delete_operation () |
virtual void | commit () |
virtual STAGE_RC | deploy () |
virtual void | rollback () |
virtual STAGE_RC | stage () |
virtual string_t | tostring () |
Public Member Functions inherited from kzh::operation | |
operation (config_t const &config, release_manifest const &rm) | |
virtual | ~operation () |
Public Attributes | |
string_t | dst_path |
Additional Inherited Members | |
Protected Member Functions inherited from kzh::logger | |
void | rename_context (string_t const &) |
logger (string_t context) | |
virtual | ~logger () |
logstream | alert () const |
logstream | crit () const |
logstream | debug () const |
logstream | error () const |
logstream | info () const |
logstream | notice () const |
logstream | plain () const |
void | set_uuid_prefix (string_t const &) |
string_t const & | uuid_prefix () const |
logstream | warn () const |
Static Protected Member Functions inherited from kzh::logger | |
static void | deindent () |
static void | enable_timestamps (bool on_or_off) |
static void | indent () |
static void | mute () |
static void | set_app_name (string_t const &app_name) |
static void | set_stream (std::ostream *) |
static void | set_threshold (char level) |
static void | unmute () |
Protected Attributes inherited from kzh::operation | |
config_t const & | config_ |
release_manifest const & | rm_ |
kzh::delete_operation::delete_operation | ( | config_t const & | config, |
release_manifest const & | rm | ||
) |
|
virtual |
|
virtual |
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 from kzh::operation.
References kzh::operation::config_, kzh::KARAZEH_EXPORT::file_manager, and kzh::file_manager::remove_file().
|
virtual |
Moves the file or directory at a given path to Karazeh's cache. The entry is purged from the cache if the patch was successful (no rollback required).
Implements kzh::operation.
References kzh::operation::config_, dst_path, kzh::logger::error(), kzh::file_manager::exists(), kzh::KARAZEH_EXPORT::file_manager, kzh::logger::info(), kzh::file_manager::move(), kzh::KARAZEH_EXPORT::root_path, kzh::STAGE_FILE_EXISTS, kzh::STAGE_FILE_MISSING, and kzh::STAGE_OK.
|
virtual |
Moves the item that was deleted from its place in the cache to its original path.
Implements kzh::operation.
References kzh::operation::config_, dst_path, kzh::logger::error(), kzh::KARAZEH_EXPORT::file_manager, kzh::file_manager::move(), and kzh::KARAZEH_EXPORT::root_path.
|
virtual |
Checks whether the source to be removed exists.
Returns STAGE_OK on success, otherwise an error indicated by the return code, see karazeh/operation.hpp for a complete listing.
Implements kzh::operation.
References kzh::KARAZEH_EXPORT::cache_path, kzh::operation::config_, kzh::file_manager::create_directory(), kzh::logger::debug(), kzh::logger::deindent(), dst_path, kzh::logger::error(), kzh::file_manager::exists(), kzh::KARAZEH_EXPORT::file_manager, kzh::release_manifest::id, kzh::logger::indent(), kzh::operation::rm_, kzh::KARAZEH_EXPORT::root_path, kzh::STAGE_FILE_EXISTS, kzh::STAGE_FILE_MISSING, kzh::STAGE_OK, and kzh::STAGE_UNAUTHORIZED.
|
virtual |
string_t kzh::delete_operation::dst_path |
Referenced by deploy(), rollback(), stage(), and tostring().