2013-04-14 19:04:33 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2013, Haiku, Inc. All Rights Reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Ingo Weinhold <ingo_weinhold@gmx.de>
|
|
|
|
*/
|
|
|
|
#ifndef _PACKAGE__PRIVATE__DAEMON_CLIENT_H_
|
|
|
|
#define _PACKAGE__PRIVATE__DAEMON_CLIENT_H_
|
|
|
|
|
|
|
|
|
|
|
|
#include <Messenger.h>
|
|
|
|
#include <package/PackageDefs.h>
|
2013-04-20 03:28:18 +04:00
|
|
|
#include <String.h>
|
|
|
|
|
|
|
|
#include <package/DaemonDefs.h>
|
2013-04-14 19:04:33 +04:00
|
|
|
|
|
|
|
|
2013-04-20 23:24:28 +04:00
|
|
|
class BDirectory;
|
|
|
|
|
|
|
|
|
2013-04-14 19:04:33 +04:00
|
|
|
namespace BPackageKit {
|
|
|
|
|
|
|
|
|
package daemon: Rework error and issue propagation to client
* BDaemonClient: Move inner class BCommitTransactionResult to top level
and make it public.
* BCommitTransactionResult:
- Add a whole bunch of specific error code enum values. Such an error
code is now the primary error, as opposed to before where we would
mix status_t and enum value errors. There's a systemError property
of type status_t which may provide additional information, though
(depending on the primary error type).
- Remove the errorMessage property. Due to mapping all errors to the
specific error codes this is no longer necessary. Mixing such a
message with another error description is also not very helpful when
it comes to localization (still not supported, though).
- Add several properties (paths, strings, error codes) that serve as
arguments to the primary error and are used by FullErrorMessage().
- Add issues property, a list of instances of new class
BTransactionIssue. Those describe non-critical issues (e.g. failed
update of a settings file) that occurred in the process of
committing the transaction. Those issues should be presented to the
user by the package management program.
* Exception: Adjust to transport the BCommitTransactionResult
properties.
* CommitTransactionHandler, FsTransactions, Root, Volume: Adjust to
BCommitTransactionResult/Exception changes.
* CommitTransactionHandler: Now requires a BCommitTransactionResult to
which it adds the issues it encounters. The reply BMessage is no
longer needed, though.
* Volume: Refactor common code from the three methods that use
CommitTransactionHandler into new method _CommitTransaction.
2014-06-14 19:40:57 +04:00
|
|
|
class BCommitTransactionResult;
|
2013-04-14 19:04:33 +04:00
|
|
|
class BInstallationLocationInfo;
|
|
|
|
class BPackageInfoSet;
|
|
|
|
|
|
|
|
|
|
|
|
namespace BPrivate {
|
|
|
|
|
|
|
|
|
2013-04-20 03:28:18 +04:00
|
|
|
class BActivationTransaction;
|
|
|
|
|
|
|
|
|
2013-04-14 19:04:33 +04:00
|
|
|
class BDaemonClient {
|
|
|
|
public:
|
|
|
|
BDaemonClient();
|
|
|
|
~BDaemonClient();
|
|
|
|
|
|
|
|
status_t GetInstallationLocationInfo(
|
|
|
|
BPackageInstallationLocation location,
|
|
|
|
BInstallationLocationInfo& _info);
|
2013-04-20 03:28:18 +04:00
|
|
|
status_t CommitTransaction(
|
|
|
|
const BActivationTransaction& transaction,
|
|
|
|
BCommitTransactionResult& _result);
|
2013-09-10 20:37:35 +04:00
|
|
|
// B_OK only means _result is initialized,
|
|
|
|
// not the success of committing the
|
|
|
|
// transaction
|
2013-04-14 19:04:33 +04:00
|
|
|
|
2013-04-20 23:24:28 +04:00
|
|
|
status_t CreateTransaction(
|
|
|
|
BPackageInstallationLocation location,
|
|
|
|
BActivationTransaction& _transaction,
|
|
|
|
BDirectory& _transactionDirectory);
|
|
|
|
|
2013-04-14 19:04:33 +04:00
|
|
|
private:
|
|
|
|
status_t _InitMessenger();
|
|
|
|
status_t _ExtractPackageInfoSet(const BMessage& message,
|
|
|
|
const char* field, BPackageInfoSet& _infos);
|
|
|
|
|
|
|
|
private:
|
|
|
|
BMessenger fDaemonMessenger;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace BPrivate
|
|
|
|
} // namespace BPackageKit
|
|
|
|
|
|
|
|
|
|
|
|
#endif // _PACKAGE__PRIVATE__DAEMON_CLIENT_H_
|