EDataBook.BookMetaBackend¶
- Subclasses:
None
Methods¶
- Inherited:
EDataBook.BookBackendSync (9), EDataBook.BookBackend (70), EBackend.Backend (21), GObject.Object (37)
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
EDataBook.BookBackendSync (3), EDataBook.BookBackend (22), EBackend.Backend (3), GObject.Object (7)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/en |
Book Cache |
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
This signal is emitted whenever the underlying backend |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent |
r |
Class Details¶
- class EDataBook.BookMetaBackend(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
Contains only private data that should be read and manipulated using the functions below.
New in version 3.26.
- connect_sync(credentials, cancellable)¶
- Parameters:
credentials (
EDataServer.NamedParametersorNone) – anEDataServer.NamedParameterswith previously used credentials, orNonecancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- out_auth_result:
an
EDataServer.SourceAuthenticationResultwith an authentication result- out_certificate_pem:
a PEM encoded certificate on failure, or
None- out_certificate_errors:
a
Gio.TlsCertificateFlagson failure, or 0
- Return type:
(
bool, out_auth_result:EDataServer.SourceAuthenticationResult, out_certificate_pem:str, out_certificate_errors:Gio.TlsCertificateFlags)
This is called always before any operation which requires a connection to the remote side. It can fail with an
EDataServer.ClientError.REPOSITORY_OFFLINEerror to indicate that the remote side cannot be currently reached. Other errors are propagated to the caller/client side. This method is not called when the backend is offline.The descendant should also call
EDataBook.BookBackend.set_writable() after successful connect to the remote side. This value is stored for later use, when being opened offline.The credentials parameter consists of the previously used credentials. It’s always
Nonewith the first connection attempt. To get the credentials, just set the out_auth_result toEDataServer.SourceAuthenticationResult.REQUIREDfor the first time and the function will be called again once the credentials are available. See the documentation ofEDataServer.SourceAuthenticationResultfor other available results.The out parameters are passed to
EBackend.Backend.schedule_credentials_required() and are ignored when the descendant returnsTrue, aka they are used only if the connection fails. The out_certificate_pem and out_certificate_errors should be used together and they can be left untouched if the failure reason was not related to certificate. Use out_auth_resultEDataServer.SourceAuthenticationResult.UNKNOWNto indicate other error than credentials error, otherwise the error is used according to out_auth_result value.It is mandatory to implement this virtual method by the descendant.
New in version 3.26.
- disconnect_sync(cancellable)¶
- Parameters:
cancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone- Raises:
- Returns:
Whether succeeded.
- Return type:
This is called when the backend goes into offline mode or when the disconnect is required. The implementation should not report any error when it is called and the self is not connected.
It is mandatory to implement this virtual method by the descendant.
New in version 3.26.
- dup_sync_tag()¶
-
Returns the last known synchronization tag, the same as used to call
EDataBook.BookMetaBackend.get_changes_sync().Free the returned string with
GLib.free(), when no longer needed.New in version 3.28.
- empty_cache_sync(cancellable)¶
- Parameters:
cancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone- Raises:
- Returns:
Whether succeeded.
- Return type:
Empties the local cache by removing all known contacts from it and notifies about such removal any opened views.
New in version 3.26.
- ensure_connected_sync(cancellable)¶
- Parameters:
cancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone- Raises:
- Returns:
Whether succeeded.
- Return type:
Ensures that the self is connected to its destination.
New in version 3.26.
- get_capabilities()¶
- Returns:
an
EDataBook.BookBackend::capabilitiesproperty to be used by the descendant in conjunction to the descendant’s capabilities in the result ofEDataBook.BookBackend.get_backend_property() withEDataServer.CLIENT_BACKEND_PROPERTY_CAPABILITIES.- Return type:
New in version 3.26.
- get_changes_sync(last_sync_tag, is_repeat, cancellable)¶
- Parameters:
last_sync_tag (
strorNone) – optional sync tag from the last checkis_repeat (
bool) – set toTruewhen this is the repeated callcancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- out_new_sync_tag:
new sync tag to store on success
- out_repeat:
whether to repeat this call again; default is
False- out_created_objects:
a
GLib.SListofEDataBook.BookMetaBackendInfoobject infos which had been created since the last check- out_modified_objects:
a
GLib.SListofEDataBook.BookMetaBackendInfoobject infos which had been modified since the last check- out_removed_objects:
a
GLib.SListofEDataBook.BookMetaBackendInfoobject infos which had been removed since the last check
- Return type:
(
bool, out_new_sync_tag:str, out_repeat:bool, out_created_objects: [EDataBook.BookMetaBackendInfo], out_modified_objects: [EDataBook.BookMetaBackendInfo], out_removed_objects: [EDataBook.BookMetaBackendInfo])
Gathers the changes since the last check which had been done on the remote side.
The last_sync_tag can be used as a tag of the last check. This can be
None, when there was no previous call or when the descendant doesn’t store any such tags. The out_new_sync_tag can be populated with a value to be stored and used the next time.The out_repeat can be set to
Truewhen the descendant didn’t finish read of all the changes. In that case the self calls this function again with the out_new_sync_tag as the last_sync_tag, but also notifies about the found changes immediately. The is_repeat is set toTrueas well in this case, otherwise it’sFalse.The descendant can populate also
EDataBook.BookMetaBackendInfo::objectof the out_created_objects and out_modified_objects, if known, in which case this will be used instead of loading it withEDataBook.BookMetaBackend.load_contact_sync().It is optional to implement this virtual method by the descendant. The default implementation calls
EDataBook.BookMetaBackend.list_existing_sync() and then compares the list with the current content of the local cache and populates the respective lists appropriately.Each output
GLib.SListshould be freed with g_slist_free_full (objects,EDataBook.BookMetaBackendInfo.free); when no longer needed.New in version 3.26.
- get_connected_writable()¶
- Returns:
Whether the self connected to a writable destination.
- Return type:
This value has meaning only if
EDataBook.BookMetaBackend.get_ever_connected() isTrue.New in version 3.26.
- get_ever_connected()¶
- Returns:
Whether the self ever made a successful connection to its destination.
- Return type:
New in version 3.26.
- get_ssl_error_details()¶
- Returns:
True, when the SSL error details had been available and the out parameters populated,Falseotherwise.- out_certificate_pem:
SSL certificate encoded in PEM format
- out_certificate_errors:
bit-or of
Gio.TlsCertificateFlagsclaiming the certificate errors
- Return type:
(
bool, out_certificate_pem:str, out_certificate_errors:Gio.TlsCertificateFlags)
It is optional to implement this virtual method by the descendants. It is used to receive SSL error details when any online operation returns E_CLIENT_ERROR,
EDataServer.ClientError.TLS_NOT_AVAILABLEerror.New in version 3.28.
- inline_local_photos_sync(contact, cancellable)¶
- Parameters:
contact (
EBookContacts.Contact) – anEBookContacts.Contactto work withcancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- Return type:
Changes all URL photos and logos which point to a local file in contact to inline type, aka adds the file content into the contact. This is called automatically before
EDataBook.BookMetaBackend.save_contact_sync().The reverse operation is
EDataBook.BookMetaBackend.store_inline_photos_sync().New in version 3.26.
- list_existing_sync(cancellable)¶
- Parameters:
cancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone- Raises:
- Returns:
Whether succeeded.
- out_new_sync_tag:
optional return location for a new sync tag
- out_existing_objects:
a
GLib.SListofEDataBook.BookMetaBackendInfoobject infos which are stored on the remote side
- Return type:
(
bool, out_new_sync_tag:str, out_existing_objects: [EDataBook.BookMetaBackendInfo])
Used to get list of all existing objects on the remote side. The descendant can optionally provide out_new_sync_tag, which will be stored on success, if not
None. The descendant can populate alsoEDataBook.BookMetaBackendInfo::objectof the out_existing_objects, if known, in which case this will be used instead of loading it withEDataBook.BookMetaBackend.load_contact_sync().It is mandatory to implement this virtual method by the descendant, unless it implements its own
EDataBook.BookMetaBackend.do_get_changes_sync().The out_existing_objects
GLib.SListshould be freed with g_slist_free_full (objects,EDataBook.BookMetaBackendInfo.free); when no longer needed.New in version 3.26.
- load_contact_sync(uid, extra, cancellable)¶
- Parameters:
uid (
str) – a contact UIDextra (
strorNone) – optional extra data stored with the contact, orNonecancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- out_contact:
a loaded contact, as an
EBookContacts.Contact- out_extra:
an extra data to store to
EDataBook.BookCachewith this contact
- Return type:
(
bool, out_contact:EBookContacts.Contact, out_extra:str)
Loads a contact from the remote side.
It is mandatory to implement this virtual method by the descendant.
The returned out_contact should be freed with
GObject.Object.unref(), when no longer needed.The returned out_extra should be freed with
GLib.free(), when no longer needed.New in version 3.26.
- process_changes_sync(created_objects, modified_objects, removed_objects, cancellable)¶
- Parameters:
created_objects ([
EDataBook.BookMetaBackendInfo] orNone) – aGLib.SListofEDataBook.BookMetaBackendInfoobject infos which had been createdmodified_objects ([
EDataBook.BookMetaBackendInfo] orNone) – aGLib.SListofEDataBook.BookMetaBackendInfoobject infos which had been modifiedremoved_objects ([
EDataBook.BookMetaBackendInfo] orNone) – aGLib.SListofEDataBook.BookMetaBackendInfoobject infos which had been removedcancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- Return type:
Processes given changes by updating local cache content accordingly. The self processes the changes like being online and particularly requires to be online to load created and modified objects when needed.
New in version 3.26.
- ref_cache()¶
- Returns:
Referenced
EDataBook.BookCache, which is used by self. Unref it withGObject.Object.unref(), when no longer needed.- Return type:
New in version 3.26.
- refresh_sync(cancellable)¶
- Parameters:
cancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone- Raises:
- Returns:
Whether succeeded.
- Return type:
Refreshes the self immediately. To just schedule refresh operation call
EDataBook.BookMetaBackend.schedule_refresh().New in version 3.26.
- remove_contact_sync(conflict_resolution, uid, extra, object, opflags, cancellable)¶
- Parameters:
conflict_resolution (
EDataServer.ConflictResolution) – anEDataServer.ConflictResolutionto useuid (
str) – a contact UIDextra (
strorNone) – extra data being saved with the contact in the local cache, orNoneobject (
strorNone) – corresponding vCard object, as stored in the local cache, orNoneopflags (
int) – bit-or ofEBookContacts.BookOperationFlagscancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- Return type:
Removes a contact from the remote side. The object is not
Nonewhen it’s removing locally deleted object in offline mode. Being itNone, the descendant can obtain the object from theEDataBook.BookCache.It is mandatory to implement this virtual method by the writable descendant.
New in version 3.26.
- requires_reconnect()¶
-
Determines, whether current source content requires reconnect of the backend.
It is optional to implement this virtual method by the descendant. The default implementation compares
EDataServer.SOURCE_EXTENSION_AUTHENTICATIONandEDataServer.SOURCE_EXTENSION_WEBDAV_BACKEND, if existing in the source, with the values after the last successful connect and returnsTruewhen they changed. It always returnTruewhen there was no successful connect done yet.New in version 3.26.
- save_contact_sync(overwrite_existing, conflict_resolution, contact, extra, opflags, cancellable)¶
- Parameters:
overwrite_existing (
bool) –Truewhen can overwrite existing contacts,Falseotherwiseconflict_resolution (
EDataServer.ConflictResolution) – one ofEDataServer.ConflictResolution, what to do on conflictscontact (
EBookContacts.Contact) – anEBookContacts.Contactto saveextra (
strorNone) – extra data saved with the contacts in anEDataBook.BookCacheopflags (
int) – bit-or ofEBookContacts.BookOperationFlagscancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- out_new_uid:
return location for the UID of the saved contact
- out_new_extra:
return location for the extra data to store with the contact
- Return type:
Saves one contact into the remote side. When the overwrite_existing is
True, then the descendant can overwrite an object with the same UID on the remote side (usually used for modify). The conflict_resolution defines what to do when the remote side had made any changes to the object since the last update.The contact has already converted locally stored photos and logos into inline variants, thus it’s not needed to call
EDataBook.BookMetaBackend.inline_local_photos_sync() by the descendant.The out_new_uid can be populated with a UID of the saved contact as the server assigned it to it. This UID, if set, is loaded from the remote side afterwards, also to see whether any changes had been made to the contact by the remote side.
The out_new_extra can be populated with a new extra data to save with the contact. Left it
None, to keep the same value as the extra.The descendant can use an
EDataServer.ClientError.OUT_OF_SYNCerror to indicate that the save failed due to made changes on the remote side, and let the self resolve this conflict based on the conflict_resolution on its own. TheEDataServer.ClientError.OUT_OF_SYNCerror should not be used when the descendant is able to resolve the conflicts itself.It is mandatory to implement this virtual method by the writable descendant.
New in version 3.26.
- schedule_refresh()¶
Schedules refresh of the content of the self. If there’s any already scheduled, then the function does nothing.
Use
EDataBook.BookMetaBackend.refresh_sync() to refresh the self immediately.New in version 3.26.
- search_sync(expr, meta_contact, cancellable)¶
- Parameters:
meta_contact (
bool) –True, when returnEBookContacts.Contactfilled with UID and REV only,Falseto return full contactscancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- out_contacts:
return location for the found contacts as
EBookContacts.Contact
- Return type:
(
bool, out_contacts: [EBookContacts.Contact])
Searches self with given expression expr and returns found contacts as a
GLib.SListofEBookContacts.Contactout_contacts. Free the returned out_contacts with g_slist_free_full (contacts,GObject.Object.unref); when no longer needed. When the expr isNone, all objects are returned. To get UID-s instead, callEDataBook.BookMetaBackend.search_uids_sync().It is optional to implement this virtual method by the descendant. The default implementation searches self's cache. It’s also not required to be online for searching, thus self doesn’t ensure it.
New in version 3.26.
- search_uids_sync(expr, cancellable)¶
- Parameters:
cancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- out_uids:
return location for the found contact UID-s
- Return type:
Searches self with given expression expr and returns found contact UID-s as a
GLib.SListout_contacts. Free the returned out_uids with g_slist_free_full (uids,GLib.free); when no longer needed. When the expr isNone, all UID-s are returned. To getEBookContacts.Contact(s) instead, callEDataBook.BookMetaBackend.search_sync().It is optional to implement this virtual method by the descendant. The default implementation searches self's cache. It’s also not required to be online for searching, thus self doesn’t ensure it.
New in version 3.26.
- set_cache(cache)¶
- Parameters:
cache (
EDataBook.BookCache) – anEDataBook.BookCacheto use
Sets the cache as the cache to be used by the self. By default, a cache.db in
EDataBook.BookBackend::cache-diris created in the constructed method. This function can be used to override the default.Note the self adds its own reference to the cache.
New in version 3.26.
- set_connected_writable(value)¶
- Parameters:
value (
bool) – value to set
Sets whether the self connected to a writable destination. This value has meaning only if
EDataBook.BookMetaBackend.get_ever_connected() isTrue.This is used by the self itself, during the opening phase, to set the backend writable or not also in the offline mode.
New in version 3.26.
- set_ever_connected(value)¶
- Parameters:
value (
bool) – value to set
Sets whether the self ever made a successful connection to its destination.
This is used by the self itself, during the opening phase, when it had not been connected yet, then it does so immediately, to eventually report settings error easily.
New in version 3.26.
- set_sync_tag(sync_tag)¶
-
Sets the sync_tag for the self.
New in version 3.50.
- split_changes_sync(objects, cancellable)¶
- Parameters:
objects ([
EDataBook.BookMetaBackendInfo]) – aGLib.SListofEDataBook.BookMetaBackendInfoobject infos to splitcancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- objects:
a
GLib.SListofEDataBook.BookMetaBackendInfoobject infos to split- out_created_objects:
a
GLib.SListofEDataBook.BookMetaBackendInfoobject infos which had been created- out_modified_objects:
a
GLib.SListofEDataBook.BookMetaBackendInfoobject infos which had been modified- out_removed_objects:
a
GLib.SListofEDataBook.BookMetaBackendInfoobject infos which had been removed; it can beNone, to not gather list of removed object infos
- Return type:
(
bool, objects: [EDataBook.BookMetaBackendInfo], out_created_objects: [EDataBook.BookMetaBackendInfo], out_modified_objects: [EDataBook.BookMetaBackendInfo], out_removed_objects: [EDataBook.BookMetaBackendInfo])
Splits objects into created/modified/removed lists according to current local cache content. Only the out_removed_objects can be
None, others cannot. The function modifies objects by moving its ‘data’ to corresponding out lists and sets the objects ‘data’ toNone.Each output
GLib.SListshould be freed with g_slist_free_full (objects,EDataBook.BookMetaBackendInfo.free); when no longer needed.The caller is still responsible to free objects as well.
New in version 3.26.
- store_inline_photos_sync(contact, cancellable)¶
- Parameters:
contact (
EBookContacts.Contact) – anEBookContacts.Contactto work withcancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Raises:
- Returns:
Whether succeeded.
- Return type:
Changes all inline photos and logos to URL type in contact, which will point to a local file instead, beside the cache file. This is called automatically after
EDataBook.BookMetaBackend.load_contact_sync().The reverse operation is
EDataBook.BookMetaBackend.inline_local_photos_sync().New in version 3.26.
- do_connect_sync(credentials, cancellable) virtual¶
- Parameters:
credentials (
EDataServer.NamedParametersorNone) – anEDataServer.NamedParameterswith previously used credentials, orNonecancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Returns:
Whether succeeded.
- out_auth_result:
an
EDataServer.SourceAuthenticationResultwith an authentication result- out_certificate_pem:
a PEM encoded certificate on failure, or
None- out_certificate_errors:
a
Gio.TlsCertificateFlagson failure, or 0
- Return type:
(
bool, out_auth_result:EDataServer.SourceAuthenticationResult, out_certificate_pem:str, out_certificate_errors:Gio.TlsCertificateFlags)
This is called always before any operation which requires a connection to the remote side. It can fail with an
EDataServer.ClientError.REPOSITORY_OFFLINEerror to indicate that the remote side cannot be currently reached. Other errors are propagated to the caller/client side. This method is not called when the backend is offline.The descendant should also call
EDataBook.BookBackend.set_writable() after successful connect to the remote side. This value is stored for later use, when being opened offline.The credentials parameter consists of the previously used credentials. It’s always
Nonewith the first connection attempt. To get the credentials, just set the out_auth_result toEDataServer.SourceAuthenticationResult.REQUIREDfor the first time and the function will be called again once the credentials are available. See the documentation ofEDataServer.SourceAuthenticationResultfor other available results.The out parameters are passed to
EBackend.Backend.schedule_credentials_required() and are ignored when the descendant returnsTrue, aka they are used only if the connection fails. The out_certificate_pem and out_certificate_errors should be used together and they can be left untouched if the failure reason was not related to certificate. Use out_auth_resultEDataServer.SourceAuthenticationResult.UNKNOWNto indicate other error than credentials error, otherwise the error is used according to out_auth_result value.It is mandatory to implement this virtual method by the descendant.
New in version 3.26.
- do_disconnect_sync(cancellable) virtual¶
- Parameters:
cancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone- Returns:
Whether succeeded.
- Return type:
This is called when the backend goes into offline mode or when the disconnect is required. The implementation should not report any error when it is called and the meta_backend is not connected.
It is mandatory to implement this virtual method by the descendant.
New in version 3.26.
- do_get_changes_sync(last_sync_tag, is_repeat, cancellable) virtual¶
- Parameters:
last_sync_tag (
strorNone) – optional sync tag from the last checkis_repeat (
bool) – set toTruewhen this is the repeated callcancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Returns:
Whether succeeded.
- out_new_sync_tag:
new sync tag to store on success
- out_repeat:
whether to repeat this call again; default is
False- out_created_objects:
a
GLib.SListofEDataBook.BookMetaBackendInfoobject infos which had been created since the last check- out_modified_objects:
a
GLib.SListofEDataBook.BookMetaBackendInfoobject infos which had been modified since the last check- out_removed_objects:
a
GLib.SListofEDataBook.BookMetaBackendInfoobject infos which had been removed since the last check
- Return type:
(
bool, out_new_sync_tag:str, out_repeat:bool, out_created_objects: [EDataBook.BookMetaBackendInfo], out_modified_objects: [EDataBook.BookMetaBackendInfo], out_removed_objects: [EDataBook.BookMetaBackendInfo])
Gathers the changes since the last check which had been done on the remote side.
The last_sync_tag can be used as a tag of the last check. This can be
None, when there was no previous call or when the descendant doesn’t store any such tags. The out_new_sync_tag can be populated with a value to be stored and used the next time.The out_repeat can be set to
Truewhen the descendant didn’t finish read of all the changes. In that case the meta_backend calls this function again with the out_new_sync_tag as the last_sync_tag, but also notifies about the found changes immediately. The is_repeat is set toTrueas well in this case, otherwise it’sFalse.The descendant can populate also
EDataBook.BookMetaBackendInfo::objectof the out_created_objects and out_modified_objects, if known, in which case this will be used instead of loading it withEDataBook.BookMetaBackend.load_contact_sync().It is optional to implement this virtual method by the descendant. The default implementation calls
EDataBook.BookMetaBackend.list_existing_sync() and then compares the list with the current content of the local cache and populates the respective lists appropriately.Each output
GLib.SListshould be freed with g_slist_free_full (objects,EDataBook.BookMetaBackendInfo.free); when no longer needed.New in version 3.26.
- do_get_ssl_error_details() virtual¶
- Returns:
True, when the SSL error details had been available and the out parameters populated,Falseotherwise.- out_certificate_pem:
SSL certificate encoded in PEM format
- out_certificate_errors:
bit-or of
Gio.TlsCertificateFlagsclaiming the certificate errors
- Return type:
(
bool, out_certificate_pem:str, out_certificate_errors:Gio.TlsCertificateFlags)
It is optional to implement this virtual method by the descendants. It is used to receive SSL error details when any online operation returns E_CLIENT_ERROR,
EDataServer.ClientError.TLS_NOT_AVAILABLEerror.New in version 3.28.
- do_list_existing_sync(cancellable) virtual¶
- Parameters:
cancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone- Returns:
Whether succeeded.
- out_new_sync_tag:
optional return location for a new sync tag
- out_existing_objects:
a
GLib.SListofEDataBook.BookMetaBackendInfoobject infos which are stored on the remote side
- Return type:
(
bool, out_new_sync_tag:str, out_existing_objects: [EDataBook.BookMetaBackendInfo])
Used to get list of all existing objects on the remote side. The descendant can optionally provide out_new_sync_tag, which will be stored on success, if not
None. The descendant can populate alsoEDataBook.BookMetaBackendInfo::objectof the out_existing_objects, if known, in which case this will be used instead of loading it withEDataBook.BookMetaBackend.load_contact_sync().It is mandatory to implement this virtual method by the descendant, unless it implements its own
EDataBook.BookMetaBackend.do_get_changes_sync().The out_existing_objects
GLib.SListshould be freed with g_slist_free_full (objects,EDataBook.BookMetaBackendInfo.free); when no longer needed.New in version 3.26.
- do_load_contact_sync(uid, extra, cancellable) virtual¶
- Parameters:
uid (
str) – a contact UIDextra (
strorNone) – optional extra data stored with the contact, orNonecancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Returns:
Whether succeeded.
- out_contact:
a loaded contact, as an
EBookContacts.Contact- out_extra:
an extra data to store to
EDataBook.BookCachewith this contact
- Return type:
(
bool, out_contact:EBookContacts.Contact, out_extra:str)
Loads a contact from the remote side.
It is mandatory to implement this virtual method by the descendant.
The returned out_contact should be freed with
GObject.Object.unref(), when no longer needed.The returned out_extra should be freed with
GLib.free(), when no longer needed.New in version 3.26.
- do_remove_contact_sync(conflict_resolution, uid, extra, object, opflags, cancellable) virtual¶
- Parameters:
conflict_resolution (
EDataServer.ConflictResolution) – anEDataServer.ConflictResolutionto useuid (
str) – a contact UIDextra (
strorNone) – extra data being saved with the contact in the local cache, orNoneobject (
strorNone) – corresponding vCard object, as stored in the local cache, orNoneopflags (
int) – bit-or ofEBookContacts.BookOperationFlagscancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Returns:
Whether succeeded.
- Return type:
Removes a contact from the remote side. The object is not
Nonewhen it’s removing locally deleted object in offline mode. Being itNone, the descendant can obtain the object from theEDataBook.BookCache.It is mandatory to implement this virtual method by the writable descendant.
New in version 3.26.
- do_requires_reconnect() virtual¶
-
Determines, whether current source content requires reconnect of the backend.
It is optional to implement this virtual method by the descendant. The default implementation compares
EDataServer.SOURCE_EXTENSION_AUTHENTICATIONandEDataServer.SOURCE_EXTENSION_WEBDAV_BACKEND, if existing in the source, with the values after the last successful connect and returnsTruewhen they changed. It always returnTruewhen there was no successful connect done yet.New in version 3.26.
- do_save_contact_sync(overwrite_existing, conflict_resolution, contact, extra, opflags, cancellable) virtual¶
- Parameters:
overwrite_existing (
bool) –Truewhen can overwrite existing contacts,Falseotherwiseconflict_resolution (
EDataServer.ConflictResolution) – one ofEDataServer.ConflictResolution, what to do on conflictscontact (
EBookContacts.Contact) – anEBookContacts.Contactto saveextra (
strorNone) – extra data saved with the contacts in anEDataBook.BookCacheopflags (
int) – bit-or ofEBookContacts.BookOperationFlagscancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Returns:
Whether succeeded.
- out_new_uid:
return location for the UID of the saved contact
- out_new_extra:
return location for the extra data to store with the contact
- Return type:
Saves one contact into the remote side. When the overwrite_existing is
True, then the descendant can overwrite an object with the same UID on the remote side (usually used for modify). The conflict_resolution defines what to do when the remote side had made any changes to the object since the last update.The contact has already converted locally stored photos and logos into inline variants, thus it’s not needed to call
EDataBook.BookMetaBackend.inline_local_photos_sync() by the descendant.The out_new_uid can be populated with a UID of the saved contact as the server assigned it to it. This UID, if set, is loaded from the remote side afterwards, also to see whether any changes had been made to the contact by the remote side.
The out_new_extra can be populated with a new extra data to save with the contact. Left it
None, to keep the same value as the extra.The descendant can use an
EDataServer.ClientError.OUT_OF_SYNCerror to indicate that the save failed due to made changes on the remote side, and let the meta_backend resolve this conflict based on the conflict_resolution on its own. TheEDataServer.ClientError.OUT_OF_SYNCerror should not be used when the descendant is able to resolve the conflicts itself.It is mandatory to implement this virtual method by the writable descendant.
New in version 3.26.
- do_search_sync(expr, meta_contact, cancellable) virtual¶
- Parameters:
meta_contact (
bool) –True, when returnEBookContacts.Contactfilled with UID and REV only,Falseto return full contactscancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Returns:
Whether succeeded.
- out_contacts:
return location for the found contacts as
EBookContacts.Contact
- Return type:
(
bool, out_contacts: [EBookContacts.Contact])
Searches meta_backend with given expression expr and returns found contacts as a
GLib.SListofEBookContacts.Contactout_contacts. Free the returned out_contacts with g_slist_free_full (contacts,GObject.Object.unref); when no longer needed. When the expr isNone, all objects are returned. To get UID-s instead, callEDataBook.BookMetaBackend.search_uids_sync().It is optional to implement this virtual method by the descendant. The default implementation searches meta_backend's cache. It’s also not required to be online for searching, thus meta_backend doesn’t ensure it.
New in version 3.26.
- do_search_uids_sync(expr, cancellable) virtual¶
- Parameters:
cancellable (
Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- Returns:
Whether succeeded.
- out_uids:
return location for the found contact UID-s
- Return type:
Searches meta_backend with given expression expr and returns found contact UID-s as a
GLib.SListout_contacts. Free the returned out_uids with g_slist_free_full (uids,GLib.free); when no longer needed. When the expr isNone, all UID-s are returned. To getEBookContacts.Contact(s) instead, callEDataBook.BookMetaBackend.search_sync().It is optional to implement this virtual method by the descendant. The default implementation searches meta_backend's cache. It’s also not required to be online for searching, thus meta_backend doesn’t ensure it.
New in version 3.26.
- do_source_changed() virtual¶
Signal Details¶
- EDataBook.BookMetaBackend.signals.refresh_completed(book_meta_backend)¶
- Signal Name:
refresh-completed- Flags:
- Parameters:
book_meta_backend (
EDataBook.BookMetaBackend) – The object which received the signal
- EDataBook.BookMetaBackend.signals.source_changed(book_meta_backend)¶
- Signal Name:
source-changed- Flags:
- Parameters:
book_meta_backend (
EDataBook.BookMetaBackend) – The object which received the signal
This signal is emitted whenever the underlying backend
EDataServer.Sourcechanges. Unlike theEDataServer.Source's ‘changed’ signal this one is tight to theEDataBook.BookMetaBackenditself and is emitted from a dedicated thread, thus it doesn’t block the main thread.New in version 3.26.
Property Details¶
- EDataBook.BookMetaBackend.props.cache¶
- Name:
cache- Type:
- Default Value:
- Flags:
The
EDataBook.BookCachebeing used for this meta backend.