Class: DInstaller::DBus::Manager

Inherits:
BaseObject
  • Object
show all
Includes:
Interfaces::Progress, Interfaces::ServiceStatus, WithServiceStatus
Defined in:
lib/dinstaller/dbus/manager.rb

Overview

D-Bus object to manage the installation process

Constant Summary collapse

STARTUP_PHASE =
0
CONFIG_PHASE =
1
INSTALL_PHASE =
2

Constants included from Interfaces::ServiceStatus

Interfaces::ServiceStatus::SERVICE_STATUS_BUSY, Interfaces::ServiceStatus::SERVICE_STATUS_IDLE, Interfaces::ServiceStatus::SERVICE_STATUS_INTERFACE

Constants included from Interfaces::Progress

Interfaces::Progress::PROGRESS_INTERFACE

Instance Method Summary collapse

Methods included from Interfaces::ServiceStatus

included, #register_service_status_callbacks, #service_status_all, #service_status_current

Methods included from Interfaces::Progress

included, #progress_current_step, #progress_finished, #progress_properties, #progress_total_steps, #register_progress_callbacks

Methods included from WithServiceStatus

#busy_while, #service_status

Methods inherited from BaseObject

#interfaces_and_properties

Constructor Details

#initialize(backend, logger) ⇒ Manager

Constructor

Parameters:



44
45
46
47
48
49
50
# File 'lib/dinstaller/dbus/manager.rb', line 44

def initialize(backend, logger)
  super(PATH, logger: logger)
  @backend = backend
  register_callbacks
  register_progress_callbacks
  register_service_status_callbacks
end

Instance Method Details

#busy_servicesArray<String>

Name of the services that are currently busy

Returns:

  • (Array<String>)


104
105
106
# File 'lib/dinstaller/dbus/manager.rb', line 104

def busy_services
  backend.busy_services
end

#config_phaseObject

Runs the config phase



68
69
70
71
72
# File 'lib/dinstaller/dbus/manager.rb', line 68

def config_phase
  safe_run do
    busy_while { backend.config_phase }
  end
end

#current_installation_phaseInteger

Current value of the installation phase

Returns:

  • (Integer)


95
96
97
98
99
# File 'lib/dinstaller/dbus/manager.rb', line 95

def current_installation_phase
  return STARTUP_PHASE if backend.installation_phase.startup?
  return CONFIG_PHASE if backend.installation_phase.config?
  return INSTALL_PHASE if backend.installation_phase.install?
end

#install_phaseObject

Runs the install phase



75
76
77
78
79
# File 'lib/dinstaller/dbus/manager.rb', line 75

def install_phase
  safe_run do
    busy_while { backend.install_phase }
  end
end

#installation_phasesArray<Hash>

Description of all possible installation phase values

Returns:

  • (Array<Hash>)


84
85
86
87
88
89
90
# File 'lib/dinstaller/dbus/manager.rb', line 84

def installation_phases
  [
    { "id" => STARTUP_PHASE, "label" => "startup" },
    { "id" => CONFIG_PHASE,  "label" => "config" },
    { "id" => INSTALL_PHASE, "label" => "install" }
  ]
end