karazeh
A cross-platform software updating library.
kzh::delete_operation Class Reference

#include <delete.hpp>

+ Inheritance diagram for kzh::delete_operation:
+ Collaboration diagram for kzh::delete_operation:

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_
 

Constructor & Destructor Documentation

kzh::delete_operation::delete_operation ( config_t const &  config,
release_manifest const &  rm 
)
kzh::delete_operation::~delete_operation ( )
virtual

Member Function Documentation

void kzh::delete_operation::commit ( )
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().

STAGE_RC kzh::delete_operation::deploy ( )
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.

void kzh::delete_operation::rollback ( )
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.

string_t kzh::delete_operation::tostring ( )
virtual

Used internally for exceptions and logging

Reimplemented from kzh::operation.

References dst_path.

Member Data Documentation

string_t kzh::delete_operation::dst_path

Referenced by deploy(), rollback(), stage(), and tostring().


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