EBackend.CollectionBackend¶
| Subclasses: | EBackend.WebDAVCollectionBackend | 
|---|
Methods¶
| Inherited: | EBackend.Backend (20), GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| authenticate_children(credentials) | |
| claim_all_resources() | |
| create_resource(source, cancellable, callback, *user_data) | |
| create_resource_finish(result) | |
| create_resource_sync(source, cancellable) | |
| delete_resource(source, cancellable, callback, *user_data) | |
| delete_resource_finish(result) | |
| delete_resource_sync(source, cancellable) | |
| dup_resource_id(child_source) | |
| freeze_populate() | |
| get_cache_dir() | |
| get_part_enabled(parts) | |
| get_populate_frozen() | |
| is_new_source(source) | |
| list_calendar_sources() | |
| list_contacts_sources() | |
| list_mail_sources() | |
| new_child(resource_id) | |
| ref_proxy_resolver() | |
| ref_server() | |
| schedule_populate() | |
| thaw_populate() | 
Virtual Methods¶
| Inherited: | EBackend.Backend (3), GObject.Object (7) | 
|---|
| do_child_added(child_source) | |
| do_child_removed(child_source) | |
| do_create_resource(source, cancellable, callback, *user_data) | |
| do_create_resource_finish(result) | |
| do_create_resource_sync(source, cancellable) | |
| do_delete_resource(source, cancellable, callback, *user_data) | |
| do_delete_resource_finish(result) | |
| do_delete_resource_sync(source, cancellable) | |
| do_dup_resource_id(child_source) | |
| do_populate() | 
Properties¶
| Inherited: | EBackend.Backend (5) | 
|---|
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| proxy-resolver | Gio.ProxyResolver | r | The proxy resolver for this backend | 
| server | EBackend.SourceRegistryServer | r/w/co | The server to which the backend belongs | 
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
| Name | Short Description | 
|---|---|
| child-added | Emitted when an EBackend.ServerSideSourceis added to backend’sEBackend.CollectionBackend:serveras a child of backend’s collectionEBackend.Backend:source. | 
| child-removed | Emitted when an EBackend.ServerSideSourcethat is a child of backend’s collectionEBackend.Backend:sourceis removed from backend’sEBackend.CollectionBackend:server. | 
Class Details¶
- 
class EBackend.CollectionBackend(**kwargs)¶
- Bases: - EBackend.Backend- Abstract: - No - Structure: - EBackend.CollectionBackendClass- Contains only private data that should be read and manipulated using the functions below. - New in version 3.6. - 
authenticate_children(credentials)¶
- Parameters: - credentials ( - EDataServer.NamedParameters) – credentials to authenticate with- Authenticates all enabled children sources with the given crendetials. This is usually called when the collection source successfully used the credentials to connect to the (possibly) remote data store, to open the childern too. Already connected child sources are skipped. - New in version 3.16. 
 - 
claim_all_resources()¶
- Returns: - a list of previously used sources - Return type: - [ - EDataServer.Source]- Claims all previously used sources that have not yet been claimed by - EBackend.CollectionBackend.new_child() and returns them in a- GLib.List. Note that previously used sources can only be claimed once, so subsequent calls to this function for self will return- None.- The self is then expected to compare the returned list with a current list of resources from a remote server, create new - EDataServer.Sourceinstances as needed with- EBackend.CollectionBackend.new_child(), discard unneeded- EDataServer.Sourceinstances with- EDataServer.Source.remove(), and export the remaining instances with- EBackend.SourceRegistryServer.add_source().- The sources returned in the list are referenced for thread-safety. They must each be unreferenced with - GObject.Object.unref() when finished with them. Free the returned- GLib.Listitself with g_list_free().- An easy way to free the list properly in one step is as follows: - g_list_free_full (list, g_object_unref);- New in version 3.6. 
 - 
create_resource(source, cancellable, callback, *user_data)¶
- Parameters: - source (EDataServer.Source) – anEDataServer.Source
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- callback (Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfied
- user_data (objectorNone) – data to pass to the callback function
 - Asynchronously creates a server-side resource described by source. For example, if source describes a new calendar, an equivalent calendar is created on the server. - It is the implementor’s responsibility to examine source and determine what the equivalent server-side resource would be. If this cannot be determined without ambiguity, the function must return an error. - After the server-side resource is successfully created, the implementor must also add an - EDataServer.Sourceto self’s- EBackend.CollectionBackend- :server. This can either be done immediately or in response to some “resource created” notification from the server. The added- EDataServer.Sourcecan be source itself or a different- EDataServer.Sourceinstance that describes the new resource.- When the operation is finished, callback will be called. You can then call - EBackend.CollectionBackend.create_resource_finish() to get the result of the operation.- New in version 3.6. 
- source (
 - 
create_resource_finish(result)¶
- Parameters: - result ( - Gio.AsyncResult) – a- Gio.AsyncResult- Raises: - GLib.Error- Returns: - Trueon success,- Falseon failure- Return type: - bool- Finishes the operation started with - EBackend.CollectionBackend.create_resource().- If an error occurred, the function will set error and return - False.- New in version 3.6. 
 - 
create_resource_sync(source, cancellable)¶
- Parameters: - source (EDataServer.Source) – anEDataServer.Source
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Raises: - Returns: - Return type: - Creates a server-side resource described by source. For example, if source describes a new calendar, an equivalent calendar is created on the server. - It is the implementor’s responsibility to examine source and determine what the equivalent server-side resource would be. If this cannot be determined without ambiguity, the function must return an error. - After the server-side resource is successfully created, the implementor must also add an - EDataServer.Sourceto self’s- EBackend.CollectionBackend- :server. This can either be done immediately or in response to some “resource created” notification from the server. The added- EDataServer.Sourcecan be source itself or a different- EDataServer.Sourceinstance that describes the new resource.- If an error occurs, the function will set error and return - False.- New in version 3.6. 
- source (
 - 
delete_resource(source, cancellable, callback, *user_data)¶
- Parameters: - source (EDataServer.Source) – anEDataServer.Source
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- callback (Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfied
- user_data (objectorNone) – data to pass to the callback function
 - Asynchronously deletes a server-side resource described by source. The source must be a child of self’s collection - EBackend.Backend- :source.- After the server-side resource is successfully deleted, the implementor must also remove source from the self’s - EBackend.CollectionBackend- :server. This can either be done immediately or in response to some “resource deleted” notification from the server.- When the operation is finished, callback will be called. You can then call - EBackend.CollectionBackend.delete_resource_finish() to get the result of the operation.- New in version 3.6. 
- source (
 - 
delete_resource_finish(result)¶
- Parameters: - result ( - Gio.AsyncResult) – a- Gio.AsyncResult- Raises: - GLib.Error- Returns: - Trueon success,- Falseon failure- Return type: - bool- Finishes the operation started with - EBackend.CollectionBackend.delete_resource().- If an error occurred, the function will set error and return - False.- New in version 3.6. 
 - 
delete_resource_sync(source, cancellable)¶
- Parameters: - source (EDataServer.Source) – anEDataServer.Source
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Raises: - Returns: - Return type: - Deletes a server-side resource described by source. The source must be a child of self’s collection - EBackend.Backend- :source.- After the server-side resource is successfully deleted, the implementor must also remove source from the self’s - EBackend.CollectionBackend- :server. This can either be done immediately or in response to some “resource deleted” notification from the server.- If an error occurs, the function will set error and return - False.- New in version 3.6. 
- source (
 - 
dup_resource_id(child_source)¶
- Parameters: - child_source ( - EDataServer.Source) – an- EDataServer.Sourcemanaged by self- Returns: - a newly-allocated resource ID for child_source, or - None- Return type: - str- Extracts the resource ID for child_source, which is supposed to be a stable and unique server-assigned identifier for the remote resource described by child_source. If child_source is not actually a child of the collection - EBackend.Backend- :sourceowned by self, the function returns- None.- The returned string should be freed with - GLib.free() when no longer needed.- New in version 3.6. 
 - 
freeze_populate()¶
- Returns: - True, when this is the first freeze call- Return type: - bool- Freezes populate of the backend’s content. This is used to avoid calling populate multiple times in parallel. Every call to this function should be followed by the call of - EBackend.CollectionBackend.thaw_populate() to reverse the effect of this function, regardless of the return value of this function.- New in version 3.38. 
 - 
get_cache_dir()¶
- Returns: - the cache directory for self - Return type: - str- Returns the private cache directory path for self, which is named after the - EDataServer.Source- :uidof self’s collection- EBackend.Backend- :source.- The cache directory is meant to store key files for backend-created data sources. See also: - EBackend.ServerSideSource.set_write_directory()- New in version 3.6. 
 - 
get_part_enabled(parts)¶
- Parameters: - parts ( - EBackend.CollectionBackendParts) – a bit-or of- EBackend.CollectionBackendPartswith parts to be checked- Returns: - True, when at least one of the parts is enabled and the backend’s- EDataServer.Sourceis enabled as well.- Return type: - bool- Checks whether the self has enabled at least of the parts. - New in version 3.38.3. 
 - 
get_populate_frozen()¶
- Returns: - Whether the backend has currently frozen (disabled) populate of its content. - Return type: - bool- New in version 3.38. 
 - 
is_new_source(source)¶
- Parameters: - source ( - EDataServer.Source) – a child- EDataServer.Source- Returns: - True, when the source is a new child;- Falsewhen it had been known before.- Return type: - bool- Returns whether the source is a newly created child or not. New sources are remembered between two populate calls only. - New in version 3.32. 
 - 
list_calendar_sources()¶
- Returns: - a list of calendar sources - Return type: - [ - EDataServer.Source]- Returns a list of calendar sources belonging to the data source collection managed by self. - The sources returned in the list are referenced for thread-safety. They must each be unreferenced with - GObject.Object.unref() when finished with them. Free the returned- GLib.Listitself with g_list_free().- An easy way to free the list properly in one step is as follows: - g_list_free_full (list, g_object_unref);- New in version 3.6. 
 - 
list_contacts_sources()¶
- Returns: - a list of address book sources - Return type: - [ - EDataServer.Source]- Returns a list of address book sources belonging to the data source collection managed by self. - The sources returned in the list are referenced for thread-safety. They must each be unreferenced with - GObject.Object.unref() when finished with them. Free the returned- GLib.Listitself with g_list_free().- An easy way to free the list properly in one step is as follows: - g_list_free_full (list, g_object_unref);- New in version 3.6. 
 - 
list_mail_sources()¶
- Returns: - a list of mail sources - Return type: - [ - EDataServer.Source]- Returns a list of mail sources belonging to the data source collection managed by self. - The sources returned in the list are referenced for thread-safety. They must each be unreferenced with - GObject.Object.unref() when finished with them. Free the returned- GLib.Listitself with g_list_free().- An easy way to free the list properly in one step is as follows: - g_list_free_full (list, g_object_unref);- New in version 3.6. 
 - 
new_child(resource_id)¶
- Parameters: - resource_id ( - str) – a stable and unique resource ID- Returns: - a newly-created data source - Return type: - EDataServer.Source- Creates a new - EBackend.ServerSideSourceas a child of the collection- EBackend.Backend- :sourceowned by self. If possible, the- EBackend.ServerSideSourceis drawn from a cache of previously used sources indexed by resource_id so that locally cached data from previous sessions can be reused.- The returned data source should be passed to - EBackend.SourceRegistryServer.add_source() to export it over D-Bus.- New in version 3.6. 
 - 
ref_proxy_resolver()¶
- Returns: - a - Gio.ProxyResolver, or- None- Return type: - Gio.ProxyResolveror- None- Returns the - Gio.ProxyResolverfor self (if applicable), as indicated by the- EDataServer.SourceAuthentication- :proxy-uidof self’s- EBackend.Backend- :sourceor one of its ancestors.- The returned - Gio.ProxyResolveris referenced for thread-safety and must be unreferenced with- GObject.Object.unref() when finished with it.- New in version 3.12. 
 - 
ref_server()¶
- Returns: - the - EBackend.SourceRegistryServerfor self- Return type: - EBackend.SourceRegistryServer- Returns the - EBackend.SourceRegistryServerto which self belongs.- The returned - EBackend.SourceRegistryServeris referenced for thread-safety. Unreference the- EBackend.SourceRegistryServerwith- GObject.Object.unref() when finished with it.- New in version 3.6. 
 - 
schedule_populate()¶
- Schedules a call to populate() of the self on idle. The function does nothing in case the self is offline. - New in version 3.30. 
 - 
thaw_populate()¶
- Thaws populate of the backend’s content. This is a pair function for - EBackend.CollectionBackend.freeze_populate().- New in version 3.38. 
 - 
do_child_added(child_source) virtual¶
- Parameters: - child_source ( - EDataServer.Source) –
 - 
do_child_removed(child_source) virtual¶
- Parameters: - child_source ( - EDataServer.Source) –
 - 
do_create_resource(source, cancellable, callback, *user_data) virtual¶
- Parameters: - source (EDataServer.Source) – anEDataServer.Source
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- callback (Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfied
- user_data (objectorNone) – data to pass to the callback function
 - Asynchronously creates a server-side resource described by source. For example, if source describes a new calendar, an equivalent calendar is created on the server. - It is the implementor’s responsibility to examine source and determine what the equivalent server-side resource would be. If this cannot be determined without ambiguity, the function must return an error. - After the server-side resource is successfully created, the implementor must also add an - EDataServer.Sourceto backend’s- EBackend.CollectionBackend- :server. This can either be done immediately or in response to some “resource created” notification from the server. The added- EDataServer.Sourcecan be source itself or a different- EDataServer.Sourceinstance that describes the new resource.- When the operation is finished, callback will be called. You can then call - EBackend.CollectionBackend.create_resource_finish() to get the result of the operation.- New in version 3.6. 
- source (
 - 
do_create_resource_finish(result) virtual¶
- Parameters: - result ( - Gio.AsyncResult) – a- Gio.AsyncResult- Returns: - Trueon success,- Falseon failure- Return type: - bool- Finishes the operation started with - EBackend.CollectionBackend.create_resource().- If an error occurred, the function will set error and return - False.- New in version 3.6. 
 - 
do_create_resource_sync(source, cancellable) virtual¶
- Parameters: - source (EDataServer.Source) – anEDataServer.Source
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Returns: - Return type: - Creates a server-side resource described by source. For example, if source describes a new calendar, an equivalent calendar is created on the server. - It is the implementor’s responsibility to examine source and determine what the equivalent server-side resource would be. If this cannot be determined without ambiguity, the function must return an error. - After the server-side resource is successfully created, the implementor must also add an - EDataServer.Sourceto backend’s- EBackend.CollectionBackend- :server. This can either be done immediately or in response to some “resource created” notification from the server. The added- EDataServer.Sourcecan be source itself or a different- EDataServer.Sourceinstance that describes the new resource.- If an error occurs, the function will set error and return - False.- New in version 3.6. 
- source (
 - 
do_delete_resource(source, cancellable, callback, *user_data) virtual¶
- Parameters: - source (EDataServer.Source) – anEDataServer.Source
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
- callback (Gio.AsyncReadyCallbackorNone) – aGio.AsyncReadyCallbackto call when the request is satisfied
- user_data (objectorNone) – data to pass to the callback function
 - Asynchronously deletes a server-side resource described by source. The source must be a child of backend’s collection - EBackend.Backend- :source.- After the server-side resource is successfully deleted, the implementor must also remove source from the backend’s - EBackend.CollectionBackend- :server. This can either be done immediately or in response to some “resource deleted” notification from the server.- When the operation is finished, callback will be called. You can then call - EBackend.CollectionBackend.delete_resource_finish() to get the result of the operation.- New in version 3.6. 
- source (
 - 
do_delete_resource_finish(result) virtual¶
- Parameters: - result ( - Gio.AsyncResult) – a- Gio.AsyncResult- Returns: - Trueon success,- Falseon failure- Return type: - bool- Finishes the operation started with - EBackend.CollectionBackend.delete_resource().- If an error occurred, the function will set error and return - False.- New in version 3.6. 
 - 
do_delete_resource_sync(source, cancellable) virtual¶
- Parameters: - source (EDataServer.Source) – anEDataServer.Source
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Returns: - Return type: - Deletes a server-side resource described by source. The source must be a child of backend’s collection - EBackend.Backend- :source.- After the server-side resource is successfully deleted, the implementor must also remove source from the backend’s - EBackend.CollectionBackend- :server. This can either be done immediately or in response to some “resource deleted” notification from the server.- If an error occurs, the function will set error and return - False.- New in version 3.6. 
- source (
 - 
do_dup_resource_id(child_source) virtual¶
- Parameters: - child_source ( - EDataServer.Source) – an- EDataServer.Sourcemanaged by backend- Returns: - a newly-allocated resource ID for child_source, or - None- Return type: - str- Extracts the resource ID for child_source, which is supposed to be a stable and unique server-assigned identifier for the remote resource described by child_source. If child_source is not actually a child of the collection - EBackend.Backend- :sourceowned by backend, the function returns- None.- The returned string should be freed with - GLib.free() when no longer needed.- New in version 3.6. 
 - 
do_populate() virtual¶
 
- 
Signal Details¶
- 
EBackend.CollectionBackend.signals.child_added(collection_backend, child_source)¶
- Signal Name: - child-added- Flags: - Parameters: - collection_backend (EBackend.CollectionBackend) – The object which received the signal
- child_source (EBackend.ServerSideSource) – the newly-added childEBackend.ServerSideSource
 - Emitted when an - EBackend.ServerSideSourceis added to backend’s- EBackend.CollectionBackend- :serveras a child of backend’s collection- EBackend.Backend- :source.- You can think of this as a filtered version of - EBackend.SourceRegistryServer’s- EBackend.SourceRegistryServer- ::source-addedsignal which only lets through sources relevant to backend.
- collection_backend (
- 
EBackend.CollectionBackend.signals.child_removed(collection_backend, child_source)¶
- Signal Name: - child-removed- Flags: - Parameters: - collection_backend (EBackend.CollectionBackend) – The object which received the signal
- child_source (EBackend.ServerSideSource) – the childEBackend.ServerSideSourcethat got removed
 - Emitted when an - EBackend.ServerSideSourcethat is a child of backend’s collection- EBackend.Backend- :sourceis removed from backend’s- EBackend.CollectionBackend- :server.- You can think of this as a filtered version of - EBackend.SourceRegistryServer’s- EBackend.SourceRegistryServer- ::source-removedsignal which only lets through sources relevant to backend.
- collection_backend (
Property Details¶
- 
EBackend.CollectionBackend.props.proxy_resolver¶
- Name: - proxy-resolver- Type: - Gio.ProxyResolver- Default Value: - None- Flags: - READABLE- The proxy resolver for this backend 
- 
EBackend.CollectionBackend.props.server¶
- Name: - server- Type: - EBackend.SourceRegistryServer- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- The server to which the backend belongs