X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=doc%2Fafm-system-daemon.html;fp=doc%2Fafm-system-daemon.html;h=436a98510738be833d6afffcec9219b85e174a26;hb=bad30c92a1cbe0e411f52c277cef37b6570b623f;hp=4569bc2c0a8b84cfd6938d7e0c23fe3d58a47023;hpb=8b1af713cef4f66d658e304f0ace0820b47d2bc5;p=src%2Fapp-framework-main.git diff --git a/doc/afm-system-daemon.html b/doc/afm-system-daemon.html index 4569bc2..436a985 100644 --- a/doc/afm-system-daemon.html +++ b/doc/afm-system-daemon.html @@ -1,63 +1,53 @@ + - - + + + + + + The afm-system-daemon + + + - -

The afm-system-daemon

- +
+

The afm-system-daemon

+

José Bollo

+

Fulup Ar Foll

+

30 mai 2016

+
+ +

The afm-system-daemon

version: 1
 Date:    30 mai 2016
-Author:  José Bollo
-
- -

- - -

Foreword

- -

This document describes application framework system daemon fundamentals. -FCF (Fully Conform to Specification) implementation is still under development. -It may happen that current implementation somehow diverges with specifications.

- - -

Introduction

- -

The daemon afm-system-daemon is in charge of installing -applications on AGL system. Its main tasks are:

- +Author: José Bollo +

TABLE-OF-CONTENT-HERE

+

Foreword

+

This document describes application framework system daemon fundamentals. FCF (Fully Conform to Specification) implementation is still under development. It may happen that current implementation somehow diverges with specifications.

+

Introduction

+

The daemon afm-system-daemon is in charge of installing applications on AGL system. Its main tasks are:

- - -

The afm-system-daemon takes its orders from system -instance of D-Bus.

- +

The afm-system-daemon takes its orders from system instance of D-Bus.

The figure below summarizes the situation of afm-system-daemon in the system.

-
+------------------------------------------------------------+
 |                          User                              |
 |                                                            |
@@ -79,169 +69,89 @@ instance of D-Bus.

| +--------------------+ +-----------------------+ | | | | System | -+------------------------------------------------------------+ -
- - -

Starting afm-system-daemon

- -

afm-system-daemon is launched as a systemd service -attached to system. Normally, the service file is -located at /lib/systemd/system/afm-system-daemon.service.

- ++------------------------------------------------------------+ +

Starting afm-system-daemon

+

afm-system-daemon is launched as a systemd service attached to system. Normally, the service file is located at /lib/systemd/system/afm-system-daemon.service.

The options for launching afm-system-daemon are:

-
-r
 --root directory
 
- Set the root application directory.
+     Set the root application directory.
 
- Note that the default root directory is defined
- to be /usr/share/afm/applications (may change).
+     Note that the default root directory is defined
+     to be /usr/share/afm/applications (may change).
 
 -d
 --daemon
 
- Daemonizes the process. It is not needed by sytemd.
+     Daemonizes the process. It is not needed by sytemd.
 
 -q
 --quiet
 
- Reduces the verbosity (can be repeated).
+     Reduces the verbosity (can be repeated).
 
 -v
 --verbose
 
- Increases the verbosity (can be repeated).
+     Increases the verbosity (can be repeated).
 
 -h
 --help
 
- Prints a short help.
-
- - -

The D-Bus interface

- - -

Overview of the dbus interface

- -

afm-system-daemon takes its orders from the session instance -of D-Bus. The use of D-Bus is great because it allows to implement -discovery and signaling.

- -

The afm-system-daemon is listening with the destination name -org.AGL.afm.system at the object of path /org/AGL/afm/system -on the interface org.AGL.afm.system for the below detailed -members install and uninstall.

- -

D-Bus is mainly used for signaling and discovery. Its optimized -typed protocol is not used except for transmitting only one string -in both directions.

- -

The client and the service are using JSON serialization to -exchange data.

- + Prints a short help. +

The D-Bus interface

+

Overview of the dbus interface

+

afm-system-daemon takes its orders from the session instance of D-Bus. The use of D-Bus is great because it allows to implement discovery and signaling.

+

The afm-system-daemon is listening with the destination name org.AGL.afm.system at the object of path /org/AGL/afm/system on the interface org.AGL.afm.system for the below detailed members install and uninstall.

+

D-Bus is mainly used for signaling and discovery. Its optimized typed protocol is not used except for transmitting only one string in both directions.

+

The client and the service are using JSON serialization to exchange data.

The D-Bus interface is defined by:

- - - -

The signature of any member of the interface is string -> string -for JSON -> JSON.

- -

This is the normal case. In case of error, the current implementation -returns a dbus error that is a string.

- -

Here is an example using dbus-send to query data on -installed applications.

- +

The signature of any member of the interface is string -> string for JSON -> JSON.

+

This is the normal case. In case of error, the current implementation returns a dbus error that is a string.

+

Here is an example using dbus-send to query data on installed applications.

dbus-send --session --print-reply \
---dest=org.AGL.afm.system \
-/org/AGL/afm/system \
-org.AGL.afm.system.install 'string:"/tmp/appli.wgt"'
-
- - -

The protocol over D-Bus

- + --dest=org.AGL.afm.system \ + /org/AGL/afm/system \ + org.AGL.afm.system.install 'string:"/tmp/appli.wgt"' +

The protocol over D-Bus


- - -

Method org.AGL.afm.system.install

- +

Method org.AGL.afm.system.install

Description: Install an application from a widget file.

- -

When an application with the same id and version already exists. Outside of -using force=true the application is not reinstalled.

- -

Applications are installed the subdirectories of applications common directory. -If root is specified, the application is installed under the -sub-directories of the root defined.

- -

Note that this methods is a simple accessor method of -org.AGL.afm.system.install from afm-system-daemon.

- -

After the installation and before returning to the sender, -afm-system-daemon sends a signal org.AGL.afm.system.changed.

- -

Input: The path of the widget file to install and, optionally, -a flag to force reinstallation, and, optionally, a root directory.

- +

When an application with the same id and version already exists. Outside of using force=true the application is not reinstalled.

+

Applications are installed the subdirectories of applications common directory. If root is specified, the application is installed under the sub-directories of the root defined.

+

Note that this methods is a simple accessor method of org.AGL.afm.system.install from afm-system-daemon.

+

After the installation and before returning to the sender, afm-system-daemon sends a signal org.AGL.afm.system.changed.

+

Input: The path of the widget file to install and, optionally, a flag to force reinstallation, and, optionally, a root directory.

Either just a string being the absolute path of the widget file:

- -
"/a/path/driving/to/the/widget"
-
- +
"/a/path/driving/to/the/widget"

Or an object:

-
{
-  "wgt": "/a/path/to/the/widget",
-  "force": false,
-  "root": "/a/path/to/the/root"
-}
-
- -

“wgt” and “root” must be absolute paths.

- -

output: An object with the field “added” being the string for -the id of the added application.

- -
{"added":"appli@x.y"}
-
- + "wgt": "/a/path/to/the/widget", + "force": false, + "root": "/a/path/to/the/root" +} +

"wgt" and "root" must be absolute paths.

+

output: An object with the field "added" being the string for the id of the added application.

+
{"added":"appli@x.y"}

- - -

Method org.AGL.afm.system.uninstall

- +

Method org.AGL.afm.system.uninstall

Description: Uninstall an application from its id.

- -

Note that this methods is a simple method accessor of -org.AGL.afm.system.uninstall from afm-system-daemon.

- -

After the uninstallation and before returning to the sender, -afm-system-daemon sends a signal org.AGL.afm.system.changed.

- +

Note that this methods is a simple method accessor of org.AGL.afm.system.uninstall from afm-system-daemon.

+

After the uninstallation and before returning to the sender, afm-system-daemon sends a signal org.AGL.afm.system.changed.

Input: the id of the application and optionally the application root path.

-

Either a string:

- -
"appli@x.y"
-
- +
"appli@x.y"

Or an object:

-
{
-  "id": "appli@x.y",
-  "root": "/a/path/to/the/root"
-}
-
- -

output: the value ‘true’.

+ "id": "appli@x.y", + "root": "/a/path/to/the/root" +} +

output: the value 'true'.