Camel.Service¶
| Subclasses: | Camel.Store,Camel.Transport | 
|---|
Methods¶
| Inherited: | Camel.Object (4), GObject.Object (37), Gio.Initable (2) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | error_quark() | 
| authenticate(mechanism, io_priority, cancellable, callback, *user_data) | |
| authenticate_finish(result) | |
| authenticate_sync(mechanism, cancellable) | |
| connect(io_priority, cancellable, callback, *user_data) | |
| connect_finish(result) | |
| connect_sync(cancellable) | |
| disconnect(clean, io_priority, cancellable, callback, *user_data) | |
| disconnect_finish(result) | |
| disconnect_sync(clean, cancellable) | |
| dup_display_name() | |
| dup_password() | |
| get_connection_status() | |
| get_display_name() | |
| get_name(brief) | |
| get_password() | |
| get_provider() | |
| get_uid() | |
| get_user_cache_dir() | |
| get_user_data_dir() | |
| migrate_files() | |
| new_camel_url() | |
| query_auth_types(io_priority, cancellable, callback, *user_data) | |
| query_auth_types_finish(result) | |
| query_auth_types_sync(cancellable) | |
| queue_task(task, task_func) | |
| ref_proxy_resolver() | |
| ref_session() | |
| ref_settings() | |
| set_display_name(display_name) | |
| set_password(password) | |
| set_proxy_resolver(proxy_resolver) | |
| set_settings(settings) | 
Virtual Methods¶
| Inherited: | Camel.Object (2), GObject.Object (7), Gio.Initable (1) | 
|---|
| do_authenticate_sync(mechanism, cancellable) | |
| do_connect_sync(cancellable) | |
| do_disconnect_sync(clean, cancellable) | |
| do_get_name(brief) | |
| do_query_auth_types_sync(cancellable) | 
Properties¶
| Inherited: | Camel.Object (1) | 
|---|
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| connection-status | Camel.ServiceConnectionStatus | r | The connection status for the service | 
| display-name | str | r/w/c/en | The display name for the service | 
| password | str | r/w/c/en | The password for the service | 
| provider | Camel.Provider | r/w/co | The Camel.Providerfor the service | 
| proxy-resolver | Gio.ProxyResolver | r/w/en | The proxy resolver for the service | 
| session | Camel.Session | r/w/co | A Camel.Sessioninstance | 
| settings | Camel.Settings | r/w/c/en | A Camel.Settingsinstance | 
| uid | str | r/w/co | The unique identity of the service | 
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
Class Details¶
- 
class Camel.Service(**kwargs)¶
- Bases: - Camel.Object,- Gio.Initable- Abstract: - Yes - Structure: - Camel.ServiceClass- 
authenticate(mechanism, io_priority, cancellable, callback, *user_data)¶
- Parameters: - mechanism (strorNone) – a SASL mechanism name, orNone
- io_priority (int) – the I/O priority of the request
- 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 attempts to authenticate self using mechanism and, if necessary, self’s - Camel.Service- :passwordproperty. The function makes only ONE attempt at authentication and does not loop.- Generally this function should only be called from a - Camel.Sessionsubclass in order to implement its own authentication loop.- When the operation is finished, callback will be called. You can then call - Camel.Service.authenticate_finish() to get the result of the operation.- New in version 3.4. 
- mechanism (
 - 
authenticate_finish(result)¶
- Parameters: - result ( - Gio.AsyncResult) – a- Gio.AsyncResult- Raises: - GLib.Error- Returns: - the authentication result - Return type: - Camel.AuthenticationResult- Finishes the operation started with - Camel.Service.authenticate().- If the authentication attempt completed and the server accepted the credentials, the function returns - Camel.AuthenticationResult.ACCEPTED.- If the authentication attempt completed but the server rejected the credentials, the function returns - Camel.AuthenticationResult.REJECTED.- If the authentication attempt failed to complete due to a network communication issue or some other mishap, the function sets error and returns - Camel.AuthenticationResult.ERROR.- New in version 3.4. 
 - 
authenticate_sync(mechanism, cancellable)¶
- Parameters: - mechanism (strorNone) – a SASL mechanism name, orNone
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Raises: - Returns: - the authentication result - Return type: - Attempts to authenticate self using mechanism and, if necessary, self’s - Camel.Service- :passwordproperty. The function makes only ONE attempt at authentication and does not loop.- If the authentication attempt completed and the server accepted the credentials, the function returns - Camel.AuthenticationResult.ACCEPTED.- If the authentication attempt completed but the server rejected the credentials, the function returns - Camel.AuthenticationResult.REJECTED.- If the authentication attempt failed to complete due to a network communication issue or some other mishap, the function sets error and returns - Camel.AuthenticationResult.ERROR.- Generally this function should only be called from a - Camel.Sessionsubclass in order to implement its own authentication loop.- New in version 3.4. 
- mechanism (
 - 
connect(io_priority, cancellable, callback, *user_data)¶
- Parameters: - io_priority (int) – the I/O priority of the request
- 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 connects self to a remote server using the information in its - Camel.Service- :settingsinstance.- If a connect operation is already in progress when this function is called, its results will be reflected in this connect operation. - If any disconnect operations are in progress when this function is called, they will be cancelled. - When the operation is finished, callback will be called. You can then call - Camel.Service.connect_finish() to get the result of the operation.- New in version 3.6. 
- io_priority (
 - 
connect_finish(result)¶
- Parameters: - result ( - Gio.AsyncResult) – a- Gio.AsyncResult- Raises: - GLib.Error- Returns: - Trueif the connection was made or- Falseotherwise- Return type: - bool- Finishes the operation started with - Camel.Service.connect().- New in version 3.6. 
 - 
connect_sync(cancellable)¶
- Parameters: - cancellable ( - Gio.Cancellableor- None) – optional- Gio.Cancellableobject, or- None- Raises: - GLib.Error- Returns: - Trueif the connection is made or- Falseotherwise- Return type: - bool- Connects self to a remote server using the information in its - Camel.Service- :settingsinstance.- If a connect operation is already in progress when this function is called, its results will be reflected in this connect operation. - New in version 3.6. 
 - 
disconnect(clean, io_priority, cancellable, callback, *user_data)¶
- Parameters: - clean (bool) – whether or not to try to disconnect cleanly
- io_priority (int) – the I/O priority of the request
- 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
 - If a disconnect operation is already in progress when this function is called, its results will be reflected in this disconnect operation. - If any connect operations are in progress when this function is called, they will be cancelled. - When the operation is finished, callback will be called. You can then call - Camel.Service.disconnect_finish() to get the result of the operation.- New in version 3.6. 
- clean (
 - 
disconnect_finish(result)¶
- Parameters: - result ( - Gio.AsyncResult) – a- Gio.AsyncResult- Raises: - GLib.Error- Returns: - Trueif the connection was severed or- Falseotherwise- Return type: - bool- Finishes the operation started with - Camel.Service.disconnect().- New in version 3.6. 
 - 
disconnect_sync(clean, cancellable)¶
- Parameters: - clean (bool) – whether or not to try to disconnect cleanly
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Raises: - Returns: - Return type: - Disconnect from the service. If clean is - False, it should not try to do any synchronizing or other cleanup of the connection.- If a disconnect operation is already in progress when this function is called, its results will be reflected in this disconnect operation. - If any connect operations are in progress when this function is called, they will be cancelled. - New in version 3.6. 
- clean (
 - 
dup_display_name()¶
- Returns: - a newly-allocated copy of - Camel.Service- :display-name- Return type: - str- Thread-safe variation of - Camel.Service.get_display_name(). Use this function when accessing self from multiple threads.- The returned string should be freed with - GLib.free() when no longer needed.- New in version 3.12. 
 - 
dup_password()¶
- Returns: - a newly-allocated copy of - Camel.Service- :password- Return type: - str- Thread-safe variation of - Camel.Service.get_password(). Use this function when accessing self from multiple threads.- The returned string should be freed with - GLib.free() when no longer needed.- New in version 3.12. 
 - 
get_connection_status()¶
- Returns: - the connection status - Return type: - Camel.ServiceConnectionStatus- Returns the connection status for self. - New in version 3.2. 
 - 
get_display_name()¶
- Returns: - the display name for self, or - None- Return type: - str- Returns the display name for self, or - Noneif self has not been given a display name. The display name is intended for use in a user interface and should generally be given a user-defined name.- Compare this with - Camel.Service.get_name(), which returns a built-in description of the type of service (IMAP, SMTP, etc.).- New in version 3.2. 
 - 
get_name(brief)¶
- Parameters: - brief ( - bool) – whether or not to use a briefer form- Returns: - a description of the service which the caller must free - Return type: - str- This gets the name of the service in a “friendly” (suitable for humans) form. If brief is - True, this should be a brief description such as for use in the folder tree. If brief is- False, it should be a more complete and mostly unambiguous description.
 - 
get_password()¶
- Returns: - the password for self - Return type: - str- Returns the password for self. Some SASL mechanisms use this when attempting to authenticate. - New in version 3.4. 
 - 
get_provider()¶
- Returns: - the - Camel.Provider- Return type: - Camel.Provider- Gets the - Camel.Providerassociated with the service.
 - 
get_uid()¶
- Returns: - the UID string - Return type: - str- Gets the unique identifier string associated with the service. - New in version 3.2. 
 - 
get_user_cache_dir()¶
- Returns: - the base cache directory for self - Return type: - str- Returns the base directory under which to store cache data for self. The directory is formed by appending the directory returned by - Camel.Session.get_user_cache_dir() with the service’s- Camel.Service- :uidvalue.- New in version 3.4. 
 - 
get_user_data_dir()¶
- Returns: - the base directory for self - Return type: - str- Returns the base directory under which to store user-specific data for self. The directory is formed by appending the directory returned by - Camel.Session.get_user_data_dir() with the service’s- Camel.Service- :uidvalue.- New in version 3.2. 
 - 
migrate_files()¶
- Performs any necessary file migrations for self. This should be called after installing or configuring the self’s - Camel.Settings, since it requires building a URL string for self.- New in version 3.4. 
 - 
new_camel_url()¶
- Returns: - a new - Camel.URL- Return type: - Camel.URL- Returns a new - Camel.URLrepresenting self. Free the returned- Camel.URLwith- Camel.URL.free().- New in version 3.2. 
 - 
query_auth_types(io_priority, cancellable, callback, *user_data)¶
- Parameters: - io_priority (int) – the I/O priority of the request
- 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 obtains a list of authentication types supported by self. - When the operation is finished, callback will be called. You can then call - Camel.Service.query_auth_types_finish() to get the result of the operation.- New in version 3.2. 
- io_priority (
 - 
query_auth_types_finish(result)¶
- Parameters: - result ( - Gio.AsyncResult) – a- Gio.AsyncResult- Raises: - GLib.Error- Returns: - a list of - Camel.ServiceAuthTypestructs- Return type: - [ - Camel.ServiceAuthType]- Finishes the operation started with - Camel.Service.query_auth_types(). Free the returned list with g_list_free().- New in version 3.2. 
 - 
query_auth_types_sync(cancellable)¶
- Parameters: - cancellable ( - Gio.Cancellableor- None) – optional- Gio.Cancellableobject, or- None- Raises: - GLib.Error- Returns: - a list of - Camel.ServiceAuthTypestructs- Return type: - [ - Camel.ServiceAuthType]- Obtains a list of authentication types supported by self. Free the returned list with g_list_free(). 
 - 
queue_task(task, task_func)¶
- Parameters: - task (Gio.Task) – aGio.Task
- task_func (Gio.TaskThreadFunc) – function to call when task is dispatched
 - Adds task to a queue of waiting tasks with the same source object. Queued tasks execute one at a time in the order they were added. When task reaches the front of the queue, it will be dispatched by invoking task_func in a separate thread. If task is cancelled while queued, it will complete immediately with an appropriate error. - This is primarily intended for use by - Camel.Store,- Camel.Transportand- Camel.Folderto achieve ordered invocation of synchronous class methods.- New in version 3.12. 
- task (
 - 
ref_proxy_resolver()¶
- Returns: - a - Gio.ProxyResolver, or- None- Return type: - Gio.ProxyResolver- Returns the - Gio.ProxyResolverfor self. If an application needs to override this, it should do so prior to calling functions on self that may require a network connection.- 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_session()¶
- Returns: - the - Camel.Session- Return type: - Camel.Session- Returns the - Camel.Sessionassociated with the service.- The returned - Camel.Sessionis referenced for thread-safety. Unreference the- Camel.Sessionwith- GObject.Object.unref() when finished with it.- New in version 3.8. 
 - 
ref_settings()¶
- Returns: - the - Camel.Settings- Return type: - Camel.Settings- Returns the - Camel.Settingsinstance associated with the service.- The returned - Camel.Settingsis referenced for thread-safety and must be unreferenced with- GObject.Object.unref() when finished with it.- New in version 3.6. 
 - 
set_display_name(display_name)¶
- Parameters: - display_name ( - str) – a valid UTF-8 string, or- None- Assigns a UTF-8 display name to self. The display name is intended for use in a user interface and should generally be given a user-defined name. - Compare this with - Camel.Service.get_name(), which returns a built-in description of the type of service (IMAP, SMTP, etc.).- New in version 3.2. 
 - 
set_password(password)¶
- Parameters: - password ( - str) – the password for self- Sets the password for self. Use this function to cache the password in memory after obtaining it through - Camel.Session.get_password(). Some SASL mechanisms use this when attempting to authenticate.- New in version 3.4. 
 - 
set_proxy_resolver(proxy_resolver)¶
- Parameters: - proxy_resolver ( - Gio.ProxyResolver) – a- Gio.ProxyResolver, or- Nonefor the default- Sets the - Gio.ProxyResolverfor self. If an application needs to override this, it should do so prior to calling functions on self that may require a network connection.- New in version 3.12. 
 - 
set_settings(settings)¶
- Parameters: - settings ( - Camel.Settings) – an instance derviced from- Camel.Settings, or- None- Associates a new - Camel.Settingsinstance with the service. The settings instance must match the settings type defined in- Camel.ServiceClass. If settings is- None, a new- Camel.Settingsinstance of the appropriate type is created with all properties set to defaults.- New in version 3.2. 
 - 
do_authenticate_sync(mechanism, cancellable) virtual¶
- Parameters: - mechanism (strorNone) – a SASL mechanism name, orNone
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Returns: - the authentication result - Return type: - Attempts to authenticate service using mechanism and, if necessary, service’s - Camel.Service- :passwordproperty. The function makes only ONE attempt at authentication and does not loop.- If the authentication attempt completed and the server accepted the credentials, the function returns - Camel.AuthenticationResult.ACCEPTED.- If the authentication attempt completed but the server rejected the credentials, the function returns - Camel.AuthenticationResult.REJECTED.- If the authentication attempt failed to complete due to a network communication issue or some other mishap, the function sets error and returns - Camel.AuthenticationResult.ERROR.- Generally this function should only be called from a - Camel.Sessionsubclass in order to implement its own authentication loop.- New in version 3.4. 
- mechanism (
 - 
do_connect_sync(cancellable) virtual¶
- Parameters: - cancellable ( - Gio.Cancellableor- None) – optional- Gio.Cancellableobject, or- None- Returns: - Trueif the connection is made or- Falseotherwise- Return type: - bool- Connects service to a remote server using the information in its - Camel.Service- :settingsinstance.- If a connect operation is already in progress when this function is called, its results will be reflected in this connect operation. - New in version 3.6. 
 - 
do_disconnect_sync(clean, cancellable) virtual¶
- Parameters: - clean (bool) – whether or not to try to disconnect cleanly
- cancellable (Gio.CancellableorNone) – optionalGio.Cancellableobject, orNone
 - Returns: - Return type: - Disconnect from the service. If clean is - False, it should not try to do any synchronizing or other cleanup of the connection.- If a disconnect operation is already in progress when this function is called, its results will be reflected in this disconnect operation. - If any connect operations are in progress when this function is called, they will be cancelled. - New in version 3.6. 
- clean (
 - 
do_get_name(brief) virtual¶
- Parameters: - brief ( - bool) – whether or not to use a briefer form- Returns: - a description of the service which the caller must free - Return type: - str- This gets the name of the service in a “friendly” (suitable for humans) form. If brief is - True, this should be a brief description such as for use in the folder tree. If brief is- False, it should be a more complete and mostly unambiguous description.
 - 
do_query_auth_types_sync(cancellable) virtual¶
- Parameters: - cancellable ( - Gio.Cancellableor- None) – optional- Gio.Cancellableobject, or- None- Returns: - a list of - Camel.ServiceAuthTypestructs- Return type: - [ - Camel.ServiceAuthType]- Obtains a list of authentication types supported by service. Free the returned list with g_list_free(). 
 
- 
Property Details¶
- 
Camel.Service.props.connection_status¶
- Name: - connection-status- Type: - Camel.ServiceConnectionStatus- Default Value: - Camel.ServiceConnectionStatus.DISCONNECTED- Flags: - READABLE- The connection status for the service 
- 
Camel.Service.props.display_name¶
- Name: - display-name- Type: - str- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT,- EXPLICIT_NOTIFY- The display name for the service 
- 
Camel.Service.props.password¶
- Name: - password- Type: - str- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT,- EXPLICIT_NOTIFY- The password for the service 
- 
Camel.Service.props.provider¶
- Name: - provider- Type: - Camel.Provider- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- The - Camel.Providerfor the service
- 
Camel.Service.props.proxy_resolver¶
- Name: - proxy-resolver- Type: - Gio.ProxyResolver- Default Value: - None- Flags: - READABLE,- WRITABLE,- EXPLICIT_NOTIFY- The proxy resolver for the service 
- 
Camel.Service.props.session¶
- Name: - session- Type: - Camel.Session- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- A - Camel.Sessioninstance
- 
Camel.Service.props.settings¶
- Name: - settings- Type: - Camel.Settings- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT,- EXPLICIT_NOTIFY- A - Camel.Settingsinstance