OpenAB  1.0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
CalDAVStorage Class Reference

#include <CalDAVStorage.hpp>

Inheritance diagram for CalDAVStorage:
Collaboration diagram for CalDAVStorage:

Public Member Functions

 CalDAVStorage (const std::string &url, const std::string &login, const OpenAB::SecureString &password, const std::string &calendarURL, const std::string &calendarName, OpenAB::PIMItemType type)
 Constructor. More...
 
 CalDAVStorage (const std::string &url, const std::string &clientId, const OpenAB::SecureString &clientSecret, const OpenAB::SecureString &refreshToken, const std::string &calendarURL, const std::string &calendarName, OpenAB::PIMItemType type)
 Constructor. More...
 
virtual ~CalDAVStorage ()
 
enum OpenAB_Source::Source::eInit init ()
 Initializes Source. More...
 
enum
OpenAB_Source::Source::eGetItemRet 
getItem (OpenAB::SmartPtr< OpenAB::PIMItem > &item)
 Gets PIM Item from Source. If Source is suspended getItem() should block until Source will be resumed or cancelled. More...
 
enum
OpenAB_Source::Source::eSuspendRet 
suspend ()
 Suspends Source, if such operation is supported. More...
 
enum
OpenAB_Source::Source::eResumeRet 
resume ()
 Resumes Source, if such operation is supported. More...
 
enum
OpenAB_Source::Source::eCancelRet 
cancel ()
 Cancels Source, if such operation is supported. After canceling Source next call to getVCard() should return eGetItemRetError status. More...
 
int getTotalCount () const
 Returns total count of items available from Source, if such information is available. More...
 
enum eAddItem addObject (const std::string &iCal, OpenAB::PIMItem::ID &newId, OpenAB::PIMItem::Revision &revision)
 Adds a new contact to the ContactsStorage. More...
 
enum eAddItem addObjects (const std::vector< std::string > &iCals, OpenAB::PIMItem::IDs &newIds, OpenAB::PIMItem::Revisions &revisions)
 Adds new contacts to the ContactsStorage. More...
 
enum eModifyItem modifyObject (const std::string &iCal, const OpenAB::PIMItem::ID &id, OpenAB::PIMItem::Revision &revision)
 Modifies contact in the ContactsStorage. More...
 
enum eModifyItem modifyObjects (const std::vector< std::string > &iCals, const OpenAB::PIMItem::IDs &ids, OpenAB::PIMItem::Revisions &revisions)
 Modifies contacts in the ContactsStorage. More...
 
enum eRemoveItem removeObject (const OpenAB::PIMItem::ID &id)
 Removes contact from the ContactsStorage. More...
 
enum eRemoveItem removeObjects (const OpenAB::PIMItem::IDs &ids)
 Removes contacts from the ContactsStorage. More...
 
enum eGetItem getEvent (const OpenAB::PIMItem::ID &id, OpenAB::SmartPtr< OpenAB::PIMCalendarEventItem > &item)
 Get the contact from the Storage. More...
 
enum eGetItem getEvents (const OpenAB::PIMItem::IDs &ids, std::vector< OpenAB::SmartPtr< OpenAB::PIMCalendarEventItem > > &items)
 Get the contacts from the Storage. More...
 
enum eGetItem getTask (const OpenAB::PIMItem::ID &id, OpenAB::SmartPtr< OpenAB::PIMCalendarTaskItem > &item)
 Get the contact from the Storage. More...
 
enum eGetItem getTasks (const OpenAB::PIMItem::IDs &ids, std::vector< OpenAB::SmartPtr< OpenAB::PIMCalendarTaskItem > > &items)
 Get the contacts from the Storage. More...
 
enum
OpenAB_Storage::Storage::eGetRevisions 
getRevisions (std::map< std::string, std::string > &revisions)
 Gets revision of the items from the Storage. More...
 
enum
OpenAB_Storage::Storage::eGetRevisions 
getChangedRevisions (const std::string &token, std::map< std::string, std::string > &revisions, std::vector< OpenAB::PIMItem::ID > &removed)
 Gets revisions of items changed since Storage was in state identified by token. More...
 
enum
OpenAB_Storage::Storage::eGetSyncToken 
getLatestSyncToken (std::string &token)
 If storage supports tracking of items changes, it returns latest status identifier of the storage. More...
 
OpenAB_Storage::StorageItemIteratornewStorageItemIterator ()
 Retrieve an new Iterator to quickly parse the list of items. More...
 
- Public Member Functions inherited from OpenAB_Storage::CalendarStorage
 CalendarStorage (OpenAB::PIMItemType type)
 Constructor. More...
 
virtual ~CalendarStorage ()
 Destructor, virtual by default. More...
 
enum Storage::eAddItem addItem (const OpenAB::SmartPtr< OpenAB::PIMItem > &item, OpenAB::PIMItem::ID &newId, OpenAB::PIMItem::Revision &revision)
 Adds a new item (OpenAB::PIMItem) to the Storage. More...
 
enum Storage::eAddItem addItems (const std::vector< OpenAB::SmartPtr< OpenAB::PIMItem > > &items, OpenAB::PIMItem::IDs &newIds, OpenAB::PIMItem::Revisions &revisions)
 Adds new items (OpenAB::PIMItem) to the Storage. More...
 
enum Storage::eModifyItem modifyItem (const OpenAB::SmartPtr< OpenAB::PIMItem > &item, const OpenAB::PIMItem::ID &id, OpenAB::PIMItem::Revision &revision)
 Modifies item (OpenAB::PIMItem) in the Storage. More...
 
enum Storage::eModifyItem modifyItems (const std::vector< OpenAB::SmartPtr< OpenAB::PIMItem > > &items, const OpenAB::PIMItem::IDs &ids, OpenAB::PIMItem::Revisions &revisions)
 Modifies items (OpenAB::PIMItem) in the Storage. More...
 
enum Storage::eRemoveItem removeItem (const OpenAB::PIMItem::ID &id)
 Removes item from the Storage. More...
 
enum Storage::eRemoveItem removeItems (const OpenAB::PIMItem::IDs &ids)
 Removes items from the Storage. More...
 
enum Storage::eGetItem getItem (const OpenAB::PIMItem::ID &id, OpenAB::SmartPtr< OpenAB::PIMItem > &item)
 Get the item from the Storage. More...
 
enum Storage::eGetItem getItems (const OpenAB::PIMItem::IDs &id, std::vector< OpenAB::SmartPtr< OpenAB::PIMItem > > &item)
 Get the items from the Storage. More...
 
- Public Member Functions inherited from OpenAB_Storage::Storage
 Storage (OpenAB::PIMItemType t)
 Constructor. More...
 
virtual ~Storage ()
 Destructor, virtual by default. More...
 
- Public Member Functions inherited from OpenAB_Source::Source
 Source (OpenAB::PIMItemType t)
 Constructor. More...
 
virtual ~Source ()
 Destructor, virtual by default. More...
 
OpenAB::PIMItemType getItemType () const
 Returns type of PIM Item supported by Source. More...
 

Additional Inherited Members

- Public Types inherited from OpenAB_Storage::Storage
enum  eAddItem { eAddItemOk, eAddItemFail }
 
enum  eModifyItem { eModifyItemOk, eModifyItemFail }
 
enum  eRemoveItem { eRemoveItemOk, eRemoveItemFail }
 
enum  eGetItem { eGetItemOk, eGetItemFail }
 
enum  eGetSyncToken { eGetSyncTokenOk, eGetSyncTokenFail }
 
enum  eGetRevisions { eGetRevisionsOk, eGetRevisionsFail }
 
- Public Types inherited from OpenAB_Source::Source
enum  eInit { eInitOk, eInitFail }
 
enum  eSuspendRet { eSuspendRetOk, eSuspendRetFail, eSuspendRetNotSupported }
 
enum  eResumeRet { eResumeRetOk, eResumeRetFail, eResumeRetNotSupported }
 
enum  eCancelRet { eCancelRetOk, eCancelRetFail, eCancelRetNotSupported }
 
enum  eGetItemRet { eGetItemRetOk, eGetItemRetEnd, eGetItemRetError }
 

Constructor & Destructor Documentation

CalDAVStorage::CalDAVStorage ( const std::string &  url,
const std::string &  login,
const OpenAB::SecureString password,
const std::string &  calendarURL,
const std::string &  calendarName,
OpenAB::PIMItemType  type 
)

Constructor.

Parameters
[in]urlserver url
[in]loginuser login
[in]passworduser password
[in]calendarURLdirect calendar url
[in]calendarNameoptional name of calendar to be used
[in]typetype of items to use (either OpenAB::eEvent or OpenAB::eTask)
CalDAVStorage::CalDAVStorage ( const std::string &  url,
const std::string &  clientId,
const OpenAB::SecureString clientSecret,
const OpenAB::SecureString refreshToken,
const std::string &  calendarURL,
const std::string &  calendarName,
OpenAB::PIMItemType  type 
)

Constructor.

Parameters
[in]urlserver url
[in]clientIdOAuth2 application id
[in]clientSecretOAuth2 application secret
[in]refreshTokenOAuth2 user refresh token
[in]calendarURLdirect calendar url
[in]calendarNameoptional name of calendar to be used
[in]typetype of items to use (either OpenAB::eEvent or OpenAB::eTask)
CalDAVStorage::~CalDAVStorage ( )
virtual

Member Function Documentation

enum OpenAB_Storage::Storage::eAddItem CalDAVStorage::addObject ( const std::string &  iCal,
OpenAB::PIMItem::ID newId,
OpenAB::PIMItem::Revision revision 
)
virtual

Adds a new contact to the ContactsStorage.

Parameters
[in]vCardvCard of contact to should added.
[out]newIdThe newly added contact ID.
[out]revisionThe revision of newly added contact - can be empty if revisions are not supported.
Returns
the status code

Implements OpenAB_Storage::CalendarStorage.

enum OpenAB_Storage::Storage::eAddItem CalDAVStorage::addObjects ( const std::vector< std::string > &  iCals,
OpenAB::PIMItem::IDs newIds,
OpenAB::PIMItem::Revisions revisions 
)
virtual

Adds new contacts to the ContactsStorage.

Parameters
[in]vCardsThe vector of contacts' vCards that should be added.
[out]newIdsThe newly added contacts ID in the same order as provided vCards.
[out]revisionsThe revisions of newly added contacts (in the same order as provided vCards). Can be empty if revisions are not supported.
Returns
the status code

Implements OpenAB_Storage::CalendarStorage.

enum OpenAB_Source::Source::eCancelRet CalDAVStorage::cancel ( )
virtual

Cancels Source, if such operation is supported. After canceling Source next call to getVCard() should return eGetItemRetError status.

Returns
the status code

Implements OpenAB_Source::Source.

enum OpenAB_Storage::Storage::eGetRevisions CalDAVStorage::getChangedRevisions ( const std::string &  token,
std::map< std::string, std::string > &  revisions,
std::vector< OpenAB::PIMItem::ID > &  removed 
)
virtual

Gets revisions of items changed since Storage was in state identified by token.

Parameters
[in]tokendatabase token since changes should be returned (getLatestSyncToken())
[out]revisionsrevisions map containing items IDs and their current revisions
[out]removedIDs vector of removed items
Returns
the status code

Implements OpenAB_Storage::Storage.

enum OpenAB_Storage::Storage::eGetItem CalDAVStorage::getEvent ( const OpenAB::PIMItem::ID id,
OpenAB::SmartPtr< OpenAB::PIMCalendarEventItem > &  item 
)
virtual

Get the contact from the Storage.

Parameters
[in]idThe ID of the contact that must be retrieved.
[out]itemThe OpenAB::PIMContactItem that was retrieved.
Returns
the status code

Implements OpenAB_Storage::CalendarStorage.

enum OpenAB_Storage::Storage::eGetItem CalDAVStorage::getEvents ( const OpenAB::PIMItem::IDs ids,
std::vector< OpenAB::SmartPtr< OpenAB::PIMCalendarEventItem > > &  items 
)
virtual

Get the contacts from the Storage.

Parameters
[in]idThe IDs of the contacts that must be retrieved.
[out]itemsThe OpenAB::PIMContactItem that was retrieved.
Returns
the status code

Implements OpenAB_Storage::CalendarStorage.

enum OpenAB_Source::Source::eGetItemRet CalDAVStorage::getItem ( OpenAB::SmartPtr< OpenAB::PIMItem > &  item)
virtual

Gets PIM Item from Source. If Source is suspended getItem() should block until Source will be resumed or cancelled.

Parameters
[out]itemitem received from Source
Returns
the status code
Note
item is returned as smart pointer, its contents will be deleted automatically when no more references to it will exist, it's not advised to dereference and use direct pointer

Implements OpenAB_Storage::Storage.

enum OpenAB_Storage::Storage::eGetSyncToken CalDAVStorage::getLatestSyncToken ( std::string &  token)
virtual

If storage supports tracking of items changes, it returns latest status identifier of the storage.

Parameters
[out]tokenlatest status identifier
Returns
eGetSyncTokenFail if storage does not supports changes tracking, eGetSyncTokenOk otherwise.

Implements OpenAB_Storage::Storage.

enum OpenAB_Storage::Storage::eGetRevisions CalDAVStorage::getRevisions ( std::map< std::string, std::string > &  revisions)
virtual

Gets revision of the items from the Storage.

Parameters
[out]revisionsmap containing items IDs and their current revisions.
Returns
the status code

Implements OpenAB_Storage::Storage.

enum OpenAB_Storage::Storage::eGetItem CalDAVStorage::getTask ( const OpenAB::PIMItem::ID id,
OpenAB::SmartPtr< OpenAB::PIMCalendarTaskItem > &  item 
)
virtual

Get the contact from the Storage.

Parameters
[in]idThe ID of the contact that must be retrieved.
[out]itemThe OpenAB::PIMContactItem that was retrieved.
Returns
the status code

Implements OpenAB_Storage::CalendarStorage.

enum OpenAB_Storage::Storage::eGetItem CalDAVStorage::getTasks ( const OpenAB::PIMItem::IDs ids,
std::vector< OpenAB::SmartPtr< OpenAB::PIMCalendarTaskItem > > &  items 
)
virtual

Get the contacts from the Storage.

Parameters
[in]idThe IDs of the contacts that must be retrieved.
[out]itemsThe OpenAB::PIMContactItem that was retrieved.
Returns
the status code

Implements OpenAB_Storage::CalendarStorage.

int CalDAVStorage::getTotalCount ( ) const
virtual

Returns total count of items available from Source, if such information is available.

Returns
total count of items available or -1 if such information is unavailable

Implements OpenAB_Source::Source.

enum OpenAB_Storage::Storage::eInit CalDAVStorage::init ( )
virtual

Initializes Source.

Returns
the status code

Implements OpenAB_Source::Source.

enum OpenAB_Storage::Storage::eModifyItem CalDAVStorage::modifyObject ( const std::string &  iCal,
const OpenAB::PIMItem::ID id,
OpenAB::PIMItem::Revision revision 
)
virtual

Modifies contact in the ContactsStorage.

Parameters
[in]vCardvCard of contact that should be modified.
[in]idThe ID of the item that should be modified.
[out]revisionThe updated revision of modified contact.
Returns
the status code

Implements OpenAB_Storage::CalendarStorage.

enum OpenAB_Storage::Storage::eModifyItem CalDAVStorage::modifyObjects ( const std::vector< std::string > &  iCals,
const OpenAB::PIMItem::IDs ids,
OpenAB::PIMItem::Revisions revisions 
)
virtual

Modifies contacts in the ContactsStorage.

Parameters
[in]vCardsThe vector of contact's vCards that should be modified.
[in]idsThe vector of ID of the contacts that must be modified (in the same order as provided vCards).
[out]revisionsThe updated revisions of modified contacts (in the same order as provided vCards).
Returns
the status code

Implements OpenAB_Storage::CalendarStorage.

OpenAB_Storage::StorageItemIterator * CalDAVStorage::newStorageItemIterator ( )
virtual

Retrieve an new Iterator to quickly parse the list of items.

Returns
the new Iterator for this Storage

Implements OpenAB_Storage::Storage.

enum OpenAB_Storage::Storage::eRemoveItem CalDAVStorage::removeObject ( const OpenAB::PIMItem::ID id)
virtual

Removes contact from the ContactsStorage.

Parameters
[in]idThe ID of the contact that must be removed.
Returns
the status code

Implements OpenAB_Storage::CalendarStorage.

enum OpenAB_Storage::Storage::eRemoveItem CalDAVStorage::removeObjects ( const OpenAB::PIMItem::IDs ids)
virtual

Removes contacts from the ContactsStorage.

Parameters
[in]idsThe vector of ID of the contacts that must be removed.
Returns
the status code

Implements OpenAB_Storage::CalendarStorage.

enum OpenAB_Source::Source::eResumeRet CalDAVStorage::resume ( )
virtual

Resumes Source, if such operation is supported.

Returns
the status code

Implements OpenAB_Source::Source.

enum OpenAB_Source::Source::eSuspendRet CalDAVStorage::suspend ( )
virtual

Suspends Source, if such operation is supported.

Returns
the status code

Implements OpenAB_Source::Source.


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