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

#include <Fuoten/API/GetWipeStatus>

Inheritance diagram for GetWipeStatus:
Component

Public Member Functions

 GetWipeStatus (QObject *parent=nullptr)
 ~GetWipeStatus () override
Q_INVOKABLE void execute () override
Public Member Functions inherited from Component
 Component (QObject *parent=nullptr)
 ~Component () override
AbstractConfigurationconfiguration () const
Errorerror () const
bool inOperation () const
bool isUseStorageEnabled () const
AbstractNotificatornotificator () const
quint16 requestTimeout () const
void setConfiguration (AbstractConfiguration *nAbstractConfiguration)
void setNotificator (AbstractNotificator *notificator)
void setRequestTimeout (quint16 seconds)
void setStorage (AbstractStorage *localStorage)
void setUseStorage (bool useStorage)
void setWipeManager (WipeManager *wipeManager)
AbstractStoragestorage () const
WipeManagerwipeManager () const

Signals

void wipeRequested ()
Signals inherited from Component
void configurationChanged (Fuoten::AbstractConfiguration *configuration)
void errorChanged (Fuoten::Error *error)
void failed (Fuoten::Error *error)
void inOperationChanged (bool inOperation)
void notificatorChanged (Fuoten::AbstractNotificator *notificator)
void requestTimeoutChanged (quint16 requestTimeout)
void sslErrors (QNetworkReply *reply, const QList< QSslError > &errors)
void storageChanged (Fuoten::AbstractStorage *storage)
void succeeded (const QJsonDocument &result)
void useStorageChanged (bool useStorage)
void wipeManagerChanged (Fuoten::WipeManager *wipeManager)

Protected Member Functions

bool checkInput () override
void successCallback () override
Protected Member Functions inherited from Component
void addRequestHeader (const QByteArray &headerName, const QByteArray &headerValue)
void addRequestHeaders (const QHash< QByteArray, QByteArray > &headers)
virtual bool checkOutput ()
virtual void extractError (QNetworkReply *reply)
QJsonDocument jsonResult () const
void notify (AbstractNotificator::Type type, QtMsgType severity, const QVariant &data) const
void notify (const Error *e) const
QHash< QByteArray, QByteArray > requestHeaders () const
void sendRequest ()
void setApiRoute (const QString &route)
void setApiRoute (const QStringList &routeParts)
void setError (Error *nError)
void setExpectedJSONType (ExpectedJSONType type)
void setInOperation (bool nInOperation)
void setNetworkOperation (QNetworkAccessManager::Operation operation)
void setPayload (const QByteArray &payload)
void setPayload (const QJsonObject &payload)
void setRequestHeaders (const QHash< QByteArray, QByteArray > &headers)
void setRequiresAuth (bool reqAuth)
void setUrlQuery (const QUrlQuery &query)

Additional Inherited Members

Public Types inherited from Component
enum  ExpectedJSONType : quint8 { Empty = 0 , Array = 1 , Object = 2 }
Properties inherited from Component
Fuoten::AbstractConfigurationconfiguration
Fuoten::Errorerror
bool inOperation
Fuoten::AbstractNotificatornotificator
quint16 requestTimeout
Fuoten::AbstractStoragestorage
bool useStorage
Fuoten::WipeManagerwipeManager
Static Public Member Functions inherited from Component
static AbstractConfigurationdefaultConfiguration ()
static AbstractNotificatordefaultNotificator ()
static AbstractStoragedefaultStorage ()
static WipeManagerdefaultWipeManager ()
static AbstractNamFactorynetworkAccessManagerFactory ()
static void setDefaultConfiguration (AbstractConfiguration *config)
static void setDefaultNotificator (AbstractNotificator *notificator)
static void setDefaultStorage (AbstractStorage *storage)
static void setDefaultWipeManager (WipeManager *wipeManager)
static void setNetworkAccessManagerFactory (AbstractNamFactory *factory)

Detailed Description

Requests the wipe status from the Nextcloud.

This will get the wipe status form the Nextcloud configured in the configuration object used by this object. So that property is mandatory. This should be used after you get a server reply with HTTP status code 401 or 403. If a wipe is requested, the wipeRequested() signal will be emitted. After the application data has been wiped on the local device, you should use PostWipeSuccess to inform the remote Nextcloud that the wipe has been executed. There is already WipeManager that can handle remote wipe requests.

See also https://docs.nextcloud.com/server/latest/developer_manual/client_apis/RemoteWipe/index.html

Mandatory properties
Component::configuration
API route
Not part of the News App API, uses general Nextcloud API at /index.php/core/wipe/check
Method
GET
Since
0.8.0
See also
WipeManager, PostWipeSuccess

Constructor & Destructor Documentation

◆ GetWipeStatus()

GetWipeStatus ( QObject * parent = nullptr)
explicit

Constructs a new GetWipeStatus object with the given parent.

◆ ~GetWipeStatus()

~GetWipeStatus ( )
override

Destroys the GetWipeStatus object.

Member Function Documentation

◆ checkInput()

bool checkInput ( )
overrideprotectedvirtual

Checks the input parameters.

Will especially check if the password has been set.

Reimplemented from Component.

◆ execute()

void execute ( )
overridevirtual

Executes the API request.

To perform a successful API request, Component::configuration has to be set to a valid object derived from AbstractConfiguration.

Execution will not run if the inOperation property returns true and will itself set that property to true when starting the request.

Implements Component.

◆ successCallback()

void successCallback ( )
overrideprotectedvirtual

Will check the reply if a remote wipe is requested.

If a wipe has been requested, the wipeRequested() signal will be emitted.

Implements Component.

◆ wipeRequested

void wipeRequested ( )
signal

Triggered when a remote wipe has been requested.

This signal will be emitted in the successCallback().