QXmpp Version: 1.10.0
Public Types | Public Member Functions | Friends | List of all members
QXmppAccountMigrationManager Class Reference

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

Inheritance diagram for QXmppAccountMigrationManager:
Inheritance graph
[legend]
Collaboration diagram for QXmppAccountMigrationManager:
Collaboration graph
[legend]

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< QXmppDiscoveryIq::IdentitydiscoveryIdentities () const
 
virtual bool handleStanza (const QDomElement &stanza)
 You need to implement this method to process incoming XMPP stanzas. More...
 
virtual bool handleStanza (const QDomElement &stanza, const std::optional< QXmppE2eeMetadata > &e2eeMetadata)
 You need to implement this method to process incoming XMPP stanzas. More...
 
- Public Member Functions inherited from QXmppLoggable
 QXmppLoggable (QObject *parent=nullptr)
 

Friends

struct QXmppAccountMigrationManagerPrivate
 

Additional Inherited Members

- Signals inherited from QXmppLoggable
void setGauge (const QString &gauge, double value)
 Sets the given gauge to value.
 
void logMessage (QXmppLogger::MessageType type, const QString &msg)
 This signal is emitted to send logging messages.
 
void updateCounter (const QString &counter, qint64 amount=1)
 Updates the given counter by amount.
 
- 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)
 
void info (const QString &message)
 
void warning (const QString &message)
 
void logReceived (const QString &message)
 
void logSent (const QString &message)
 

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>
QXmppAccountMigrationManager::Result

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()

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: