libfuoten 0.8.1
Qt based library to access the ownCloud/Nextcloud News App API
Loading...
Searching...
No Matches
WipeManager Class Reference

#include <Fuoten/Helper/WipeManager>

Properties

bool inOperation

Public Member Functions

 WipeManager (QObject *parent=nullptr)
 ~WipeManager () override
void checkForWipe ()
bool inOperation () const
void setConfiguration (AbstractConfiguration *configuration)
void setNotificator (AbstractNotificator *notificator)
void setStorage (AbstractStorage *storage)

Signals

void inOperationChanged (bool inOperation)
void wipeDone ()
void wipeFailed ()
void wipeStarted ()

Detailed Description

Handles and manages remote wipe requests.

Coordinates the use of different classes and objects to perform remotely requested wipe of application data on this device. It is used in the implementations of Component::extractError() after the Nextcloud server replied with a 401 or 403 HTTP status code. If that happens, checkForWipe() is called. It uses GetWipeStatus to check if a remote wipe is requested by the server for this application. If a wipe is requested, it will use AbstractStorage::clearStorage() and AbstractConfiguration::deleteAccount() to delete the local data. After the data has been wiped it will use PostWipeSuccess to inform the Nextcloud server about the performed wipe.

If no configuration or no storage or no notificator has been set to this object, Component::defaultConfiguration(), Component::defaultStorage() or Component::defaultNotifactor() will be used if they have been set. At least a configuration is mandatory.

To set a default wipe manager that will be used for all actions, use Component::setDefaultWipemanager().

Since
0.8.0
See also
PostWipeSuccess, GetWipeStatus

Property Documentation

◆ inOperation

bool inOperation
read

Returns true while remote wipe is running.

Access functions
Notifier signal

Constructor & Destructor Documentation

◆ WipeManager()

WipeManager ( QObject * parent = nullptr)
explicit

Constructs a new WipeManager object with the given parent.

◆ ~WipeManager()

~WipeManager ( )
override

Destroys the WipeManager object.

Member Function Documentation

◆ checkForWipe()

void checkForWipe ( )

Call this to check if remote wipe should be performed.

This will use GetWipeStatus to check if a remote wipe has been requested by the Nextcloud server. If a wipe has been requested, the wipe will be performed and the wipeStarted() signal will be emitted. If something fails, wipeFailed() will be emitted. If the wipe has been performed, wipeDone() will be emitted.

◆ inOperation()

bool inOperation ( ) const

Returns true while remote wipe is running.

See also
WipeManager::inOperation, inOperationChanged()

◆ inOperationChanged

void inOperationChanged ( bool inOperation)
signal

Emitted if the inOperation property changes.

◆ setConfiguration()

void setConfiguration ( AbstractConfiguration * configuration)

Sets the configuration.

If no configuration has been set, Component::defaultConfiguration() will be used.

◆ setNotificator()

void setNotificator ( AbstractNotificator * notificator)

Sets the notificator.

If no notificator has been set, Component::defaultNotificator() will be used.

◆ setStorage()

void setStorage ( AbstractStorage * storage)

Sets the storage.

If no storage has been set, Component::defaultStorage() will be used.

◆ wipeDone

void wipeDone ( )
signal

Emitted if the wipe has been done.

◆ wipeFailed

void wipeFailed ( )
signal

Emitted if the wipe has been failed.

◆ wipeStarted

void wipeStarted ( )
signal

Emitted if the wipe has been started.