51 const std::string& login,
55 const std::string& clientId,
102 std::map<std::string, std::string>& revisions,
103 std::vector<OpenAB::PIMItem::ID>& removed);
124 bool downloadVCards(
unsigned int offset,
unsigned int size);
126 std::string serverUrl;
128 std::string userLogin;
131 std::string clientId;
135 std::string syncToken;
184 enum eFetchContacts {
189 enum eFetchContacts fetchContacts(
int fetchsize);
191 static void* downloadThreadFunc(
void* ptr);
192 bool downloadVCards(
unsigned int offset,
unsigned int size);
197 unsigned int offsetOfCachedVCards;
198 std::list<OpenAB::SmartPtr<OpenAB::PIMContactItem> > cachedContacts;
199 std::vector<CardDAVHelper::ContactMetadata> contactsMetadata;
202 pthread_t downloadThread;
204 pthread_mutex_t mutex;
205 pthread_cond_t bufferReadyCond;
CardDAVStorageItemIterator()
Constructor.
Definition: CardDAVStorage.cpp:437
Documentation for class CardDAVHelper.
Definition: CardDAVHelper.hpp:19
enum OpenAB_Source::Source::eCancelRet cancel()
Cancels Source, if such operation is supported. After canceling Source next call to getVCard() should...
Definition: CardDAVStorage.cpp:419
virtual ~CardDAVStorage()
Definition: CardDAVStorage.cpp:71
std::string Revision
Definition: PIMItem.hpp:89
enum eGetItem getContact(const OpenAB::PIMItem::ID &id, OpenAB::SmartPtr< OpenAB::PIMContactItem > &item)
Get the contact from the Storage.
Definition: CardDAVStorage.cpp:231
enum eRemoveItem removeContacts(const OpenAB::PIMItem::IDs &ids)
Removes contacts from the ContactsStorage.
Definition: CardDAVStorage.cpp:218
HttpSession class. Allows to send Http requests.
Definition: Http.hpp:26
enum eModifyItem modifyContacts(const std::vector< std::string > &vCard, const OpenAB::PIMItem::IDs &ids, OpenAB::PIMItem::Revisions &revisions)
Modifies contacts in the ContactsStorage.
Definition: CardDAVStorage.cpp:191
HttpAuthorizer interface. This should be used by classes implementing different Http authorization me...
Definition: Http.hpp:334
eCancelRet
Definition: Source.hpp:138
eResumeRet
Definition: Source.hpp:123
Definition: CardDAVStorage.hpp:44
eModifyItem
Definition: Storage.hpp:164
enum eModifyItem modifyContact(const std::string &vCard, const OpenAB::PIMItem::ID &id, OpenAB::PIMItem::Revision &revision)
Modifies contact in the ContactsStorage.
Definition: CardDAVStorage.cpp:180
enum eAddItem addContact(const std::string &vCard, OpenAB::PIMItem::ID &newId, OpenAB::PIMItem::Revision &revision)
Adds a new contact to the ContactsStorage.
Definition: CardDAVStorage.cpp:148
std::vector< OpenAB::PIMItem::Revision > Revisions
Definition: PIMItem.hpp:111
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.
Definition: CardDAVStorage.cpp:326
eAddItem
Definition: Storage.hpp:126
This object associates OpenAB::PIMItem with its unique ID from OpenAB_Storage::Storage. Additionally it stores status flag used in synchronization process.
Definition: StorageItem.hpp:22
unsigned int getSize() const
Retrieve number of items in interator.
Definition: CardDAVStorage.cpp:612
SecureString class, used to store strings like passwords etc. Current implementation encodes string i...
Definition: SecureString.hpp:26
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...
Definition: CardDAVStorage.cpp:380
Definition: CardDAVStorage.hpp:157
int getTotalCount() const
Returns total count of items available from Source, if such information is available.
Definition: CardDAVStorage.cpp:428
OpenAB_Storage::StorageItem * operator->()
Retrieve the current StorageItem.
Definition: CardDAVStorage.cpp:606
eSuspendRet
Definition: Source.hpp:108
The StorageItemIterator is mainly used to quickly browse the Storage contents.
Definition: StorageItem.hpp:97
eCursorInit
Definition: CardDAVStorage.hpp:156
std::vector< OpenAB::PIMItem::ID > IDs
Definition: PIMItem.hpp:110
Definition: CardDAVStorage.hpp:158
OpenAB_Storage::StorageItem * next()
Retrieve the next StorageItem.
Definition: CardDAVStorage.cpp:561
eGetItemRet
Definition: Source.hpp:155
enum eRemoveItem removeContact(const OpenAB::PIMItem::ID &id)
Removes contact from the ContactsStorage.
Definition: CardDAVStorage.cpp:209
OpenAB_Storage::StorageItemIterator * newStorageItemIterator()
Retrieve an new Iterator to quickly parse the list of items.
Definition: CardDAVStorage.cpp:363
eGetItem
Definition: Storage.hpp:226
enum OpenAB_Storage::Storage::eGetSyncToken getLatestSyncToken(std::string &token)
If storage supports tracking of items changes, it returns latest status identifier of the storage...
Definition: CardDAVStorage.cpp:351
eGetRevisions
Definition: Storage.hpp:265
enum OpenAB_Source::Source::eInit init()
Initializes Source.
Definition: CardDAVStorage.cpp:99
OpenAB_Storage::StorageItem operator*()
Retrieve the current StorageItem.
Definition: CardDAVStorage.cpp:600
CardDAVStorage(const std::string &url, const std::string &login, const OpenAB::SecureString &password)
Constructor.
Definition: CardDAVStorage.cpp:26
enum eCursorInit cursorInit(CardDAVHelper *cardDavHelper)
Definition: CardDAVStorage.cpp:462
eGetSyncToken
Definition: Storage.hpp:251
eInit
Definition: Source.hpp:94
enum OpenAB_Storage::Storage::eGetRevisions getRevisions(std::map< std::string, std::string > &revisions)
Gets revision of the items from the Storage.
Definition: CardDAVStorage.cpp:309
std::string ID
Definition: PIMItem.hpp:64
enum OpenAB_Source::Source::eSuspendRet suspend()
Suspends Source, if such operation is supported.
Definition: CardDAVStorage.cpp:401
enum OpenAB_Source::Source::eResumeRet resume()
Resumes Source, if such operation is supported.
Definition: CardDAVStorage.cpp:410
virtual ~CardDAVStorageItemIterator()
Destructor, virtual by default.
Definition: CardDAVStorage.cpp:451
enum eGetItem getContacts(const OpenAB::PIMItem::IDs &ids, std::vector< OpenAB::SmartPtr< OpenAB::PIMContactItem > > &items)
Get the contacts from the Storage.
Definition: CardDAVStorage.cpp:268
enum eAddItem addContacts(const std::vector< std::string > &vCards, OpenAB::PIMItem::IDs &newIds, OpenAB::PIMItem::Revisions &revisions)
Adds new contacts to the ContactsStorage.
Definition: CardDAVStorage.cpp:159
Definition: CardDAVStorage.hpp:143
eRemoveItem
Definition: Storage.hpp:201