Implement a Lock/Unlock Queue API calls. 74/41874/7
authorLukasz Pawelczyk <l.pawelczyk@samsung.com>
Thu, 18 Jun 2015 13:21:38 +0000 (15:21 +0200)
committerDariusz Michaluk <d.michaluk@samsung.com>
Tue, 30 Jun 2015 09:01:28 +0000 (02:01 -0700)
commitfaa1396d2fe42048020678b06287dc3573a2b128
treea6a1983d42d3c365d3d7376da83318f79e50593c
parentc94cb2f9edd0188c3ef54f62ddeeb74fb7b9f6ea
Implement a Lock/Unlock Queue API calls.

[Feature]       Calls that make it possible to lock a queue exclusively
                to one client (IPC/DBUS) which can then order few calls
                in a row with a guarantee that no other client will
                interrupt.
[Cause]         n/a
[Solution]      n/a
[Verification]  Built, installed, run tests. Also see below.

Additional features implemented in this commit to support the above:
- DBus client disconnected notification. Adds a new callback to
  registerObject() that's called when a client that previously talked to
  the server gets disconnected.
- ZoneManager level client disconnect notification using the
  aforementioned DBus and already implemented IPC functionalities.
- Changed SwitchToDefault from signal to a method so we can return an
  error code when the queue is locked.
- MethodResultBuilder's getID() call that returns ipc independent
  identifier that client connections can be identified with (using
  getPeerID and getPeerName from IPC and DBus specific classes
  respectively).
- mGuard fixed in the DbusConnection class. Now it really does protect
  mConnection and mNameID as well as newly introduced mWatchedClients.
- Various half-related fixes/changes here and there (whitespaces,
  duplicate definition of PROXY_CALL in the DBus interface, etc).

There are no tests in this commit for the DBus features and the
Lock/Unlock queue. They will follow in the later commits.

To somewhat test the disconnect notifications (both, DBus level and
ZoneManager level) one can connect to the server using appropriate APIs
and watch the DEBUG/TRACE logs. This can be achieved using the following
commands:

$ dbus-send --system --dest=org.tizen.vasum.host \
            --type=method_call --print-reply \
            /org/tizen/vasum/host \
            org.tizen.vasum.host.manager.GetZoneIds
$ vasum-cli get_zone_ids

WARNING: this commit breaks API/ABI of libSimpleDbus

Change-Id: Ic0ed2371e563c34340ad41d66dd943a1abc8eb48
25 files changed:
client/vasum-client-impl.cpp
client/vasum-client-impl.hpp
client/vasum-client.cpp
client/vasum-client.h
common/api/dbus-method-result-builder.hpp
common/api/ipc-method-result-builder.cpp
common/api/ipc-method-result-builder.hpp
common/api/method-result-builder.hpp
libs/dbus/connection.cpp
libs/dbus/connection.hpp
libs/ipc/method-result.cpp
libs/ipc/method-result.hpp
server/common-definitions.hpp
server/host-dbus-connection.cpp
server/host-dbus-connection.hpp
server/host-dbus-definitions.hpp
server/host-ipc-connection.cpp
server/host-ipc-connection.hpp
server/host-ipc-definitions.hpp
server/zones-manager.cpp
server/zones-manager.hpp
tests/unit_tests/dbus/test-server.cpp
tests/unit_tests/dbus/ut-connection.cpp
tests/unit_tests/server/ut-zones-manager.cpp
zone-daemon/daemon-connection.cpp