sbuild  1.7.1
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
sbuild::chroot::facet::session_clonable Class Reference

Chroot support for creation of sessions. More...

#include <session-clonable.h>

+ Inheritance diagram for sbuild::chroot::facet::session_clonable:
+ Collaboration diagram for sbuild::chroot::facet::session_clonable:

Public Types

typedef std::shared_ptr
< session_clonable
ptr
 A shared_ptr to a chroot facet object.
 
typedef std::shared_ptr< const
session_clonable
const_ptr
 A shared_ptr to a const chroot facet object.
 
- Public Types inherited from sbuild::chroot::facet::facet
enum  session_flags { SESSION_NOFLAGS = 0, SESSION_CREATE = 1 << 0, SESSION_CLONE = 1 << 1, SESSION_PURGE = 1 << 2 }
 Chroot session properties. More...
 
typedef std::shared_ptr< facetptr
 A shared_ptr to a chroot facet object.
 
typedef std::shared_ptr< const
facet
const_ptr
 A shared_ptr to a const chroot facet object.
 

Public Member Functions

virtual ~session_clonable ()
 The destructor.
 
virtual facet::ptr clone () const
 Copy the chroot facet. More...
 
virtual std::string const & get_name () const
 Get the name of the chroot facet. More...
 
virtual session_flags get_session_flags () const
 Get the session flags of the chroot. More...
 
virtual chroot::ptr clone_session (const std::string &session_id, const std::string &alias, const std::string &user, bool root) const
 Clone a session chroot. More...
 
- Public Member Functions inherited from sbuild::chroot::facet::facet
virtual ~facet ()
 The destructor.
 
virtual void setup_env (environment &env) const
 Set environment. More...
 
virtual void get_details (format_detail &detail) const
 Get detailed information about the chroot for output. More...
 
virtual void get_used_keys (string_list &used_keys) const
 Get a list of the keys used during keyfile parsing. More...
 
virtual void get_keyfile (keyfile &keyfile) const
 Copy the chroot properties into a keyfile. More...
 
virtual void set_keyfile (const keyfile &keyfile)
 Set the chroot properties from a keyfile. More...
 

Static Public Member Functions

static ptr create ()
 Create a chroot facet. More...
 

Private Member Functions

 session_clonable ()
 The constructor.
 

Additional Inherited Members

- Protected Member Functions inherited from sbuild::chroot::facet::facet
 facet ()
 The constructor.
 
virtual void set_chroot (chroot &chroot, bool copy=false)
 Set containing chroot. More...
 
- Protected Attributes inherited from sbuild::chroot::facet::facet
chrootowner
 Chroot owning this facet.
 

Detailed Description

Chroot support for creation of sessions.

A chroot may offer a "session" facet to signal restorable or parallel chroot environment usage. This facet allows the chroot to support session creation.

Member Function Documentation

facet::ptr sbuild::chroot::facet::session_clonable::clone ( ) const
virtual

Copy the chroot facet.

This is a virtual copy constructor.

Returns
a shared_ptr to the new copy of the chroot facet.

Implements sbuild::chroot::facet::facet.

References session_clonable().

Referenced by clone_session().

+ Here is the caller graph for this function:

chroot::ptr sbuild::chroot::facet::session_clonable::clone_session ( const std::string &  session_id,
const std::string &  alias,
const std::string &  user,
bool  root 
) const
virtual

Clone a session chroot.

Parameters
session_idthe identifier for the new session.
aliasthe alias used to initially identify the chroot.
userthe user creating the session.
rootwhether or not the user is switching to root.
Returns
a session chroot.

References sbuild::_(), sbuild::chroot::facet::session_setup::chroot_session_setup(), clone(), sbuild::chroot::chroot::clone(), sbuild::chroot::facet::session::create(), sbuild::DEBUG_INFO, sbuild::DEBUG_NOTICE, sbuild::chroot::facet::facet::facet(), sbuild::log_debug(), and sbuild::chroot::facet::facet::owner.

session_clonable::ptr sbuild::chroot::facet::session_clonable::create ( )
static
std::string const & sbuild::chroot::facet::session_clonable::get_name ( ) const
virtual

Get the name of the chroot facet.

Returns
the chroot facet name.

Implements sbuild::chroot::facet::facet.

facet::session_flags sbuild::chroot::facet::session_clonable::get_session_flags ( ) const
virtual

Get the session flags of the chroot.

These determine how the Session controlling the chroot will operate.

Parameters
chrootthe chroot to use.
Returns
the session flags.

Reimplemented from sbuild::chroot::facet::facet.

References sbuild::chroot::facet::facet::SESSION_CREATE.


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