QXmpp Version: 1.15.0
Loading...
Searching...
No Matches
QXmppAccountMigrationManager Class Reference

Allows to export and import account data. More...

Inheritance diagram for QXmppAccountMigrationManager:
QXmppClientExtension QXmppLoggable

Public Types

template<typename T = QXmpp::Success>
using Result = std::variant<T, QXmppError>

Public Member Functions

 QXmppAccountMigrationManager ()
QXmppTask< Result<> > importData (const QXmppExportData &account)
QXmppTask< Result< QXmppExportData > > exportData ()
template<typename DataType, typename ImportFunc, typename ExportFunc>
void registerExportData (ImportFunc importFunc, ExportFunc exportFunc)
template<typename DataType>
void unregisterExportData ()
Q_SIGNAL void errorOccurred (const QXmppError &error)
Public Member Functions inherited from QXmppClientExtension
 QXmppClientExtension ()
virtual QStringList discoveryFeatures () const
virtual QList< QXmppDiscoIdentitydiscoveryIdentities () const
virtual bool handleStanza (const QDomElement &stanza)
 You need to implement this method to process incoming XMPP stanzas.
virtual bool handleStanza (const QDomElement &stanza, const std::optional< QXmppE2eeMetadata > &e2eeMetadata)
 You need to implement this method to process incoming XMPP stanzas.
Public Member Functions inherited from QXmppLoggable
 QXmppLoggable (QObject *parent=nullptr)
Q_SIGNAL void setGauge (const QString &gauge, double value)
 Sets the given gauge to value.
Q_SIGNAL void logMessage (QXmppLogger::MessageType type, const QString &msg)
 This signal is emitted to send logging messages.
Q_SIGNAL void updateCounter (const QString &counter, qint64 amount=1)
 Updates the given counter by amount.

Friends

struct QXmppAccountMigrationManagerPrivate

Additional Inherited Members

Protected Member Functions inherited from QXmppClientExtension
QXmppClientclient () const
virtual void setClient (QXmppClient *client)
virtual void onRegistered (QXmppClient *client)
virtual void onUnregistered (QXmppClient *client)
void injectIq (const QDomElement &element, const std::optional< QXmppE2eeMetadata > &e2eeMetadata)
bool injectMessage (QXmppMessage &&message)
Protected Member Functions inherited from QXmppLoggable
void debug (const QString &message)
 Logs a debugging message.
void info (const QString &message)
 Logs an informational message.
void warning (const QString &message)
 Logs a warning message.
void logReceived (const QString &message)
 Logs a received packet.
void logSent (const QString &message)
 Logs a sent packet.

Detailed Description

Allows to export and import account data.

You can use exportData() to start a data export. Afterwards you can use the exported data to start a data import on another account using importData().

The data that is exported (or imported) is determined by the other registered client extensions. They can register callbacks for export and import using registerExtension().

Since
QXmpp 1.8

This manager help migrating a user account into another server.

Member Typedef Documentation

◆ Result

template<typename T = QXmpp::Success>
using QXmppAccountMigrationManager::Result = std::variant<T, QXmppError>

Contains T or QXmppError.

Constructor & Destructor Documentation

◆ QXmppAccountMigrationManager()

QXmppAccountMigrationManager::QXmppAccountMigrationManager ( )

Constructs an account migration manager.

Note
You would need the QXmppClient(QXmppClient::NoExtensions, this) approach to use this manager because it needs to be instantiated before others using it.

Member Function Documentation

◆ errorOccurred()

Q_SIGNAL void QXmppAccountMigrationManager::errorOccurred ( const QXmppError & error)

Emitted when an error occured during export or import.

Parameters
errorThe occured error

◆ exportData()

QXmppTask< QXmppAccountMigrationManager::Result< QXmppExportData > > QXmppAccountMigrationManager::exportData ( )

Creates a data export of the current account.

◆ importData()

QXmppTask< QXmppAccountMigrationManager::Result<> > QXmppAccountMigrationManager::importData ( const QXmppExportData & account)

Imports QXmppExportData to the currently connected account.

◆ registerExportData()

template<typename DataType, typename ImportFunc, typename ExportFunc>
void QXmppAccountMigrationManager::registerExportData ( ImportFunc importFunc,
ExportFunc exportFunc )

Registers a data type that can be imported to an account using importFunc and generated using exportFunc.

The functions are used when importData() or exportData() is called. You can unregister the functions using unregisterExportData().

The data type MUST also be registered via QXmppExportData::registerExtension() so it can be serialized.

◆ unregisterExportData()

template<typename DataType>
void QXmppAccountMigrationManager::unregisterExportData ( )

Unregisters a data type.


The documentation for this class was generated from the following files: