KDAV 5.109.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
KDAV::DavJobBase

base class for the jobs used by the resource. More...

#include <KDAV/DavJobBase>

Public Member Functions

 DavJobBase (QObject *parent=nullptr)
 
bool canRetryLater () const
 Check if the job can be retried later.
 
Error davError () const
 Returns a instance of the KDAV:Error to be able to translate the error.
 
bool hasConflict () const
 Check if the job failed because of a conflict.
 
int latestResponseCode () const
 Get the latest response code.
 

Protected Member Functions

 DavJobBase (DavJobBasePrivate *dd, QObject *parent=nullptr)
 

Protected Attributes

std::unique_ptr< DavJobBasePrivate > d_ptr
 

Detailed Description

base class for the jobs used by the resource.

Member Function Documentation

◆ canRetryLater()

bool KDAV::DavJobBase::canRetryLater ( ) const

Check if the job can be retried later.

This will return true for transient errors, i.e. if the response code is either zero and error() is set or if the HTTP response code hints at a temporary error.

The HTTP response codes considered retryable are:

  • 401
  • 402
  • 407
  • 408
  • 423
  • 429
  • 501 to 504, inclusive
  • 507
  • 511

◆ davError()

Error KDAV::DavJobBase::davError ( ) const

Returns a instance of the KDAV:Error to be able to translate the error.

◆ hasConflict()

bool KDAV::DavJobBase::hasConflict ( ) const

Check if the job failed because of a conflict.

◆ latestResponseCode()

int KDAV::DavJobBase::latestResponseCode ( ) const

Get the latest response code.

If no response code has been set then 0 will be returned, but will be meaningless unless error() is non-zero. In that case this means that the latest error was not at the HTTP level.