libqtaws  0.1.0
UnofficialAWSlibraryforQt
Public Slots | Signals | Public Member Functions | List of all members
AwsAbstractCredentials Class Referenceabstract

Interface class for providing AWS credentials. More...

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

Public Slots

virtual bool refresh ()
 Refresh this object's credentials. More...
 

Signals

void changed ()
 Signal emitted when this object's credentials have been updated. More...
 

Public Member Functions

 AwsAbstractCredentials (QObject *const parent=0)
 Construct an AwsAbstractCredentials. More...
 
virtual QString accessKeyId () const =0
 AWS access key ID for this credentials object. More...
 
virtual QString secretKey () const =0
 AWS secret access key for this credentials object. More...
 
virtual QString token () const =0
 AWS security token for this credentials object. More...
 
virtual QDateTime expiration () const
 DateTime at which the credentials will expire. More...
 
virtual bool isExpired () const
 Is this credentials object currently expired. More...
 
virtual bool isRefreshable () const
 Is this credentials object refreshable. More...
 

Detailed Description

Interface class for providing AWS credentials.

Constructor & Destructor Documentation

AwsAbstractCredentials::AwsAbstractCredentials ( QObject *const  parent = 0)

Construct an AwsAbstractCredentials.

Parameters
parent

Member Function Documentation

QString AwsAbstractCredentials::accessKeyId ( ) const
pure virtual

AWS access key ID for this credentials object.

Returns
The AWS access key ID for this credentials object.

Implemented in AwsBasicCredentials, and AwsAnonymousCredentials.

void AwsAbstractCredentials::changed ( )
signal

Signal emitted when this object's credentials have been updated.

See also
refresh()
QDateTime AwsAbstractCredentials::expiration ( ) const
virtual

DateTime at which the credentials will expire.

This method should not be invoked unless the object is known to be refreshable (ie isRefreshable() returns true). As the base implementation of isRefreshable() always returns false, this implementation of expiration() should not be invoked.

Derived classes that return true from isRefreshable() must also override this function to provide the appropriate expiration timestamp (which may a null QDateTime if the credentials never expire).

Returns
The DateTime at whcih the credentials will expire.
See also
isExpired()
isRefreshable()
refresh()
bool AwsAbstractCredentials::isExpired ( ) const
virtual

Is this credentials object currently expired.

In this base implementation, non-refreshable credentials (ie those for which isRefreshable() returns false) are assumed to never expire, whereas refreshable credentials are assume to be expired only if expiration() returns a valid QDateTime representing a time in the past (ie earlier than QDateTime::currentDateTimeUtc()).

Derived classes may override this method to implement custom expiration logic.

Returns
true if this credentials object is expired, false otherwise.
See also
expiration()
isRefreshable()
refresh()
bool AwsAbstractCredentials::isRefreshable ( ) const
virtual

Is this credentials object refreshable.

This base implementation always returns false - ie credentials are not refreshable by default. However, dervived classes may override this method as appropriate.

Derived classes that override this method must also override the expiration() method (merely returning a null QDateTime is the credentials do not expire), and may wish to override isExpired() also.

Returns
true if this credentials object is expired, false otherwise.
See also
expiration()
isExpired()
refresh()
bool AwsAbstractCredentials::refresh ( )
virtualslot

Refresh this object's credentials.

This slot begins an asynchronous refresh transaction, and should be followed by a change() signal when the credentials have been refreshed.

Todo:
A signal for errors?

This method should not be invoked unless the object is known to be refreshable (ie isRefreshable() returns true). As the base implementation of isRefreshable() always returns false, this implementation of expiration() should not be invoked.

Derived classes that return true from isRefreshable() must also override this function to provide the appropriate refresh behaviour.

Returns
true if the refresh transaction has begun successfully, false otherwise.
See also
isRefreshable()
changed()
QString AwsAbstractCredentials::secretKey ( ) const
pure virtual

AWS secret access key for this credentials object.

Returns
The AWS secret access key for this credentials object.

Implemented in AwsBasicCredentials, and AwsAnonymousCredentials.

QString AwsAbstractCredentials::token ( ) const
pure virtual

AWS security token for this credentials object.

Returns
The AWS security token for this credentials object.

Implemented in AwsBasicCredentials, and AwsAnonymousCredentials.


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