Akonadi::ServerManager Class
class Akonadi::ServerManagerProvides methods to control the Akonadi server process. More...
| Header: | #include <Akonadi/ServerManager> |
| CMake: | find_package(KPim6 REQUIRED COMPONENTS AkonadiCore)target_link_libraries(mytarget PRIVATE KPim6::AkonadiCore) |
Public Types
| enum | ServiceAgentType { Agent, Resource, Preprocessor } |
| enum | ServiceType { Server, Control, ControlLock, UpgradeIndicator } |
| enum | State { NotRunning, Starting, Running, Stopping, Broken, Upgrading } |
Signals
| void | started() |
| void | stateChanged(Akonadi::ServerManager::State state) |
| void | stopped() |
Static Public Members
| QString | addNamespace(const QString &string) |
| QString | agentConfigFilePath(const QString &identifier) |
| QString | agentServiceName(Akonadi::ServerManager::ServiceAgentType agentType, const QString &identifier) |
| QString | brokenReason() |
| uint | generation() |
| bool | hasInstanceIdentifier() |
| QString | instanceIdentifier() |
| bool | isRunning() |
| Akonadi::ServerManager * | self() |
| QString | serverConfigFilePath(Akonadi::ServerManager::OpenMode openMode) |
| QString | serviceName(Akonadi::ServerManager::ServiceType serviceType) |
| void | showSelfTestDialog(QWidget *parent) |
| bool | start() |
| Akonadi::ServerManager::State | state() |
| bool | stop() |
Detailed Description
Asynchronous, low-level control of the Akonadi server. Akonadi::Control provides a synchronous interface to some of the methods in here.
Author: Volker Krause <vkrause@kde.org>
See also Akonadi::Control.
Member Type Documentation
enum ServerManager::ServiceAgentType
Known agent types.
enum ServerManager::ServiceType
Types of known D-Bus services.
enum ServerManager::State
Enum for the various states the server can be in.
Member Function Documentation
[static] QString ServerManager::addNamespace(const QString &string)
Adds the multi-instance namespace to string if required (with '_' as separator). Use whenever a multi-instance safe name is required (configfiles, identifiers, ...). string the string to adapt
[static] QString ServerManager::agentConfigFilePath(const QString &identifier)
Returns absolute path to configuration file of an agent identified by given identifier.
[static] QString ServerManager::agentServiceName(Akonadi::ServerManager::ServiceAgentType agentType, const QString &identifier)
Returns the namespaced D-Bus service name for an agent of type agentType with agent identifier identifier. agentType the agent type to use for D-Bus base name identifier the agent identifier to include in the D-Bus name
[static] QString ServerManager::brokenReason()
Returns the reason why the Server is broken, if known.
If state() is Broken, then you can use this method to obtain a more detailed description of the problem and present it to users. Note that the message can be empty if the reason is not known.
[static] uint ServerManager::generation()
Returns current Akonadi database generation identifier
Generation is guaranteed to never change unless as long as the database backend is not removed and re-created. In such case it is guaranteed that the new generation number will be higher than the previous one.
Generation can be used by applications to detect when Akonadi database has been recreated and thus some of the configuration (for example collection IDs stored in a config file) must be invalidated.
Note: Note that the generation number is only available if the server is running. If this function is called before the server starts it will return 0.
[static] bool ServerManager::hasInstanceIdentifier()
Returns \ true if we are connected to a non-default Akonadi server instance.
[static] QString ServerManager::instanceIdentifier()
Returns the identifier of the Akonadi instance we are connected to. This is usually an empty string (representing the default instance), unless you have explicitly set the AKONADI_INSTANCE environment variable to connect to a different one.
[static] bool ServerManager::isRunning()
Checks if the server is available currently. For more detailed status information see state().
See also state().
[static] Akonadi::ServerManager *ServerManager::self()
Returns the singleton instance of this class, for connecting to its signals
[static] QString ServerManager::serverConfigFilePath(Akonadi::ServerManager::OpenMode openMode)
Returns absolute path to akonadiserverrc file with Akonadi server configuration.
[static] QString ServerManager::serviceName(Akonadi::ServerManager::ServiceType serviceType)
Returns the namespaced D-Bus service name for serviceType. Use this rather the raw service name strings in order to support usage of a non-default instance of the Akonadi server. serviceType the service type for which to return the D-Bus name
[static] void ServerManager::showSelfTestDialog(QWidget *parent)
Shows the Akonadi self test dialog, which tests Akonadi for various problems and reports these to the user if. parent the parent widget for the dialog
[static] bool ServerManager::start()
Starts the server. This method returns immediately and does not wait until the server is actually up and running. Returns \ true if the start was possible (which not necessarily means the server is really running though) and \ false if an immediate error occurred.
See also Akonadi::Control::start().
[signal] void ServerManager::started()
Emitted whenever the server becomes fully operational.
[static] Akonadi::ServerManager::State ServerManager::state()
Returns the state of the server.
[signal] void ServerManager::stateChanged(Akonadi::ServerManager::State state)
Emitted whenever the server state changes. state the new server state
[static] bool ServerManager::stop()
Stops the server. This methods returns immediately after the shutdown command has been send and does not wait until the server is actually shut down. Returns \ true if the shutdown command was sent successfully, \ false otherwise
[signal] void ServerManager::stopped()
Emitted whenever the server becomes unavailable.